diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 6745fa3fc1afc..0000000000000 --- a/.dockerignore +++ /dev/null @@ -1,4 +0,0 @@ -.github/ -.dockerignore -releases/ -bin/ diff --git a/.github/workflows/build-test-images.yml b/.github/workflows/build-test-images.yml index 2d44cb0268c55..c34f3e79f8353 100644 --- a/.github/workflows/build-test-images.yml +++ b/.github/workflows/build-test-images.yml @@ -39,7 +39,7 @@ jobs: steps: - uses: actions/setup-go@v2 with: - go-version: '1.17.5' + go-version: '1.17.7' - uses: actions/checkout@v2 with: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 57c5abe88499a..6f12fd30203e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: strategy: matrix: - go-version: [1.17.5] + go-version: [1.17.7] os: [ubuntu-18.04, macos-10.15, windows-2019] steps: @@ -46,7 +46,7 @@ jobs: steps: - uses: actions/setup-go@v2 with: - go-version: '1.17.5' + go-version: '1.17.7' - uses: actions/checkout@v2 with: @@ -78,7 +78,7 @@ jobs: steps: - uses: actions/setup-go@v2 with: - go-version: '1.17.5' + go-version: '1.17.7' - uses: actions/checkout@v2 with: @@ -110,7 +110,7 @@ jobs: steps: - uses: actions/setup-go@v2 with: - go-version: '1.17.5' + go-version: '1.17.7' - uses: actions/checkout@v2 - run: go install github.com/cpuguy83/go-md2man/v2@v2.0.1 - run: make man @@ -144,7 +144,7 @@ jobs: steps: - uses: actions/setup-go@v2 with: - go-version: '1.17.5' + go-version: '1.17.7' - uses: actions/checkout@v2 - run: | set -e -x @@ -201,7 +201,7 @@ jobs: strategy: matrix: os: [ubuntu-18.04, macos-10.15, windows-2019, windows-2022] - go-version: ['1.17.5'] + go-version: ['1.16.14', '1.17.7'] steps: - uses: actions/setup-go@v2 @@ -248,7 +248,7 @@ jobs: steps: - uses: actions/setup-go@v2 with: - go-version: '1.17.5' + go-version: '1.17.7' - uses: actions/checkout@v2 with: @@ -330,7 +330,7 @@ jobs: steps: - uses: actions/setup-go@v2 with: - go-version: '1.17.5' + go-version: '1.17.7' - uses: actions/checkout@v2 @@ -449,7 +449,7 @@ jobs: steps: - uses: actions/setup-go@v2 with: - go-version: '1.17.5' + go-version: '1.17.7' - uses: actions/checkout@v2 - run: sudo -E PATH=$PATH script/setup/install-gotestsum - name: Tests diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 3eb7bd3a2cbed..502150493e2ef 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -2,11 +2,13 @@ name: "CodeQL Scan" on: push: - schedule: - - cron: '0 0 * * 0' + branches: + - main + - 'release/**' pull_request: - paths: - - '.github/workflows/codeql.yml' + branches: + - main + - 'release/**' jobs: CodeQL-Build: @@ -22,6 +24,10 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: 1.17.7 + # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v1 @@ -29,21 +35,9 @@ jobs: # with: # languages: go, javascript, csharp, python, cpp, java - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below). - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - # ℹ️ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release + - run: | + sudo apt-get install -y libseccomp-dev libbtrfs-dev + make - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/images.yml b/.github/workflows/images.yml index 7502338330566..de6c68c7fcc90 100644 --- a/.github/workflows/images.yml +++ b/.github/workflows/images.yml @@ -24,7 +24,7 @@ jobs: steps: - uses: actions/setup-go@v2 with: - go-version: '1.17.5' + go-version: '1.17.7' - uses: actions/checkout@v2 with: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 5f1f86efcc297..7a5355d971bd9 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/setup-go@v2 with: - go-version: '1.17.5' + go-version: '1.17.7' - uses: actions/checkout@v2 with: @@ -135,7 +135,7 @@ jobs: steps: - uses: actions/setup-go@v2 with: - go-version: '1.17.5' + go-version: '1.17.7' - uses: actions/checkout@v2 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 611d41a244c67..91db976b68eea 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -64,7 +64,7 @@ jobs: - name: Install Go uses: actions/setup-go@v2 with: - go-version: '1.17.5' + go-version: '1.17.7' - name: Set env shell: bash env: diff --git a/.github/workflows/release/Dockerfile b/.github/workflows/release/Dockerfile index b889b59f19f48..b00f41468ed2e 100644 --- a/.github/workflows/release/Dockerfile +++ b/.github/workflows/release/Dockerfile @@ -50,5 +50,10 @@ RUN \ make release cri-release cri-cni-release && \ for f in $(find bin -executable -type f); do xx-verify $f; done +# check git working tree after build +RUN \ + export GIT_STATUS_OUTPUT=$(git status --porcelain) && \ + test -z $GIT_STATUS_OUTPUT || (echo $GIT_STATUS_OUTPUT && exit 1) + FROM scratch AS release COPY --from=target /go/src/github.com/containerd/containerd/releases/ / diff --git a/.github/workflows/windows-periodic-trigger.yml b/.github/workflows/windows-periodic-trigger.yml index faed254bfde95..302d4050ac006 100644 --- a/.github/workflows/windows-periodic-trigger.yml +++ b/.github/workflows/windows-periodic-trigger.yml @@ -21,5 +21,5 @@ jobs: secrets: AZURE_SUB_ID: "${{ secrets.AZURE_SUB_ID }}" AZURE_CREDS: "${{ secrets.AZURE_CREDS }}" - GCP_PROJECT_ID: "${{ secrets.GCP_PROJECT_ID }}" - GCP_SA_KEY: "${{ secrets.GCP_SA_KEY }}" + GCP_SERVICE_ACCOUNT: "${{ secrets.GCP_SERVICE_ACCOUNT }}" + GCP_WORKLOAD_IDENTITY_PROVIDER: "${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}" diff --git a/.github/workflows/windows-periodic.yml b/.github/workflows/windows-periodic.yml index 615429409a348..af872a2d6d5ed 100644 --- a/.github/workflows/windows-periodic.yml +++ b/.github/workflows/windows-periodic.yml @@ -10,9 +10,9 @@ on: required: true AZURE_CREDS: required: true - GCP_PROJECT_ID: + GCP_SERVICE_ACCOUNT: required: true - GCP_SA_KEY: + GCP_WORKLOAD_IDENTITY_PROVIDER: required: true env: @@ -23,9 +23,17 @@ env: DEFAULT_ADMIN_USERNAME: azureuser SSH_OPTS: "-o ServerAliveInterval=20 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" REMOTE_VM_BIN_PATH: "c:\\containerd\\bin" + BUSYBOX_TESTING_IMAGE_REF: "k8s.gcr.io/e2e-test-images/busybox:1.29-2" + RESOURCE_CONSUMER_TESTING_IMAGE_REF: "k8s.gcr.io/e2e-test-images/resource-consumer:1.10" + WEBSERVER_TESTING_IMAGE_REF: "k8s.gcr.io/e2e-test-images/nginx:1.14-2" + jobs: winIntegration: + # NOTE: the following permissions are required by `google-github-actions/auth`: + permissions: + contents: 'read' + id-token: 'write' strategy: matrix: win_ver: [ltsc2019, ltsc2022] @@ -33,11 +41,11 @@ jobs: - win_ver: ltsc2019 AZURE_IMG: "MicrosoftWindowsServer:WindowsServer:2019-Datacenter-with-Containers-smalldisk:17763.1935.2105080716" AZURE_RESOURCE_GROUP: ctrd-integration-ltsc2019-${{ github.run_id }} - GOOGLE_BUCKET: "gs://containerd-integration/logs/windows-ltsc2019/" + GOOGLE_BUCKET: "containerd-integration/logs/windows-ltsc2019/" - win_ver: ltsc2022 AZURE_IMG: "MicrosoftWindowsServer:WindowsServer:2022-datacenter-smalldisk-g2:20348.169.2108120020" AZURE_RESOURCE_GROUP: ctrd-integration-ltsc2022-${{ github.run_id }} - GOOGLE_BUCKET: "gs://containerd-integration/logs/windows-ltsc2022/" + GOOGLE_BUCKET: "containerd-integration/logs/windows-ltsc2022/" runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -77,13 +85,25 @@ jobs: uses: azure/CLI@v1 with: inlinescript: | - az vm create -n winTestVM --admin-username ${{ env.DEFAULT_ADMIN_USERNAME }} --admin-password ${{ env.PASSWORD }} --image ${{ matrix.AZURE_IMG }} -g ${{ matrix.AZURE_RESOURCE_GROUP }} --nsg-rule SSH --size ${{ env.AZURE_DEFAULT_VM_SIZE }} - - - name: GetAZVMPublicIP - uses: azure/CLI@v1 - with: - inlinescript: | - echo "VM_PUB_IP=$(az network public-ip list -g ${{ matrix.AZURE_RESOURCE_GROUP }} | jq '.[0]["ipAddress"]' | tr -d '\"')" >> $GITHUB_ENV + DETAILS=$(az vm create -n winTestVM --admin-username ${{ env.DEFAULT_ADMIN_USERNAME }} --admin-password ${{ env.PASSWORD }} --image ${{ matrix.AZURE_IMG }} -g ${{ matrix.AZURE_RESOURCE_GROUP }} --nsg-rule SSH --size ${{ env.AZURE_DEFAULT_VM_SIZE }} --public-ip-sku Standard -o json) + PUB_IP=$(echo $DETAILS | jq -r .publicIpAddress) + if [ "$PUB_IP" == "null" ] + then + RETRY=0 + while [ "$PUB_IP" == "null" ] || [ $RETRY -le 5 ] + do + sleep 5 + PUB_IP=$(az vm show -d -g ${{ matrix.AZURE_RESOURCE_GROUP }} -n winTestVM -o json --query publicIps | jq -r) + RETRY=$(( $RETRY + 1 )) + done + fi + + if [ "$PUB_IP" == "null" ] + then + echo "failed to fetch public IP" + exit 1 + fi + echo "VM_PUB_IP=$PUB_IP" >> $GITHUB_ENV - name: EnableAZVMSSH uses: azure/CLI@v1 @@ -143,13 +163,20 @@ jobs: ssh -i $HOME/.ssh/id_rsa ${{ env.SSH_OPTS }} azureuser@${{ env.VM_PUB_IP }} "sh.exe -c 'cd /c/containerd && (make integration | tee /c/Logs/integration.log)'" ssh -i $HOME/.ssh/id_rsa ${{ env.SSH_OPTS }} azureuser@${{ env.VM_PUB_IP }} "sh.exe -c 'cat /c/Logs/integration.log | go-junit-report.exe > /c/Logs/junit_00.xml'" - # CRI-integration tests for Windows PR is not merged. TO DO (adelina-t): enable these when PR #5163 merges. - name: PrepareRepoList run: | - ssh -i $HOME/.ssh/id_rsa ${{ env.SSH_OPTS }} azureuser@${{ env.VM_PUB_IP }} "sh -c 'cat > c:/repolist.toml'" <<'EOF' - busybox = "k8s.gcr.io/e2e-test-images/busybox:1.29-2" - ResourceConsumer = "k8s.gcr.io/e2e-test-images/resource-consumer:1.10" - EOF + cat > repolist.toml << EOF + busybox = "${{ env.BUSYBOX_TESTING_IMAGE_REF }}" + ResourceConsumer = "${{ env.RESOURCE_CONSUMER_TESTING_IMAGE_REF }}" + EOF + + cat > cri-test-images.yaml << EOF + defaultTestContainerImage: ${{ env.BUSYBOX_TESTING_IMAGE_REF }} + webServerTestImage: ${{ env.WEBSERVER_TESTING_IMAGE_REF }} + EOF + + scp -i $HOME/.ssh/id_rsa ${{ env.SSH_OPTS }} repolist.toml azureuser@${{ env.VM_PUB_IP }}:c:/repolist.toml + scp -i $HOME/.ssh/id_rsa ${{ env.SSH_OPTS }} cri-test-images.yaml azureuser@${{ env.VM_PUB_IP }}:c:/cri-test-images.yaml - name: RunCRIIntegrationTests run: | @@ -163,19 +190,16 @@ jobs: ssh -i $HOME/.ssh/id_rsa ${{ env.SSH_OPTS }} azureuser@${{ env.VM_PUB_IP }} "sh.exe -c 'cat /c/Logs/cri-integration.log | go-junit-report.exe > c:/Logs/junit_01.xml' " - name: GetCritestRepo - if: ${{ matrix.win_ver != 'ltsc2022' }} run: | ssh -i $HOME/.ssh/id_rsa ${{ env.SSH_OPTS }} azureuser@${{ env.VM_PUB_IP }} "git clone https://github.com/kubernetes-sigs/cri-tools c:/cri-tools" - name: BuildCritest - if: ${{ matrix.win_ver != 'ltsc2022' }} run: | ssh -i $HOME/.ssh/id_rsa ${{ env.SSH_OPTS }} azureuser@${{ env.VM_PUB_IP }} "sh.exe -c 'cd /c/cri-tools && make critest'" - name: RunCritest - if: ${{ matrix.win_ver != 'ltsc2022' }} run: | - ssh -i $HOME/.ssh/id_rsa ${{ env.SSH_OPTS }} azureuser@${{ env.VM_PUB_IP }} "powershell.exe -command { Start-Process -FilePath C:\containerd\bin\containerd.exe -NoNewWindow -RedirectStandardError true -PassThru ; get-process | sls containerd ; start-sleep 5 ; c:\cri-tools\build\bin\critest.exe --runtime-endpoint=\"npipe:\\\\.\\pipe\\containerd-containerd\" --report-dir='c:\Logs' }" + ssh -i $HOME/.ssh/id_rsa ${{ env.SSH_OPTS }} azureuser@${{ env.VM_PUB_IP }} "powershell.exe -command { Start-Process -FilePath C:\containerd\bin\containerd.exe -NoNewWindow -RedirectStandardError true -PassThru ; get-process | sls containerd ; start-sleep 5 ; c:\cri-tools\build\bin\critest.exe --runtime-endpoint=\"npipe:\\\\.\\pipe\\containerd-containerd\" --test-images-file='c:\cri-test-images.yaml' --report-dir='c:\Logs' }" - name: PullLogsFromWinNode run: | @@ -188,29 +212,39 @@ jobs: - name: FinishJob run: | jq -n --arg result SUCCESS --arg timestamp $(date +%s) '$timestamp|tonumber|{timestamp:.,$result}' > ${{ env.LOGS_DIR }}/finished.json - echo "${{ env.STARTED_TIME }}" > $HOME/latest-build.txt + echo "${{ env.STARTED_TIME }}" > ${{ github.workspace }}/latest-build.txt - name: AssignGcpCreds id: AssignGcpCreds run: | - echo '::set-output name=GCP_PROJECT_ID::${{ secrets.GCP_PROJECT_ID }}' - echo '::set-output name=GCP_SA_KEY::${{ secrets.GCP_SA_KEY }}' + echo '::set-output name=GCP_SERVICE_ACCOUNT::${{ secrets.GCP_SERVICE_ACCOUNT }}' + echo '::set-output name=GCP_WORKLOAD_IDENTITY_PROVIDER::${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}' - - name: SetUpCloudSDK - if: steps.AssignGcpCreds.outputs.GCP_PROJECT_ID && steps.AssignGcpCreds.outputs.GCP_SA_KEY - uses: google-github-actions/setup-gcloud@master + - name: AuthGcp + uses: google-github-actions/auth@v0 + if: steps.AssignGcpCreds.outputs.GCP_SERVICE_ACCOUNT && steps.AssignGcpCreds.outputs.GCP_WORKLOAD_IDENTITY_PROVIDER with: - project_id: ${{ secrets.GCP_PROJECT_ID }} - service_account_key: ${{ secrets.GCP_SA_KEY }} - export_default_credentials: true + service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }} + workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} - - name: UploadArtifacts - if: steps.AssignGcpCreds.outputs.GCP_PROJECT_ID && steps.AssignGcpCreds.outputs.GCP_SA_KEY - run: | - gsutil cp -r ${{ env.LOGS_DIR }} ${{ matrix.GOOGLE_BUCKET }} - gsutil cp $HOME/latest-build.txt ${{ matrix.GOOGLE_BUCKET }} + - name: UploadJobReport + uses: google-github-actions/upload-cloud-storage@v0 + if: steps.AssignGcpCreds.outputs.GCP_SERVICE_ACCOUNT && steps.AssignGcpCreds.outputs.GCP_WORKLOAD_IDENTITY_PROVIDER + with: + path: ${{ github.workspace }}/latest-build.txt + destination: ${{ matrix.GOOGLE_BUCKET }} + parent: false + + - name: UploadLogsDir + uses: google-github-actions/upload-cloud-storage@v0 + if: steps.AssignGcpCreds.outputs.GCP_SERVICE_ACCOUNT && steps.AssignGcpCreds.outputs.GCP_WORKLOAD_IDENTITY_PROVIDER + with: + path: ${{ env.LOGS_DIR }} + destination: ${{ matrix.GOOGLE_BUCKET }}${{ env.STARTED_TIME}} + parent: false - name: ResourceCleanup + if: always() uses: azure/CLI@v1 with: inlinescript: | diff --git a/.mailmap b/.mailmap index 35a8967458547..83bb03cd002c3 100644 --- a/.mailmap +++ b/.mailmap @@ -29,11 +29,13 @@ Eric Ernst Eric Ren Eric Ren Eric Ren +Fabiano Fidêncio Fahed Dorgaa Frank Yang Fupan Li Fupan Li Fupan Li +Furkan Türkal Georgia Panoutsakopoulou Guangming Wang Haiyan Meng @@ -55,11 +57,13 @@ John Howard John Howard Lorenz Brun Luc Perkins +Jiajun Jiang Julien Balestra Jun Lin Chen <1913688+mc256@users.noreply.github.com> Justin Cormack Justin Terry Justin Terry +Kante Kenfe-Mickaël Laventure Kevin Kern Kevin Parsons @@ -84,6 +88,8 @@ Michael Katsoulis Mike Brown Mohammad Asif Siddiqui Ng Yang +Ning Li +ningmingxiao Nishchay Kumar Oliver Stenbom Phil Estes @@ -109,6 +115,7 @@ Stephen J Day Sudeesh John Su Fei Su Xiaolin +Takumasa Sakao Ted Yu Tõnis Tiigi Wade Lee diff --git a/.zuul/playbooks/containerd-build/run.yaml b/.zuul/playbooks/containerd-build/run.yaml index 01e4d91a02f73..1e83f83035950 100644 --- a/.zuul/playbooks/containerd-build/run.yaml +++ b/.zuul/playbooks/containerd-build/run.yaml @@ -2,7 +2,7 @@ become: yes roles: - role: config-golang - go_version: '1.17.5' + go_version: '1.17.7' arch: arm64 tasks: - name: Build containerd diff --git a/ADOPTERS.md b/ADOPTERS.md index 42cfbb140ded0..bbf99e7dd592d 100644 --- a/ADOPTERS.md +++ b/ADOPTERS.md @@ -12,7 +12,7 @@ including the Balena project listed below. **_[IBM Cloud Private (ICP)](https://www.ibm.com/cloud/private)_** - IBM's on-premises cloud offering has containerd as a "tech preview" CRI runtime for the Kubernetes offered within this product for the past two releases, and plans to fully migrate to containerd in a future release. -**_[Google Cloud Kubernetes Engine (GKE)](https://cloud.google.com/kubernetes-engine/)_** - offers containerd as the CRI runtime in **beta** for recent versions of Kubernetes. +**_[Google Cloud Kubernetes Engine (GKE)](https://cloud.google.com/kubernetes-engine/)_** - containerd has been offered in GKE since version 1.14 and has been the default runtime since version 1.19. It is also the only supported runtime for GKE Autopilot from the launch. [More details](https://cloud.google.com/kubernetes-engine/docs/concepts/using-containerd) **_[AWS Fargate](https://aws.amazon.com/fargate)_** - uses containerd + Firecracker (noted below) as the runtime and isolation technology for containers run in the Fargate platform. Fargate is a serverless, container-native compute offering from Amazon Web Services. @@ -36,7 +36,7 @@ including the Balena project listed below. **_BuildKit_** - The Moby project's [BuildKit](https://github.com/moby/buildkit) can use either runC or containerd as build execution backends for building container images. BuildKit support has also been built into the Docker engine in recent releases, making BuildKit provide the backend to the `docker build` command. -**_Azure acs-engine_** - Microsoft Azure's [acs-engine](https://github.com/Azure/acs-engine) open source project has customizable deployment of Kubernetes clusters, where containerd is a selectable container runtime. At some point in the future Azure's AKS service will default to use containerd as the CRI runtime for deployed Kubernetes clusters. +**_[Azure Kubernetes Service (AKS)](https://azure.microsoft.com/services/kubernetes-service)_** - Microsoft's managed Kubernetes offering uses containerd for Linux nodes running v1.19 or greater. Containerd for Windows nodes is currently in public preview. [More Details](https://docs.microsoft.com/azure/aks/cluster-configuration#container-runtime-configuration) **_Amazon Firecracker_** - The AWS [Firecracker VMM project](http://firecracker-microvm.io/) has extended containerd with a new snapshotter and v2 shim to allow containerd to drive virtualized container processes via their VMM implementation. More details on their containerd integration are available in [their GitHub project](https://github.com/firecracker-microvm/firecracker-containerd). @@ -50,6 +50,8 @@ including the Balena project listed below. **_VMware TCE_** - [Tanzu Community Edition](https://github.com/vmware-tanzu/community-edition) VMware's fully-featured, easy to manage, Kubernetes platform for learners and users. It is a freely available, community supported, and open source distribution of VMware Tanzu. It uses containerd as the default CRI runtime. +**_[Talos Linux](https://www.talos.dev/)_** - Talos Linux is Linux designed for Kubernetes – secure, immutable, and minimal. Talos Linux is using containerd as the core system runtime and CRI implementation. + **_Other Projects_** - While the above list provides a cross-section of well known uses of containerd, the simplicity and clear API layer for containerd has inspired many smaller projects around providing simple container management platforms. Several examples of building higher layer functionality on top of the containerd base have come from various containerd community participants: - Michael Crosby's [boss](https://github.com/crosbymichael/boss) project, - Evan Hazlett's [stellar](https://github.com/ehazlett/stellar) project, diff --git a/BUILDING.md b/BUILDING.md index 0174cd576e4c9..5310924ce84cc 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -260,6 +260,10 @@ PASS ok github.com/containerd/containerd 4.778s ``` +> *Note*: in order to run `sudo go` you need to +> - either keep user PATH environment variable. ex: `sudo "PATH=$PATH" env go test ` +> - or use `go test -exec` ex: `go test -exec sudo -v -run "TestTarWithXattr" ./archive/ -test.root` + ## Additional tools ### containerd-stress diff --git a/Makefile b/Makefile index 96c048f0fb324..5791d8fa228ab 100644 --- a/Makefile +++ b/Makefile @@ -417,7 +417,6 @@ vendor: ## ensure all the go.mod/go.sum files are up-to-date including vendor/ d @$(GO) mod tidy @$(GO) mod vendor @$(GO) mod verify - @(cd ${ROOTDIR}/api && ${GO} mod tidy) @(cd ${ROOTDIR}/integration/client && ${GO} mod tidy) verify-vendor: ## verify if all the go.mod/go.sum files are up-to-date @@ -425,11 +424,9 @@ verify-vendor: ## verify if all the go.mod/go.sum files are up-to-date $(eval TMPDIR := $(shell mktemp -d)) @cp -R ${ROOTDIR} ${TMPDIR} @(cd ${TMPDIR}/containerd && ${GO} mod tidy) - @(cd ${TMPDIR}/containerd/api && ${GO} mod tidy) @(cd ${TMPDIR}/containerd/integration/client && ${GO} mod tidy) @diff -r -u -q ${ROOTDIR} ${TMPDIR}/containerd @rm -rf ${TMPDIR} - @${ROOTDIR}/script/verify-go-modules.sh api @${ROOTDIR}/script/verify-go-modules.sh integration/client diff --git a/README.md b/README.md index e4126f60f3716..f876079abb29a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -![containerd banner](https://raw.githubusercontent.com/cncf/artwork/master/projects/containerd/horizontal/color/containerd-horizontal-color.png) +![containerd banner light mode](https://raw.githubusercontent.com/cncf/artwork/master/projects/containerd/horizontal/color/containerd-horizontal-color.png#gh-light-mode-only) +![containerd banner dark mode](https://raw.githubusercontent.com/cncf/artwork/master/projects/containerd/horizontal/white/containerd-horizontal-white.png#gh-dark-mode-only) [![PkgGoDev](https://pkg.go.dev/badge/github.com/containerd/containerd)](https://pkg.go.dev/github.com/containerd/containerd) [![Build Status](https://github.com/containerd/containerd/workflows/CI/badge.svg)](https://github.com/containerd/containerd/actions?query=workflow%3ACI) diff --git a/RELEASES.md b/RELEASES.md index e5b5d10e73fb5..24762487c81c2 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -100,21 +100,23 @@ The current state is available in the following tables: | [1.1](https://github.com/containerd/containerd/releases/tag/v1.1.8) | End of Life | April 23, 2018 | October 23, 2019 | | [1.2](https://github.com/containerd/containerd/releases/tag/v1.2.13) | End of Life | October 24, 2018 | October 15, 2020 | | [1.3](https://github.com/containerd/containerd/releases/tag/v1.3.10) | End of Life | September 26, 2019 | March 4, 2021 | -| [1.4](https://github.com/containerd/containerd/releases/tag/v1.4.4) | Extended | August 17, 2020 | November 3, 2021 (Active), February 3, 2022 (Extended) | -| [1.5](https://github.com/containerd/containerd/releases/tag/v1.5.0) | Active | May 3, 2021 | max(May 3, 2022, release of 1.6.0 + 6 months) | -| [1.6](https://github.com/containerd/containerd/milestone/34) | Next | TBD | max(TBD+1 year, release of 1.7.0 or 2.0.0 + 6 months) | +| [1.4](https://github.com/containerd/containerd/releases/tag/v1.4.12) | Extended | August 17, 2020 | March 3, 2022 (Extended) | +| [1.5](https://github.com/containerd/containerd/releases/tag/v1.5.9) | Active | May 3, 2021 | October 28, 2022 | +| [1.6](https://github.com/containerd/containerd/releases/tag/v1.6.0) | Active | February 15, 2022 | max(February 15, 2023 or release of 1.7.0 + 6 months) | +| [1.7](https://github.com/containerd/containerd/milestone/42) | Next | TBD | TBD | Note that branches and release from before 1.0 may not follow these rules. -| 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 (End-Of-Life) | 1.10+ | v1alpha2 | -| | v1.3 (End-Of-Life) | 1.12+ | v1alpha2 | -| | v1.4 | 1.19+ | v1alpha2 | -| | v1.5 | 1.20+ | v1alpha2 | +| 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 (End-Of-Life) | 1.10+ | v1alpha2 | +| | v1.3 (End-Of-Life) | 1.12+ | v1alpha2 | +| | v1.4 | 1.19+ | v1alpha2 | +| | v1.5 | 1.20+ | v1alpha2 | +| | v1.6 | 1.23+ | v1, v1alpha2 | **Note:** The support table above specifies the Kubernetes Version that was supported at time of release of the containerd - cri integration and Kubernetes only supports n-3 minor release versions. @@ -193,9 +195,9 @@ containerd versions: | GRPC API | Stable | 1.0 | [gRPC API](#grpc-api) | | Metrics API | Stable | 1.0 | - | | Runtime Shim API | Stable | 1.2 | - | -| Daemon Config | Stable | 1.0 | - | +| Daemon Config | Stable | 1.0 | - | +| CRI GRPC API | Stable | 1.6 (_CRI v1_) | [cri-api](https://github.com/kubernetes/cri-api/tree/master/pkg/apis/runtime/v1) | | Go client API | Unstable | _future_ | [godoc](https://godoc.org/github.com/containerd/containerd) | -| CRI GRPC API | Unstable | v1alpha2 _current_ | [cri-api](https://github.com/kubernetes/cri-api/tree/master/pkg/apis/runtime/v1alpha2) | | `ctr` tool | Unstable | Out of scope | - | From the version stated in the above table, that component must adhere to the @@ -334,9 +336,10 @@ against total impact. The deprecated features are shown in the following table: -| Component | Deprecation release | Target release for removal | Recommendation | -|----------------------------------------------------------------------|---------------------|----------------------------|-------------------------------| -| Runtime V1 API and implementation (`io.containerd.runtime.v1.linux`) | containerd v1.4 | containerd v2.0 | Use `io.containerd.runc.v2` | -| Runc V1 implementation of Runtime V2 (`io.containerd.runc.v1`) | containerd v1.4 | containerd v2.0 | Use `io.containerd.runc.v2` | -| config.toml `version = 1` | containerd v1.5 | containerd v2.0 | Use config.toml `version = 2` | -| Built-in `aufs` snapshotter | containerd v1.5 | containerd v2.0 | Use `overlayfs` snapshotter | +| Component | Deprecation release | Target release for removal | Recommendation | +|----------------------------------------------------------------------|---------------------|----------------------------|-----------------------------------| +| Runtime V1 API and implementation (`io.containerd.runtime.v1.linux`) | containerd v1.4 | containerd v2.0 | Use `io.containerd.runc.v2` | +| Runc V1 implementation of Runtime V2 (`io.containerd.runc.v1`) | containerd v1.4 | containerd v2.0 | Use `io.containerd.runc.v2` | +| config.toml `version = 1` | containerd v1.5 | containerd v2.0 | Use config.toml `version = 2` | +| Built-in `aufs` snapshotter | containerd v1.5 | containerd v2.0 | Use `overlayfs` snapshotter | +| `cri-containerd-*.tar.gz` release bundles | containerd v1.6 | containerd v2.0 | Use `containerd-*.tar.gz` bundles | diff --git a/Vagrantfile b/Vagrantfile index 1d6d1a7c0ec31..16feb48a1a9a3 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -77,7 +77,7 @@ Vagrant.configure("2") do |config| config.vm.provision "install-golang", type: "shell", run: "once" do |sh| sh.upload_path = "/tmp/vagrant-install-golang" sh.env = { - 'GO_VERSION': ENV['GO_VERSION'] || "1.17.5", + 'GO_VERSION': ENV['GO_VERSION'] || "1.17.7", } sh.inline = <<~SHELL #!/usr/bin/env bash diff --git a/api/go.mod b/api/go.mod deleted file mode 100644 index 7145eb805ce99..0000000000000 --- a/api/go.mod +++ /dev/null @@ -1,19 +0,0 @@ -module github.com/containerd/containerd/api - -go 1.16 - -require ( - github.com/containerd/ttrpc v1.1.0 - github.com/containerd/typeurl v1.0.2 - github.com/gogo/googleapis v1.4.0 - github.com/gogo/protobuf v1.3.2 - github.com/opencontainers/go-digest v1.0.0 - google.golang.org/grpc v1.43.0 -) - -replace ( - github.com/gogo/googleapis => github.com/gogo/googleapis v1.3.2 - // urfave/cli must be <= v1.22.1 due to a regression: https://github.com/urfave/cli/issues/1092 - github.com/urfave/cli => github.com/urfave/cli v1.22.1 - google.golang.org/genproto => google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63 -) diff --git a/archive/tar.go b/archive/tar.go index fbc061c450e69..62341d5e12f07 100644 --- a/archive/tar.go +++ b/archive/tar.go @@ -19,6 +19,8 @@ package archive import ( "archive/tar" "context" + "errors" + "fmt" "io" "os" "path/filepath" @@ -30,7 +32,6 @@ import ( "github.com/containerd/containerd/log" "github.com/containerd/continuity/fs" - "github.com/pkg/errors" ) var bufPool = &sync.Pool{ @@ -76,7 +77,7 @@ func WriteDiff(ctx context.Context, w io.Writer, a, b string, opts ...WriteDiffO var options WriteDiffOptions for _, opt := range opts { if err := opt(&options); err != nil { - return errors.Wrap(err, "failed to apply option") + return fmt.Errorf("failed to apply option: %w", err) } } if options.writeDiffFunc == nil { @@ -97,7 +98,7 @@ func writeDiffNaive(ctx context.Context, w io.Writer, a, b string, _ WriteDiffOp 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 fmt.Errorf("failed to create diff tar stream: %w", err) } return cw.Close() } @@ -128,7 +129,7 @@ func Apply(ctx context.Context, root string, r io.Reader, opts ...ApplyOpt) (int var options ApplyOptions for _, opt := range opts { if err := opt(&options); err != nil { - return 0, errors.Wrap(err, "failed to apply option") + return 0, fmt.Errorf("failed to apply option: %w", err) } } if options.Filter == nil { @@ -236,7 +237,7 @@ func applyNaive(ctx context.Context, root string, r io.Reader, options ApplyOpti 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") + return 0, fmt.Errorf("failed to get root path: %w", err) } // Join to root before joining to parent path to ensure relative links are @@ -266,7 +267,7 @@ func applyNaive(ctx context.Context, root string, r io.Reader, options ApplyOpti } writeFile, err := convertWhiteout(hdr, path) if err != nil { - return 0, errors.Wrapf(err, "failed to convert whiteout file %q", hdr.Name) + return 0, fmt.Errorf("failed to convert whiteout file %q: %w", hdr.Name, err) } if !writeFile { continue @@ -373,7 +374,7 @@ func createTarFile(ctx context.Context, path, extractDir string, hdr *tar.Header return nil default: - return errors.Errorf("unhandled tar header type %d\n", hdr.Typeflag) + return fmt.Errorf("unhandled tar header type %d", hdr.Typeflag) } // Lchown is not supported on Windows. @@ -520,7 +521,7 @@ func (cw *ChangeWriter) HandleChange(k fs.ChangeKind, p string, f os.FileInfo, e return err } if err := cw.tw.WriteHeader(hdr); err != nil { - return errors.Wrap(err, "failed to write whiteout header") + return fmt.Errorf("failed to write whiteout header: %w", err) } } else { var ( @@ -555,12 +556,12 @@ func (cw *ChangeWriter) HandleChange(k fs.ChangeKind, p string, f os.FileInfo, e 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") + return fmt.Errorf("failed to make path relative: %w", err) } } name, err = tarName(name) if err != nil { - return errors.Wrap(err, "cannot canonicalize path") + return fmt.Errorf("cannot canonicalize path: %w", err) } // suffix with '/' for directories if f.IsDir() && !strings.HasSuffix(name, "/") { @@ -569,7 +570,7 @@ func (cw *ChangeWriter) HandleChange(k fs.ChangeKind, p string, f os.FileInfo, e hdr.Name = name if err := setHeaderForSpecialDevice(hdr, name, f); err != nil { - return errors.Wrap(err, "failed to set device headers") + return fmt.Errorf("failed to set device headers: %w", err) } // additionalLinks stores file names which must be linked to @@ -597,7 +598,7 @@ func (cw *ChangeWriter) HandleChange(k fs.ChangeKind, p string, f os.FileInfo, e } if capability, err := getxattr(source, "security.capability"); err != nil { - return errors.Wrap(err, "failed to get capabilities xattr") + return fmt.Errorf("failed to get capabilities xattr: %w", err) } else if len(capability) > 0 { if hdr.PAXRecords == nil { hdr.PAXRecords = map[string]string{} @@ -609,19 +610,19 @@ func (cw *ChangeWriter) HandleChange(k fs.ChangeKind, p string, f os.FileInfo, e return err } if err := cw.tw.WriteHeader(hdr); err != nil { - return errors.Wrap(err, "failed to write file header") + return fmt.Errorf("failed to write file header: %w", err) } 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) + return fmt.Errorf("failed to open path: %v: %w", source, err) } defer file.Close() n, err := copyBuffered(context.TODO(), cw.tw, file) if err != nil { - return errors.Wrap(err, "failed to copy") + return fmt.Errorf("failed to copy: %w", err) } if n != hdr.Size { return errors.New("short write copying file") @@ -640,7 +641,7 @@ func (cw *ChangeWriter) HandleChange(k fs.ChangeKind, p string, f os.FileInfo, e return err } if err := cw.tw.WriteHeader(hdr); err != nil { - return errors.Wrap(err, "failed to write file header") + return fmt.Errorf("failed to write file header: %w", err) } } } @@ -651,7 +652,7 @@ func (cw *ChangeWriter) HandleChange(k fs.ChangeKind, p string, f os.FileInfo, e // Close closes this writer. func (cw *ChangeWriter) Close() error { if err := cw.tw.Close(); err != nil { - return errors.Wrap(err, "failed to close tar writer") + return fmt.Errorf("failed to close tar writer: %w", err) } return nil } @@ -764,7 +765,7 @@ func validateWhiteout(path string) error { dir += string(filepath.Separator) } if !strings.HasPrefix(originalPath, dir) { - return errors.Wrapf(errInvalidArchive, "invalid whiteout name: %v", base) + return fmt.Errorf("invalid whiteout name: %v: %w", base, errInvalidArchive) } } return nil diff --git a/archive/tar_linux_test.go b/archive/tar_linux_test.go index a75fefe9caaff..9a4397de5c388 100644 --- a/archive/tar_linux_test.go +++ b/archive/tar_linux_test.go @@ -31,7 +31,6 @@ import ( "github.com/containerd/containerd/snapshots/overlay/overlayutils" "github.com/containerd/continuity/fs" "github.com/containerd/continuity/fs/fstest" - "github.com/pkg/errors" ) func TestOverlayApply(t *testing.T) { @@ -72,7 +71,7 @@ func TestOverlayApplyNoParents(t *testing.T) { cw.addedDirs = nil err := fs.Changes(ctx, a, b, cw.HandleChange) if err != nil { - return errors.Wrap(err, "failed to create diff tar stream") + return fmt.Errorf("failed to create diff tar stream: %w", err) } return cw.Close() }, @@ -97,7 +96,7 @@ type contextKey struct{} func (d overlayDiffApplier) TestContext(ctx context.Context) (context.Context, func(), error) { merged, err := os.MkdirTemp(d.tmp, "merged") if err != nil { - return ctx, nil, errors.Wrap(err, "failed to make merged dir") + return ctx, nil, fmt.Errorf("failed to make merged dir: %w", err) } oc := &overlayContext{ @@ -118,7 +117,7 @@ func (d overlayDiffApplier) Apply(ctx context.Context, a fstest.Applier) (string applyCopy, err := os.MkdirTemp(d.tmp, "apply-copy-") if err != nil { - return "", nil, errors.Wrap(err, "failed to create temp dir") + return "", nil, fmt.Errorf("failed to create temp dir: %w", err) } defer os.RemoveAll(applyCopy) @@ -128,33 +127,33 @@ func (d overlayDiffApplier) Apply(ctx context.Context, a fstest.Applier) (string } if err = fs.CopyDir(applyCopy, base); err != nil { - return "", nil, errors.Wrap(err, "failed to copy base") + return "", nil, fmt.Errorf("failed to copy base: %w", err) } if err := a.Apply(applyCopy); err != nil { - return "", nil, errors.Wrap(err, "failed to apply changes to copy of base") + return "", nil, fmt.Errorf("failed to apply changes to copy of base: %w", err) } buf := bytes.NewBuffer(nil) if err := d.diff(ctx, buf, base, applyCopy); err != nil { - return "", nil, errors.Wrap(err, "failed to create diff") + return "", nil, fmt.Errorf("failed to create diff: %w", err) } if oc.mounted { if err := mount.Unmount(oc.merged, 0); err != nil { - return "", nil, errors.Wrap(err, "failed to unmount") + return "", nil, fmt.Errorf("failed to unmount: %w", err) } oc.mounted = false } next, err := os.MkdirTemp(d.tmp, "lower-") if err != nil { - return "", nil, errors.Wrap(err, "failed to create temp dir") + return "", nil, fmt.Errorf("failed to create temp dir: %w", err) } if _, err = Apply(ctx, next, buf, WithConvertWhiteout(OverlayConvertWhiteout), WithParents(oc.lowers)); err != nil { - return "", nil, errors.Wrap(err, "failed to apply tar stream") + return "", nil, fmt.Errorf("failed to apply tar stream: %w", err) } oc.lowers = append([]string{next}, oc.lowers...) @@ -172,7 +171,7 @@ func (d overlayDiffApplier) Apply(ctx context.Context, a fstest.Applier) (string } if err := m.Mount(oc.merged); err != nil { - return "", nil, errors.Wrapf(err, "failed to mount: %v", m) + return "", nil, fmt.Errorf("failed to mount: %v: %w", m, err) } oc.mounted = true diff --git a/archive/tar_test.go b/archive/tar_test.go index faee38daf12db..f18b1ce4f3e13 100644 --- a/archive/tar_test.go +++ b/archive/tar_test.go @@ -23,6 +23,7 @@ import ( "archive/tar" "bytes" "context" + "errors" "fmt" "io" "os" @@ -36,7 +37,6 @@ import ( "github.com/containerd/containerd/pkg/testutil" "github.com/containerd/continuity/fs" "github.com/containerd/continuity/fs/fstest" - "github.com/pkg/errors" exec "golang.org/x/sys/execabs" ) @@ -235,10 +235,10 @@ func TestBreakouts(t *testing.T) { unbrokenCheck := func(root string) error { b, err := os.ReadFile(filepath.Join(root, "etc", "unbroken")) if err != nil { - return errors.Wrap(err, "failed to read unbroken") + return fmt.Errorf("failed to read unbroken: %w", err) } if string(b) != expected { - return errors.Errorf("/etc/unbroken: unexpected value %s, expected %s", b, expected) + return fmt.Errorf("/etc/unbroken: unexpected value %s, expected %s", b, expected) } return nil } @@ -257,7 +257,7 @@ func TestBreakouts(t *testing.T) { } if got := fi.Mode() & os.ModeSymlink; got != os.ModeSymlink { - return errors.Errorf("%s should be symlink", fi.Name()) + return fmt.Errorf("%s should be symlink", fi.Name()) } return nil } @@ -285,7 +285,7 @@ func TestBreakouts(t *testing.T) { } if t1 != t2 { - return errors.Wrapf(errFileDiff, "%#v and %#v", t1, t2) + return fmt.Errorf("%#v and %#v: %w", t1, t2, errFileDiff) } return nil } @@ -310,7 +310,7 @@ func TestBreakouts(t *testing.T) { return err } if !os.SameFile(s1, s2) { - return errors.Wrapf(errFileDiff, "%#v and %#v", s1, s2) + return fmt.Errorf("%#v and %#v: %w", s1, s2, errFileDiff) } return nil } @@ -335,7 +335,7 @@ func TestBreakouts(t *testing.T) { return err } if !bytes.Equal(b, content) { - return errors.Errorf("content differs: expected %v, got %v", content, b) + return fmt.Errorf("content differs: expected %v, got %v", content, b) } return nil } @@ -422,7 +422,7 @@ func TestBreakouts(t *testing.T) { validator: func(root string) error { b, err := os.ReadFile(filepath.Join(root, "etc", "emptied")) if err != nil { - return errors.Wrap(err, "failed to read unbroken") + return fmt.Errorf("failed to read unbroken: %w", err) } if len(b) > 0 { return errors.New("/etc/emptied: non-empty") @@ -774,7 +774,7 @@ func TestBreakouts(t *testing.T) { return err } if perm := fi.Mode() & os.ModePerm; perm != 0400 { - return errors.Errorf("%s perm changed from 0400 to %04o", p, perm) + return fmt.Errorf("%s perm changed from 0400 to %04o", p, perm) } return nil }, @@ -800,7 +800,7 @@ func TestApplyTar(t *testing.T) { return err } if _, err := os.Stat(p); err != nil { - return errors.Wrapf(err, "failure checking existence for %v", d) + return fmt.Errorf("failure checking existence for %v: %w", d, err) } } return nil @@ -844,23 +844,23 @@ func TestApplyTar(t *testing.T) { func testApply(a fstest.Applier) error { td, err := os.MkdirTemp("", "test-apply-") if err != nil { - return errors.Wrap(err, "failed to create temp dir") + return fmt.Errorf("failed to create temp dir: %w", err) } defer os.RemoveAll(td) dest, err := os.MkdirTemp("", "test-apply-dest-") if err != nil { - return errors.Wrap(err, "failed to create temp dir") + return fmt.Errorf("failed to create temp dir: %w", err) } defer os.RemoveAll(dest) if err := a.Apply(td); err != nil { - return errors.Wrap(err, "failed to apply filesystem changes") + return fmt.Errorf("failed to apply filesystem changes: %w", err) } tarArgs := []string{"c", "-C", td} names, err := readDirNames(td) if err != nil { - return errors.Wrap(err, "failed to read directory names") + return fmt.Errorf("failed to read directory names: %w", err) } tarArgs = append(tarArgs, names...) @@ -868,15 +868,15 @@ func testApply(a fstest.Applier) error { arch, err := cmd.StdoutPipe() if err != nil { - return errors.Wrap(err, "failed to create stdout pipe") + return fmt.Errorf("failed to create stdout pipe: %w", err) } if err := cmd.Start(); err != nil { - return errors.Wrap(err, "failed to start command") + return fmt.Errorf("failed to start command: %w", err) } if _, err := Apply(context.Background(), dest, arch); err != nil { - return errors.Wrap(err, "failed to apply tar stream") + return fmt.Errorf("failed to apply tar stream: %w", err) } return fstest.CheckDirectoryEqual(td, dest) @@ -885,17 +885,17 @@ func testApply(a fstest.Applier) error { func testBaseDiff(a fstest.Applier) error { td, err := os.MkdirTemp("", "test-base-diff-") if err != nil { - return errors.Wrap(err, "failed to create temp dir") + return fmt.Errorf("failed to create temp dir: %w", err) } defer os.RemoveAll(td) dest, err := os.MkdirTemp("", "test-base-diff-dest-") if err != nil { - return errors.Wrap(err, "failed to create temp dir") + return fmt.Errorf("failed to create temp dir: %w", err) } defer os.RemoveAll(dest) if err := a.Apply(td); err != nil { - return errors.Wrap(err, "failed to apply filesystem changes") + return fmt.Errorf("failed to apply filesystem changes: %w", err) } arch := Diff(context.Background(), "", td) @@ -903,7 +903,7 @@ func testBaseDiff(a fstest.Applier) error { cmd := exec.Command(tarCmd, "x", "-C", dest) cmd.Stdin = arch if err := cmd.Run(); err != nil { - return errors.Wrap(err, "tar command failed") + return fmt.Errorf("tar command failed: %w", err) } return fstest.CheckDirectoryEqual(td, dest) @@ -912,18 +912,18 @@ func testBaseDiff(a fstest.Applier) error { func testDiffApply(appliers ...fstest.Applier) error { td, err := os.MkdirTemp("", "test-diff-apply-") if err != nil { - return errors.Wrap(err, "failed to create temp dir") + return fmt.Errorf("failed to create temp dir: %w", err) } defer os.RemoveAll(td) dest, err := os.MkdirTemp("", "test-diff-apply-dest-") if err != nil { - return errors.Wrap(err, "failed to create temp dir") + return fmt.Errorf("failed to create temp dir: %w", err) } defer os.RemoveAll(dest) for _, a := range appliers { if err := a.Apply(td); err != nil { - return errors.Wrap(err, "failed to apply filesystem changes") + return fmt.Errorf("failed to apply filesystem changes: %w", err) } } @@ -931,18 +931,18 @@ func testDiffApply(appliers ...fstest.Applier) error { if len(appliers) > 1 { for _, a := range appliers[:len(appliers)-1] { if err := a.Apply(dest); err != nil { - return errors.Wrap(err, "failed to apply base filesystem changes") + return fmt.Errorf("failed to apply base filesystem changes: %w", err) } } } diffBytes, err := io.ReadAll(Diff(context.Background(), dest, td)) if err != nil { - return errors.Wrap(err, "failed to create diff") + return fmt.Errorf("failed to create diff: %w", err) } if _, err := Apply(context.Background(), dest, bytes.NewReader(diffBytes)); err != nil { - return errors.Wrap(err, "failed to apply tar stream") + return fmt.Errorf("failed to apply tar stream: %w", err) } return fstest.CheckDirectoryEqual(td, dest) @@ -1194,10 +1194,10 @@ func dirEntry(name string, mode int) tarEntryValidator { return errors.New("not directory type") } if hdr.Name != name { - return errors.Errorf("wrong name %q, expected %q", hdr.Name, name) + return fmt.Errorf("wrong name %q, expected %q", hdr.Name, name) } if hdr.Mode != int64(mode) { - return errors.Errorf("wrong mode %o, expected %o", hdr.Mode, mode) + return fmt.Errorf("wrong mode %o, expected %o", hdr.Mode, mode) } return nil } @@ -1209,10 +1209,10 @@ func fileEntry(name string, expected []byte, mode int) tarEntryValidator { return errors.New("not file type") } if hdr.Name != name { - return errors.Errorf("wrong name %q, expected %q", hdr.Name, name) + return fmt.Errorf("wrong name %q, expected %q", hdr.Name, name) } if hdr.Mode != int64(mode) { - return errors.Errorf("wrong mode %o, expected %o", hdr.Mode, mode) + return fmt.Errorf("wrong mode %o, expected %o", hdr.Mode, mode) } if !bytes.Equal(b, expected) { return errors.New("different file content") @@ -1227,10 +1227,10 @@ func linkEntry(name, link string) tarEntryValidator { return errors.New("not link type") } if hdr.Name != name { - return errors.Errorf("wrong name %q, expected %q", hdr.Name, name) + return fmt.Errorf("wrong name %q, expected %q", hdr.Name, name) } if hdr.Linkname != link { - return errors.Errorf("wrong link %q, expected %q", hdr.Linkname, link) + return fmt.Errorf("wrong link %q, expected %q", hdr.Linkname, link) } return nil } @@ -1243,10 +1243,10 @@ func whiteoutEntry(name string) tarEntryValidator { return func(hdr *tar.Header, b []byte) error { if hdr.Typeflag != tar.TypeReg { - return errors.Errorf("not file type: %q", hdr.Typeflag) + return fmt.Errorf("not file type: %q", hdr.Typeflag) } if hdr.Name != whiteOut { - return errors.Errorf("wrong name %q, expected whiteout %q", hdr.Name, name) + return fmt.Errorf("wrong name %q, expected whiteout %q", hdr.Name, name) } return nil } @@ -1309,7 +1309,7 @@ type diffApplier struct{} func (d diffApplier) TestContext(ctx context.Context) (context.Context, func(), error) { base, err := os.MkdirTemp("", "test-diff-apply-") if err != nil { - return ctx, nil, errors.Wrap(err, "failed to create temp dir") + return ctx, nil, fmt.Errorf("failed to create temp dir: %w", err) } return context.WithValue(ctx, d, base), func() { os.RemoveAll(base) @@ -1321,23 +1321,23 @@ func (d diffApplier) Apply(ctx context.Context, a fstest.Applier) (string, func( applyCopy, err := os.MkdirTemp("", "test-diffapply-apply-copy-") if err != nil { - return "", nil, errors.Wrap(err, "failed to create temp dir") + return "", nil, fmt.Errorf("failed to create temp dir: %w", err) } defer os.RemoveAll(applyCopy) if err = fs.CopyDir(applyCopy, base); err != nil { - return "", nil, errors.Wrap(err, "failed to copy base") + return "", nil, fmt.Errorf("failed to copy base: %w", err) } if err := a.Apply(applyCopy); err != nil { - return "", nil, errors.Wrap(err, "failed to apply changes to copy of base") + return "", nil, fmt.Errorf("failed to apply changes to copy of base: %w", err) } diffBytes, err := io.ReadAll(Diff(ctx, base, applyCopy)) if err != nil { - return "", nil, errors.Wrap(err, "failed to create diff") + return "", nil, fmt.Errorf("failed to create diff: %w", err) } if _, err = Apply(ctx, base, bytes.NewReader(diffBytes)); err != nil { - return "", nil, errors.Wrap(err, "failed to apply tar stream") + return "", nil, fmt.Errorf("failed to apply tar stream: %w", err) } return base, nil, nil diff --git a/archive/tar_unix.go b/archive/tar_unix.go index c5ddf596ffeb1..2f3a3a392e6c8 100644 --- a/archive/tar_unix.go +++ b/archive/tar_unix.go @@ -21,6 +21,8 @@ package archive import ( "archive/tar" + "errors" + "fmt" "os" "runtime" "strings" @@ -29,7 +31,6 @@ import ( "github.com/containerd/containerd/pkg/userns" "github.com/containerd/continuity/fs" "github.com/containerd/continuity/sysx" - "github.com/pkg/errors" "golang.org/x/sys/unix" ) @@ -139,7 +140,7 @@ func getxattr(path, attr string) ([]byte, error) { 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 fmt.Errorf("admin attributes from archive not supported: %w", unix.ENOTSUP) } return unix.Lsetxattr(path, key, []byte(value), 0) } @@ -159,12 +160,12 @@ func copyDirInfo(fi os.FileInfo, path string) error { } } if err != nil { - return errors.Wrapf(err, "failed to chown %s", path) + return fmt.Errorf("failed to chown %s: %w", path, err) } } if err := os.Chmod(path, fi.Mode()); err != nil { - return errors.Wrapf(err, "failed to chmod %s", path) + return fmt.Errorf("failed to chmod %s: %w", path, err) } timespec := []unix.Timespec{ @@ -172,7 +173,7 @@ func copyDirInfo(fi os.FileInfo, path string) error { 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 fmt.Errorf("failed to utime %s: %w", path, err) } return nil @@ -184,7 +185,7 @@ func copyUpXAttrs(dst, src string) error { if err == unix.ENOTSUP || err == sysx.ENODATA { return nil } - return errors.Wrapf(err, "failed to list xattrs on %s", src) + return fmt.Errorf("failed to list xattrs on %s: %w", src, err) } for _, xattr := range xattrKeys { // Do not copy up trusted attributes @@ -196,10 +197,10 @@ func copyUpXAttrs(dst, src string) error { if err == unix.ENOTSUP || err == sysx.ENODATA { continue } - return errors.Wrapf(err, "failed to get xattr %q on %s", xattr, src) + return fmt.Errorf("failed to get xattr %q on %s: %w", xattr, src, err) } if err := lsetxattrCreate(dst, xattr, data); err != nil { - return errors.Wrapf(err, "failed to set xattr %q on %s", xattr, dst) + return fmt.Errorf("failed to set xattr %q on %s: %w", xattr, dst, err) } } diff --git a/archive/tar_windows.go b/archive/tar_windows.go index c38154caa14de..4b71c1e307260 100644 --- a/archive/tar_windows.go +++ b/archive/tar_windows.go @@ -18,12 +18,12 @@ package archive import ( "archive/tar" + "errors" "fmt" "os" "strings" "github.com/containerd/containerd/sys" - "github.com/pkg/errors" ) // tarName returns platform-specific filepath @@ -112,7 +112,7 @@ func setxattr(path, key, value string) error { 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 fmt.Errorf("failed to chmod %s: %w", path, err) } return nil } diff --git a/archive/time_unix.go b/archive/time_unix.go index 53e77aa9f60c0..043e374538cea 100644 --- a/archive/time_unix.go +++ b/archive/time_unix.go @@ -20,11 +20,10 @@ package archive import ( + "fmt" "time" "golang.org/x/sys/unix" - - "github.com/pkg/errors" ) func chtimes(path string, atime, mtime time.Time) error { @@ -33,7 +32,7 @@ func chtimes(path string, atime, mtime time.Time) error { 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 fmt.Errorf("failed call to UtimesNanoAt for %s: %w", path, err) } return nil diff --git a/cio/io_unix.go b/cio/io_unix.go index 99281c9d1b949..5606cc88a9420 100644 --- a/cio/io_unix.go +++ b/cio/io_unix.go @@ -21,6 +21,7 @@ package cio import ( "context" + "fmt" "io" "os" "path/filepath" @@ -28,7 +29,6 @@ import ( "syscall" "github.com/containerd/fifo" - "github.com/pkg/errors" ) // NewFIFOSetInDir returns a new FIFOSet with paths in a temporary directory under root @@ -112,7 +112,7 @@ func openFifos(ctx context.Context, fifos *FIFOSet) (f pipes, retErr error) { if fifos.Stdin != "" { if f.Stdin, retErr = fifo.OpenFifo(ctx, fifos.Stdin, syscall.O_WRONLY|syscall.O_CREAT|syscall.O_NONBLOCK, 0700); retErr != nil { - return f, errors.Wrapf(retErr, "failed to open stdin fifo") + return f, fmt.Errorf("failed to open stdin fifo: %w", retErr) } defer func() { if retErr != nil && f.Stdin != nil { @@ -122,7 +122,7 @@ func openFifos(ctx context.Context, fifos *FIFOSet) (f pipes, retErr error) { } if fifos.Stdout != "" { if f.Stdout, retErr = fifo.OpenFifo(ctx, fifos.Stdout, syscall.O_RDONLY|syscall.O_CREAT|syscall.O_NONBLOCK, 0700); retErr != nil { - return f, errors.Wrapf(retErr, "failed to open stdout fifo") + return f, fmt.Errorf("failed to open stdout fifo: %w", retErr) } defer func() { if retErr != nil && f.Stdout != nil { @@ -132,7 +132,7 @@ func openFifos(ctx context.Context, fifos *FIFOSet) (f pipes, retErr error) { } if !fifos.Terminal && fifos.Stderr != "" { if f.Stderr, retErr = fifo.OpenFifo(ctx, fifos.Stderr, syscall.O_RDONLY|syscall.O_CREAT|syscall.O_NONBLOCK, 0700); retErr != nil { - return f, errors.Wrapf(retErr, "failed to open stderr fifo") + return f, fmt.Errorf("failed to open stderr fifo: %w", retErr) } } return f, nil diff --git a/cio/io_windows.go b/cio/io_windows.go index ded475788f692..f3d736a6d42f1 100644 --- a/cio/io_windows.go +++ b/cio/io_windows.go @@ -23,7 +23,6 @@ import ( winio "github.com/Microsoft/go-winio" "github.com/containerd/containerd/log" - "github.com/pkg/errors" ) const pipeRoot = `\\.\pipe` @@ -54,7 +53,7 @@ func copyIO(fifos *FIFOSet, ioset *Streams) (_ *cio, retErr error) { 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) + return nil, fmt.Errorf("failed to create stdin pipe %s: %w", fifos.Stdin, err) } cios.closers = append(cios.closers, l) @@ -77,7 +76,7 @@ func copyIO(fifos *FIFOSet, ioset *Streams) (_ *cio, retErr error) { 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) + return nil, fmt.Errorf("failed to create stdout pipe %s: %w", fifos.Stdout, err) } cios.closers = append(cios.closers, l) @@ -100,7 +99,7 @@ func copyIO(fifos *FIFOSet, ioset *Streams) (_ *cio, retErr error) { 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) + return nil, fmt.Errorf("failed to create stderr pipe %s: %w", fifos.Stderr, err) } cios.closers = append(cios.closers, l) diff --git a/client.go b/client.go index c6e47d2a2ce68..1c2202e1ecdbd 100644 --- a/client.go +++ b/client.go @@ -61,8 +61,6 @@ import ( 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" - "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" "golang.org/x/sync/semaphore" "google.golang.org/grpc" "google.golang.org/grpc/backoff" @@ -137,22 +135,16 @@ func New(address string, opts ...ClientOpt) (*Client, error) { } if copts.defaultns != "" { unary, stream := newNSInterceptors(copts.defaultns) - gopts = append(gopts, - grpc.WithChainUnaryInterceptor(unary, otelgrpc.UnaryClientInterceptor()), - grpc.WithChainStreamInterceptor(stream, otelgrpc.StreamClientInterceptor()), - ) - } else { - gopts = append(gopts, - grpc.WithUnaryInterceptor(otelgrpc.UnaryClientInterceptor()), - grpc.WithStreamInterceptor(otelgrpc.StreamClientInterceptor()), - ) + gopts = append(gopts, grpc.WithChainUnaryInterceptor(unary)) + gopts = append(gopts, grpc.WithChainStreamInterceptor(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 nil, fmt.Errorf("failed to dial %q: %w", address, err) } return conn, nil } @@ -163,7 +155,7 @@ func New(address string, opts ...ClientOpt) (*Client, error) { 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") + return nil, fmt.Errorf("no grpc connection or services is available: %w", errdefs.ErrUnavailable) } // check namespace labels for default runtime @@ -223,7 +215,7 @@ type Client struct { // 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") + return fmt.Errorf("unable to reconnect to containerd, no connector available: %w", errdefs.ErrUnavailable) } c.connMu.Lock() defer c.connMu.Unlock() @@ -251,7 +243,7 @@ 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") + return false, fmt.Errorf("no grpc connection available: %w", errdefs.ErrUnavailable) } c.connMu.Unlock() r, err := c.HealthService().Check(ctx, &grpc_health_v1.HealthCheckRequest{}, grpc.WaitForReady(true)) @@ -393,7 +385,7 @@ func (c *Client) Fetch(ctx context.Context, ref string, opts ...RemoteOpt) (imag } if fetchCtx.Unpack { - return images.Image{}, errors.Wrap(errdefs.ErrNotImplemented, "unpack on fetch not supported, try pull") + return images.Image{}, fmt.Errorf("unpack on fetch not supported, try pull: %w", errdefs.ErrNotImplemented) } if fetchCtx.PlatformMatcher == nil { @@ -404,7 +396,7 @@ func (c *Client) Fetch(ctx context.Context, ref string, opts ...RemoteOpt) (imag for _, s := range fetchCtx.Platforms { p, err := platforms.Parse(s) if err != nil { - return images.Image{}, errors.Wrapf(err, "invalid platform %s", s) + return images.Image{}, fmt.Errorf("invalid platform %s: %w", s, err) } ps = append(ps, p) } @@ -440,7 +432,7 @@ func (c *Client) Push(ctx context.Context, ref string, desc ocispec.Descriptor, for _, platform := range pushCtx.Platforms { p, err := platforms.Parse(platform) if err != nil { - return errors.Wrapf(err, "invalid platform %s", platform) + return fmt.Errorf("invalid platform %s: %w", platform, err) } ps = append(ps, p) } @@ -723,7 +715,7 @@ 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") + return Version{}, fmt.Errorf("no grpc connection available: %w", errdefs.ErrUnavailable) } c.connMu.Unlock() response, err := c.VersionService().Version(ctx, &ptypes.Empty{}) @@ -746,7 +738,7 @@ 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") + return ServerInfo{}, fmt.Errorf("no grpc connection available: %w", errdefs.ErrUnavailable) } c.connMu.Unlock() @@ -784,7 +776,7 @@ func (c *Client) getSnapshotter(ctx context.Context, name string) (snapshots.Sna s := c.SnapshotService(name) if s == nil { - return nil, errors.Wrapf(errdefs.ErrNotFound, "snapshotter %s was not found", name) + return nil, fmt.Errorf("snapshotter %s was not found: %w", name, errdefs.ErrNotFound) } return s, nil diff --git a/cmd/containerd-shim/main_unix.go b/cmd/containerd-shim/main_unix.go index e1d3eb13fb679..024611bf3bdff 100644 --- a/cmd/containerd-shim/main_unix.go +++ b/cmd/containerd-shim/main_unix.go @@ -45,7 +45,6 @@ import ( "github.com/containerd/ttrpc" "github.com/containerd/typeurl" ptypes "github.com/gogo/protobuf/types" - "github.com/pkg/errors" "github.com/sirupsen/logrus" exec "golang.org/x/sys/execabs" "golang.org/x/sys/unix" @@ -154,7 +153,7 @@ func executeShim() error { } server, err := newServer() if err != nil { - return errors.Wrap(err, "failed creating server") + return fmt.Errorf("failed creating server: %w", err) } sv, err := shim.NewService( shim.Config{ @@ -212,7 +211,7 @@ func serve(ctx context.Context, server *ttrpc.Server, path string) error { p = abstractSocketPrefix + p } if len(p) > socketPathLimit { - return errors.Errorf("%q: unix socket path too long (> %d)", p, socketPathLimit) + return fmt.Errorf("%q: unix socket path too long (> %d)", p, socketPathLimit) } l, err = net.Listen("unix", p) } @@ -310,10 +309,10 @@ func (l *remoteEventsPublisher) Publish(ctx context.Context, topic string, event } status, err := reaper.Default.WaitTimeout(cmd, c, 30*time.Second) if err != nil { - return errors.Wrapf(err, "failed to publish event: %s", b.String()) + return fmt.Errorf("failed to publish event: %s: %w", b.String(), err) } if status != 0 { - return errors.Errorf("failed to publish event: %s", b.String()) + return fmt.Errorf("failed to publish event: %s", b.String()) } return nil } diff --git a/cmd/containerd-stress/density.go b/cmd/containerd-stress/density.go index 4b2ad50ca12ac..8006a6dda4f95 100644 --- a/cmd/containerd-stress/density.go +++ b/cmd/containerd-stress/density.go @@ -52,6 +52,7 @@ var densityCommand = cli.Command{ Duration: cliContext.GlobalDuration("duration"), Concurrency: cliContext.GlobalInt("concurrent"), Exec: cliContext.GlobalBool("exec"), + Image: cliContext.GlobalString("image"), JSON: cliContext.GlobalBool("json"), Metrics: cliContext.GlobalString("metrics"), Snapshotter: cliContext.GlobalString("snapshotter"), @@ -65,8 +66,8 @@ var densityCommand = cli.Command{ if err := cleanup(ctx, client); err != nil { return err } - logrus.Infof("pulling %s", imageName) - image, err := client.Pull(ctx, imageName, containerd.WithPullUnpack, containerd.WithPullSnapshotter(config.Snapshotter)) + logrus.Infof("pulling %s", config.Image) + image, err := client.Pull(ctx, config.Image, containerd.WithPullUnpack, containerd.WithPullSnapshotter(config.Snapshotter)) if err != nil { return err } @@ -75,9 +76,6 @@ var densityCommand = cli.Command{ s := make(chan os.Signal, 1) signal.Notify(s, syscall.SIGTERM, syscall.SIGINT) - if err != nil { - return err - } var ( pids []uint32 count = cliContext.Int("count") diff --git a/cmd/containerd-stress/exec_worker.go b/cmd/containerd-stress/exec_worker.go index 9810554551b5d..9b990d10b33e8 100644 --- a/cmd/containerd-stress/exec_worker.go +++ b/cmd/containerd-stress/exec_worker.go @@ -63,6 +63,12 @@ func (w *execWorker) exec(ctx, tctx context.Context) { logrus.WithError(err).Error("wait exec container's task") return } + + if err := task.Start(ctx); err != nil { + logrus.WithError(err).Error("exec container start failure") + return + } + spec, err := c.Spec(ctx) if err != nil { logrus.WithError(err).Error("failed to get spec") diff --git a/cmd/containerd-stress/main.go b/cmd/containerd-stress/main.go index 2706b826d7619..f25539d967c7d 100644 --- a/cmd/containerd-stress/main.go +++ b/cmd/containerd-stress/main.go @@ -36,8 +36,6 @@ import ( "github.com/urfave/cli" ) -const imageName = "docker.io/library/alpine:latest" - var ( ct metrics.LabeledTimer execTimer metrics.LabeledTimer @@ -136,6 +134,11 @@ func main() { Name: "exec", Usage: "add execs to the stress tests", }, + cli.StringFlag{ + Name: "image,i", + Value: "docker.io/library/alpine:latest", + Usage: "image to be utilized for testing", + }, cli.BoolFlag{ Name: "json,j", Usage: "output results in json format", @@ -173,6 +176,7 @@ func main() { Duration: context.GlobalDuration("duration"), Concurrency: context.GlobalInt("concurrent"), Exec: context.GlobalBool("exec"), + Image: context.GlobalString("image"), JSON: context.GlobalBool("json"), Metrics: context.GlobalString("metrics"), Runtime: context.GlobalString("runtime"), @@ -194,6 +198,7 @@ type config struct { Duration time.Duration Address string Exec bool + Image string JSON bool Metrics string Runtime string @@ -228,8 +233,8 @@ func test(c config) error { if err := cleanup(ctx, client); err != nil { return err } - logrus.Infof("pulling %s", imageName) - image, err := client.Pull(ctx, imageName, containerd.WithPullUnpack, containerd.WithPullSnapshotter(c.Snapshotter)) + logrus.Infof("pulling %s", c.Image) + image, err := client.Pull(ctx, c.Image, containerd.WithPullUnpack, containerd.WithPullSnapshotter(c.Snapshotter)) if err != nil { return err } diff --git a/cmd/containerd/command/main.go b/cmd/containerd/command/main.go index e4ec305e7425c..571151e633ddf 100644 --- a/cmd/containerd/command/main.go +++ b/cmd/containerd/command/main.go @@ -39,7 +39,6 @@ import ( "github.com/containerd/containerd/sys" "github.com/containerd/containerd/tracing" "github.com/containerd/containerd/version" - "github.com/pkg/errors" "github.com/sirupsen/logrus" "github.com/urfave/cli" "go.opencensus.io/trace" @@ -161,7 +160,7 @@ can be used and modified as necessary as a custom configuration.` // cleanup temp mounts if err := mount.SetTempMountLocation(filepath.Join(config.Root, "tmpmounts")); err != nil { - return errors.Wrap(err, "creating temp mount location") + return fmt.Errorf("creating temp mount location: %w", err) } // unmount all temp mounts on boot for the server warnings, err := mount.CleanupTempMounts(0) @@ -173,7 +172,7 @@ can be used and modified as necessary as a custom configuration.` } if config.GRPC.Address == "" { - return errors.Wrap(errdefs.ErrInvalidArgument, "grpc address cannot be empty") + return fmt.Errorf("grpc address cannot be empty: %w", errdefs.ErrInvalidArgument) } if config.TTRPC.Address == "" { // If TTRPC was not explicitly configured, use defaults based on GRPC. @@ -241,11 +240,11 @@ can be used and modified as necessary as a custom configuration.` var l net.Listener if isLocalAddress(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") + return fmt.Errorf("failed to get listener for debug endpoint: %w", err) } } else { if l, err = net.Listen("tcp", config.Debug.Address); err != nil { - return errors.Wrapf(err, "failed to get listener for debug endpoint") + return fmt.Errorf("failed to get listener for debug endpoint: %w", err) } } serve(ctx, l, server.ServeDebug) @@ -253,28 +252,28 @@ can be used and modified as necessary as a custom configuration.` 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") + return fmt.Errorf("failed to get listener for metrics endpoint: %w", err) } 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") + return fmt.Errorf("failed to get listener for main ttrpc endpoint: %w", err) } 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") + return fmt.Errorf("failed to get listener for TCP grpc endpoint: %w", err) } 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") + return fmt.Errorf("failed to get listener for main endpoint: %w", err) } serve(ctx, l, server.ServeGRPC) @@ -370,7 +369,7 @@ func setLogFormat(config *srvconfig.Config) error { TimestampFormat: log.RFC3339NanoFixed, }) default: - return errors.Errorf("unknown log format: %s", f) + return fmt.Errorf("unknown log format: %s", f) } return nil diff --git a/cmd/containerd/command/publish.go b/cmd/containerd/command/publish.go index efe0ad7c8ce2e..b18f19f7e80ad 100644 --- a/cmd/containerd/command/publish.go +++ b/cmd/containerd/command/publish.go @@ -18,6 +18,7 @@ package command import ( gocontext "context" + "fmt" "io" "net" "os" @@ -28,7 +29,6 @@ import ( "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" @@ -52,7 +52,7 @@ var publishCommand = cli.Command{ ctx := namespaces.WithNamespace(gocontext.Background(), context.String("namespace")) topic := context.String("topic") if topic == "" { - return errors.Wrap(errdefs.ErrInvalidArgument, "topic required to publish event") + return fmt.Errorf("topic required to publish event: %w", errdefs.ErrInvalidArgument) } payload, err := getEventPayload(os.Stdin) if err != nil { @@ -87,7 +87,7 @@ func getEventPayload(r io.Reader) (*types.Any, error) { 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 nil, fmt.Errorf("failed to dial %q: %w", address, err) } return eventsapi.NewEventsClient(conn), nil } @@ -109,7 +109,7 @@ func connect(address string, d func(gocontext.Context, string) (net.Conn, error) 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 nil, fmt.Errorf("failed to dial %q: %w", address, err) } return conn, nil } diff --git a/cmd/containerd/command/service_windows.go b/cmd/containerd/command/service_windows.go index 2e5384eaad1f8..6b9be5f17955e 100644 --- a/cmd/containerd/command/service_windows.go +++ b/cmd/containerd/command/service_windows.go @@ -27,7 +27,6 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/services/server" - "github.com/pkg/errors" "github.com/sirupsen/logrus" "github.com/urfave/cli" exec "golang.org/x/sys/execabs" @@ -218,7 +217,7 @@ 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, fmt.Errorf("--register-service and --unregister-service cannot be used together: %w", errdefs.ErrInvalidArgument) } return true, unregisterService() } @@ -242,7 +241,7 @@ func registerUnregisterService(root string) (bool, error) { // 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) + return true, fmt.Errorf("error allocating conhost: %w", err) } if err := initPanicFile(filepath.Join(root, "panic.log")); err != nil { @@ -253,7 +252,7 @@ func registerUnregisterService(root string) (bool, error) { 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) + return true, fmt.Errorf("open log file %q: %w", logFileFlag, err) } logOutput = f } diff --git a/cmd/ctr/commands/containers/checkpoint.go b/cmd/ctr/commands/containers/checkpoint.go index 53bf70b3c8d77..62804f486cda6 100644 --- a/cmd/ctr/commands/containers/checkpoint.go +++ b/cmd/ctr/commands/containers/checkpoint.go @@ -17,12 +17,12 @@ package containers import ( + "errors" "fmt" "github.com/containerd/containerd" "github.com/containerd/containerd/cmd/ctr/commands" "github.com/containerd/containerd/errdefs" - "github.com/pkg/errors" "github.com/urfave/cli" ) @@ -88,7 +88,7 @@ var checkpointCommand = cli.Command{ } defer func() { if err := task.Resume(ctx); err != nil { - fmt.Println(errors.Wrap(err, "error resuming task")) + fmt.Println(fmt.Errorf("error resuming task: %w", err)) } }() } diff --git a/cmd/ctr/commands/containers/containers.go b/cmd/ctr/commands/containers/containers.go index de503c38abdce..d1025344e0a06 100644 --- a/cmd/ctr/commands/containers/containers.go +++ b/cmd/ctr/commands/containers/containers.go @@ -31,7 +31,6 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/log" "github.com/containerd/typeurl" - "github.com/pkg/errors" "github.com/urfave/cli" ) @@ -66,17 +65,17 @@ var createCommand = cli.Command{ if config { id = context.Args().First() if context.NArg() > 1 { - return errors.Wrap(errdefs.ErrInvalidArgument, "with spec config file, only container id should be provided") + return fmt.Errorf("with spec config file, only container id should be provided: %w", errdefs.ErrInvalidArgument) } } else { id = context.Args().Get(1) ref = context.Args().First() if ref == "" { - return errors.Wrap(errdefs.ErrInvalidArgument, "image ref must be provided") + return fmt.Errorf("image ref must be provided: %w", errdefs.ErrInvalidArgument) } } if id == "" { - return errors.Wrap(errdefs.ErrInvalidArgument, "container id must be provided") + return fmt.Errorf("container id must be provided: %w", errdefs.ErrInvalidArgument) } client, ctx, cancel, err := commands.NewClient(context) if err != nil { @@ -149,7 +148,7 @@ var deleteCommand = cli.Command{ Name: "delete", Usage: "delete one or more existing containers", ArgsUsage: "[flags] CONTAINER [CONTAINER, ...]", - Aliases: []string{"del", "rm"}, + Aliases: []string{"del", "remove", "rm"}, Flags: []cli.Flag{ cli.BoolFlag{ Name: "keep-snapshot", @@ -169,7 +168,7 @@ var deleteCommand = cli.Command{ } if context.NArg() == 0 { - return errors.Wrap(errdefs.ErrInvalidArgument, "must specify at least one container to delete") + return fmt.Errorf("must specify at least one container to delete: %w", errdefs.ErrInvalidArgument) } for _, arg := range context.Args() { if err := deleteContainer(ctx, client, arg, deleteOpts...); err != nil { @@ -215,7 +214,7 @@ var setLabelsCommand = cli.Command{ Action: func(context *cli.Context) error { containerID, labels := commands.ObjectWithLabelArgs(context) if containerID == "" { - return errors.Wrap(errdefs.ErrInvalidArgument, "container id must be provided") + return fmt.Errorf("container id must be provided: %w", errdefs.ErrInvalidArgument) } client, ctx, cancel, err := commands.NewClient(context) if err != nil { @@ -257,7 +256,7 @@ var infoCommand = cli.Command{ Action: func(context *cli.Context) error { id := context.Args().First() if id == "" { - return errors.Wrap(errdefs.ErrInvalidArgument, "container id must be provided") + return fmt.Errorf("container id must be provided: %w", errdefs.ErrInvalidArgument) } client, ctx, cancel, err := commands.NewClient(context) if err != nil { diff --git a/cmd/ctr/commands/containers/restore.go b/cmd/ctr/commands/containers/restore.go index 85337b34d41f4..2847340c9135e 100644 --- a/cmd/ctr/commands/containers/restore.go +++ b/cmd/ctr/commands/containers/restore.go @@ -17,11 +17,12 @@ package containers import ( + "errors" + "github.com/containerd/containerd" "github.com/containerd/containerd/cio" "github.com/containerd/containerd/cmd/ctr/commands" "github.com/containerd/containerd/errdefs" - "github.com/pkg/errors" "github.com/urfave/cli" ) diff --git a/cmd/ctr/commands/content/content.go b/cmd/ctr/commands/content/content.go index 9ff52ec6c0d77..f0458ddd547d6 100644 --- a/cmd/ctr/commands/content/content.go +++ b/cmd/ctr/commands/content/content.go @@ -17,6 +17,7 @@ package content import ( + "errors" "fmt" "io" "os" @@ -31,7 +32,6 @@ import ( units "github.com/docker/go-units" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" "github.com/urfave/cli" exec "golang.org/x/sys/execabs" ) diff --git a/cmd/ctr/commands/images/convert.go b/cmd/ctr/commands/images/convert.go index 3baec0b9fd3f1..e2bcd0d1d352f 100644 --- a/cmd/ctr/commands/images/convert.go +++ b/cmd/ctr/commands/images/convert.go @@ -17,6 +17,7 @@ package images import ( + "errors" "fmt" "github.com/containerd/containerd/cmd/ctr/commands" @@ -24,7 +25,6 @@ import ( "github.com/containerd/containerd/images/converter/uncompress" "github.com/containerd/containerd/platforms" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" "github.com/urfave/cli" ) @@ -74,7 +74,7 @@ When '--all-platforms' is given all images in a manifest list must be available. for _, ps := range pss { p, err := platforms.Parse(ps) if err != nil { - return errors.Wrapf(err, "invalid platform %q", ps) + return fmt.Errorf("invalid platform %q: %w", ps, err) } all = append(all, p) } diff --git a/cmd/ctr/commands/images/export.go b/cmd/ctr/commands/images/export.go index 41d8893b695b9..0a1394cb082da 100644 --- a/cmd/ctr/commands/images/export.go +++ b/cmd/ctr/commands/images/export.go @@ -17,6 +17,8 @@ package images import ( + "errors" + "fmt" "io" "os" @@ -24,7 +26,6 @@ import ( "github.com/containerd/containerd/images/archive" "github.com/containerd/containerd/platforms" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" "github.com/urfave/cli" ) @@ -73,7 +74,7 @@ When '--all-platforms' is given all images in a manifest list must be available. for _, ps := range pss { p, err := platforms.Parse(ps) if err != nil { - return errors.Wrapf(err, "invalid platform %q", ps) + return fmt.Errorf("invalid platform %q: %w", ps, err) } all = append(all, p) } diff --git a/cmd/ctr/commands/images/images.go b/cmd/ctr/commands/images/images.go index 077afd8f8fac0..a68d2168dfa2c 100644 --- a/cmd/ctr/commands/images/images.go +++ b/cmd/ctr/commands/images/images.go @@ -17,6 +17,7 @@ package images import ( + "errors" "fmt" "os" "sort" @@ -29,7 +30,6 @@ import ( "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/progress" "github.com/containerd/containerd/platforms" - "github.com/pkg/errors" "github.com/urfave/cli" ) @@ -82,7 +82,7 @@ var listCommand = cli.Command{ ) imageList, err := imageStore.List(ctx, filters...) if err != nil { - return errors.Wrap(err, "failed to list images") + return fmt.Errorf("failed to list images: %w", err) } if quiet { for _, image := range imageList { @@ -224,7 +224,7 @@ var checkCommand = cli.Command{ args := []string(context.Args()) imageList, err := client.ListImages(ctx, args...) if err != nil { - return errors.Wrap(err, "failed listing images") + return fmt.Errorf("failed listing images: %w", err) } if len(imageList) == 0 { log.G(ctx).Debugf("no images found") @@ -248,7 +248,7 @@ var checkCommand = cli.Command{ available, required, present, missing, err := images.Check(ctx, contentStore, image.Target(), platforms.Default()) if err != nil { if exitErr == nil { - exitErr = errors.Wrapf(err, "unable to check %v", image.Name()) + exitErr = fmt.Errorf("unable to check %v: %w", image.Name(), err) } log.G(ctx).WithError(err).Errorf("unable to check %v", image.Name()) status = "error" @@ -284,7 +284,7 @@ var checkCommand = cli.Command{ unpacked, err := image.IsUnpacked(ctx, context.String("snapshotter")) if err != nil { if exitErr == nil { - exitErr = errors.Wrapf(err, "unable to check unpack for %v", image.Name()) + exitErr = fmt.Errorf("unable to check unpack for %v: %w", image.Name(), err) } log.G(ctx).WithError(err).Errorf("unable to check unpack for %v", image.Name()) } @@ -311,8 +311,8 @@ var checkCommand = cli.Command{ } var removeCommand = cli.Command{ - Name: "remove", - Aliases: []string{"rm"}, + Name: "delete", + Aliases: []string{"del", "remove", "rm"}, Usage: "remove one or more images by reference", ArgsUsage: "[flags] [, ...]", Description: "remove one or more images by reference", @@ -340,7 +340,7 @@ var removeCommand = cli.Command{ if err := imageStore.Delete(ctx, target, opts...); err != nil { if !errdefs.IsNotFound(err) { if exitErr == nil { - exitErr = errors.Wrapf(err, "unable to delete %v", target) + exitErr = fmt.Errorf("unable to delete %v: %w", target, err) } log.G(ctx).WithError(err).Errorf("unable to delete %v", target) continue diff --git a/cmd/ctr/commands/images/mount.go b/cmd/ctr/commands/images/mount.go index c0e03dc23fee1..a907ad596e097 100644 --- a/cmd/ctr/commands/images/mount.go +++ b/cmd/ctr/commands/images/mount.go @@ -27,7 +27,6 @@ import ( "github.com/containerd/containerd/mount" "github.com/containerd/containerd/platforms" "github.com/opencontainers/image-spec/identity" - "github.com/pkg/errors" "github.com/urfave/cli" ) @@ -93,7 +92,7 @@ When you are done, use the unmount command. ps := context.String("platform") p, err := platforms.Parse(ps) if err != nil { - return errors.Wrapf(err, "unable to parse platform %s", ps) + return fmt.Errorf("unable to parse platform %s: %w", ps, err) } img, err := client.ImageService().Get(ctx, ref) @@ -103,7 +102,7 @@ When you are done, use the unmount command. i := containerd.NewImageWithPlatform(client, img, platforms.Only(p)) if err := i.Unpack(ctx, snapshotter); err != nil { - return errors.Wrap(err, "error unpacking image") + return fmt.Errorf("error unpacking image: %w", err) } diffIDs, err := i.RootFS(ctx) diff --git a/cmd/ctr/commands/images/pull.go b/cmd/ctr/commands/images/pull.go index 7a5db210fb9b6..c46dcd4028afa 100644 --- a/cmd/ctr/commands/images/pull.go +++ b/cmd/ctr/commands/images/pull.go @@ -28,7 +28,6 @@ import ( "github.com/containerd/containerd/platforms" "github.com/opencontainers/image-spec/identity" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" "github.com/urfave/cli" ) @@ -106,13 +105,13 @@ command. As part of this process, we do the following: if context.Bool("all-platforms") { p, err = images.Platforms(ctx, client.ContentStore(), img.Target) if err != nil { - return errors.Wrap(err, "unable to resolve image platforms") + return fmt.Errorf("unable to resolve image platforms: %w", err) } } else { for _, s := range context.StringSlice("platform") { ps, err := platforms.Parse(s) if err != nil { - return errors.Wrapf(err, "unable to parse platform %s", s) + return fmt.Errorf("unable to parse platform %s: %w", s, err) } p = append(p, ps) } diff --git a/cmd/ctr/commands/images/push.go b/cmd/ctr/commands/images/push.go index da9e8968badb6..7123878040586 100644 --- a/cmd/ctr/commands/images/push.go +++ b/cmd/ctr/commands/images/push.go @@ -18,6 +18,8 @@ package images import ( gocontext "context" + "errors" + "fmt" "net/http/httptrace" "os" "sync" @@ -35,7 +37,6 @@ import ( "github.com/containerd/containerd/remotes/docker" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" "github.com/urfave/cli" "golang.org/x/sync/errgroup" ) @@ -67,6 +68,9 @@ var pushCommand = cli.Command{ }, cli.IntFlag{ Name: "max-concurrent-uploaded-layers", Usage: "Set the max concurrent uploaded layers for each push", + }, cli.BoolFlag{ + Name: "allow-non-distributable-blobs", + Usage: "Allow pushing blobs that are marked as non-distributable", }), Action: func(context *cli.Context) error { var ( @@ -88,7 +92,7 @@ var pushCommand = cli.Command{ if manifest := context.String("manifest"); manifest != "" { desc.Digest, err = digest.Parse(manifest) if err != nil { - return errors.Wrap(err, "invalid manifest digest") + return fmt.Errorf("invalid manifest digest: %w", err) } desc.MediaType = context.String("manifest-type") } else { @@ -97,14 +101,14 @@ var pushCommand = cli.Command{ } img, err := client.ImageService().Get(ctx, local) if err != nil { - return errors.Wrap(err, "unable to resolve image to manifest") + return fmt.Errorf("unable to resolve image to manifest: %w", err) } desc = img.Target if pss := context.StringSlice("platform"); len(pss) == 1 { p, err := platforms.Parse(pss[0]) if err != nil { - return errors.Wrapf(err, "invalid platform %q", pss[0]) + return fmt.Errorf("invalid platform %q: %w", pss[0], err) } cs := client.ContentStore() @@ -113,7 +117,7 @@ var pushCommand = cli.Command{ for _, manifest := range manifests { if manifest.Platform != nil && matcher.Match(*manifest.Platform) { if _, err := images.Children(ctx, cs, manifest); err != nil { - return errors.Wrap(err, "no matching manifest") + return fmt.Errorf("no matching manifest: %w", err) } desc = manifest break @@ -143,13 +147,21 @@ var pushCommand = cli.Command{ log.G(ctx).WithField("image", ref).WithField("digest", desc.Digest).Debug("pushing") jobHandler := images.HandlerFunc(func(ctx gocontext.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { + if !context.Bool("allow-non-distributable-blobs") && images.IsNonDistributable(desc.MediaType) { + return nil, nil + } ongoing.add(remotes.MakeRefKey(ctx, desc)) return nil, nil }) + handler := jobHandler + if !context.Bool("allow-non-distributable-blobs") { + handler = remotes.SkipNonDistributableBlobs(handler) + } + ropts := []containerd.RemoteOpt{ containerd.WithResolver(resolver), - containerd.WithImageHandler(jobHandler), + containerd.WithImageHandler(handler), } if context.IsSet("max-concurrent-uploaded-layers") { diff --git a/cmd/ctr/commands/images/unmount.go b/cmd/ctr/commands/images/unmount.go index 3f54f63b4bacd..f98570d845e7f 100644 --- a/cmd/ctr/commands/images/unmount.go +++ b/cmd/ctr/commands/images/unmount.go @@ -23,7 +23,6 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/leases" "github.com/containerd/containerd/mount" - "github.com/pkg/errors" "github.com/urfave/cli" ) @@ -60,10 +59,10 @@ var unmountCommand = cli.Command{ snapshotter := context.String("snapshotter") s := client.SnapshotService(snapshotter) if err := client.LeasesService().Delete(ctx, leases.Lease{ID: target}); err != nil && !errdefs.IsNotFound(err) { - return errors.Wrap(err, "error deleting lease") + return fmt.Errorf("error deleting lease: %w", err) } if err := s.Remove(ctx, target); err != nil && !errdefs.IsNotFound(err) { - return errors.Wrap(err, "error removing snapshot") + return fmt.Errorf("error removing snapshot: %w", err) } } diff --git a/cmd/ctr/commands/leases/leases.go b/cmd/ctr/commands/leases/leases.go index d0b107dbfc254..d9f1025e59837 100644 --- a/cmd/ctr/commands/leases/leases.go +++ b/cmd/ctr/commands/leases/leases.go @@ -26,7 +26,6 @@ import ( "github.com/containerd/containerd/cmd/ctr/commands" "github.com/containerd/containerd/leases" - "github.com/pkg/errors" "github.com/urfave/cli" ) @@ -69,7 +68,7 @@ var listCommand = cli.Command{ leaseList, err := ls.List(ctx, filters...) if err != nil { - return errors.Wrap(err, "failed to list leases") + return fmt.Errorf("failed to list leases: %w", err) } if quiet { for _, l := range leaseList { @@ -159,7 +158,7 @@ var createCommand = cli.Command{ var deleteCommand = cli.Command{ Name: "delete", - Aliases: []string{"rm"}, + Aliases: []string{"del", "remove", "rm"}, Usage: "delete a lease", ArgsUsage: "[flags] ...", Description: "delete a lease", diff --git a/cmd/ctr/commands/namespaces/namespaces.go b/cmd/ctr/commands/namespaces/namespaces.go index af80e953a0a54..ddab3f58a114c 100644 --- a/cmd/ctr/commands/namespaces/namespaces.go +++ b/cmd/ctr/commands/namespaces/namespaces.go @@ -17,6 +17,7 @@ package namespaces import ( + "errors" "fmt" "os" "sort" @@ -26,7 +27,6 @@ import ( "github.com/containerd/containerd/cmd/ctr/commands" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/log" - "github.com/pkg/errors" "github.com/urfave/cli" ) @@ -167,7 +167,7 @@ var removeCommand = cli.Command{ if err := namespaces.Delete(ctx, target, opts...); err != nil { if !errdefs.IsNotFound(err) { if exitErr == nil { - exitErr = errors.Wrapf(err, "unable to delete %v", target) + exitErr = fmt.Errorf("unable to delete %v: %w", target, err) } log.G(ctx).WithError(err).Errorf("unable to delete %v", target) continue diff --git a/cmd/ctr/commands/oci/oci.go b/cmd/ctr/commands/oci/oci.go index d27d0266422a9..cbd64fee38903 100644 --- a/cmd/ctr/commands/oci/oci.go +++ b/cmd/ctr/commands/oci/oci.go @@ -17,7 +17,8 @@ package oci import ( - "github.com/pkg/errors" + "fmt" + "github.com/urfave/cli" "github.com/containerd/containerd/cmd/ctr/commands" @@ -43,7 +44,7 @@ var defaultSpecCommand = cli.Command{ spec, err := oci.GenerateSpec(ctx, nil, &containers.Container{}) if err != nil { - return errors.Wrap(err, "failed to generate spec") + return fmt.Errorf("failed to generate spec: %w", err) } commands.PrintAsJSON(spec) diff --git a/cmd/ctr/commands/pprof/pprof.go b/cmd/ctr/commands/pprof/pprof.go index acaf2f908f591..1eafcf29abea6 100644 --- a/cmd/ctr/commands/pprof/pprof.go +++ b/cmd/ctr/commands/pprof/pprof.go @@ -24,7 +24,6 @@ import ( "time" "github.com/containerd/containerd/defaults" - "github.com/pkg/errors" "github.com/urfave/cli" ) @@ -183,7 +182,7 @@ func httpGetRequest(client *http.Client, request string) (io.ReadCloser, error) return nil, err } if resp.StatusCode != 200 { - return nil, errors.Errorf("http get failed with status: %s", resp.Status) + return nil, fmt.Errorf("http get failed with status: %s", resp.Status) } return resp.Body, nil } diff --git a/cmd/ctr/commands/resolver.go b/cmd/ctr/commands/resolver.go index 95c6ed6093690..729d514556024 100644 --- a/cmd/ctr/commands/resolver.go +++ b/cmd/ctr/commands/resolver.go @@ -21,6 +21,7 @@ import ( gocontext "context" "crypto/tls" "crypto/x509" + "errors" "fmt" "io" "net/http" @@ -34,7 +35,6 @@ import ( "github.com/containerd/containerd/remotes" "github.com/containerd/containerd/remotes/docker" "github.com/containerd/containerd/remotes/docker/config" - "github.com/pkg/errors" "github.com/urfave/cli" ) @@ -46,12 +46,12 @@ func passwordPrompt() (string, error) { defer c.Reset() if err := c.DisableEcho(); err != nil { - return "", errors.Wrap(err, "failed to disable echo") + return "", fmt.Errorf("failed to disable echo: %w", err) } line, _, err := bufio.NewReader(c).ReadLine() if err != nil { - return "", errors.Wrap(err, "failed to read line") + return "", fmt.Errorf("failed to read line: %w", err) } return string(line), nil } @@ -126,7 +126,7 @@ func resolverDefaultTLS(clicontext *cli.Context) (*tls.Config, error) { if tlsRootPath := clicontext.String("tlscacert"); tlsRootPath != "" { tlsRootData, err := os.ReadFile(tlsRootPath) if err != nil { - return nil, errors.Wrapf(err, "failed to read %q", tlsRootPath) + return nil, fmt.Errorf("failed to read %q: %w", tlsRootPath, err) } config.RootCAs = x509.NewCertPool() @@ -143,7 +143,7 @@ func resolverDefaultTLS(clicontext *cli.Context) (*tls.Config, error) { } keyPair, err := tls.LoadX509KeyPair(tlsCertPath, tlsKeyPath) if err != nil { - return nil, errors.Wrapf(err, "failed to load TLS client credentials (cert=%q, key=%q)", tlsCertPath, tlsKeyPath) + return nil, fmt.Errorf("failed to load TLS client credentials (cert=%q, key=%q): %w", tlsCertPath, tlsKeyPath, err) } config.Certificates = []tls.Certificate{keyPair} } @@ -161,7 +161,7 @@ type DebugTransport struct { func (t DebugTransport) RoundTrip(req *http.Request) (*http.Response, error) { in, err := httputil.DumpRequest(req, true) if err != nil { - return nil, errors.Wrap(err, "failed to dump request") + return nil, fmt.Errorf("failed to dump request: %w", err) } if _, err := t.writer.Write(in); err != nil { @@ -175,7 +175,7 @@ func (t DebugTransport) RoundTrip(req *http.Request) (*http.Response, error) { out, err := httputil.DumpResponse(resp, true) if err != nil { - return nil, errors.Wrap(err, "failed to dump response") + return nil, fmt.Errorf("failed to dump response: %w", err) } if _, err := t.writer.Write(out); err != nil { diff --git a/cmd/ctr/commands/run/run.go b/cmd/ctr/commands/run/run.go index 2a5174f79fe58..bf0ebfe5c46f2 100644 --- a/cmd/ctr/commands/run/run.go +++ b/cmd/ctr/commands/run/run.go @@ -20,6 +20,7 @@ import ( "context" gocontext "context" "encoding/csv" + "errors" "fmt" "strings" @@ -34,7 +35,6 @@ import ( "github.com/containerd/containerd/oci" gocni "github.com/containerd/go-cni" specs "github.com/opencontainers/runtime-spec/specs-go" - "github.com/pkg/errors" "github.com/sirupsen/logrus" "github.com/urfave/cli" ) diff --git a/cmd/ctr/commands/run/run_unix.go b/cmd/ctr/commands/run/run_unix.go index 7641ba61b7a57..69283e111d3ce 100644 --- a/cmd/ctr/commands/run/run_unix.go +++ b/cmd/ctr/commands/run/run_unix.go @@ -21,6 +21,7 @@ package run import ( gocontext "context" + "errors" "fmt" "os" "path/filepath" @@ -39,7 +40,6 @@ import ( "github.com/containerd/containerd/runtime/v2/runc/options" "github.com/containerd/containerd/snapshots" "github.com/opencontainers/runtime-spec/specs-go" - "github.com/pkg/errors" "github.com/sirupsen/logrus" "github.com/urfave/cli" ) @@ -204,7 +204,7 @@ func NewContainer(ctx gocontext.Context, client *containerd.Client, context *cli if context.Bool("net-host") { hostname, err := os.Hostname() if err != nil { - return nil, errors.Wrap(err, "get hostname") + return nil, fmt.Errorf("get hostname: %w", err) } opts = append(opts, oci.WithHostNamespace(specs.NetworkNamespace), @@ -417,15 +417,15 @@ func parseIDMapping(mapping string) (specs.LinuxIDMapping, error) { } cID, err := strconv.ParseUint(parts[0], 0, 32) if err != nil { - return specs.LinuxIDMapping{}, errors.Wrapf(err, "invalid container id for user namespace remapping") + return specs.LinuxIDMapping{}, fmt.Errorf("invalid container id for user namespace remapping: %w", err) } hID, err := strconv.ParseUint(parts[1], 0, 32) if err != nil { - return specs.LinuxIDMapping{}, errors.Wrapf(err, "invalid host id for user namespace remapping") + return specs.LinuxIDMapping{}, fmt.Errorf("invalid host id for user namespace remapping: %w", err) } size, err := strconv.ParseUint(parts[2], 0, 32) if err != nil { - return specs.LinuxIDMapping{}, errors.Wrapf(err, "invalid size for user namespace remapping") + return specs.LinuxIDMapping{}, fmt.Errorf("invalid size for user namespace remapping: %w", err) } return specs.LinuxIDMapping{ ContainerID: uint32(cID), diff --git a/cmd/ctr/commands/run/run_windows.go b/cmd/ctr/commands/run/run_windows.go index e12d218d83988..a2d85d75e4aeb 100644 --- a/cmd/ctr/commands/run/run_windows.go +++ b/cmd/ctr/commands/run/run_windows.go @@ -18,6 +18,7 @@ package run import ( gocontext "context" + "errors" "github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options" "github.com/containerd/console" @@ -26,7 +27,6 @@ import ( "github.com/containerd/containerd/oci" "github.com/containerd/containerd/pkg/netns" specs "github.com/opencontainers/runtime-spec/specs-go" - "github.com/pkg/errors" "github.com/sirupsen/logrus" "github.com/urfave/cli" ) diff --git a/cmd/ctr/commands/shim/shim.go b/cmd/ctr/commands/shim/shim.go index 20871d7def430..36d75e338b360 100644 --- a/cmd/ctr/commands/shim/shim.go +++ b/cmd/ctr/commands/shim/shim.go @@ -21,6 +21,7 @@ package shim import ( gocontext "context" + "errors" "fmt" "net" "os" @@ -36,7 +37,6 @@ import ( "github.com/containerd/typeurl" ptypes "github.com/gogo/protobuf/types" "github.com/opencontainers/runtime-spec/specs-go" - "github.com/pkg/errors" "github.com/sirupsen/logrus" "github.com/urfave/cli" ) diff --git a/cmd/ctr/commands/snapshots/snapshots.go b/cmd/ctr/commands/snapshots/snapshots.go index a1ef3c1ec33ee..1d69b0aee0f8c 100644 --- a/cmd/ctr/commands/snapshots/snapshots.go +++ b/cmd/ctr/commands/snapshots/snapshots.go @@ -18,6 +18,7 @@ package snapshots import ( gocontext "context" + "errors" "fmt" "io" "os" @@ -35,7 +36,6 @@ import ( "github.com/containerd/containerd/snapshots" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" "github.com/urfave/cli" ) @@ -248,8 +248,8 @@ var usageCommand = cli.Command{ } var removeCommand = cli.Command{ - Name: "remove", - Aliases: []string{"rm"}, + Name: "delete", + Aliases: []string{"del", "remove", "rm"}, ArgsUsage: " [, ...]", Usage: "remove snapshots", Action: func(context *cli.Context) error { @@ -262,7 +262,7 @@ var removeCommand = cli.Command{ for _, key := range context.Args() { err = snapshotter.Remove(ctx, key) if err != nil { - return errors.Wrapf(err, "failed to remove %q", key) + return fmt.Errorf("failed to remove %q: %w", key, err) } } diff --git a/cmd/ctr/commands/tasks/checkpoint.go b/cmd/ctr/commands/tasks/checkpoint.go index e6d1b73bfc755..3271aa1cf4494 100644 --- a/cmd/ctr/commands/tasks/checkpoint.go +++ b/cmd/ctr/commands/tasks/checkpoint.go @@ -17,6 +17,7 @@ package tasks import ( + "errors" "fmt" "github.com/containerd/containerd" @@ -24,7 +25,6 @@ import ( "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/runtime/linux/runctypes" "github.com/containerd/containerd/runtime/v2/runc/options" - "github.com/pkg/errors" "github.com/urfave/cli" ) diff --git a/cmd/ctr/commands/tasks/delete.go b/cmd/ctr/commands/tasks/delete.go index 9f43655b55812..c0edbe746f47c 100644 --- a/cmd/ctr/commands/tasks/delete.go +++ b/cmd/ctr/commands/tasks/delete.go @@ -30,7 +30,7 @@ var deleteCommand = cli.Command{ Name: "delete", Usage: "delete one or more tasks", ArgsUsage: "CONTAINER [CONTAINER, ...]", - Aliases: []string{"rm"}, + Aliases: []string{"del", "remove", "rm"}, Flags: []cli.Flag{ cli.BoolFlag{ Name: "force, f", diff --git a/cmd/ctr/commands/tasks/kill.go b/cmd/ctr/commands/tasks/kill.go index 08137507bfba7..3aef2c9f7e2de 100644 --- a/cmd/ctr/commands/tasks/kill.go +++ b/cmd/ctr/commands/tasks/kill.go @@ -17,10 +17,11 @@ package tasks import ( + "errors" + "github.com/containerd/containerd" "github.com/containerd/containerd/cmd/ctr/commands" "github.com/moby/sys/signal" - "github.com/pkg/errors" "github.com/urfave/cli" ) diff --git a/cmd/ctr/commands/tasks/ps.go b/cmd/ctr/commands/tasks/ps.go index 0442a1e92d713..cb444b3da57a9 100644 --- a/cmd/ctr/commands/tasks/ps.go +++ b/cmd/ctr/commands/tasks/ps.go @@ -17,13 +17,13 @@ package tasks import ( + "errors" "fmt" "os" "text/tabwriter" "github.com/containerd/containerd/cmd/ctr/commands" "github.com/containerd/typeurl" - "github.com/pkg/errors" "github.com/urfave/cli" ) diff --git a/cmd/ctr/commands/tasks/start.go b/cmd/ctr/commands/tasks/start.go index de55767ee834b..4639c287c6c11 100644 --- a/cmd/ctr/commands/tasks/start.go +++ b/cmd/ctr/commands/tasks/start.go @@ -17,11 +17,12 @@ package tasks import ( + "errors" + "github.com/containerd/console" "github.com/containerd/containerd" "github.com/containerd/containerd/cio" "github.com/containerd/containerd/cmd/ctr/commands" - "github.com/pkg/errors" "github.com/sirupsen/logrus" "github.com/urfave/cli" ) diff --git a/cmd/ctr/commands/tasks/tasks_unix.go b/cmd/ctr/commands/tasks/tasks_unix.go index 748ba2892d385..0e5311a539bf9 100644 --- a/cmd/ctr/commands/tasks/tasks_unix.go +++ b/cmd/ctr/commands/tasks/tasks_unix.go @@ -21,6 +21,7 @@ package tasks import ( gocontext "context" + "errors" "net/url" "os" "os/signal" @@ -29,7 +30,6 @@ import ( "github.com/containerd/containerd" "github.com/containerd/containerd/cio" "github.com/containerd/containerd/log" - "github.com/pkg/errors" "github.com/urfave/cli" "golang.org/x/sys/unix" ) diff --git a/cmd/ctr/commands/tasks/tasks_windows.go b/cmd/ctr/commands/tasks/tasks_windows.go index 8905c5b862699..0d5e19b3778b5 100644 --- a/cmd/ctr/commands/tasks/tasks_windows.go +++ b/cmd/ctr/commands/tasks/tasks_windows.go @@ -18,6 +18,7 @@ package tasks import ( gocontext "context" + "errors" "net/url" "time" @@ -25,7 +26,6 @@ import ( "github.com/containerd/containerd" "github.com/containerd/containerd/cio" "github.com/containerd/containerd/log" - "github.com/pkg/errors" "github.com/urfave/cli" ) diff --git a/container.go b/container.go index d5da55e51892b..7d8d674c89da8 100644 --- a/container.go +++ b/container.go @@ -19,6 +19,7 @@ package containerd import ( "context" "encoding/json" + "fmt" "os" "path/filepath" "strings" @@ -38,7 +39,6 @@ import ( 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 ( @@ -173,7 +173,7 @@ func (c *container) Spec(ctx context.Context) (*oci.Spec, error) { // 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) + return fmt.Errorf("cannot delete running task %v: %w", c.id, errdefs.ErrFailedPrecondition) } r, err := c.get(ctx) if err != nil { @@ -198,11 +198,11 @@ func (c *container) Image(ctx context.Context) (Image, error) { return nil, err } if r.Image == "" { - return nil, errors.Wrap(errdefs.ErrNotFound, "container not created from an image") + return nil, fmt.Errorf("container not created from an image: %w", errdefs.ErrNotFound) } 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 nil, fmt.Errorf("failed to get image %s for container: %w", r.Image, err) } return NewImage(c.client, i), nil } @@ -232,7 +232,7 @@ func (c *container) NewTask(ctx context.Context, ioCreate cio.Creator, opts ...N } if r.SnapshotKey != "" { if r.Snapshotter == "" { - return nil, errors.Wrapf(errdefs.ErrInvalidArgument, "unable to resolve rootfs mounts without snapshotter on container") + return nil, fmt.Errorf("unable to resolve rootfs mounts without snapshotter on container: %w", errdefs.ErrInvalidArgument) } // get the rootfs from the snapshotter and add it to the request @@ -391,7 +391,7 @@ func (c *container) loadTask(ctx context.Context, ioAttach cio.Attach) (Task, er if err != nil { err = errdefs.FromGRPC(err) if errdefs.IsNotFound(err) { - return nil, errors.Wrapf(err, "no running task found") + return nil, fmt.Errorf("no running task found: %w", err) } return nil, err } diff --git a/container_checkpoint_opts.go b/container_checkpoint_opts.go index 510863681cd2b..a64ef618ba62b 100644 --- a/container_checkpoint_opts.go +++ b/container_checkpoint_opts.go @@ -19,6 +19,7 @@ package containerd import ( "bytes" "context" + "errors" "fmt" "runtime" @@ -31,7 +32,6 @@ import ( "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 ( diff --git a/container_opts.go b/container_opts.go index 024d6e10b6767..4d630ea6c9d2e 100644 --- a/container_opts.go +++ b/container_opts.go @@ -19,6 +19,7 @@ package containerd import ( "context" "encoding/json" + "errors" "fmt" "github.com/containerd/containerd/containers" @@ -31,7 +32,6 @@ import ( "github.com/gogo/protobuf/types" "github.com/opencontainers/image-spec/identity" v1 "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" ) // DeleteOpts allows the caller to set options for the deletion of a container @@ -227,7 +227,7 @@ func WithNewSnapshot(id string, i Image, opts ...snapshots.Opt) NewContainerOpts 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") + return fmt.Errorf("container.Snapshotter must be set to cleanup rootfs snapshot: %w", errdefs.ErrInvalidArgument) } s, err := client.getSnapshotter(ctx, c.Snapshotter) if err != nil { @@ -276,15 +276,15 @@ func WithNewSnapshotView(id string, i Image, opts ...snapshots.Opt) NewContainer 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") + return fmt.Errorf("extension key must not be zero-length: %w", errdefs.ErrInvalidArgument) } 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 fmt.Errorf("extension %q is not registered with the typeurl package, see `typeurl.Register`: %w", name, err) } - return errors.Wrap(err, "error marshalling extension") + return fmt.Errorf("error marshalling extension: %w", err) } if c.Extensions == nil { diff --git a/container_restore_opts.go b/container_restore_opts.go index 8150d8e696ad2..bdc8650cda261 100644 --- a/container_restore_opts.go +++ b/container_restore_opts.go @@ -18,6 +18,8 @@ package containerd import ( "context" + "errors" + "fmt" "github.com/containerd/containerd/containers" "github.com/containerd/containerd/content" @@ -26,7 +28,6 @@ import ( 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 ( @@ -92,7 +93,7 @@ func WithRestoreRuntime(ctx context.Context, id string, client *Client, checkpoi store := client.ContentStore() data, err := content.ReadBlob(ctx, store, *m) if err != nil { - return errors.Wrap(err, "unable to read checkpoint runtime") + return fmt.Errorf("unable to read checkpoint runtime: %w", err) } if err := proto.Unmarshal(data, &options); err != nil { return err @@ -117,7 +118,7 @@ func WithRestoreSpec(ctx context.Context, id string, client *Client, checkpoint store := client.ContentStore() data, err := content.ReadBlob(ctx, store, *m) if err != nil { - return errors.Wrap(err, "unable to read checkpoint config") + return fmt.Errorf("unable to read checkpoint config: %w", err) } var any ptypes.Any if err := proto.Unmarshal(data, &any); err != nil { diff --git a/content/helpers.go b/content/helpers.go index 0596d2a835427..3ec1ffce001d3 100644 --- a/content/helpers.go +++ b/content/helpers.go @@ -18,6 +18,8 @@ package content import ( "context" + "errors" + "fmt" "io" "math/rand" "sync" @@ -26,7 +28,6 @@ import ( "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{ @@ -76,7 +77,7 @@ func WriteBlob(ctx context.Context, cs Ingester, ref string, r io.Reader, desc o 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 fmt.Errorf("failed to open writer: %w", err) } return nil // all ready present @@ -133,28 +134,28 @@ func OpenWriter(ctx context.Context, cs Ingester, opts ...WriterOpt) (Writer, er 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") + return fmt.Errorf("failed to get status: %w", err) } 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) + return fmt.Errorf("unable to resume write to %v: %w", ws.Ref, err) } } copied, err := copyWithBuffer(cw, r) if err != nil { - return errors.Wrap(err, "failed to copy") + return fmt.Errorf("failed to copy: %w", err) } if size != 0 && copied < size-ws.Offset { // Short writes would return its own error, this indicates a read failure - return errors.Wrapf(io.ErrUnexpectedEOF, "failed to read expected number of bytes") + return fmt.Errorf("failed to read expected number of bytes: %w", io.ErrUnexpectedEOF) } 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 fmt.Errorf("failed commit on ref %q: %w", ws.Ref, err) } } @@ -171,11 +172,11 @@ func CopyReaderAt(cw Writer, ra ReaderAt, n int64) error { copied, err := copyWithBuffer(cw, io.NewSectionReader(ra, ws.Offset, n)) if err != nil { - return errors.Wrap(err, "failed to copy") + return fmt.Errorf("failed to copy: %w", err) } if copied < n { // Short writes would return its own error, this indicates a read failure - return errors.Wrap(io.ErrUnexpectedEOF, "failed to read expected number of bytes") + return fmt.Errorf("failed to read expected number of bytes: %w", io.ErrUnexpectedEOF) } return nil } @@ -189,13 +190,13 @@ func CopyReaderAt(cw Writer, ra ReaderAt, n int64) error { 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") + return 0, fmt.Errorf("failed to get status: %w", err) } 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 0, fmt.Errorf("unable to resume write to %v: %w", ws.Ref, err) } } @@ -211,7 +212,10 @@ func seekReader(r io.Reader, offset, size int64) (io.Reader, error) { 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 { + err = fmt.Errorf("unexpected seek location without seek error") + } + return nil, fmt.Errorf("failed to seek to offset %v: %w", offset, err) } if err != nil { @@ -231,7 +235,7 @@ func seekReader(r io.Reader, offset, size int64) (io.Reader, error) { // well then, let's just discard up to the offset n, err := copyWithBuffer(io.Discard, io.LimitReader(r, offset)) if err != nil { - return nil, errors.Wrap(err, "failed to discard to offset") + return nil, fmt.Errorf("failed to discard to offset: %w", err) } if n != offset { return nil, errors.New("unable to discard to offset") diff --git a/content/local/locks.go b/content/local/locks.go index 077b6241ec2dc..1e59f39b30dd0 100644 --- a/content/local/locks.go +++ b/content/local/locks.go @@ -17,11 +17,11 @@ package local import ( + "fmt" "sync" "time" "github.com/containerd/containerd/errdefs" - "github.com/pkg/errors" ) // Handles locking references @@ -44,9 +44,9 @@ func tryLock(ref string) error { // Returning the duration may help developers distinguish dead locks (long duration) from // lock contentions (short duration). now := time.Now() - return errors.Wrapf( + return fmt.Errorf( + "ref %s locked for %s (since %s): %w", ref, now.Sub(v.since), v.since, errdefs.ErrUnavailable, - "ref %s locked for %s (since %s)", ref, now.Sub(v.since), v.since, ) } diff --git a/content/local/readerat.go b/content/local/readerat.go index 5d3ae03903822..a83c171bbd2bf 100644 --- a/content/local/readerat.go +++ b/content/local/readerat.go @@ -17,10 +17,9 @@ package local import ( + "fmt" "os" - "github.com/pkg/errors" - "github.com/containerd/containerd/content" "github.com/containerd/containerd/errdefs" ) @@ -40,7 +39,7 @@ func OpenReader(p string) (content.ReaderAt, error) { return nil, err } - return nil, errors.Wrap(errdefs.ErrNotFound, "blob not found") + return nil, fmt.Errorf("blob not found: %w", errdefs.ErrNotFound) } fp, err := os.Open(p) @@ -49,7 +48,7 @@ func OpenReader(p string) (content.ReaderAt, error) { return nil, err } - return nil, errors.Wrap(errdefs.ErrNotFound, "blob not found") + return nil, fmt.Errorf("blob not found: %w", errdefs.ErrNotFound) } return sizeReaderAt{size: fi.Size(), fp: fp}, nil diff --git a/content/local/store.go b/content/local/store.go index c105f926e90bb..457bbcd0eb4dd 100644 --- a/content/local/store.go +++ b/content/local/store.go @@ -36,7 +36,6 @@ import ( digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" ) var bufPool = sync.Pool{ @@ -93,13 +92,13 @@ func NewLabeledStore(root string, ls LabelStore) (content.Store, error) { 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") + return content.Info{}, fmt.Errorf("calculating blob info path: %w", err) } fi, err := os.Stat(p) if err != nil { if os.IsNotExist(err) { - err = errors.Wrapf(errdefs.ErrNotFound, "content %v", dgst) + err = fmt.Errorf("content %v: %w", dgst, errdefs.ErrNotFound) } return content.Info{}, err @@ -128,12 +127,12 @@ func (s *store) info(dgst digest.Digest, fi os.FileInfo, labels map[string]strin 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") + return nil, fmt.Errorf("calculating blob path for ReaderAt: %w", err) } reader, err := OpenReader(p) if err != nil { - return nil, errors.Wrapf(err, "blob %s expected at %s", desc.Digest, p) + return nil, fmt.Errorf("blob %s expected at %s: %w", desc.Digest, p, err) } return reader, nil @@ -146,7 +145,7 @@ func (s *store) ReaderAt(ctx context.Context, desc ocispec.Descriptor) (content. 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") + return fmt.Errorf("calculating blob path for delete: %w", err) } if err := os.RemoveAll(bp); err != nil { @@ -154,7 +153,7 @@ func (s *store) Delete(ctx context.Context, dgst digest.Digest) error { return err } - return errors.Wrapf(errdefs.ErrNotFound, "content %v", dgst) + return fmt.Errorf("content %v: %w", dgst, errdefs.ErrNotFound) } return nil @@ -162,18 +161,18 @@ func (s *store) Delete(ctx context.Context, dgst digest.Digest) error { 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") + return content.Info{}, fmt.Errorf("update not supported on immutable content store: %w", errdefs.ErrFailedPrecondition) } p, err := s.blobPath(info.Digest) if err != nil { - return content.Info{}, errors.Wrapf(err, "calculating blob path for update") + return content.Info{}, fmt.Errorf("calculating blob path for update: %w", err) } fi, err := os.Stat(p) if err != nil { if os.IsNotExist(err) { - err = errors.Wrapf(errdefs.ErrNotFound, "content %v", info.Digest) + err = fmt.Errorf("content %v: %w", info.Digest, errdefs.ErrNotFound) } return content.Info{}, err @@ -200,7 +199,7 @@ func (s *store) Update(ctx context.Context, info content.Info, fieldpaths ...str all = true labels = info.Labels default: - return content.Info{}, errors.Wrapf(errdefs.ErrInvalidArgument, "cannot update %q field on content info %q", path, info.Digest) + return content.Info{}, fmt.Errorf("cannot update %q field on content info %q: %w", path, info.Digest, errdefs.ErrInvalidArgument) } } } else { @@ -377,7 +376,7 @@ func (s *store) status(ingestPath string) (content.Status, error) { fi, err := os.Stat(dp) if err != nil { if os.IsNotExist(err) { - err = errors.Wrap(errdefs.ErrNotFound, err.Error()) + err = fmt.Errorf("%s: %w", err.Error(), errdefs.ErrNotFound) } return content.Status{}, err } @@ -385,19 +384,19 @@ func (s *store) status(ingestPath string) (content.Status, error) { ref, err := readFileString(filepath.Join(ingestPath, "ref")) if err != nil { if os.IsNotExist(err) { - err = errors.Wrap(errdefs.ErrNotFound, err.Error()) + err = fmt.Errorf("%s: %w", err.Error(), errdefs.ErrNotFound) } return content.Status{}, err } startedAt, err := readFileTimestamp(filepath.Join(ingestPath, "startedat")) if err != nil { - return content.Status{}, errors.Wrapf(err, "could not read startedat") + return content.Status{}, fmt.Errorf("could not read startedat: %w", err) } updatedAt, err := readFileTimestamp(filepath.Join(ingestPath, "updatedat")) if err != nil { - return content.Status{}, errors.Wrapf(err, "could not read updatedat") + return content.Status{}, fmt.Errorf("could not read updatedat: %w", err) } // because we don't write updatedat on every write, the mod time may @@ -460,7 +459,7 @@ func (s *store) Writer(ctx context.Context, opts ...content.WriterOpt) (content. // 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") + return nil, fmt.Errorf("ref must not be empty: %w", errdefs.ErrInvalidArgument) } var lockErr error for count := uint64(0); count < 10; count++ { @@ -494,16 +493,16 @@ func (s *store) resumeStatus(ref string, total int64, digester digest.Digester) path, _, data := s.ingestPaths(ref) status, err := s.status(path) if err != nil { - return status, errors.Wrap(err, "failed reading status of resume write") + return status, fmt.Errorf("failed reading status of resume write: %w", err) } if ref != status.Ref { // NOTE(stevvooe): This is fairly catastrophic. Either we have some // layout corruption or a hash collision for the ref key. - return status, errors.Errorf("ref key does not match: %v != %v", ref, status.Ref) + return status, fmt.Errorf("ref key does not match: %v != %v", ref, status.Ref) } if total > 0 && status.Total > 0 && total != status.Total { - return status, errors.Errorf("provided total differs from status: %v != %v", total, status.Total) + return status, fmt.Errorf("provided total differs from status: %v != %v", total, status.Total) } // TODO(stevvooe): slow slow slow!!, send to goroutine or use resumable hashes @@ -527,10 +526,10 @@ func (s *store) writer(ctx context.Context, ref string, total int64, expected di if expected != "" { p, err := s.blobPath(expected) if err != nil { - return nil, errors.Wrap(err, "calculating expected blob path for writer") + return nil, fmt.Errorf("calculating expected blob path for writer: %w", err) } if _, err := os.Stat(p); err == nil { - return nil, errors.Wrapf(errdefs.ErrAlreadyExists, "content %v", expected) + return nil, fmt.Errorf("content %v: %w", expected, errdefs.ErrAlreadyExists) } } @@ -588,12 +587,12 @@ func (s *store) writer(ctx context.Context, ref string, total int64, expected di 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") + return nil, fmt.Errorf("failed to open data file: %w", err) } if _, err := fp.Seek(offset, io.SeekStart); err != nil { fp.Close() - return nil, errors.Wrap(err, "could not seek to current write offset") + return nil, fmt.Errorf("could not seek to current write offset: %w", err) } return &writer{ @@ -615,7 +614,7 @@ 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 fmt.Errorf("ingest ref %q: %w", ref, errdefs.ErrNotFound) } return err @@ -626,7 +625,7 @@ func (s *store) Abort(ctx context.Context, ref string) error { 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 "", fmt.Errorf("cannot calculate blob path from invalid digest: %v: %w", err, errdefs.ErrInvalidArgument) } return filepath.Join(s.root, "blobs", dgst.Algorithm().String(), dgst.Hex()), nil @@ -665,14 +664,14 @@ func readFileTimestamp(p string) (time.Time, error) { b, err := os.ReadFile(p) if err != nil { if os.IsNotExist(err) { - err = errors.Wrap(errdefs.ErrNotFound, err.Error()) + err = fmt.Errorf("%s: %w", err.Error(), errdefs.ErrNotFound) } 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 time.Time{}, fmt.Errorf("could not parse timestamp file %v: %w", p, err) } return t, nil @@ -690,16 +689,16 @@ func writeToCompletion(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") + return fmt.Errorf("create tmp file: %w", err) } _, err = f.Write(data) f.Close() if err != nil { - return errors.Wrap(err, "write tmp file") + return fmt.Errorf("write tmp file: %w", err) } err = os.Rename(tmp, path) if err != nil { - return errors.Wrap(err, "rename tmp file") + return fmt.Errorf("rename tmp file: %w", err) } return nil } diff --git a/content/local/writer.go b/content/local/writer.go index a61394ea2ed69..b187e524cb71a 100644 --- a/content/local/writer.go +++ b/content/local/writer.go @@ -18,6 +18,8 @@ package local import ( "context" + "errors" + "fmt" "io" "os" "path/filepath" @@ -28,7 +30,6 @@ import ( "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. @@ -88,30 +89,30 @@ func (w *writer) Commit(ctx context.Context, size int64, expected digest.Digest, w.fp = nil if fp == nil { - return errors.Wrap(errdefs.ErrFailedPrecondition, "cannot commit on closed writer") + return fmt.Errorf("cannot commit on closed writer: %w", errdefs.ErrFailedPrecondition) } if err := fp.Sync(); err != nil { fp.Close() - return errors.Wrap(err, "sync failed") + return fmt.Errorf("sync failed: %w", err) } fi, err := fp.Stat() closeErr := fp.Close() if err != nil { - return errors.Wrap(err, "stat on ingest file failed") + return fmt.Errorf("stat on ingest file failed: %w", err) } if closeErr != nil { - return errors.Wrap(err, "failed to close ingest file") + return fmt.Errorf("failed to close ingest file: %w", closeErr) } if size > 0 && size != fi.Size() { - return errors.Wrapf(errdefs.ErrFailedPrecondition, "unexpected commit size %d, expected %d", fi.Size(), size) + return fmt.Errorf("unexpected commit size %d, expected %d: %w", fi.Size(), size, errdefs.ErrFailedPrecondition) } dgst := w.digester.Digest() if expected != "" && expected != dgst { - return errors.Wrapf(errdefs.ErrFailedPrecondition, "unexpected commit digest %s, expected %s", dgst, expected) + return fmt.Errorf("unexpected commit digest %s, expected %s: %w", dgst, expected, errdefs.ErrFailedPrecondition) } var ( @@ -129,7 +130,7 @@ func (w *writer) Commit(ctx context.Context, size int64, expected digest.Digest, if err := os.RemoveAll(w.path); err != nil { log.G(ctx).WithField("ref", w.ref).WithField("path", w.path).Error("failed to remove ingest directory") } - return errors.Wrapf(errdefs.ErrAlreadyExists, "content %v", dgst) + return fmt.Errorf("content %v: %w", dgst, errdefs.ErrAlreadyExists) } if err := os.Rename(ingest, target); err != nil { diff --git a/content/proxy/content_writer.go b/content/proxy/content_writer.go index 8423335988783..ffc0f50ea1bc0 100644 --- a/content/proxy/content_writer.go +++ b/content/proxy/content_writer.go @@ -18,13 +18,13 @@ package proxy import ( "context" + "fmt" "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 { @@ -57,7 +57,7 @@ func (rw *remoteWriter) Status() (content.Status, error) { Action: contentapi.WriteActionStat, }) if err != nil { - return content.Status{}, errors.Wrap(errdefs.FromGRPC(err), "error getting writer status") + return content.Status{}, fmt.Errorf("error getting writer status: %w", errdefs.FromGRPC(err)) } return content.Status{ @@ -82,7 +82,7 @@ func (rw *remoteWriter) Write(p []byte) (n int, err error) { Data: p, }) if err != nil { - return 0, errors.Wrap(errdefs.FromGRPC(err), "failed to send write") + return 0, fmt.Errorf("failed to send write: %w", errdefs.FromGRPC(err)) } n = int(resp.Offset - offset) @@ -119,15 +119,15 @@ func (rw *remoteWriter) Commit(ctx context.Context, size int64, expected digest. Labels: base.Labels, }) if err != nil { - return errors.Wrap(errdefs.FromGRPC(err), "commit failed") + return fmt.Errorf("commit failed: %w", errdefs.FromGRPC(err)) } if size != 0 && resp.Offset != size { - return errors.Errorf("unexpected size: %v != %v", resp.Offset, size) + return fmt.Errorf("unexpected size: %v != %v", resp.Offset, size) } if expected != "" && resp.Digest != expected { - return errors.Errorf("unexpected digest: %v != %v", resp.Digest, expected) + return fmt.Errorf("unexpected digest: %v != %v", resp.Digest, expected) } rw.digest = resp.Digest diff --git a/content/testsuite/testsuite.go b/content/testsuite/testsuite.go index 0ec0b2e627120..c02498f4e57dd 100644 --- a/content/testsuite/testsuite.go +++ b/content/testsuite/testsuite.go @@ -34,7 +34,6 @@ import ( "github.com/containerd/containerd/pkg/testutil" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" "gotest.tools/v3/assert" ) @@ -712,35 +711,47 @@ func checkResume(rf func(context.Context, content.Writer, []byte, int64, int64, func resumeTruncate(ctx context.Context, w content.Writer, b []byte, written, size int64, dgst digest.Digest) error { if err := w.Truncate(0); err != nil { - return errors.Wrap(err, "truncate failed") + return fmt.Errorf("truncate failed: %w", err) } if _, err := io.CopyBuffer(w, bytes.NewReader(b), make([]byte, 1024)); err != nil { - return errors.Wrap(err, "write failed") + return fmt.Errorf("write failed: %w", err) } - - return errors.Wrap(w.Commit(ctx, size, dgst), "commit failed") + if err := w.Commit(ctx, size, dgst); err != nil { + return fmt.Errorf("commit failed: %w", err) + } + return nil } func resumeDiscard(ctx context.Context, w content.Writer, b []byte, written, size int64, dgst digest.Digest) error { if _, err := io.CopyBuffer(w, bytes.NewReader(b[written:]), make([]byte, 1024)); err != nil { - return errors.Wrap(err, "write failed") + return fmt.Errorf("write failed: %w", err) } - return errors.Wrap(w.Commit(ctx, size, dgst), "commit failed") + if err := w.Commit(ctx, size, dgst); err != nil { + return fmt.Errorf("commit failed: %w", err) + + } + return nil } func resumeCopy(ctx context.Context, w content.Writer, b []byte, _, size int64, dgst digest.Digest) error { r := struct { io.Reader }{bytes.NewReader(b)} - return errors.Wrap(content.Copy(ctx, w, r, size, dgst), "copy failed") + if err := content.Copy(ctx, w, r, size, dgst); err != nil { + return fmt.Errorf("copy failed: %w", err) + } + return nil } func resumeCopySeeker(ctx context.Context, w content.Writer, b []byte, _, size int64, dgst digest.Digest) error { r := struct { io.ReadSeeker }{bytes.NewReader(b)} - return errors.Wrap(content.Copy(ctx, w, r, size, dgst), "copy failed") + if err := content.Copy(ctx, w, r, size, dgst); err != nil { + return fmt.Errorf("copy failed: %w", err) + } + return nil } func resumeCopyReaderAt(ctx context.Context, w content.Writer, b []byte, _, size int64, dgst digest.Digest) error { @@ -751,7 +762,10 @@ func resumeCopyReaderAt(ctx context.Context, w content.Writer, b []byte, _, size r := struct { readerAt }{bytes.NewReader(b)} - return errors.Wrap(content.Copy(ctx, w, r, size, dgst), "copy failed") + if err := content.Copy(ctx, w, r, size, dgst); err != nil { + return fmt.Errorf("copy failed: %w", err) + } + return nil } // checkSmallBlob tests reading a blob which is smaller than the read size. @@ -1018,35 +1032,35 @@ func checkNewlyCreated(t *testing.T, w content.Writer, preStart, postStart, preU func checkInfo(ctx context.Context, cs content.Store, d digest.Digest, expected content.Info, c1, c2, u1, u2 time.Time) error { info, err := cs.Info(ctx, d) if err != nil { - return errors.Wrap(err, "failed to get info") + return fmt.Errorf("failed to get info: %w", err) } if info.Digest != d { - return errors.Errorf("unexpected info digest %s, expected %s", info.Digest, d) + return fmt.Errorf("unexpected info digest %s, expected %s", info.Digest, d) } if info.Size != expected.Size { - return errors.Errorf("unexpected info size %d, expected %d", info.Size, expected.Size) + return fmt.Errorf("unexpected info size %d, expected %d", info.Size, expected.Size) } if info.CreatedAt.After(c2) || info.CreatedAt.Before(c1) { - return errors.Errorf("unexpected created at time %s, expected between %s and %s", info.CreatedAt, c1, c2) + return fmt.Errorf("unexpected created at time %s, expected between %s and %s", info.CreatedAt, c1, c2) } // FIXME: broken on windows: unexpected updated at time 2017-11-14 13:43:22.178013 -0800 PST, // expected between 2017-11-14 13:43:22.1790195 -0800 PST m=+1.022137300 and // 2017-11-14 13:43:22.1790195 -0800 PST m=+1.022137300 if runtime.GOOS != "windows" && (info.UpdatedAt.After(u2) || info.UpdatedAt.Before(u1)) { - return errors.Errorf("unexpected updated at time %s, expected between %s and %s", info.UpdatedAt, u1, u2) + return fmt.Errorf("unexpected updated at time %s, expected between %s and %s", info.UpdatedAt, u1, u2) } if len(info.Labels) != len(expected.Labels) { - return errors.Errorf("mismatched number of labels\ngot:\n%#v\nexpected:\n%#v", info.Labels, expected.Labels) + return fmt.Errorf("mismatched number of labels\ngot:\n%#v\nexpected:\n%#v", info.Labels, expected.Labels) } for k, v := range expected.Labels { actual := info.Labels[k] if v != actual { - return errors.Errorf("unexpected value for label %q: %q, expected %q", k, actual, v) + return fmt.Errorf("unexpected value for label %q: %q, expected %q", k, actual, v) } } @@ -1059,16 +1073,16 @@ func checkContent(ctx context.Context, cs content.Store, d digest.Digest, expect b, err := content.ReadBlob(ctx, cs, ocispec.Descriptor{Digest: d}) if err != nil { - return errors.Wrap(err, "failed to read blob") + return fmt.Errorf("failed to read blob: %w", err) } if int64(len(b)) != expected.Size { - return errors.Errorf("wrong blob size %d, expected %d", len(b), expected.Size) + return fmt.Errorf("wrong blob size %d, expected %d", len(b), expected.Size) } actual := digest.FromBytes(b) if actual != d { - return errors.Errorf("wrong digest %s, expected %s", actual, d) + return fmt.Errorf("wrong digest %s, expected %s", actual, d) } return nil diff --git a/contrib/Dockerfile.test b/contrib/Dockerfile.test index b532252c69eb5..87f9b6f554a56 100644 --- a/contrib/Dockerfile.test +++ b/contrib/Dockerfile.test @@ -10,7 +10,7 @@ # # docker build -t containerd-test --build-arg RUNC_VERSION=v1.0.0-rc94 -f Dockerfile.test ../ -ARG GOLANG_VERSION=1.17.5 +ARG GOLANG_VERSION=1.17.7 ARG GOLANG_IMAGE=golang FROM ${GOLANG_IMAGE}:${GOLANG_VERSION} AS golang diff --git a/contrib/apparmor/apparmor.go b/contrib/apparmor/apparmor.go index 343043980178f..be6a49a39c615 100644 --- a/contrib/apparmor/apparmor.go +++ b/contrib/apparmor/apparmor.go @@ -22,12 +22,12 @@ package apparmor import ( "bytes" "context" + "fmt" "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 @@ -76,7 +76,7 @@ func LoadDefaultProfile(name string) error { return err } if err := load(path); err != nil { - return errors.Wrapf(err, "load apparmor profile %s", path) + return fmt.Errorf("load apparmor profile %s: %w", path, err) } return nil } diff --git a/contrib/apparmor/apparmor_unsupported.go b/contrib/apparmor/apparmor_unsupported.go index 239ca5e386ac5..ac00fd17899c1 100644 --- a/contrib/apparmor/apparmor_unsupported.go +++ b/contrib/apparmor/apparmor_unsupported.go @@ -21,11 +21,11 @@ package apparmor import ( "context" + "errors" "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 diff --git a/contrib/apparmor/template.go b/contrib/apparmor/template.go index 89bf7786ca4b9..ba613c3e7db62 100644 --- a/contrib/apparmor/template.go +++ b/contrib/apparmor/template.go @@ -31,7 +31,6 @@ import ( "strings" "text/template" - "github.com/pkg/errors" exec "golang.org/x/sys/execabs" ) @@ -125,7 +124,7 @@ func loadData(name string) (*data, error) { } ver, err := getVersion() if err != nil { - return nil, errors.Wrap(err, "get apparmor_parser version") + return nil, fmt.Errorf("get apparmor_parser version: %w", err) } p.Version = ver @@ -152,7 +151,7 @@ func generate(p *data, o io.Writer) error { func load(path string) error { out, err := aaParser("-Kr", path) if err != nil { - return errors.Errorf("%s: %s", err, out) + return fmt.Errorf("parser error(%q): %w", strings.TrimSpace(out), err) } return nil } @@ -165,10 +164,7 @@ func macroExists(m string) bool { func aaParser(args ...string) (string, error) { out, err := exec.Command("apparmor_parser", args...).CombinedOutput() - if err != nil { - return "", err - } - return string(out), nil + return string(out), err } func getVersion() (int, error) { diff --git a/contrib/gce/cloud-init/master.yaml b/contrib/gce/cloud-init/master.yaml index 35c869c5b84b2..1b2aea445e5dc 100644 --- a/contrib/gce/cloud-init/master.yaml +++ b/contrib/gce/cloud-init/master.yaml @@ -75,7 +75,8 @@ write_files: content: | [Unit] Description=Download and install k8s binaries and configurations - After=network-online.target + After=network-online.target containerd.target + Wants=network-online.target containerd.target [Service] Type=oneshot diff --git a/contrib/gce/cloud-init/node.yaml b/contrib/gce/cloud-init/node.yaml index 97d7ad4295438..56dae241966ee 100644 --- a/contrib/gce/cloud-init/node.yaml +++ b/contrib/gce/cloud-init/node.yaml @@ -69,7 +69,8 @@ write_files: content: | [Unit] Description=Download and install k8s binaries and configurations - After=network-online.target + After=network-online.target containerd.target + Wants=network-online.target containerd.target [Service] Type=oneshot diff --git a/contrib/seccomp/seccomp_default.go b/contrib/seccomp/seccomp_default.go index c369e9f50ef49..10ae7c6f78252 100644 --- a/contrib/seccomp/seccomp_default.go +++ b/contrib/seccomp/seccomp_default.go @@ -128,6 +128,7 @@ func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp { "ftruncate64", "futex", "futex_time64", + "futex_waitv", "futimesat", "getcpu", "getcwd", @@ -184,6 +185,9 @@ func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp { "io_uring_setup", "ipc", "kill", + "landlock_add_rule", + "landlock_create_ruleset", + "landlock_restrict_self", "lchown", "lchown32", "lgetxattr", @@ -201,6 +205,7 @@ func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp { "madvise", "membarrier", "memfd_create", + "memfd_secret", "mincore", "mkdir", "mkdirat", @@ -248,6 +253,7 @@ func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp { "preadv", "preadv2", "prlimit64", + "process_mrelease", "pselect6", "pselect6_time64", "pwrite64", @@ -467,6 +473,7 @@ func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp { s.Syscalls = append(s.Syscalls, specs.LinuxSyscall{ Names: []string{ "sync_file_range2", + "swapcontext", }, Action: specs.ActAllow, Args: []specs.LinuxSeccompArg{}, @@ -536,11 +543,13 @@ func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp { "fspick", "lookup_dcookie", "mount", + "mount_setattr", "move_mount", "name_to_handle_at", "open_tree", "perf_event_open", "quotactl", + "quotactl_fd", "setdomainname", "sethostname", "setns", diff --git a/diff/apply/apply.go b/diff/apply/apply.go index 937d02ce8d638..d4b34238c49a7 100644 --- a/diff/apply/apply.go +++ b/diff/apply/apply.go @@ -18,6 +18,7 @@ package apply import ( "context" + "fmt" "io" "time" @@ -27,7 +28,6 @@ import ( "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" ) @@ -64,13 +64,13 @@ func (s *fsApplier) Apply(ctx context.Context, desc ocispec.Descriptor, mounts [ 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") + return emptyDesc, fmt.Errorf("failed to apply config opt: %w", err) } } ra, err := s.store.ReaderAt(ctx, desc) if err != nil { - return emptyDesc, errors.Wrap(err, "failed to get reader from content store") + return emptyDesc, fmt.Errorf("failed to get reader from content store: %w", err) } defer ra.Close() @@ -79,7 +79,7 @@ func (s *fsApplier) Apply(ctx context.Context, desc ocispec.Descriptor, mounts [ 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) + return emptyDesc, fmt.Errorf("failed to get stream processor for %s: %w", desc.MediaType, err) } processors = append(processors, processor) if processor.MediaType() == ocispec.MediaTypeImageLayer { diff --git a/diff/apply/apply_linux.go b/diff/apply/apply_linux.go index 7f805b5f61d73..55602db625b21 100644 --- a/diff/apply/apply_linux.go +++ b/diff/apply/apply_linux.go @@ -18,6 +18,7 @@ package apply import ( "context" + "fmt" "io" "strings" @@ -25,7 +26,6 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/pkg/userns" - "github.com/pkg/errors" ) func apply(ctx context.Context, mounts []mount.Mount, r io.Reader) error { @@ -86,7 +86,7 @@ func getOverlayPath(options []string) (upper string, lower []string, err error) } } if upper == "" { - return "", nil, errors.Wrap(errdefs.ErrInvalidArgument, "upperdir not found") + return "", nil, fmt.Errorf("upperdir not found: %w", errdefs.ErrInvalidArgument) } return @@ -111,22 +111,22 @@ func getAufsPath(options []string) (upper string, lower []string, err error) { for _, b := range strings.Split(o, sep) { if strings.HasSuffix(b, rwSuffix) { if upper != "" { - return "", nil, errors.Wrap(errdefs.ErrInvalidArgument, "multiple rw branch found") + return "", nil, fmt.Errorf("multiple rw branch found: %w", errdefs.ErrInvalidArgument) } upper = strings.TrimSuffix(b, rwSuffix) } else if strings.HasSuffix(b, roSuffix) { if upper == "" { - return "", nil, errors.Wrap(errdefs.ErrInvalidArgument, "rw branch be first") + return "", nil, fmt.Errorf("rw branch be first: %w", errdefs.ErrInvalidArgument) } lower = append(lower, strings.TrimSuffix(b, roSuffix)) } else { - return "", nil, errors.Wrap(errdefs.ErrInvalidArgument, "unhandled aufs suffix") + return "", nil, fmt.Errorf("unhandled aufs suffix: %w", errdefs.ErrInvalidArgument) } } } if upper == "" { - return "", nil, errors.Wrap(errdefs.ErrInvalidArgument, "rw branch not found") + return "", nil, fmt.Errorf("rw branch not found: %w", errdefs.ErrInvalidArgument) } return } diff --git a/diff/lcow/lcow.go b/diff/lcow/lcow.go index c72efa89e9a69..3fa19fe6fcc52 100644 --- a/diff/lcow/lcow.go +++ b/diff/lcow/lcow.go @@ -21,6 +21,7 @@ package lcow import ( "context" + "fmt" "io" "os" "path" @@ -38,7 +39,6 @@ import ( "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" ) @@ -111,7 +111,7 @@ func (s windowsLcowDiff) Apply(ctx context.Context, desc ocispec.Descriptor, mou 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") + return emptyDesc, fmt.Errorf("failed to apply config opt: %w", err) } } @@ -122,14 +122,14 @@ func (s windowsLcowDiff) Apply(ctx context.Context, desc ocispec.Descriptor, mou ra, err := s.store.ReaderAt(ctx, desc) if err != nil { - return emptyDesc, errors.Wrap(err, "failed to get reader from content store") + return emptyDesc, fmt.Errorf("failed to get reader from content store: %w", err) } 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) + return emptyDesc, fmt.Errorf("failed to get stream processor for %s: %w", desc.MediaType, err) } if processor.MediaType() == ocispec.MediaTypeImageLayer { break @@ -157,11 +157,11 @@ func (s windowsLcowDiff) Apply(ctx context.Context, desc ocispec.Descriptor, mou 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") + return emptyDesc, fmt.Errorf("failed to convert tar2ext4 vhd: %w", err) } err = outFile.Sync() if err != nil { - return emptyDesc, errors.Wrapf(err, "failed to sync tar2ext4 vhd to disk") + return emptyDesc, fmt.Errorf("failed to sync tar2ext4 vhd to disk: %w", err) } outFile.Close() @@ -172,7 +172,7 @@ func (s windowsLcowDiff) Apply(ctx context.Context, desc ocispec.Descriptor, mou err = security.GrantVmGroupAccess(layerPath) if err != nil { - return emptyDesc, errors.Wrapf(err, "failed GrantVmGroupAccess on layer vhd: %v", layerPath) + return emptyDesc, fmt.Errorf("failed GrantVmGroupAccess on layer vhd: %v: %w", layerPath, err) } return ocispec.Descriptor{ @@ -185,7 +185,7 @@ func (s windowsLcowDiff) Apply(ctx context.Context, desc ocispec.Descriptor, mou // 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") + return emptyDesc, fmt.Errorf("windowsLcowDiff does not implement Compare method: %w", errdefs.ErrNotImplemented) } type readCounter struct { @@ -201,11 +201,11 @@ func (rc *readCounter) Read(p []byte) (n int, err error) { 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") + return "", nil, fmt.Errorf("number of mounts should always be 1 for Windows lcow-layers: %w", errdefs.ErrInvalidArgument) } mnt := mounts[0] if mnt.Type != "lcow-layer" { - return "", nil, errors.Wrap(errdefs.ErrInvalidArgument, "mount layer type must be lcow-layer") + return "", nil, fmt.Errorf("mount layer type must be lcow-layer: %w", errdefs.ErrInvalidArgument) } parentLayerPaths, err := mnt.GetParentPaths() diff --git a/diff/stream.go b/diff/stream.go index 655f9ce838629..44e35fcc8155c 100644 --- a/diff/stream.go +++ b/diff/stream.go @@ -18,6 +18,7 @@ package diff import ( "context" + "errors" "io" "os" @@ -25,7 +26,6 @@ import ( "github.com/containerd/containerd/images" "github.com/gogo/protobuf/types" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" ) var ( diff --git a/diff/stream_unix.go b/diff/stream_unix.go index fd8adc223b849..6622c331eea9c 100644 --- a/diff/stream_unix.go +++ b/diff/stream_unix.go @@ -22,6 +22,7 @@ package diff import ( "bytes" "context" + "errors" "fmt" "io" "os" @@ -29,7 +30,6 @@ import ( "github.com/gogo/protobuf/proto" "github.com/gogo/protobuf/types" - "github.com/pkg/errors" exec "golang.org/x/sys/execabs" ) diff --git a/diff/stream_windows.go b/diff/stream_windows.go index 3058bd2512752..c0bf03b94ab32 100644 --- a/diff/stream_windows.go +++ b/diff/stream_windows.go @@ -19,6 +19,7 @@ package diff import ( "bytes" "context" + "errors" "fmt" "io" "os" @@ -28,7 +29,6 @@ import ( winio "github.com/Microsoft/go-winio" "github.com/gogo/protobuf/proto" "github.com/gogo/protobuf/types" - "github.com/pkg/errors" "github.com/sirupsen/logrus" exec "golang.org/x/sys/execabs" ) diff --git a/diff/walking/differ.go b/diff/walking/differ.go index c5d142bbd06db..a24c72273c52d 100644 --- a/diff/walking/differ.go +++ b/diff/walking/differ.go @@ -19,6 +19,7 @@ package walking import ( "context" "encoding/base64" + "errors" "fmt" "io" "math/rand" @@ -33,7 +34,6 @@ import ( "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 { @@ -81,7 +81,7 @@ func (s *walkingDiff) Compare(ctx context.Context, lower, upper []mount.Mount, o case ocispec.MediaTypeImageLayerGzip: isCompressed = true default: - return emptyDesc, errors.Wrapf(errdefs.ErrNotImplemented, "unsupported diff media type: %v", config.MediaType) + return emptyDesc, fmt.Errorf("unsupported diff media type: %v: %w", config.MediaType, errdefs.ErrNotImplemented) } } @@ -100,7 +100,7 @@ func (s *walkingDiff) Compare(ctx context.Context, lower, upper []mount.Mount, o MediaType: config.MediaType, // most contentstore implementations just ignore this })) if err != nil { - return errors.Wrap(err, "failed to open writer") + return fmt.Errorf("failed to open writer: %w", err) } // errOpen is set when an error occurs while the content writer has not been @@ -128,18 +128,18 @@ func (s *walkingDiff) Compare(ctx context.Context, lower, upper []mount.Mount, o if config.Compressor != nil { compressed, errOpen = config.Compressor(cw, config.MediaType) if errOpen != nil { - return errors.Wrap(errOpen, "failed to get compressed stream") + return fmt.Errorf("failed to get compressed stream: %w", errOpen) } } else { compressed, errOpen = compression.CompressStream(cw, compression.Gzip) if errOpen != nil { - return errors.Wrap(errOpen, "failed to get compressed stream") + return fmt.Errorf("failed to get compressed stream: %w", errOpen) } } errOpen = archive.WriteDiff(ctx, io.MultiWriter(compressed, dgstr.Hash()), lowerRoot, upperRoot) compressed.Close() if errOpen != nil { - return errors.Wrap(errOpen, "failed to write compressed diff") + return fmt.Errorf("failed to write compressed diff: %w", errOpen) } if config.Labels == nil { @@ -148,7 +148,7 @@ func (s *walkingDiff) Compare(ctx context.Context, lower, upper []mount.Mount, o config.Labels[uncompressed] = dgstr.Digest().String() } else { if errOpen = archive.WriteDiff(ctx, cw, lowerRoot, upperRoot); errOpen != nil { - return errors.Wrap(errOpen, "failed to write diff") + return fmt.Errorf("failed to write diff: %w", errOpen) } } @@ -160,14 +160,14 @@ func (s *walkingDiff) Compare(ctx context.Context, lower, upper []mount.Mount, o dgst := cw.Digest() if errOpen = cw.Commit(ctx, 0, dgst, commitopts...); errOpen != nil { if !errdefs.IsAlreadyExists(errOpen) { - return errors.Wrap(errOpen, "failed to commit") + return fmt.Errorf("failed to commit: %w", errOpen) } errOpen = nil } info, err := s.store.Info(ctx, dgst) if err != nil { - return errors.Wrap(err, "failed to get info from content store") + return fmt.Errorf("failed to get info from content store: %w", err) } if info.Labels == nil { info.Labels = make(map[string]string) @@ -176,7 +176,7 @@ func (s *walkingDiff) Compare(ctx context.Context, lower, upper []mount.Mount, o 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") + return fmt.Errorf("error setting uncompressed label: %w", err) } } diff --git a/diff/windows/windows.go b/diff/windows/windows.go index 032163b64a0c3..97afb5a5f2679 100644 --- a/diff/windows/windows.go +++ b/diff/windows/windows.go @@ -40,7 +40,6 @@ import ( "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" ) @@ -106,20 +105,20 @@ func (s windowsDiff) Apply(ctx context.Context, desc ocispec.Descriptor, mounts 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") + return emptyDesc, fmt.Errorf("failed to apply config opt: %w", err) } } ra, err := s.store.ReaderAt(ctx, desc) if err != nil { - return emptyDesc, errors.Wrap(err, "failed to get reader from content store") + return emptyDesc, fmt.Errorf("failed to get reader from content store: %w", err) } 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) + return emptyDesc, fmt.Errorf("failed to get stream processor for %s: %w", desc.MediaType, err) } if processor.MediaType() == ocispec.MediaTypeImageLayer { break @@ -188,7 +187,7 @@ func (s windowsDiff) Compare(ctx context.Context, lower, upper []mount.Mount, op case ocispec.MediaTypeImageLayerGzip: isCompressed = true default: - return emptyDesc, errors.Wrapf(errdefs.ErrNotImplemented, "unsupported diff media type: %v", config.MediaType) + return emptyDesc, fmt.Errorf("unsupported diff media type: %v: %w", config.MediaType, errdefs.ErrNotImplemented) } newReference := false @@ -202,7 +201,7 @@ func (s windowsDiff) Compare(ctx context.Context, lower, upper []mount.Mount, op })) if err != nil { - return emptyDesc, errors.Wrap(err, "failed to open writer") + return emptyDesc, fmt.Errorf("failed to open writer: %w", err) } defer func() { @@ -235,12 +234,12 @@ func (s windowsDiff) Compare(ctx context.Context, lower, upper []mount.Mount, op var compressed io.WriteCloser compressed, err = compression.CompressStream(cw, compression.Gzip) if err != nil { - return emptyDesc, errors.Wrap(err, "failed to get compressed stream") + return emptyDesc, fmt.Errorf("failed to get compressed stream: %w", err) } err = archive.WriteDiff(ctx, io.MultiWriter(compressed, dgstr.Hash()), "", layers[0], archive.AsWindowsContainerLayerPair(), archive.WithParentLayers(layers[1:])) compressed.Close() if err != nil { - return emptyDesc, errors.Wrap(err, "failed to write compressed diff") + return emptyDesc, fmt.Errorf("failed to write compressed diff: %w", err) } if config.Labels == nil { @@ -249,7 +248,7 @@ func (s windowsDiff) Compare(ctx context.Context, lower, upper []mount.Mount, op config.Labels[uncompressed] = dgstr.Digest().String() } else { if err = archive.WriteDiff(ctx, cw, "", layers[0], archive.AsWindowsContainerLayerPair(), archive.WithParentLayers(layers[1:])); err != nil { - return emptyDesc, errors.Wrap(err, "failed to write diff") + return emptyDesc, fmt.Errorf("failed to write diff: %w", err) } } @@ -261,13 +260,13 @@ func (s windowsDiff) Compare(ctx context.Context, lower, upper []mount.Mount, op dgst := cw.Digest() if err := cw.Commit(ctx, 0, dgst, commitopts...); err != nil { if !errdefs.IsAlreadyExists(err) { - return emptyDesc, errors.Wrap(err, "failed to commit") + return emptyDesc, fmt.Errorf("failed to commit: %w", err) } } info, err := s.store.Info(ctx, dgst) if err != nil { - return emptyDesc, errors.Wrap(err, "failed to get info from content store") + return emptyDesc, fmt.Errorf("failed to get info from content store: %w", err) } if info.Labels == nil { info.Labels = make(map[string]string) @@ -276,7 +275,7 @@ func (s windowsDiff) Compare(ctx context.Context, lower, upper []mount.Mount, op if _, ok := info.Labels[uncompressed]; !ok { info.Labels[uncompressed] = config.Labels[uncompressed] if _, err := s.store.Update(ctx, info, "labels."+uncompressed); err != nil { - return emptyDesc, errors.Wrap(err, "error setting uncompressed label") + return emptyDesc, fmt.Errorf("error setting uncompressed label: %w", err) } } @@ -309,14 +308,14 @@ func (rc *readCounter) Read(p []byte) (n int, err error) { 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") + return "", nil, fmt.Errorf("number of mounts should always be 1 for Windows layers: %w", errdefs.ErrInvalidArgument) } 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) + return "", nil, fmt.Errorf("windowsDiff does not support layer type %s: %w", mnt.Type, errdefs.ErrNotImplemented) } parentLayerPaths, err := mnt.GetParentPaths() @@ -335,39 +334,39 @@ func mountPairToLayerStack(lower, upper []mount.Mount) ([]string, error) { // May return an ErrNotImplemented, which will fall back to LCOW upperLayer, upperParentLayerPaths, err := mountsToLayerAndParents(upper) if err != nil { - return nil, errors.Wrapf(err, "Upper mount invalid") + return nil, fmt.Errorf("Upper mount invalid: %w", err) } // Trivial case, diff-against-nothing if len(lower) == 0 { if len(upperParentLayerPaths) != 0 { - return nil, errors.Wrap(errdefs.ErrInvalidArgument, "windowsDiff cannot diff a layer with parents against a null layer") + return nil, fmt.Errorf("windowsDiff cannot diff a layer with parents against a null layer: %w", errdefs.ErrInvalidArgument) } return []string{upperLayer}, nil } if len(upperParentLayerPaths) < 1 { - return nil, errors.Wrap(errdefs.ErrInvalidArgument, "windowsDiff cannot diff a layer with no parents against another layer") + return nil, fmt.Errorf("windowsDiff cannot diff a layer with no parents against another layer: %w", errdefs.ErrInvalidArgument) } lowerLayer, lowerParentLayerPaths, err := mountsToLayerAndParents(lower) if errdefs.IsNotImplemented(err) { // Upper was a windows-layer, lower is not. We can't handle that. - return nil, errors.Wrap(errdefs.ErrInvalidArgument, "windowsDiff cannot diff a windows-layer against a non-windows-layer") + return nil, fmt.Errorf("windowsDiff cannot diff a windows-layer against a non-windows-layer: %w", errdefs.ErrInvalidArgument) } else if err != nil { - return nil, errors.Wrapf(err, "Lower mount invalid") + return nil, fmt.Errorf("Lower mount invalid: %w", err) } if upperParentLayerPaths[0] != lowerLayer { - return nil, errors.Wrap(errdefs.ErrInvalidArgument, "windowsDiff cannot diff a layer against a layer other than its own parent") + return nil, fmt.Errorf("windowsDiff cannot diff a layer against a layer other than its own parent: %w", errdefs.ErrInvalidArgument) } if len(upperParentLayerPaths) != len(lowerParentLayerPaths)+1 { - return nil, errors.Wrap(errdefs.ErrInvalidArgument, "windowsDiff cannot diff a layer against a layer with different parents") + return nil, fmt.Errorf("windowsDiff cannot diff a layer against a layer with different parents: %w", errdefs.ErrInvalidArgument) } for i, upperParent := range upperParentLayerPaths[1:] { if upperParent != lowerParentLayerPaths[i] { - return nil, errors.Wrap(errdefs.ErrInvalidArgument, "windowsDiff cannot diff a layer against a layer with different parents") + return nil, fmt.Errorf("windowsDiff cannot diff a layer against a layer with different parents: %w", errdefs.ErrInvalidArgument) } } diff --git a/docs/cri/architecture.md b/docs/cri/architecture.md index 823e72853493a..2cff5f2d5258a 100644 --- a/docs/cri/architecture.md +++ b/docs/cri/architecture.md @@ -1,7 +1,7 @@ # Architecture of The CRI Plugin This document describes the architecture of the `cri` plugin for `containerd`. -This plugin is an implementation of Kubernetes [container runtime interface (CRI)](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/apis/cri/runtime/v1alpha2/api.proto). Containerd operates on the same node as the [Kubelet](https://kubernetes.io/docs/reference/generated/kubelet/). The `cri` plugin inside containerd handles all CRI service requests from the Kubelet and uses containerd internals to manage containers and container images. +This plugin is an implementation of Kubernetes [container runtime interface (CRI)](https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.proto). Containerd operates on the same node as the [Kubelet](https://kubernetes.io/docs/reference/generated/kubelet/). The `cri` plugin inside containerd handles all CRI service requests from the Kubelet and uses containerd internals to manage containers and container images. The `cri` plugin uses containerd to manage the full container lifecycle and all container images. As also shown below, `cri` manages pod networking via [CNI](https://github.com/containernetworking/cni) (another CNCF project). @@ -9,7 +9,7 @@ The `cri` plugin uses containerd to manage the full container lifecycle and all Let's use an example to demonstrate how the `cri` plugin works for the case when Kubelet creates a single-container pod: * Kubelet calls the `cri` plugin, via the CRI runtime service API, to create a pod; -* `cri` creates and configures the pod’s network namespace using CNI; +* `cri` creates the pod’s network namespace, and then configures it using CNI; * `cri` uses containerd internal to create and start a special [pause container](https://www.ianlewis.org/en/almighty-pause-container) (the sandbox container) and put that container inside the pod’s cgroups and namespace (steps omitted for brevity); * Kubelet subsequently calls the `cri` plugin, via the CRI image service API, to pull the application container image; * `cri` further uses containerd to pull the image if the image is not present on the node; diff --git a/docs/ops.md b/docs/ops.md index 2e14beda1e5c0..c884db083e620 100644 --- a/docs/ops.md +++ b/docs/ops.md @@ -232,7 +232,3 @@ The default is "shared". While this is largely the most desired policy, one can [plugins.bolt] content_sharing_policy = "isolated" ``` - -It is possible to share only the contents of a specific namespace by adding the label `containerd.io/namespace.shareable=true` to that namespace. -This will share the contents of the namespace even if the content sharing policy is set to isolated and make its images usable by all other namespaces. -If the label value is set to anything other than `true`, the namespace content will not be shared. diff --git a/docs/tracing.md b/docs/tracing.md new file mode 100644 index 0000000000000..041e5f89b1b62 --- /dev/null +++ b/docs/tracing.md @@ -0,0 +1,84 @@ +# Tracing + +containerd supports OpenTelemetry tracing since v1.6.0. +Tracing currently targets only gRPC calls. + +## Sending traces from containerd deamon + +By configuring `io.containerd.tracing.processor.v1.otlp` plugin. +containerd daemon can send traces to the specified OpenTelemetry endpoint. + +```toml +[plugins."io.containerd.tracing.processor.v1.otlp"] + endpoint = "http://localhost:4318" +``` + +The following options are supported. + +- `endpoint`: The address of a server that receives [OpenTelemetry Protocol](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.8.0/specification/protocol/otlp.md). +- `protocol`: OpenTelemetry supports multiple protocols. + The default value is "http/protobuf". "grpc" is also supported. +- `insecure`: Disable transport security when the protocol is "grpc". The default is false. + "http/protobuf" always uses the schema provided by the endpoint and + the value of this setting being ignored. + +The sampling ratio and the service name on the traces could be configured by +`io.containerd.internal.v1.tracing` plugin. + +```toml +[plugins."io.containerd.internal.v1.tracing"] + sampling_ratio = 1.0 + service_name = "containerd" +``` + +## Sending traces from containerd client + +By configuring its underlying gRPC client, containerd's Go client can send +traces to an OpenTelemetry endpoint. + +Note that the Go client's methods and gRPC calls are not 1:1. Single method +call would issue multiple gRPC calls. + +```go +func clientWithTrace() error { + exp, err := otlptracehttp.New(ctx, + otlptracehttp.WithEndpoint("localhost:4318"), + otlptracehttp.WithInsecure(), + ) + if err != nil { + return err + } + + res, err := resource.New(ctx, resource.WithAttributes( + semconv.ServiceNameKey.String("CLIENT NAME"), + )) + if err != nil { + return err + } + + provider := trace.NewTracerProvider( + trace.WithSampler(trace.AlwaysSample()), + trace.WithSpanProcessor(trace.NewSimpleSpanProcessor(exp)), + trace.WithResource(res), + ) + otel.SetTracerProvider(provider) + otel.SetTextMapPropagator(propagation.TraceContext{}) + + ... + + dialOpts := []grpc.DialOption{ + grpc.WithTransportCredentials(insecure.NewCredentials()), + grpc.WithStreamInterceptor(otelgrpc.StreamClientInterceptor()), + grpc.WithUnaryInterceptor(otelgrpc.UnaryClientInterceptor()), + } + client, ctx, cancel, err := commands.NewClient(context, containerd.WithDialOpts(dialOpts)) + if err != nil { + return err + } + defer cancel() + + ctx, span := tracing.StartSpan(ctx, "OPERATION NAME") + defer span.End() + ... +} +``` diff --git a/errdefs/errors.go b/errdefs/errors.go index 05a35228ca420..8762255970829 100644 --- a/errdefs/errors.go +++ b/errdefs/errors.go @@ -17,7 +17,7 @@ // Package errdefs defines the common errors used throughout containerd // packages. // -// Use with errors.Wrap and error.Wrapf to add context to an error. +// Use with fmt.Errorf 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. @@ -28,8 +28,7 @@ package errdefs import ( "context" - - "github.com/pkg/errors" + "errors" ) // Definitions of common error types used throughout containerd. All containerd diff --git a/errdefs/grpc.go b/errdefs/grpc.go index 209f63bd0fc0d..7a9b33e05afe1 100644 --- a/errdefs/grpc.go +++ b/errdefs/grpc.go @@ -18,9 +18,9 @@ package errdefs import ( "context" + "fmt" "strings" - "github.com/pkg/errors" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -68,9 +68,9 @@ func ToGRPC(err error) error { // 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...)) +// This is equivalent to errdefs.ToGRPC(fmt.Errorf("%s: %w", fmt.Sprintf(format, args...), err)) func ToGRPCf(err error, format string, args ...interface{}) error { - return ToGRPC(errors.Wrapf(err, format, args...)) + return ToGRPC(fmt.Errorf("%s: %w", fmt.Sprintf(format, args...), err)) } // FromGRPC returns the underlying error from a grpc service based on the grpc error code @@ -104,9 +104,9 @@ func FromGRPC(err error) error { msg := rebaseMessage(cls, err) if msg != "" { - err = errors.Wrap(cls, msg) + err = fmt.Errorf("%s: %w", msg, cls) } else { - err = errors.WithStack(cls) + err = cls } return err diff --git a/errdefs/grpc_test.go b/errdefs/grpc_test.go index 982cebdf9f91f..30da69f9d3f2b 100644 --- a/errdefs/grpc_test.go +++ b/errdefs/grpc_test.go @@ -18,12 +18,12 @@ package errdefs import ( "context" + "errors" + "fmt" "testing" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - - "github.com/pkg/errors" ) func TestGRPCRoundTrip(t *testing.T) { @@ -43,7 +43,7 @@ func TestGRPCRoundTrip(t *testing.T) { cause: ErrNotFound, }, { - input: errors.Wrapf(ErrFailedPrecondition, "test test test"), + input: fmt.Errorf("test test test: %w", ErrFailedPrecondition), cause: ErrFailedPrecondition, str: "test test test: failed precondition", }, @@ -63,7 +63,7 @@ func TestGRPCRoundTrip(t *testing.T) { str: "context canceled", }, { - input: errors.Wrapf(context.Canceled, "this is a test cancel"), + input: fmt.Errorf("this is a test cancel: %w", context.Canceled), cause: context.Canceled, str: "this is a test cancel: context canceled", }, @@ -73,7 +73,7 @@ func TestGRPCRoundTrip(t *testing.T) { str: "context deadline exceeded", }, { - input: errors.Wrapf(context.DeadlineExceeded, "this is a test deadline exceeded"), + input: fmt.Errorf("this is a test deadline exceeded: %w", context.DeadlineExceeded), cause: context.DeadlineExceeded, str: "this is a test deadline exceeded: context deadline exceeded", }, @@ -85,9 +85,6 @@ func TestGRPCRoundTrip(t *testing.T) { ferr := FromGRPC(gerr) t.Logf("recovered: %v", ferr) - if errors.Cause(ferr) != testcase.cause { - t.Fatalf("unexpected cause: %v != %v", errors.Cause(ferr), testcase.cause) - } if !errors.Is(ferr, testcase.cause) { t.Fatalf("unexpected cause: !errors.Is(%v, %v)", ferr, testcase.cause) } diff --git a/events/exchange/exchange.go b/events/exchange/exchange.go index eb27bf29b3075..a1f385d7abd3d 100644 --- a/events/exchange/exchange.go +++ b/events/exchange/exchange.go @@ -18,6 +18,7 @@ package exchange import ( "context" + "fmt" "strings" "time" @@ -30,7 +31,6 @@ import ( "github.com/containerd/typeurl" goevents "github.com/docker/go-events" "github.com/gogo/protobuf/types" - "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -88,10 +88,10 @@ func (e *Exchange) Publish(ctx context.Context, topic string, event events.Event namespace, err = namespaces.NamespaceRequired(ctx) if err != nil { - return errors.Wrapf(err, "failed publishing event") + return fmt.Errorf("failed publishing event: %w", err) } if err := validateTopic(topic); err != nil { - return errors.Wrapf(err, "envelope topic %q", topic) + return fmt.Errorf("envelope topic %q: %w", topic, err) } encoded, err = typeurl.MarshalAny(event) @@ -150,7 +150,7 @@ func (e *Exchange) Subscribe(ctx context.Context, fs ...string) (ch <-chan *even if len(fs) > 0 { filter, err := filters.ParseAll(fs...) if err != nil { - errq <- errors.Wrapf(err, "failed parsing subscription filters") + errq <- fmt.Errorf("failed parsing subscription filters: %w", err) closeAll() return } @@ -175,7 +175,7 @@ func (e *Exchange) Subscribe(ctx context.Context, fs ...string) (ch <-chan *even // 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) + err = fmt.Errorf("invalid envelope encountered %#v; please file a bug", ev) break } @@ -203,21 +203,21 @@ func (e *Exchange) Subscribe(ctx context.Context, fs ...string) (ch <-chan *even func validateTopic(topic string) error { if topic == "" { - return errors.Wrap(errdefs.ErrInvalidArgument, "must not be empty") + return fmt.Errorf("must not be empty: %w", errdefs.ErrInvalidArgument) } if topic[0] != '/' { - return errors.Wrapf(errdefs.ErrInvalidArgument, "must start with '/'") + return fmt.Errorf("must start with '/': %w", errdefs.ErrInvalidArgument) } if len(topic) == 1 { - return errors.Wrapf(errdefs.ErrInvalidArgument, "must have at least one component") + return fmt.Errorf("must have at least one component: %w", errdefs.ErrInvalidArgument) } 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 fmt.Errorf("failed validation on component %q: %w", component, err) } } @@ -226,15 +226,15 @@ func validateTopic(topic string) error { func validateEnvelope(envelope *events.Envelope) error { if err := identifiers.Validate(envelope.Namespace); err != nil { - return errors.Wrapf(err, "event envelope has invalid namespace") + return fmt.Errorf("event envelope has invalid namespace: %w", err) } if err := validateTopic(envelope.Topic); err != nil { - return errors.Wrapf(err, "envelope topic %q", envelope.Topic) + return fmt.Errorf("envelope topic %q: %w", envelope.Topic, err) } if envelope.Timestamp.IsZero() { - return errors.Wrapf(errdefs.ErrInvalidArgument, "timestamp must be set on forwarded event") + return fmt.Errorf("timestamp must be set on forwarded event: %w", errdefs.ErrInvalidArgument) } return nil diff --git a/events/exchange/exchange_test.go b/events/exchange/exchange_test.go index 97d2879500071..8f87cbba24c90 100644 --- a/events/exchange/exchange_test.go +++ b/events/exchange/exchange_test.go @@ -18,6 +18,7 @@ package exchange import ( "context" + "errors" "reflect" "testing" "time" @@ -27,7 +28,6 @@ import ( "github.com/containerd/containerd/events" "github.com/containerd/containerd/namespaces" "github.com/containerd/typeurl" - "github.com/pkg/errors" ) func TestExchangeBasic(t *testing.T) { diff --git a/filters/parser.go b/filters/parser.go index 0825d668caf0f..49182d7b7bd60 100644 --- a/filters/parser.go +++ b/filters/parser.go @@ -21,7 +21,6 @@ import ( "io" "github.com/containerd/containerd/errdefs" - "github.com/pkg/errors" ) /* @@ -71,7 +70,7 @@ func ParseAll(ss ...string) (Filter, error) { for _, s := range ss { f, err := Parse(s) if err != nil { - return nil, errors.Wrap(errdefs.ErrInvalidArgument, err.Error()) + return nil, fmt.Errorf("%s: %w", err.Error(), errdefs.ErrInvalidArgument) } fs = append(fs, f) @@ -90,7 +89,7 @@ func (p *parser) parse() (Filter, error) { ss, err := p.selectors() if err != nil { - return nil, errors.Wrap(err, "filters") + return nil, fmt.Errorf("filters: %w", err) } return ss, nil @@ -284,9 +283,9 @@ func (pe parseError) Error() string { } func (p *parser) mkerr(pos int, format string, args ...interface{}) error { - return errors.Wrap(parseError{ + return fmt.Errorf("parse error: %w", parseError{ input: p.input, pos: pos, msg: fmt.Sprintf(format, args...), - }, "parse error") + }) } diff --git a/filters/quote.go b/filters/quote.go index 2d64e23a300f8..b76aab9b4a7af 100644 --- a/filters/quote.go +++ b/filters/quote.go @@ -17,9 +17,8 @@ package filters import ( + "errors" "unicode/utf8" - - "github.com/pkg/errors" ) // NOTE(stevvooe): Most of this code in this file is copied from the stdlib diff --git a/gc/gc.go b/gc/gc.go index 4f71cb305c5dd..079a6eae97279 100644 --- a/gc/gc.go +++ b/gc/gc.go @@ -59,6 +59,8 @@ type Stats interface { // // We can probably use this to inform a design for incremental GC by injecting // callbacks to the set modification algorithms. +// +// https://en.wikipedia.org/wiki/Tracing_garbage_collection#Tri-color_marking func Tricolor(roots []Node, refs func(ref Node) ([]Node, error)) (map[Node]struct{}, error) { var ( grays []Node // maintain a gray "stack" diff --git a/gc/scheduler/scheduler.go b/gc/scheduler/scheduler.go index f5890fb74da8a..f6999249d4460 100644 --- a/gc/scheduler/scheduler.go +++ b/gc/scheduler/scheduler.go @@ -18,6 +18,7 @@ package scheduler import ( "context" + "errors" "fmt" "sync" "time" @@ -25,7 +26,6 @@ import ( "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. @@ -117,7 +117,7 @@ func init() { mdCollector, ok := md.(collector) if !ok { - return nil, errors.Errorf("%s %T must implement collector", plugin.MetadataPlugin, md) + return nil, fmt.Errorf("%s %T must implement collector", plugin.MetadataPlugin, md) } m := newScheduler(mdCollector, ic.Config.(*config)) diff --git a/go.mod b/go.mod index ae69a44a5e94b..16876d7ecea8c 100644 --- a/go.mod +++ b/go.mod @@ -3,19 +3,19 @@ module github.com/containerd/containerd go 1.16 require ( + cloud.google.com/go v0.81.0 // indirect github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8 github.com/Microsoft/go-winio v0.5.1 - github.com/Microsoft/hcsshim v0.9.1 + github.com/Microsoft/hcsshim v0.9.2 github.com/containerd/aufs v1.0.0 github.com/containerd/btrfs v1.0.0 - github.com/containerd/cgroups v1.0.2 + github.com/containerd/cgroups v1.0.3 github.com/containerd/console v1.0.3 - github.com/containerd/containerd/api v1.6.0-beta.3 - github.com/containerd/continuity v0.2.2-0.20211201162329-8e53e7cac79d + github.com/containerd/continuity v0.2.2 github.com/containerd/fifo v1.0.0 - github.com/containerd/go-cni v1.1.1-0.20211026134925-aa8bf14323a5 + github.com/containerd/go-cni v1.1.3 github.com/containerd/go-runc v1.0.0 - github.com/containerd/imgcrypt v1.1.1 + github.com/containerd/imgcrypt v1.1.3 github.com/containerd/nri v0.1.0 github.com/containerd/ttrpc v1.1.0 github.com/containerd/typeurl v1.0.2 @@ -38,6 +38,7 @@ require ( github.com/hashicorp/go-multierror v1.1.1 github.com/imdario/mergo v0.3.12 github.com/intel/goresctrl v0.2.0 + github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.11.13 github.com/moby/locker v1.0.1 github.com/moby/sys/mountinfo v0.5.0 @@ -45,9 +46,9 @@ require ( github.com/moby/sys/symlink v0.2.0 github.com/opencontainers/go-digest v1.0.0 github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5 - github.com/opencontainers/runc v1.0.3 + github.com/opencontainers/runc v1.1.0 github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 - github.com/opencontainers/selinux v1.8.2 + github.com/opencontainers/selinux v1.10.0 github.com/pelletier/go-toml v1.9.3 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.11.0 @@ -58,27 +59,31 @@ require ( github.com/urfave/cli v1.22.2 github.com/vishvananda/netlink v1.1.1-0.20210330154013-f5de75959ad5 go.etcd.io/bbolt v1.3.6 - go.opencensus.io v0.22.4 + go.opencensus.io v0.23.0 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.28.0 go.opentelemetry.io/otel v1.3.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.3.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.3.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.3.0 go.opentelemetry.io/otel/sdk v1.3.0 go.opentelemetry.io/otel/trace v1.3.0 + golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect golang.org/x/net v0.0.0-20211216030914-fe4d6282115f + golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect golang.org/x/sync v0.0.0-20210220032951-036812b2e83c golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e - golang.org/x/text v0.3.7 // indirect + golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa // indirect google.golang.org/grpc v1.43.0 google.golang.org/protobuf v1.27.1 gotest.tools/v3 v3.0.3 - k8s.io/api v0.22.0 - k8s.io/apimachinery v0.22.1 - k8s.io/apiserver v0.22.0 - k8s.io/client-go v0.22.0 - k8s.io/component-base v0.22.0 - k8s.io/cri-api v0.23.0-alpha.4 - k8s.io/klog/v2 v2.20.0 + k8s.io/api v0.22.5 + k8s.io/apimachinery v0.22.5 + k8s.io/apiserver v0.22.5 + k8s.io/client-go v0.22.5 + k8s.io/component-base v0.22.5 + k8s.io/cri-api v0.23.1 + k8s.io/klog/v2 v2.30.0 k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b ) @@ -87,8 +92,6 @@ replace ( // prevent transitional dependencies due to containerd having a circular // dependency on itself through plugins. see .empty-mod/go.mod for details github.com/containerd/containerd => ./.empty-mod/ - // Use the relative local source of the github.com/containerd/containerd/api to build - github.com/containerd/containerd/api => ./api github.com/gogo/googleapis => github.com/gogo/googleapis v1.3.2 // urfave/cli must be <= v1.22.1 due to a regression: https://github.com/urfave/cli/issues/1092 github.com/urfave/cli => github.com/urfave/cli v1.22.1 diff --git a/go.sum b/go.sum index c758751f26884..fb6acbd349896 100644 --- a/go.sum +++ b/go.sum @@ -14,8 +14,13 @@ cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bP cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0 h1:Dg9iHVQfrhq82rUNu9ZxUDrJLaxFUe/HlCVaLyRruq8= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0 h1:at8Tk2zUz63cLPR0JPWm5vp77pEZmzxEQBEfRKn1VV8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -50,15 +55,13 @@ github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBp github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= -github.com/Microsoft/go-winio v0.4.17-0.20210211115548-6eac466e5fa3/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.4.17-0.20210324224401-5516f17a5958/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.4.17/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.5.1 h1:aPJp2QD7OOrhO5tQXqQoGSJc+DjDtWTGLOmNyAm6FgY= github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/hcsshim v0.8.16/go.mod h1:o5/SZqmR7x9JNKsW3pu+nqHm0MF8vbA+VxGOoXdC600= github.com/Microsoft/hcsshim v0.8.20/go.mod h1:+w2gRZ5ReXQhFOrvSQeNfhrYB/dg3oDwTOcER2fw4I4= -github.com/Microsoft/hcsshim v0.9.1 h1:VfDCj+QnY19ktX5TsH22JHcjaZ05RWQiwDbOyEg5ziM= -github.com/Microsoft/hcsshim v0.9.1/go.mod h1:Y/0uV2jUab5kBI7SQgl62at0AVX7uaruzADAVmxm3eM= +github.com/Microsoft/hcsshim v0.8.23/go.mod h1:4zegtUJth7lAvFyc6cH2gGQ5B3OFQim01nnU2M8jKDg= +github.com/Microsoft/hcsshim v0.9.2 h1:wB06W5aYFfUB3IvootYAY2WnOmIdgPGfqSI6tufQNnY= +github.com/Microsoft/hcsshim v0.9.2/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -84,7 +87,6 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bits-and-blooms/bitset v1.2.0 h1:Kn4yilvwNtMACtf1eYDlG8H77R07mZSPbMjLyS07ChA= github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= @@ -102,15 +104,17 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= +github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= github.com/cilium/ebpf v0.4.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= -github.com/cilium/ebpf v0.6.2 h1:iHsfF/t4aW4heW2YKfeHrVPGdtYTL4C4KocpM8KTSnI= github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= +github.com/cilium/ebpf v0.7.0 h1:1k/q3ATgxSXRdrmPfH8d7YK0GfqVsEKZAX9dQZvs56k= +github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2usCA= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= @@ -124,33 +128,32 @@ github.com/containerd/aufs v1.0.0 h1:2oeJiwX5HstO7shSrPZjrohJZLzK36wvpdmzDRkL/LY github.com/containerd/aufs v1.0.0/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= github.com/containerd/btrfs v1.0.0 h1:osn1exbzdub9L5SouXO5swW4ea/xVdJZ3wokxN5GrnA= github.com/containerd/btrfs v1.0.0/go.mod h1:zMcX3qkXTAi9GI50+0HOeuV8LU2ryCE/V2vG/ZBiTss= -github.com/containerd/cgroups v0.0.0-20210114181951-8a68de567b68/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE= github.com/containerd/cgroups v1.0.1/go.mod h1:0SJrPIenamHDcZhEcJMNBB85rHcUsw4f25ZfBiPYRkU= -github.com/containerd/cgroups v1.0.2 h1:mZBclaSgNDfPWtfhj2xJY28LZ9nYIgzB0pwSURPl6JM= -github.com/containerd/cgroups v1.0.2/go.mod h1:qpbpJ1jmlqsR9f2IyaLPsdkCdnt0rbDVqIDlhuu5tRY= +github.com/containerd/cgroups v1.0.3 h1:ADZftAkglvCiD44c77s5YmMqaP2pzVCFZvBmAlBdAP4= +github.com/containerd/cgroups v1.0.3/go.mod h1:/ofk34relqNjSGyqPrmEULrO4Sc8LJhvJmWbUCUKqj8= github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw= github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8acV1PGKCbzQ= github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw= github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e/go.mod h1:EXlVlkqNba9rJe3j7w3Xa924itAMLgZH4UD/Q4PExuQ= -github.com/containerd/continuity v0.2.2-0.20211201162329-8e53e7cac79d h1:X5aD4AgIfNi00260miYN8nCzxPQCusmnNapaphze0FM= -github.com/containerd/continuity v0.2.2-0.20211201162329-8e53e7cac79d/go.mod h1:pWygW9u7LtS1o4N/Tn0FoCFDIXZ7rxcMX7HX1Dmibvk= +github.com/containerd/continuity v0.1.0/go.mod h1:ICJu0PwR54nI0yPEnJ6jcS+J7CZAUXrLh8lPo2knzsM= +github.com/containerd/continuity v0.2.2 h1:QSqfxcn8c+12slxwu00AtzXrsami0MJb/MQs9lOLHLA= +github.com/containerd/continuity v0.2.2/go.mod h1:pWygW9u7LtS1o4N/Tn0FoCFDIXZ7rxcMX7HX1Dmibvk= github.com/containerd/fifo v1.0.0 h1:6PirWBr9/L7GDamKr+XM0IeUFXu5mf3M/BPpH9gaLBU= github.com/containerd/fifo v1.0.0/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= -github.com/containerd/go-cni v1.1.1-0.20211026134925-aa8bf14323a5 h1:khacN1kfW+7jnuj5rWytfCORVL1RmeDpD7Y1fdM4G1c= -github.com/containerd/go-cni v1.1.1-0.20211026134925-aa8bf14323a5/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA= -github.com/containerd/go-runc v0.0.0-20201020171139-16b287bc67d0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= +github.com/containerd/go-cni v1.1.0/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA= +github.com/containerd/go-cni v1.1.3 h1:t0MQwrtM96SH71Md8tH0uKrVE9v+jxkDTbvFSm3B9VE= +github.com/containerd/go-cni v1.1.3/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA= github.com/containerd/go-runc v1.0.0 h1:oU+lLv1ULm5taqgV/CJivypVODI4SUz1znWjv3nNYS0= github.com/containerd/go-runc v1.0.0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= -github.com/containerd/imgcrypt v1.1.1 h1:LBwiTfoUsdiEGAR1TpvxE+Gzt7469oVu87iR3mv3Byc= -github.com/containerd/imgcrypt v1.1.1/go.mod h1:xpLnwiQmEUJPvQoAapeb2SNCxz7Xr6PJrXQb0Dpc4ms= +github.com/containerd/imgcrypt v1.1.3 h1:69UKRsA3Q/lAwo2eDzWshdjimqhmprrWXfNtBeO0fBc= +github.com/containerd/imgcrypt v1.1.3/go.mod h1:/TPA1GIDXMzbj01yd8pIbQiLdQxed5ue1wb8bP7PQu4= github.com/containerd/nri v0.1.0 h1:6QioHRlThlKh2RkRTR4kIT3PKAcrLo3gIWnjkM4dQmQ= github.com/containerd/nri v0.1.0/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= github.com/containerd/stargz-snapshotter/estargz v0.4.1/go.mod h1:x7Q9dg9QYb4+ELgxmo4gBUeJB0tl5dqH1Sdz0nJU1QM= github.com/containerd/ttrpc v1.0.2/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y= github.com/containerd/ttrpc v1.1.0 h1:GbtyLRxb0gOLR0TYQWt3O6B0NvT8tMdorEHqIQo/lWI= github.com/containerd/ttrpc v1.1.0/go.mod h1:XX4ZTnoOId4HklF4edwc4DcqskFZuvXB1Evzy5KFQpQ= -github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg= github.com/containerd/typeurl v1.0.2 h1:Chlt8zIieDbzQFzXzAeBEF92KhExuE4p9p92/QmY7aY= github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s= github.com/containerd/zfs v1.0.0 h1:cXLJbx+4Jj7rNsTiqVfm6i+RNLx6FFA2fMmDlEf+Wm8= @@ -159,8 +162,8 @@ github.com/containernetworking/cni v1.0.1 h1:9OIL/sZmMYDBe+G8svzILAlulUpaDTUjeAb github.com/containernetworking/cni v1.0.1/go.mod h1:AKuhXbN5EzmD4yTNtfSsX3tPcmtrBI6QcRV0NiNt15Y= github.com/containernetworking/plugins v1.0.1 h1:wwCfYbTCj5FC0EJgyzyjTXmqysOiJE9r712Z+2KVZAk= github.com/containernetworking/plugins v1.0.1/go.mod h1:QHCfGpaTwYTbbH+nZXKVTxNBDZcxSOplJT5ico8/FLE= -github.com/containers/ocicrypt v1.1.1 h1:prL8l9w3ntVqXvNH1CiNn5ENjcCnr38JqpSyvKKB4GI= -github.com/containers/ocicrypt v1.1.1/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= +github.com/containers/ocicrypt v1.1.2 h1:Ez+GAMP/4GLix5Ywo/fL7O0nY771gsBIigiqUm1aXz0= +github.com/containers/ocicrypt v1.1.2/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -180,6 +183,7 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsr github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= +github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c/go.mod h1:Ct2BUK8SB0YC1SMSibvLzxjeJLnrYEVLULFNiHY9YfQ= github.com/d2g/dhcp4client v1.0.0/go.mod h1:j0hNfjhrt2SxUOw55nL0ATM/z4Yt3t2Kd1mW34z5W5s= github.com/d2g/dhcp4server v0.0.0-20181031114812-7d4a0a7f59a5/go.mod h1:Eo87+Kg/IX2hfWJfwxMzLyuSZyxSoAug2nGa1G2QAi8= @@ -209,6 +213,7 @@ github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= @@ -239,7 +244,6 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v1.0.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.1/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2 h1:ahHml/yUpnlb96Rp8HCvtYVPY8ZYpxq3g7UYchIYwbs= @@ -264,8 +268,9 @@ github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/godbus/dbus/v5 v5.0.4 h1:9349emZab16e7zQvpmsbtjc18ykshndd8y2PG3sgJbA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/godbus/dbus/v5 v5.0.6 h1:mkgN1ofwASrYnJ5W6U/BxG15eXXXjirgZc7CLqkcaro= +github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/googleapis v1.3.2 h1:kX1es4djPJrsDhY7aZKJy7aZasdcB5oSOEphMjSB53c= github.com/gogo/googleapis v1.3.2/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -287,6 +292,7 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -317,6 +323,7 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= @@ -328,6 +335,7 @@ github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= @@ -335,6 +343,10 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -384,6 +396,7 @@ github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2p github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= @@ -399,8 +412,9 @@ github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= @@ -470,8 +484,9 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= @@ -506,14 +521,15 @@ github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zM github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5 h1:q37d91F6BO4Jp1UqWiun0dUFYaqv6WsKTLTCaWv+8LY= github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= -github.com/opencontainers/runc v1.0.3 h1:1hbqejyQWCJBvtKAfdO0b1FmaEf2z/bxnjqbARass5k= -github.com/opencontainers/runc v1.0.3/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= +github.com/opencontainers/runc v1.1.0 h1:O9+X96OcDjkmmZyfaG996kV7yq8HsoU2h1XRRQcefG8= +github.com/opencontainers/runc v1.1.0/go.mod h1:Tj1hFw6eFWp/o33uxGf5yF2BX5yz2Z6iptFpuvbbKqc= github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 h1:3snG66yBm59tKhhSPQrQ/0bCrv1LQbKt40LnUPiUxdc= github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/selinux v1.8.2 h1:c4ca10UMgRcvZ6h0K4HtS15UaVSBEaE+iln2LVpAuGc= github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= +github.com/opencontainers/selinux v1.10.0 h1:rAiKF8hTcgLI3w0DHm6i0ylVVcOrlgR1kK99DRLDhyU= +github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= @@ -571,6 +587,7 @@ github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZ github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= +github.com/seccomp/libseccomp-golang v0.9.2-0.20210429002308-3879420cc921/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -654,8 +671,10 @@ go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/contrib v0.20.0 h1:ubFQUn0VCZ0gPwIoJfBJVpeBlyRMxu8Mm/huKWYd9p0= go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0/go.mod h1:oVGt1LRbBOBq1A5BQLlUg9UaU/54aiHw8cgjV3aWZ/E= @@ -673,6 +692,8 @@ go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.3.0 h1:giGm8w67Ja7amYNfYMdm go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.3.0/go.mod h1:hO1KLR7jcKaDDKDkvI9dP/FIhpmna5lkqPUQdEjFAM8= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.3.0 h1:VQbUHoJqytHHSJ1OZodPH9tvZZSVzUHjPHpkO85sT6k= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.3.0/go.mod h1:keUU7UfnwWTWpJ+FWnyqmogPa82nuU5VUANFq49hlMY= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.3.0 h1:Ydage/P0fRrSPpZeCVxzjqGcI6iVmG2xb43+IR8cjqM= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.3.0/go.mod h1:QNX1aly8ehqqX1LEa6YniTU7VY9I6R3X/oPxhGdTceE= go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc= @@ -705,8 +726,9 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 h1:It14KIkyBFYkHkwZ7k45minvA9aorojkyjGk9KJ5B/w= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ= +golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -728,6 +750,7 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -736,6 +759,8 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -772,16 +797,20 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211216030914-fe4d6282115f h1:hEYJvxw1lSnWIl8X9ofsYMklzaDs90JI2az5YMd4fPM= golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -789,8 +818,15 @@ golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c h1:pkQiBZBvdos9qq4wBAHqlzuZHEXo07pqV06ef90u1WI= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f h1:Qmd2pbz05z7z6lm0DrgQVVPuBm92jqujBKMHMOlOQEw= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -836,7 +872,6 @@ golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -854,14 +889,21 @@ golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -870,23 +912,28 @@ golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210820121016-41cdb8703e55/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210903071746-97244b99971b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d h1:SZxvLBoTP5yHO3Frd4z4vrF+DBX9vMVanchswa69toE= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b h1:9zKuko04nR4gjZ4+DNjHqRlAJqbJETHwiNKDqTfOjfE= +golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -948,9 +995,15 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/tools v0.0.0-20200916195026-c9a70fc28ce3/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -974,13 +1027,19 @@ google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63 h1:YzfoEYWbODU5Fbt37+h7X16BWQbad7Q4S6gclTKFXM8= google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -996,9 +1055,13 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= @@ -1062,20 +1125,20 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.22.0 h1:elCpMZ9UE8dLdYxr55E06TmSeji9I3KH494qH70/y+c= -k8s.io/api v0.22.0/go.mod h1:0AoXXqst47OI/L0oGKq9DG61dvGRPXs7X4/B7KyjBCU= -k8s.io/apimachinery v0.22.0/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= -k8s.io/apimachinery v0.22.1 h1:DTARnyzmdHMz7bFWFDDm22AM4pLWTQECMpRTFu2d2OM= +k8s.io/api v0.22.5 h1:xk7C+rMjF/EGELiD560jdmwzrB788mfcHiNbMQLIVI8= +k8s.io/api v0.22.5/go.mod h1:mEhXyLaSD1qTOf40rRiKXkc+2iCem09rWLlFwhCEiAs= k8s.io/apimachinery v0.22.1/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= -k8s.io/apiserver v0.22.0 h1:KZh2asnRBjawLLfPOi6qiD+A2jaNt31HCnZG6AX3Qcs= -k8s.io/apiserver v0.22.0/go.mod h1:04kaIEzIQrTGJ5syLppQWvpkLJXQtJECHmae+ZGc/nc= -k8s.io/client-go v0.22.0 h1:sD6o9O6tCwUKCENw8v+HFsuAbq2jCu8cWC61/ydwA50= -k8s.io/client-go v0.22.0/go.mod h1:GUjIuXR5PiEv/RVK5OODUsm6eZk7wtSWZSaSJbpFdGg= +k8s.io/apimachinery v0.22.5 h1:cIPwldOYm1Slq9VLBRPtEYpyhjIm1C6aAMAoENuvN9s= +k8s.io/apimachinery v0.22.5/go.mod h1:xziclGKwuuJ2RM5/rSFQSYAj0zdbci3DH8kj+WvyN0U= +k8s.io/apiserver v0.22.5 h1:71krQxCUz218ecb+nPhfDsNB6QgP1/4EMvi1a2uYBlg= +k8s.io/apiserver v0.22.5/go.mod h1:s2WbtgZAkTKt679sYtSudEQrTGWUSQAPe6MupLnlmaQ= +k8s.io/client-go v0.22.5 h1:I8Zn/UqIdi2r02aZmhaJ1hqMxcpfJ3t5VqvHtctHYFo= +k8s.io/client-go v0.22.5/go.mod h1:cs6yf/61q2T1SdQL5Rdcjg9J1ElXSwbjSrW2vFImM4Y= k8s.io/code-generator v0.19.7/go.mod h1:lwEq3YnLYb/7uVXLorOJfxg+cUu2oihFhHZ0n9NIla0= -k8s.io/component-base v0.22.0 h1:ZTmX8hUqH9T9gc0mM42O+KDgtwTYbVTt2MwmLP0eK8A= -k8s.io/component-base v0.22.0/go.mod h1:SXj6Z+V6P6GsBhHZVbWCw9hFjUdUYnJerlhhPnYCBCg= -k8s.io/cri-api v0.23.0-alpha.4 h1:VY9Bxk+254iz5rop9IWorEfVQIzcv8IkUVEwWcvODgM= -k8s.io/cri-api v0.23.0-alpha.4/go.mod h1:qVxNSzR1gwLmZWK61jKRA5NhbyYrNoXUaZpQ7yOUYOQ= +k8s.io/component-base v0.22.5 h1:U0eHqZm7mAFE42hFwYhY6ze/MmVaW00JpMrzVsQmzYE= +k8s.io/component-base v0.22.5/go.mod h1:VK3I+TjuF9eaa+Ln67dKxhGar5ynVbwnGrUiNF4MqCI= +k8s.io/cri-api v0.23.1 h1:0DHL/hpTf4Fp+QkUXFefWcp1fhjXr9OlNdY9X99c+O8= +k8s.io/cri-api v0.23.1/go.mod h1:REJE3PSU0h/LOV1APBrupxrEJqnoxZC8KWzkBUHwrK4= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20201113003025-83324d819ded/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= @@ -1083,11 +1146,12 @@ k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/klog/v2 v2.20.0 h1:tlyxlSvd63k7axjhuchckaRJm+a92z5GSOrTOQY5sHw= -k8s.io/klog/v2 v2.20.0/go.mod h1:Gm8eSIfQN6457haJuPaMxZw4wyP5k+ykPFlrhQDvhvw= +k8s.io/klog/v2 v2.30.0 h1:bUO6drIvCIsvZ/XFgfxoGFQU/a4Qkh0iAlvUR7vlHJw= +k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= +k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b h1:wxEMGetGMur3J1xuGLQY7GEQYg9bZxKn3tKo5k/eYcs= k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/identifiers/validate.go b/identifiers/validate.go index f52317b491b81..cbd3a52ba9e2f 100644 --- a/identifiers/validate.go +++ b/identifiers/validate.go @@ -25,10 +25,10 @@ package identifiers import ( + "fmt" "regexp" "github.com/containerd/containerd/errdefs" - "github.com/pkg/errors" ) const ( @@ -51,15 +51,15 @@ var ( // 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") + return fmt.Errorf("identifier must not be empty: %w", errdefs.ErrInvalidArgument) } if len(s) > maxLength { - return errors.Wrapf(errdefs.ErrInvalidArgument, "identifier %q greater than maximum length (%d characters)", s, maxLength) + return fmt.Errorf("identifier %q greater than maximum length (%d characters): %w", s, maxLength, errdefs.ErrInvalidArgument) } if !identifierRe.MatchString(s) { - return errors.Wrapf(errdefs.ErrInvalidArgument, "identifier %q must match %v", s, identifierRe) + return fmt.Errorf("identifier %q must match %v: %w", s, identifierRe, errdefs.ErrInvalidArgument) } return nil } diff --git a/image.go b/image.go index 5c5cdf57aca4f..216b3adb1e659 100644 --- a/image.go +++ b/image.go @@ -19,6 +19,7 @@ package containerd import ( "context" "encoding/json" + "errors" "fmt" "strings" "sync/atomic" @@ -33,7 +34,6 @@ import ( "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" ) @@ -399,7 +399,7 @@ func (i *image) getLayers(ctx context.Context, platform platforms.MatchComparer, cs := i.ContentStore() diffIDs, err := i.i.RootFS(ctx, cs, platform) if err != nil { - return nil, errors.Wrap(err, "failed to resolve rootfs") + return nil, fmt.Errorf("failed to resolve rootfs: %w", err) } if len(diffIDs) != len(manifest.Layers) { return nil, errors.New("mismatched image rootfs and manifest layers") diff --git a/images/archive/exporter.go b/images/archive/exporter.go index 7801b2552cda7..549474644b5f4 100644 --- a/images/archive/exporter.go +++ b/images/archive/exporter.go @@ -20,6 +20,7 @@ import ( "archive/tar" "context" "encoding/json" + "fmt" "io" "path" "sort" @@ -31,7 +32,6 @@ import ( 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 { @@ -230,7 +230,7 @@ func Export(ctx context.Context, store content.Provider, writer io.Writer, opts manifest: manifests[0], } } else if eo.platform != nil { - return errors.Wrap(errdefs.ErrNotFound, "no manifest found for platform") + return fmt.Errorf("no manifest found for platform: %w", errdefs.ErrNotFound) } } resolvedIndex[desc.Digest] = d @@ -243,14 +243,14 @@ func Export(ctx context.Context, store content.Provider, writer io.Writer, opts } default: - return errors.Wrap(errdefs.ErrInvalidArgument, "only manifests may be exported") + return fmt.Errorf("only manifests may be exported: %w", errdefs.ErrInvalidArgument) } } if len(dManifests) > 0 { tr, err := manifestsRecord(ctx, store, dManifests) if err != nil { - return errors.Wrap(err, "unable to create manifests file") + return fmt.Errorf("unable to create manifests file: %w", err) } records = append(records, tr) @@ -316,7 +316,7 @@ func blobRecord(cs content.Provider, desc ocispec.Descriptor, opts *blobRecordOp 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") + return 0, fmt.Errorf("failed to get reader: %w", err) } defer r.Close() @@ -325,10 +325,10 @@ func blobRecord(cs content.Provider, desc ocispec.Descriptor, opts *blobRecordOp 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") + return 0, fmt.Errorf("failed to copy to tar: %w", err) } if dgstr.Digest() != desc.Digest { - return 0, errors.Errorf("unexpected digest %s copied", dgstr.Digest()) + return 0, fmt.Errorf("unexpected digest %s copied", dgstr.Digest()) } return n, nil }, @@ -424,7 +424,7 @@ func manifestsRecord(ctx context.Context, store content.Provider, manifests map[ return tarRecord{}, err } if err := manifest.Config.Digest.Validate(); err != nil { - return tarRecord{}, errors.Wrapf(err, "invalid manifest %q", m.manifest.Digest) + return tarRecord{}, fmt.Errorf("invalid manifest %q: %w", m.manifest.Digest, err) } dgst := manifest.Config.Digest @@ -491,10 +491,10 @@ func writeTar(ctx context.Context, tw *tar.Writer, recordsWithEmpty []tarRecord) return err } if n != record.Header.Size { - return errors.Errorf("unexpected copy size for %s", record.Header.Name) + return fmt.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 fmt.Errorf("no content to write to record with non-zero size for %s", record.Header.Name) } } return nil diff --git a/images/archive/importer.go b/images/archive/importer.go index 82d96c9cfb323..c531049508416 100644 --- a/images/archive/importer.go +++ b/images/archive/importer.go @@ -22,6 +22,7 @@ import ( "bytes" "context" "encoding/json" + "errors" "fmt" "io" "path" @@ -35,7 +36,6 @@ import ( 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 { @@ -104,16 +104,16 @@ func ImportIndex(ctx context.Context, store content.Store, reader io.Reader, opt 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) + return ocispec.Descriptor{}, fmt.Errorf("untar oci layout %q: %w", hdr.Name, err) } } else if hdrName == "manifest.json" { if err = onUntarJSON(tr, &mfsts); err != nil { - return ocispec.Descriptor{}, errors.Wrapf(err, "untar manifest %q", hdr.Name) + return ocispec.Descriptor{}, fmt.Errorf("untar manifest %q: %w", hdr.Name, err) } } 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) + return ocispec.Descriptor{}, fmt.Errorf("failed to ingest %q: %w", hdr.Name, err) } blobs[hdrName] = ocispec.Descriptor{ @@ -128,12 +128,12 @@ func ImportIndex(ctx context.Context, store content.Store, reader io.Reader, opt // 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) + return ocispec.Descriptor{}, fmt.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) + return ocispec.Descriptor{}, fmt.Errorf("missing index.json in OCI layout %s", ocispec.ImageLayoutVersion) } idx.MediaType = ocispec.MediaTypeImageIndex @@ -147,7 +147,7 @@ func ImportIndex(ctx context.Context, store content.Store, reader io.Reader, opt 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) + return ocispec.Descriptor{}, fmt.Errorf("no target for symlink layer from %q to %q", name, linkname) } blobs[name] = desc } @@ -160,13 +160,13 @@ func ImportIndex(ctx context.Context, store content.Store, reader io.Reader, opt for _, mfst := range mfsts { config, ok := blobs[mfst.Config] if !ok { - return ocispec.Descriptor{}, errors.Errorf("image config %q not found", mfst.Config) + return ocispec.Descriptor{}, fmt.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") + return ocispec.Descriptor{}, fmt.Errorf("failed to resolve layers: %w", err) } manifest := struct { @@ -183,12 +183,12 @@ func ImportIndex(ctx context.Context, store content.Store, reader io.Reader, opt desc, err := writeManifest(ctx, store, manifest, manifest.MediaType) if err != nil { - return ocispec.Descriptor{}, errors.Wrap(err, "write docker manifest") + return ocispec.Descriptor{}, fmt.Errorf("write docker manifest: %w", err) } imgPlatforms, err := images.Platforms(ctx, store, desc) if err != nil { - return ocispec.Descriptor{}, errors.Wrap(err, "unable to resolve platform") + return ocispec.Descriptor{}, fmt.Errorf("unable to resolve platform: %w", err) } if len(imgPlatforms) > 0 { // Only one platform can be resolved from non-index manifest, @@ -257,7 +257,7 @@ func resolveLayers(ctx context.Context, store content.Store, layerFiles []string for i, f := range layerFiles { desc, ok := blobs[f] if !ok { - return nil, errors.Errorf("layer %q not found", f) + return nil, fmt.Errorf("layer %q not found", f) } layers[i] = desc descs[desc.Digest] = &layers[i] @@ -269,15 +269,19 @@ func resolveLayers(ctx context.Context, store content.Store, layerFiles []string if ok { desc := descs[digest.Digest(dgst)] if desc != nil { - desc.MediaType = images.MediaTypeDockerSchema2LayerGzip desc.Digest = info.Digest desc.Size = info.Size + mediaType, err := detectLayerMediaType(ctx, store, *desc) + if err != nil { + return fmt.Errorf("failed to detect media type of layer: %w", err) + } + desc.MediaType = mediaType } } return nil }, filters...) if err != nil { - return nil, errors.Wrap(err, "failure checking for compressed blobs") + return nil, fmt.Errorf("failure checking for compressed blobs: %w", err) } for i, desc := range layers { @@ -287,12 +291,12 @@ func resolveLayers(ctx context.Context, store content.Store, layerFiles []string // 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) + return nil, fmt.Errorf("failed to open %q (%s): %w", layerFiles[i], desc.Digest, err) } s, err := compression.DecompressStream(content.NewReader(ra)) if err != nil { ra.Close() - return nil, errors.Wrapf(err, "failed to detect compression for %q", layerFiles[i]) + return nil, fmt.Errorf("failed to detect compression for %q: %w", layerFiles[i], err) } if s.GetCompression() == compression.Uncompressed { if compress { @@ -322,7 +326,7 @@ func resolveLayers(ctx context.Context, store content.Store, layerFiles []string 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") + return ocispec.Descriptor{}, fmt.Errorf("failed to open writer: %w", err) } defer func() { @@ -332,7 +336,7 @@ func compressBlob(ctx context.Context, cs content.Store, r io.Reader, ref string } }() if err := w.Truncate(0); err != nil { - return ocispec.Descriptor{}, errors.Wrap(err, "failed to truncate writer") + return ocispec.Descriptor{}, fmt.Errorf("failed to truncate writer: %w", err) } cw, err := compression.CompressStream(w, compression.Gzip) @@ -349,7 +353,7 @@ func compressBlob(ctx context.Context, cs content.Store, r io.Reader, ref string cst, err := w.Status() if err != nil { - return ocispec.Descriptor{}, errors.Wrap(err, "failed to get writer status") + return ocispec.Descriptor{}, fmt.Errorf("failed to get writer status: %w", err) } desc.Digest = w.Digest() @@ -357,7 +361,7 @@ func compressBlob(ctx context.Context, cs content.Store, r io.Reader, ref string 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 ocispec.Descriptor{}, fmt.Errorf("failed to commit: %w", err) } } @@ -381,3 +385,29 @@ func writeManifest(ctx context.Context, cs content.Ingester, manifest interface{ return desc, nil } + +func detectLayerMediaType(ctx context.Context, store content.Store, desc ocispec.Descriptor) (string, error) { + var mediaType string + // need to parse existing blob to use the proper media type + bytes := make([]byte, 10) + ra, err := store.ReaderAt(ctx, desc) + if err != nil { + return "", fmt.Errorf("failed to read content store to detect layer media type: %w", err) + } + defer ra.Close() + _, err = ra.ReadAt(bytes, 0) + if err != nil && err != io.EOF { + return "", fmt.Errorf("failed to read header bytes from layer to detect media type: %w", err) + } + if err == io.EOF { + // in the case of an empty layer then the media type should be uncompressed + return images.MediaTypeDockerSchema2Layer, nil + } + switch c := compression.DetectCompression(bytes); c { + case compression.Uncompressed: + mediaType = images.MediaTypeDockerSchema2Layer + default: + mediaType = images.MediaTypeDockerSchema2LayerGzip + } + return mediaType, nil +} diff --git a/images/archive/reference.go b/images/archive/reference.go index ce9fe98f91b03..ba19b111f11c0 100644 --- a/images/archive/reference.go +++ b/images/archive/reference.go @@ -17,12 +17,12 @@ package archive import ( + "fmt" "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 @@ -72,7 +72,7 @@ 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 "", fmt.Errorf("normalize image ref %q: %w", ref, err) } return normalized.String(), nil @@ -81,7 +81,7 @@ func normalizeReference(ref string) (string, error) { func familiarizeReference(ref string) (string, error) { named, err := distref.ParseNormalizedNamed(ref) if err != nil { - return "", errors.Wrapf(err, "failed to parse %q", ref) + return "", fmt.Errorf("failed to parse %q: %w", ref, err) } named = distref.TagNameOnly(named) diff --git a/images/handlers.go b/images/handlers.go index c30d82effd676..077d88e787746 100644 --- a/images/handlers.go +++ b/images/handlers.go @@ -18,6 +18,7 @@ package images import ( "context" + "errors" "fmt" "sort" @@ -25,7 +26,6 @@ import ( "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" ) @@ -308,7 +308,7 @@ func LimitManifests(f HandlerFunc, m platforms.MatchComparer, n int) HandlerFunc if n > 0 { if len(children) == 0 { - return children, errors.Wrap(errdefs.ErrNotFound, "no match for platform in manifest") + return children, fmt.Errorf("no match for platform in manifest: %w", errdefs.ErrNotFound) } if len(children) > n { children = children[:n] diff --git a/images/image.go b/images/image.go index 2e5cd61c9a7aa..d45afe482c900 100644 --- a/images/image.go +++ b/images/image.go @@ -29,7 +29,6 @@ import ( "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. @@ -115,7 +114,7 @@ func (image *Image) Size(ctx context.Context, provider content.Provider, platfor 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) + return nil, fmt.Errorf("invalid size %v in %v (%v)", desc.Size, desc.Digest, desc.MediaType) } size += desc.Size return nil, nil @@ -156,7 +155,7 @@ func Manifest(ctx context.Context, provider content.Provider, image ocispec.Desc } if err := validateMediaType(p, desc.MediaType); err != nil { - return nil, errors.Wrapf(err, "manifest: invalid desc %s", desc.Digest) + return nil, fmt.Errorf("manifest: invalid desc %s: %w", desc.Digest, err) } var manifest ocispec.Manifest @@ -200,7 +199,7 @@ func Manifest(ctx context.Context, provider content.Provider, image ocispec.Desc } if err := validateMediaType(p, desc.MediaType); err != nil { - return nil, errors.Wrapf(err, "manifest: invalid desc %s", desc.Digest) + return nil, fmt.Errorf("manifest: invalid desc %s: %w", desc.Digest, err) } var idx ocispec.Index @@ -236,15 +235,15 @@ func Manifest(ctx context.Context, provider content.Provider, image ocispec.Desc } return descs, nil } - return nil, errors.Wrapf(errdefs.ErrNotFound, "unexpected media type %v for %v", desc.MediaType, desc.Digest) + return nil, fmt.Errorf("unexpected media type %v for %v: %w", desc.MediaType, desc.Digest, errdefs.ErrNotFound) }), image); err != nil { return ocispec.Manifest{}, err } if len(m) == 0 { - err := errors.Wrapf(errdefs.ErrNotFound, "manifest %v", image.Digest) + err := fmt.Errorf("manifest %v: %w", image.Digest, errdefs.ErrNotFound) if wasIndex { - err = errors.Wrapf(errdefs.ErrNotFound, "no match for platform in manifest %v", image.Digest) + err = fmt.Errorf("no match for platform in manifest %v: %w", image.Digest, errdefs.ErrNotFound) } return ocispec.Manifest{}, err } @@ -309,7 +308,7 @@ func Check(ctx context.Context, provider content.Provider, image ocispec.Descrip 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) + return false, nil, nil, nil, fmt.Errorf("failed to check image %v: %w", image.Digest, err) } // TODO(stevvooe): It is possible that referenced conponents could have @@ -324,7 +323,7 @@ func Check(ctx context.Context, provider content.Provider, image ocispec.Descrip missing = append(missing, desc) continue } else { - return false, nil, nil, nil, errors.Wrapf(err, "failed to check image %v", desc.Digest) + return false, nil, nil, nil, fmt.Errorf("failed to check image %v: %w", desc.Digest, err) } } ra.Close() @@ -346,7 +345,7 @@ func Children(ctx context.Context, provider content.Provider, desc ocispec.Descr } if err := validateMediaType(p, desc.MediaType); err != nil { - return nil, errors.Wrapf(err, "children: invalid desc %s", desc.Digest) + return nil, fmt.Errorf("children: invalid desc %s: %w", desc.Digest, err) } // TODO(stevvooe): We just assume oci manifest, for now. There may be @@ -365,7 +364,7 @@ func Children(ctx context.Context, provider content.Provider, desc ocispec.Descr } if err := validateMediaType(p, desc.MediaType); err != nil { - return nil, errors.Wrapf(err, "children: invalid desc %s", desc.Digest) + return nil, fmt.Errorf("children: invalid desc %s: %w", desc.Digest, err) } var index ocispec.Index diff --git a/images/mediatypes.go b/images/mediatypes.go index 785d71291e29f..671e160e15d2e 100644 --- a/images/mediatypes.go +++ b/images/mediatypes.go @@ -18,12 +18,12 @@ package images import ( "context" + "fmt" "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. @@ -87,7 +87,7 @@ func DiffCompression(ctx context.Context, mediaType string) (string, error) { } return "", nil default: - return "", errors.Wrapf(errdefs.ErrNotImplemented, "unrecognised mediatype %s", mediaType) + return "", fmt.Errorf("unrecognised mediatype %s: %w", mediaType, errdefs.ErrNotImplemented) } } diff --git a/install.go b/install.go index 274f42c2a045c..16cff08d24abe 100644 --- a/install.go +++ b/install.go @@ -19,6 +19,8 @@ package containerd import ( "archive/tar" "context" + "errors" + "fmt" "os" "path/filepath" "runtime" @@ -28,7 +30,6 @@ import ( "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 @@ -82,7 +83,7 @@ func (c *Client) Install(ctx context.Context, image Image, opts ...InstallOpts) } 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 false, fmt.Errorf("cannot replace %s in %s", hdr.Name, path) } } return result, nil diff --git a/integration/client/client_windows_test.go b/integration/client/client_windows_test.go index 2d401de4d7d0f..2ee38721e8815 100644 --- a/integration/client/client_windows_test.go +++ b/integration/client/client_windows_test.go @@ -57,18 +57,14 @@ func init() { testImage = "mcr.microsoft.com/windows/nanoserver:2004" case osversion.V20H2: testImage = "mcr.microsoft.com/windows/nanoserver:20H2" - case 20348: - // 20348 is Windows server 2022's build number. - // - // TODO(dcantah): Use the hardcoded number until there's an hcsshim release with this build - // number included. + case osversion.V21H2Server: testImage = "mcr.microsoft.com/windows/nanoserver:ltsc2022" default: // Due to some efforts in improving down-level compatibility for Windows containers (see // https://techcommunity.microsoft.com/t5/containers/windows-server-2022-and-beyond-for-containers/ba-p/2712487) - // the ltsc2022 image should continue to work on builds ws2022 and onwards (Winodws 11 for example). With this in mind, + // the ltsc2022 image should continue to work on builds ws2022 and onwards (Windows 11 for example). With this in mind, // if there's no mapping for the host build just use the Windows Server 2022 image. - if b > 20348 { + if b > osversion.V21H2Server { testImage = "mcr.microsoft.com/windows/nanoserver:ltsc2022" return } diff --git a/integration/client/container_linux_test.go b/integration/client/container_linux_test.go index c7a74353d3f0b..ac6d2ea34facf 100644 --- a/integration/client/container_linux_test.go +++ b/integration/client/container_linux_test.go @@ -445,76 +445,6 @@ func getRuntimeVersion() string { } } -func TestContainerPTY(t *testing.T) { - t.Parallel() - - client, err := newClient(t, address) - if err != nil { - t.Fatal(err) - } - defer client.Close() - - var ( - image Image - ctx, cancel = testContext(t) - id = t.Name() - ) - defer cancel() - - image, err = client.GetImage(ctx, testImage) - if err != nil { - t.Fatal(err) - } - - container, err := client.NewContainer(ctx, id, WithNewSnapshot(id, image), WithNewSpec(oci.WithImageConfig(image), oci.WithTTY, withProcessArgs("echo", "hello"))) - if err != nil { - t.Fatal(err) - } - defer container.Delete(ctx, WithSnapshotCleanup) - - direct, err := newDirectIO(ctx, true) - if err != nil { - t.Fatal(err) - } - defer direct.Delete() - var ( - wg sync.WaitGroup - buf = bytes.NewBuffer(nil) - ) - wg.Add(1) - go func() { - defer wg.Done() - io.Copy(buf, direct.Stdout) - }() - - task, err := container.NewTask(ctx, direct.IOCreate) - if err != nil { - t.Fatal(err) - } - defer task.Delete(ctx) - - status, err := task.Wait(ctx) - if err != nil { - t.Error(err) - } - - if err := task.Start(ctx); err != nil { - t.Fatal(err) - } - - <-status - wg.Wait() - - if err := direct.Close(); err != nil { - t.Error(err) - } - - out := buf.String() - if !strings.ContainsAny(fmt.Sprintf("%#q", out), `\x00`) { - t.Fatal(`expected \x00 in output`) - } -} - func TestContainerAttach(t *testing.T) { t.Parallel() @@ -620,75 +550,6 @@ func TestContainerAttach(t *testing.T) { } } -func TestContainerUsername(t *testing.T) { - t.Parallel() - - client, err := newClient(t, address) - if err != nil { - t.Fatal(err) - } - defer client.Close() - - var ( - image Image - ctx, cancel = testContext(t) - id = t.Name() - ) - defer cancel() - - image, err = client.GetImage(ctx, testImage) - if err != nil { - t.Fatal(err) - } - direct, err := newDirectIO(ctx, false) - if err != nil { - t.Fatal(err) - } - defer direct.Delete() - var ( - wg sync.WaitGroup - buf = bytes.NewBuffer(nil) - ) - wg.Add(1) - go func() { - defer wg.Done() - io.Copy(buf, direct.Stdout) - }() - - // the www-data user in the busybox image has a uid of 33 - container, err := client.NewContainer(ctx, id, - WithNewSnapshot(id, image), - WithNewSpec(oci.WithImageConfig(image), oci.WithUsername("www-data"), oci.WithProcessArgs("id", "-u")), - ) - if err != nil { - t.Fatal(err) - } - defer container.Delete(ctx, WithSnapshotCleanup) - - task, err := container.NewTask(ctx, direct.IOCreate) - if err != nil { - t.Fatal(err) - } - defer task.Delete(ctx) - - statusC, err := task.Wait(ctx) - if err != nil { - t.Fatal(err) - } - - if err := task.Start(ctx); err != nil { - t.Fatal(err) - } - <-statusC - - wg.Wait() - - output := strings.TrimSuffix(buf.String(), "\n") - if output != "33" { - t.Errorf("expected www-data uid to be 33 but received %q", output) - } -} - func TestContainerUser(t *testing.T) { t.Parallel() t.Run("UserNameAndGroupName", func(t *testing.T) { testContainerUser(t, "www-data:www-data", "33:33") }) diff --git a/integration/client/container_test.go b/integration/client/container_test.go index b01a84c218213..ed93bc2f1b333 100644 --- a/integration/client/container_test.go +++ b/integration/client/container_test.go @@ -46,7 +46,6 @@ import ( "github.com/containerd/typeurl" gogotypes "github.com/gogo/protobuf/types" specs "github.com/opencontainers/runtime-spec/specs-go" - "github.com/pkg/errors" exec "golang.org/x/sys/execabs" ) @@ -1903,7 +1902,7 @@ func TestRegressionIssue4769(t *testing.T) { select { case et := <-statusC: if got := et.ExitCode(); got != 0 { - t.Fatal(errors.Errorf("expect zero exit status, but got %v", got)) + t.Fatal(fmt.Errorf("expect zero exit status, but got %v", got)) } case <-time.After(timeout): t.Fatal(fmt.Errorf("failed to get exit event in time")) @@ -1913,21 +1912,21 @@ func TestRegressionIssue4769(t *testing.T) { select { case et := <-eventStream: if et.Event == nil { - t.Fatal(errors.Errorf("unexpected empty event: %+v", et)) + t.Fatal(fmt.Errorf("unexpected empty event: %+v", et)) } v, err := typeurl.UnmarshalAny(et.Event) if err != nil { - t.Fatal(errors.Wrap(err, "failed to unmarshal event")) + t.Fatal(fmt.Errorf("failed to unmarshal event: %w", err)) } if e, ok := v.(*apievents.TaskExit); !ok { - t.Fatal(errors.Errorf("unexpected event type: %+v", v)) + t.Fatal(fmt.Errorf("unexpected event type: %+v", v)) } else if e.ExitStatus != 0 { - t.Fatal(errors.Errorf("expect zero exit status, but got %v", e.ExitStatus)) + t.Fatal(fmt.Errorf("expect zero exit status, but got %v", e.ExitStatus)) } case err := <-errC: - t.Fatal(errors.Wrap(err, "unexpected error from event service")) + t.Fatal(fmt.Errorf("unexpected error from event service: %w", err)) case <-time.After(timeout): t.Fatal(fmt.Errorf("failed to get exit event in time")) @@ -1940,9 +1939,70 @@ func TestRegressionIssue4769(t *testing.T) { // check duplicate event should not show up select { case event := <-eventStream: - t.Fatal(errors.Errorf("unexpected exit event: %+v", event)) + t.Fatal(fmt.Errorf("unexpected exit event: %+v", event)) case err := <-errC: - t.Fatal(errors.Wrap(err, "unexpected error from event service")) + t.Fatal(fmt.Errorf("unexpected error from event service: %w", err)) + case <-time.After(timeout): + } +} + +// TestRegressionIssue6429 should not send exit event out if command is not found. +// +// Issue: https://github.com/containerd/containerd/issues/6429. +func TestRegressionIssue6429(t *testing.T) { + t.Parallel() + + if runtime.GOOS == "windows" { + t.Skip("Test relies on runc") + } + + client, err := newClient(t, address) + if err != nil { + t.Fatal(err) + } + defer client.Close() + + // use unique namespace to get unique task events + id := t.Name() + ns := fmt.Sprintf("%s-%s", testNamespace, id) + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + ctx = namespaces.WithNamespace(ctx, ns) + ctx = logtest.WithT(ctx, t) + + image, err := client.Pull(ctx, testImage, WithPullUnpack) + if err != nil { + t.Fatal(err) + } + defer client.ImageService().Delete(ctx, testImage, images.SynchronousDelete()) + + container, err := client.NewContainer(ctx, id, + WithNewSnapshot(id, image), + WithNewSpec(oci.WithImageConfig(image), withProcessArgs("notfound404")), + WithRuntime(client.Runtime(), nil), + ) + if err != nil { + t.Fatal(err) + } + defer container.Delete(ctx, WithSnapshotCleanup) + + eventStream, errC := client.EventService().Subscribe(ctx, "namespace=="+ns+",topic~=|^/tasks/exit|") + + if _, err := container.NewTask(ctx, empty()); err == nil { + t.Fatalf("expected error but got nil") + } + + var timeout = 10 * time.Second + + // start to check events + select { + case et := <-eventStream: + t.Fatal(fmt.Errorf("unexpected task exit event: %+v", et)) + case err := <-errC: + t.Fatal(fmt.Errorf("unexpected error from event service: %w", err)) + case <-time.After(timeout): } } @@ -2358,3 +2418,127 @@ func TestTaskSpec(t *testing.T) { } <-statusC } + +func TestContainerUsername(t *testing.T) { + t.Parallel() + + client, err := newClient(t, address) + if err != nil { + t.Fatal(err) + } + defer client.Close() + + var ( + image Image + ctx, cancel = testContext(t) + id = t.Name() + ) + defer cancel() + + image, err = client.GetImage(ctx, testImage) + if err != nil { + t.Fatal(err) + } + + username := "www-data" + command := []string{ + "id", "-u", + } + expectedOutput := "33" + if runtime.GOOS == "windows" { + username = "ContainerUser" + command = []string{ + "echo", `%USERNAME%`, + } + expectedOutput = "ContainerUser" + } + + // the www-data user in the busybox image has a uid of 33 + container, err := client.NewContainer(ctx, id, + WithNewSnapshot(id, image), + WithNewSpec(oci.WithImageConfig(image), oci.WithUsername(username), withProcessArgs(command...)), + ) + if err != nil { + t.Fatal(err) + } + defer container.Delete(ctx, WithSnapshotCleanup) + + buf := bytes.NewBuffer(nil) + task, err := container.NewTask(ctx, cio.NewCreator(withByteBuffers(buf))) + if err != nil { + t.Fatal(err) + } + + statusC, err := task.Wait(ctx) + if err != nil { + t.Fatal(err) + } + + if err := task.Start(ctx); err != nil { + t.Fatal(err) + } + <-statusC + if _, err := task.Delete(ctx); err != nil { + t.Fatal(err) + } + + output := strings.TrimSuffix(buf.String(), newLine) + if output != expectedOutput { + t.Errorf("expected %s uid to be %s but received %q", username, expectedOutput, buf.String()) + } +} + +func TestContainerPTY(t *testing.T) { + t.Parallel() + + client, err := newClient(t, address) + if err != nil { + t.Fatal(err) + } + defer client.Close() + + var ( + image Image + ctx, cancel = testContext(t) + id = t.Name() + ) + defer cancel() + + image, err = client.GetImage(ctx, testImage) + if err != nil { + t.Fatal(err) + } + + container, err := client.NewContainer(ctx, id, WithNewSnapshot(id, image), WithNewSpec(oci.WithImageConfig(image), oci.WithTTY, withProcessArgs("echo", "hello"))) + if err != nil { + t.Fatal(err) + } + defer container.Delete(ctx, WithSnapshotCleanup) + + buf := bytes.NewBuffer(nil) + task, err := container.NewTask(ctx, cio.NewCreator(withByteBuffers(buf), withProcessTTY())) + if err != nil { + t.Fatal(err) + } + defer task.Delete(ctx) + + statusC, err := task.Wait(ctx) + if err != nil { + t.Error(err) + } + + if err := task.Start(ctx); err != nil { + t.Fatal(err) + } + + <-statusC + + if _, err := task.Delete(ctx); err != nil { + t.Fatal(err) + } + + out := buf.String() + if !strings.ContainsAny(fmt.Sprintf("%#q", out), `\x00`) { + t.Fatal(`expected \x00 in output`) + } +} diff --git a/integration/client/content_test.go b/integration/client/content_test.go index c4aa1c03f628d..6ad760e47e5b2 100644 --- a/integration/client/content_test.go +++ b/integration/client/content_test.go @@ -27,7 +27,6 @@ import ( "github.com/containerd/containerd/content/testsuite" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/namespaces" - "github.com/pkg/errors" ) func newContentStore(ctx context.Context, root string) (context.Context, content.Store, func() error, error) { @@ -59,7 +58,7 @@ func newContentStore(ctx context.Context, root string) (context.Context, content } for _, st := range statuses { if err := cs.Abort(ctx, st.Ref); err != nil && !errdefs.IsNotFound(err) { - return errors.Wrapf(err, "failed to abort %s", st.Ref) + return fmt.Errorf("failed to abort %s: %w", st.Ref, err) } } err = cs.Walk(ctx, func(info content.Info) error { diff --git a/integration/client/daemon_test.go b/integration/client/daemon_test.go index a7d67be5f2157..8b7e22fc794b3 100644 --- a/integration/client/daemon_test.go +++ b/integration/client/daemon_test.go @@ -18,13 +18,14 @@ package client import ( "context" + "errors" + "fmt" "io" "runtime" "sync" "syscall" . "github.com/containerd/containerd" - "github.com/pkg/errors" exec "golang.org/x/sys/execabs" ) @@ -46,7 +47,7 @@ func (d *daemon) start(name, address string, args []string, stdout, stderr io.Wr cmd.Stderr = stderr if err := cmd.Start(); err != nil { cmd.Wait() - return errors.Wrap(err, "failed to start daemon") + return fmt.Errorf("failed to start daemon: %w", err) } d.addr = address d.cmd = cmd @@ -117,7 +118,7 @@ func (d *daemon) Restart(stopCb func()) error { } var err error if err = d.cmd.Process.Signal(signal); err != nil { - return errors.Wrap(err, "failed to signal daemon") + return fmt.Errorf("failed to signal daemon: %w", err) } d.cmd.Wait() @@ -131,7 +132,7 @@ func (d *daemon) Restart(stopCb func()) error { cmd.Stderr = d.cmd.Stderr if err := cmd.Start(); err != nil { cmd.Wait() - return errors.Wrap(err, "failed to start new daemon instance") + return fmt.Errorf("failed to start new daemon instance: %w", err) } d.cmd = cmd diff --git a/integration/client/go.mod b/integration/client/go.mod index 9cee7e421bab8..618ee8f932d40 100644 --- a/integration/client/go.mod +++ b/integration/client/go.mod @@ -3,12 +3,11 @@ module github.com/containerd/containerd/integration/client go 1.15 require ( - github.com/Microsoft/hcsshim v0.9.1 + github.com/Microsoft/hcsshim v0.9.2 github.com/Microsoft/hcsshim/test v0.0.0-20210408205431-da33ecd607e1 - github.com/containerd/cgroups v1.0.2 + github.com/containerd/cgroups v1.0.3 // the actual version of containerd is replaced with the code at the root of this repository - github.com/containerd/containerd v1.5.7 - github.com/containerd/containerd/api v1.6.0-beta.3 + github.com/containerd/containerd v1.5.8 github.com/containerd/go-runc v1.0.0 github.com/containerd/ttrpc v1.1.0 github.com/containerd/typeurl v1.0.2 @@ -16,7 +15,6 @@ require ( github.com/opencontainers/go-digest v1.0.0 github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5 github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 - github.com/pkg/errors v0.9.1 github.com/sirupsen/logrus v1.8.1 golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e gotest.tools/v3 v3.0.3 @@ -29,7 +27,6 @@ replace ( // in the "require" section above are still taken into account for version // resolution if newer. github.com/containerd/containerd => ../../ - github.com/containerd/containerd/api => ../../api // Replace rules below must be kept in sync with the main go.mod file at the // root, because that's the actual version expected by the "containerd/containerd" diff --git a/integration/client/go.sum b/integration/client/go.sum index eecdc5d835cad..07505df0a68cd 100644 --- a/integration/client/go.sum +++ b/integration/client/go.sum @@ -14,8 +14,12 @@ cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bP cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0 h1:Dg9iHVQfrhq82rUNu9ZxUDrJLaxFUe/HlCVaLyRruq8= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -50,15 +54,14 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.4.17-0.20210211115548-6eac466e5fa3/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.4.17-0.20210324224401-5516f17a5958/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.4.17/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.5.1 h1:aPJp2QD7OOrhO5tQXqQoGSJc+DjDtWTGLOmNyAm6FgY= github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/hcsshim v0.8.15/go.mod h1:x38A4YbHbdxJtc0sF6oIz+RG0npwSCAvn69iY6URG00= -github.com/Microsoft/hcsshim v0.8.16/go.mod h1:o5/SZqmR7x9JNKsW3pu+nqHm0MF8vbA+VxGOoXdC600= github.com/Microsoft/hcsshim v0.8.20/go.mod h1:+w2gRZ5ReXQhFOrvSQeNfhrYB/dg3oDwTOcER2fw4I4= -github.com/Microsoft/hcsshim v0.9.1 h1:VfDCj+QnY19ktX5TsH22JHcjaZ05RWQiwDbOyEg5ziM= -github.com/Microsoft/hcsshim v0.9.1/go.mod h1:Y/0uV2jUab5kBI7SQgl62at0AVX7uaruzADAVmxm3eM= +github.com/Microsoft/hcsshim v0.8.23/go.mod h1:4zegtUJth7lAvFyc6cH2gGQ5B3OFQim01nnU2M8jKDg= +github.com/Microsoft/hcsshim v0.9.2 h1:wB06W5aYFfUB3IvootYAY2WnOmIdgPGfqSI6tufQNnY= +github.com/Microsoft/hcsshim v0.9.2/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc= github.com/Microsoft/hcsshim/test v0.0.0-20210408205431-da33ecd607e1 h1:pVKfKyPkXna29XlGjxSr9J0A7vNucOUHZ/2ClcTWalw= github.com/Microsoft/hcsshim/test v0.0.0-20210408205431-da33ecd607e1/go.mod h1:Cmvnhlie15Ha2UYrJs9EhgSx76Bq9RV2FgfEiT78GhI= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= @@ -85,7 +88,6 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bits-and-blooms/bitset v1.2.0 h1:Kn4yilvwNtMACtf1eYDlG8H77R07mZSPbMjLyS07ChA= github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= @@ -99,16 +101,18 @@ github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghf github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= +github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775/go.mod h1:7cR51M8ViRLIdUjrmSXlK9pkrsDlLHbO8jiB8X8JnOc= -github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= github.com/cilium/ebpf v0.4.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= -github.com/cilium/ebpf v0.6.2 h1:iHsfF/t4aW4heW2YKfeHrVPGdtYTL4C4KocpM8KTSnI= github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= +github.com/cilium/ebpf v0.7.0 h1:1k/q3ATgxSXRdrmPfH8d7YK0GfqVsEKZAX9dQZvs56k= +github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2usCA= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= @@ -121,26 +125,27 @@ github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u9 github.com/containerd/aufs v1.0.0/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= github.com/containerd/btrfs v1.0.0/go.mod h1:zMcX3qkXTAi9GI50+0HOeuV8LU2ryCE/V2vG/ZBiTss= github.com/containerd/cgroups v0.0.0-20200824123100-0b889c03f102/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo= -github.com/containerd/cgroups v0.0.0-20210114181951-8a68de567b68/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE= github.com/containerd/cgroups v1.0.1/go.mod h1:0SJrPIenamHDcZhEcJMNBB85rHcUsw4f25ZfBiPYRkU= -github.com/containerd/cgroups v1.0.2 h1:mZBclaSgNDfPWtfhj2xJY28LZ9nYIgzB0pwSURPl6JM= -github.com/containerd/cgroups v1.0.2/go.mod h1:qpbpJ1jmlqsR9f2IyaLPsdkCdnt0rbDVqIDlhuu5tRY= +github.com/containerd/cgroups v1.0.3 h1:ADZftAkglvCiD44c77s5YmMqaP2pzVCFZvBmAlBdAP4= +github.com/containerd/cgroups v1.0.3/go.mod h1:/ofk34relqNjSGyqPrmEULrO4Sc8LJhvJmWbUCUKqj8= github.com/containerd/console v0.0.0-20191206165004-02ecf6a7291e/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE= github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw= github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8acV1PGKCbzQ= github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw= github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e/go.mod h1:EXlVlkqNba9rJe3j7w3Xa924itAMLgZH4UD/Q4PExuQ= -github.com/containerd/continuity v0.2.2-0.20211201162329-8e53e7cac79d h1:X5aD4AgIfNi00260miYN8nCzxPQCusmnNapaphze0FM= -github.com/containerd/continuity v0.2.2-0.20211201162329-8e53e7cac79d/go.mod h1:pWygW9u7LtS1o4N/Tn0FoCFDIXZ7rxcMX7HX1Dmibvk= +github.com/containerd/continuity v0.1.0/go.mod h1:ICJu0PwR54nI0yPEnJ6jcS+J7CZAUXrLh8lPo2knzsM= +github.com/containerd/continuity v0.2.2 h1:QSqfxcn8c+12slxwu00AtzXrsami0MJb/MQs9lOLHLA= +github.com/containerd/continuity v0.2.2/go.mod h1:pWygW9u7LtS1o4N/Tn0FoCFDIXZ7rxcMX7HX1Dmibvk= github.com/containerd/fifo v1.0.0 h1:6PirWBr9/L7GDamKr+XM0IeUFXu5mf3M/BPpH9gaLBU= github.com/containerd/fifo v1.0.0/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= -github.com/containerd/go-cni v1.1.1-0.20211026134925-aa8bf14323a5/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA= +github.com/containerd/go-cni v1.1.0/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA= +github.com/containerd/go-cni v1.1.3/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA= github.com/containerd/go-runc v0.0.0-20200220073739-7016d3ce2328/go.mod h1:PpyHrqVs8FTi9vpyHwPwiNEGaACDxT/N/pLcvMSRA9g= github.com/containerd/go-runc v0.0.0-20201020171139-16b287bc67d0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= github.com/containerd/go-runc v1.0.0 h1:oU+lLv1ULm5taqgV/CJivypVODI4SUz1znWjv3nNYS0= github.com/containerd/go-runc v1.0.0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= -github.com/containerd/imgcrypt v1.1.1/go.mod h1:xpLnwiQmEUJPvQoAapeb2SNCxz7Xr6PJrXQb0Dpc4ms= +github.com/containerd/imgcrypt v1.1.3/go.mod h1:/TPA1GIDXMzbj01yd8pIbQiLdQxed5ue1wb8bP7PQu4= github.com/containerd/nri v0.1.0/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= github.com/containerd/stargz-snapshotter/estargz v0.4.1/go.mod h1:x7Q9dg9QYb4+ELgxmo4gBUeJB0tl5dqH1Sdz0nJU1QM= github.com/containerd/ttrpc v1.0.2/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y= @@ -152,7 +157,7 @@ github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcD github.com/containerd/zfs v1.0.0/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= github.com/containernetworking/cni v1.0.1/go.mod h1:AKuhXbN5EzmD4yTNtfSsX3tPcmtrBI6QcRV0NiNt15Y= github.com/containernetworking/plugins v1.0.1/go.mod h1:QHCfGpaTwYTbbH+nZXKVTxNBDZcxSOplJT5ico8/FLE= -github.com/containers/ocicrypt v1.1.1/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= +github.com/containers/ocicrypt v1.1.2/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -172,6 +177,7 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsr github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= +github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c/go.mod h1:Ct2BUK8SB0YC1SMSibvLzxjeJLnrYEVLULFNiHY9YfQ= github.com/d2g/dhcp4client v1.0.0/go.mod h1:j0hNfjhrt2SxUOw55nL0ATM/z4Yt3t2Kd1mW34z5W5s= github.com/d2g/dhcp4server v0.0.0-20181031114812-7d4a0a7f59a5/go.mod h1:Eo87+Kg/IX2hfWJfwxMzLyuSZyxSoAug2nGa1G2QAi8= @@ -198,6 +204,7 @@ github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= @@ -227,13 +234,10 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v1.0.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.1/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.2 h1:ahHml/yUpnlb96Rp8HCvtYVPY8ZYpxq3g7UYchIYwbs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.0/go.mod h1:YkVgnZu1ZjjL7xTxrfm/LLZBfkhTqSR1ydtm6jTKKwI= -github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= @@ -252,8 +256,9 @@ github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/godbus/dbus/v5 v5.0.4 h1:9349emZab16e7zQvpmsbtjc18ykshndd8y2PG3sgJbA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/godbus/dbus/v5 v5.0.6 h1:mkgN1ofwASrYnJ5W6U/BxG15eXXXjirgZc7CLqkcaro= +github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/googleapis v1.3.2 h1:kX1es4djPJrsDhY7aZKJy7aZasdcB5oSOEphMjSB53c= github.com/gogo/googleapis v1.3.2/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -275,6 +280,7 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -305,6 +311,7 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= @@ -315,6 +322,7 @@ github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= @@ -322,6 +330,10 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -366,6 +378,7 @@ github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2p github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= @@ -381,6 +394,7 @@ github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCV github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= @@ -445,6 +459,7 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= @@ -476,16 +491,17 @@ github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zM github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5 h1:q37d91F6BO4Jp1UqWiun0dUFYaqv6WsKTLTCaWv+8LY= github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= -github.com/opencontainers/runc v1.0.3 h1:1hbqejyQWCJBvtKAfdO0b1FmaEf2z/bxnjqbARass5k= -github.com/opencontainers/runc v1.0.3/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= +github.com/opencontainers/runc v1.1.0 h1:O9+X96OcDjkmmZyfaG996kV7yq8HsoU2h1XRRQcefG8= +github.com/opencontainers/runc v1.1.0/go.mod h1:Tj1hFw6eFWp/o33uxGf5yF2BX5yz2Z6iptFpuvbbKqc= github.com/opencontainers/runtime-spec v1.0.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 h1:3snG66yBm59tKhhSPQrQ/0bCrv1LQbKt40LnUPiUxdc= github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs= -github.com/opencontainers/selinux v1.8.2 h1:c4ca10UMgRcvZ6h0K4HtS15UaVSBEaE+iln2LVpAuGc= github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= +github.com/opencontainers/selinux v1.10.0 h1:rAiKF8hTcgLI3w0DHm6i0ylVVcOrlgR1kK99DRLDhyU= +github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= @@ -538,6 +554,7 @@ github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZ github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= +github.com/seccomp/libseccomp-golang v0.9.2-0.20210429002308-3879420cc921/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= @@ -611,21 +628,21 @@ go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opentelemetry.io/contrib v0.20.0 h1:ubFQUn0VCZ0gPwIoJfBJVpeBlyRMxu8Mm/huKWYd9p0= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0/go.mod h1:oVGt1LRbBOBq1A5BQLlUg9UaU/54aiHw8cgjV3aWZ/E= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.28.0 h1:Ky1MObd188aGbgb5OgNnwGuEEwI9MVIcc7rBW6zk5Ak= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.28.0/go.mod h1:vEhqr0m4eTc+DWxfsXoXue2GBgV2uUwVznkGIHW/e5w= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0/go.mod h1:2AboqHi0CiIZU0qwhtUfCYD1GeUzvvIXWNkhDt7ZMG4= go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= -go.opentelemetry.io/otel v1.3.0 h1:APxLf0eiBwLl+SOXiJJCVYzA1OOJNyAoV8C5RNRyy7Y= go.opentelemetry.io/otel v1.3.0/go.mod h1:PWIKzi6JCp7sM0k9yZ43VX+T345uNbAkDKwHVjb2PTs= go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM= go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.3.0/go.mod h1:VpP4/RMn8bv8gNo9uK7/IMY4mtWLELsS+JIP0inH0h4= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.3.0/go.mod h1:hO1KLR7jcKaDDKDkvI9dP/FIhpmna5lkqPUQdEjFAM8= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.3.0/go.mod h1:keUU7UfnwWTWpJ+FWnyqmogPa82nuU5VUANFq49hlMY= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.3.0/go.mod h1:QNX1aly8ehqqX1LEa6YniTU7VY9I6R3X/oPxhGdTceE= go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc= @@ -633,13 +650,13 @@ go.opentelemetry.io/otel/sdk v1.3.0/go.mod h1:rIo4suHNhQwBIPg9axF8V9CA72Wz2mKF1t go.opentelemetry.io/otel/sdk/export/metric v0.20.0/go.mod h1:h7RBNMsDJ5pmI1zExLi+bJK+Dr8NQCh0qGhm1KDnNlE= go.opentelemetry.io/otel/sdk/metric v0.20.0/go.mod h1:knxiS8Xd4E/N+ZqKmUPf3gTTZ4/0TjTXukfxjzSTpHE= go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= -go.opentelemetry.io/otel/trace v1.3.0 h1:doy8Hzb1RJ+I3yFhtDmwNc7tIyw1tNMOIsyPzp1NOGY= go.opentelemetry.io/otel/trace v1.3.0/go.mod h1:c/VDhno8888bvQYmbYLqe41/Ldmr/KKunbvWM4/fEjk= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v0.11.0/go.mod h1:QpEjXPrNQzrFDZgoTo49dgHR9RYRSrg3NAKnUGl9YpQ= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= @@ -656,6 +673,7 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -677,6 +695,8 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 h1:2M3HP5CCK1Si9FQhwnzYhXdG6DXeebvUHFpre8QvbyI= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -685,6 +705,9 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -721,16 +744,20 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211216030914-fe4d6282115f h1:hEYJvxw1lSnWIl8X9ofsYMklzaDs90JI2az5YMd4fPM= golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -738,8 +765,14 @@ golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c h1:pkQiBZBvdos9qq4wBAHqlzuZHEXo07pqV06ef90u1WI= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -803,6 +836,7 @@ golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -810,8 +844,14 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -820,22 +860,27 @@ golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210820121016-41cdb8703e55/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210903071746-97244b99971b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -896,10 +941,17 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/tools v0.0.0-20200916195026-c9a70fc28ce3/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.5 h1:ouewzE6p+/VEB31YYnTbEJdi8pFqKp4P4n85vwo3DHA= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -922,13 +974,18 @@ google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63 h1:YzfoEYWbODU5Fbt37+h7X16BWQbad7Q4S6gclTKFXM8= google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -944,9 +1001,13 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= @@ -1007,15 +1068,15 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.22.0/go.mod h1:0AoXXqst47OI/L0oGKq9DG61dvGRPXs7X4/B7KyjBCU= -k8s.io/apimachinery v0.22.0/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= +k8s.io/api v0.22.5/go.mod h1:mEhXyLaSD1qTOf40rRiKXkc+2iCem09rWLlFwhCEiAs= k8s.io/apimachinery v0.22.1/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= -k8s.io/apiserver v0.22.0/go.mod h1:04kaIEzIQrTGJ5syLppQWvpkLJXQtJECHmae+ZGc/nc= -k8s.io/client-go v0.22.0/go.mod h1:GUjIuXR5PiEv/RVK5OODUsm6eZk7wtSWZSaSJbpFdGg= +k8s.io/apimachinery v0.22.5/go.mod h1:xziclGKwuuJ2RM5/rSFQSYAj0zdbci3DH8kj+WvyN0U= +k8s.io/apiserver v0.22.5/go.mod h1:s2WbtgZAkTKt679sYtSudEQrTGWUSQAPe6MupLnlmaQ= +k8s.io/client-go v0.22.5/go.mod h1:cs6yf/61q2T1SdQL5Rdcjg9J1ElXSwbjSrW2vFImM4Y= k8s.io/code-generator v0.19.7/go.mod h1:lwEq3YnLYb/7uVXLorOJfxg+cUu2oihFhHZ0n9NIla0= -k8s.io/component-base v0.22.0/go.mod h1:SXj6Z+V6P6GsBhHZVbWCw9hFjUdUYnJerlhhPnYCBCg= +k8s.io/component-base v0.22.5/go.mod h1:VK3I+TjuF9eaa+Ln67dKxhGar5ynVbwnGrUiNF4MqCI= k8s.io/cri-api v0.20.1/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= -k8s.io/cri-api v0.23.0-alpha.4/go.mod h1:qVxNSzR1gwLmZWK61jKRA5NhbyYrNoXUaZpQ7yOUYOQ= +k8s.io/cri-api v0.23.1/go.mod h1:REJE3PSU0h/LOV1APBrupxrEJqnoxZC8KWzkBUHwrK4= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20201113003025-83324d819ded/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= @@ -1023,10 +1084,11 @@ k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/klog/v2 v2.20.0/go.mod h1:Gm8eSIfQN6457haJuPaMxZw4wyP5k+ykPFlrhQDvhvw= +k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= +k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= diff --git a/integration/container_stats_test.go b/integration/container_stats_test.go index 309f5c14cd4c4..2380aa4043281 100644 --- a/integration/container_stats_test.go +++ b/integration/container_stats_test.go @@ -17,12 +17,12 @@ package integration import ( + "errors" "fmt" goruntime "runtime" "testing" "time" - "github.com/pkg/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" @@ -372,7 +372,7 @@ func TestContainerListStatsWithIdSandboxIdFilter(t *testing.T) { return false, err } if len(stats) != 1 { - return false, errors.Errorf("expected only one stat, but got %v", stats) + return false, fmt.Errorf("expected only one stat, but got %v", stats) } if stats[0].GetWritableLayer().GetUsedBytes().GetValue() != 0 { return true, nil diff --git a/integration/container_update_resources_test.go b/integration/container_update_resources_test.go index 5067b54d275f0..b7af4d86903ff 100644 --- a/integration/container_update_resources_test.go +++ b/integration/container_update_resources_test.go @@ -21,7 +21,6 @@ package integration import ( "bytes" - "io/ioutil" "os" "strings" "testing" @@ -116,7 +115,7 @@ func getCgroupMemoryLimitForTask(t *testing.T, task containerd.Task) uint64 { func isSwapLikelyEnabled() bool { // Check whether swap is enabled. swapFile := "/proc/swaps" - swapData, err := ioutil.ReadFile(swapFile) + swapData, err := os.ReadFile(swapFile) if err != nil { // We can't read the file or it doesn't exist, assume we don't have swap. return false diff --git a/integration/containerd_image_test.go b/integration/containerd_image_test.go index 2b19242e8dfc3..c5b0daa95bf53 100644 --- a/integration/containerd_image_test.go +++ b/integration/containerd_image_test.go @@ -17,17 +17,17 @@ package integration import ( + "errors" + "fmt" "testing" "time" - "golang.org/x/net/context" - "github.com/containerd/containerd" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/namespaces" - "github.com/pkg/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) @@ -77,10 +77,10 @@ func TestContainerdImage(t *testing.T) { } if len(img.RepoTags) != 1 { // RepoTags must have been populated correctly. - return false, errors.Errorf("unexpected repotags: %+v", img.RepoTags) + return false, fmt.Errorf("unexpected repotags: %+v", img.RepoTags) } if img.RepoTags[0] != testImage { - return false, errors.Errorf("unexpected repotag %q", img.RepoTags[0]) + return false, fmt.Errorf("unexpected repotag %q", img.RepoTags[0]) } return true, nil } diff --git a/integration/imagefs_info_test.go b/integration/imagefs_info_test.go index 7ae36c5528d12..ea83a22477999 100644 --- a/integration/imagefs_info_test.go +++ b/integration/imagefs_info_test.go @@ -17,11 +17,11 @@ package integration import ( + "fmt" "os" "testing" "time" - "github.com/pkg/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" @@ -47,7 +47,7 @@ func TestImageFSInfo(t *testing.T) { return false, nil } if len(stats) >= 2 { - return false, errors.Errorf("unexpected stats length: %d", len(stats)) + return false, fmt.Errorf("unexpected stats length: %d", len(stats)) } info = stats[0] if info.GetTimestamp() != 0 && diff --git a/integration/images/volume-copy-up/Makefile b/integration/images/volume-copy-up/Makefile index f302a0720fa40..cba817488c812 100644 --- a/integration/images/volume-copy-up/Makefile +++ b/integration/images/volume-copy-up/Makefile @@ -41,7 +41,7 @@ OSVERSION ?= 1809 OUTPUT_TYPE ?= docker ALL_OS = linux -ALL_ARCH.linux = amd64 arm64 +ALL_ARCH.linux = amd64 arm64 ppc64le ALL_OS_ARCH.linux = $(foreach arch, ${ALL_ARCH.linux}, linux-$(arch)) ifneq ($(REMOTE_DOCKER_URL),) @@ -53,6 +53,7 @@ endif BASE.linux.amd64 := busybox BASE.linux.arm64 := arm64v8/busybox +BASE.linux.ppc64le := busybox BASE.linux := ${BASE.linux.${ARCH}} BASE := ${BASE.${OS}} diff --git a/integration/images/volume-ownership/Makefile b/integration/images/volume-ownership/Makefile index 189194ebce57f..175e11cf6c275 100644 --- a/integration/images/volume-ownership/Makefile +++ b/integration/images/volume-ownership/Makefile @@ -41,7 +41,7 @@ OSVERSION ?= 1809 OUTPUT_TYPE ?= docker ALL_OS = linux -ALL_ARCH.linux = amd64 arm64 +ALL_ARCH.linux = amd64 arm64 ppc64le ALL_OS_ARCH.linux = $(foreach arch, ${ALL_ARCH.linux}, linux-$(arch)) ifneq ($(REMOTE_DOCKER_URL),) @@ -53,6 +53,7 @@ endif BASE.linux.amd64 := busybox BASE.linux.arm64 := arm64v8/busybox +BASE.linux.ppc64le := busybox BASE.linux := ${BASE.linux.${ARCH}} BASE := ${BASE.${OS}} diff --git a/integration/main_test.go b/integration/main_test.go index 28b9fe68b2420..1bef00d40d17c 100644 --- a/integration/main_test.go +++ b/integration/main_test.go @@ -19,6 +19,7 @@ package integration import ( "context" "encoding/json" + "errors" "flag" "fmt" "os" @@ -37,7 +38,6 @@ import ( "github.com/containerd/containerd/pkg/cri/constants" "github.com/containerd/containerd/pkg/cri/server" "github.com/containerd/containerd/pkg/cri/util" - "github.com/pkg/errors" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -78,29 +78,29 @@ func ConnectDaemons() error { var err error runtimeService, err = remote.NewRuntimeService(*criEndpoint, timeout) if err != nil { - return errors.Wrap(err, "failed to create runtime service") + return fmt.Errorf("failed to create runtime service: %w", err) } imageService, err = remote.NewImageService(*criEndpoint, timeout) if err != nil { - return errors.Wrap(err, "failed to create image service") + return fmt.Errorf("failed to create image service: %w", err) } // Since CRI grpc client doesn't have `WithBlock` specified, we // need to check whether it is actually connected. // TODO(#6069) Use grpc options to block on connect and remove for this list containers request. _, err = runtimeService.ListContainers(&runtime.ContainerFilter{}) if err != nil { - return errors.Wrap(err, "failed to list containers") + return fmt.Errorf("failed to list containers: %w", err) } _, err = imageService.ListImages(&runtime.ImageFilter{}) if err != nil { - return errors.Wrap(err, "failed to list images") + return fmt.Errorf("failed to list images: %w", err) } // containerdEndpoint is the same with criEndpoint now containerdEndpoint = strings.TrimPrefix(*criEndpoint, "unix://") containerdEndpoint = strings.TrimPrefix(containerdEndpoint, "npipe:") containerdClient, err = containerd.New(containerdEndpoint, containerd.WithDefaultNamespace(k8sNamespace)) if err != nil { - return errors.Wrap(err, "failed to connect containerd") + return fmt.Errorf("failed to connect containerd: %w", err) } return nil } @@ -371,7 +371,7 @@ func KillProcess(name string) error { output, err := exec.Command(command[0], command[1:]...).CombinedOutput() if err != nil { - return errors.Errorf("failed to kill %q - error: %v, output: %q", name, err, output) + return fmt.Errorf("failed to kill %q - error: %v, output: %q", name, err, output) } return nil } @@ -380,7 +380,7 @@ func KillProcess(name string) error { func KillPid(pid int) error { //nolint:unused output, err := exec.Command("kill", strconv.Itoa(pid)).CombinedOutput() if err != nil { - return errors.Errorf("failed to kill %d - error: %v, output: %q", pid, err, output) + return fmt.Errorf("failed to kill %d - error: %v, output: %q", pid, err, output) } return nil } @@ -391,7 +391,7 @@ func PidOf(name string) (int, error) { output := strings.TrimSpace(string(b)) if err != nil { if len(output) != 0 { - return 0, errors.Errorf("failed to run pidof %q - error: %v, output: %q", name, err, output) + return 0, fmt.Errorf("failed to run pidof %q - error: %v, output: %q", name, err, output) } return 0, nil } @@ -402,7 +402,7 @@ func PidOf(name string) (int, error) { func RawRuntimeClient() (runtime.RuntimeServiceClient, error) { addr, dialer, err := dialer.GetAddressAndDialer(*criEndpoint) if err != nil { - return nil, errors.Wrap(err, "failed to get dialer") + return nil, fmt.Errorf("failed to get dialer: %w", err) } ctx, cancel := context.WithTimeout(context.Background(), timeout) defer cancel() @@ -411,7 +411,7 @@ func RawRuntimeClient() (runtime.RuntimeServiceClient, error) { grpc.WithContextDialer(dialer), ) if err != nil { - return nil, errors.Wrap(err, "failed to connect cri endpoint") + return nil, fmt.Errorf("failed to connect cri endpoint: %w", err) } return runtime.NewRuntimeServiceClient(conn), nil } @@ -420,15 +420,15 @@ func RawRuntimeClient() (runtime.RuntimeServiceClient, error) { func CRIConfig() (*criconfig.Config, error) { client, err := RawRuntimeClient() if err != nil { - return nil, errors.Wrap(err, "failed to get raw runtime client") + return nil, fmt.Errorf("failed to get raw runtime client: %w", err) } resp, err := client.Status(context.Background(), &runtime.StatusRequest{Verbose: true}) if err != nil { - return nil, errors.Wrap(err, "failed to get status") + return nil, fmt.Errorf("failed to get status: %w", err) } config := &criconfig.Config{} if err := json.Unmarshal([]byte(resp.Info["config"]), config); err != nil { - return nil, errors.Wrap(err, "failed to unmarshal config") + return nil, fmt.Errorf("failed to unmarshal config: %w", err) } return config, nil } @@ -437,19 +437,19 @@ func CRIConfig() (*criconfig.Config, error) { func SandboxInfo(id string) (*runtime.PodSandboxStatus, *server.SandboxInfo, error) { //nolint:unused client, err := RawRuntimeClient() if err != nil { - return nil, nil, errors.Wrap(err, "failed to get raw runtime client") + return nil, nil, fmt.Errorf("failed to get raw runtime client: %w", err) } resp, err := client.PodSandboxStatus(context.Background(), &runtime.PodSandboxStatusRequest{ PodSandboxId: id, Verbose: true, }) if err != nil { - return nil, nil, errors.Wrap(err, "failed to get sandbox status") + return nil, nil, fmt.Errorf("failed to get sandbox status: %w", err) } status := resp.GetStatus() var info server.SandboxInfo if err := json.Unmarshal([]byte(resp.GetInfo()["info"]), &info); err != nil { - return nil, nil, errors.Wrap(err, "failed to unmarshal sandbox info") + return nil, nil, fmt.Errorf("failed to unmarshal sandbox info: %w", err) } return status, &info, nil } diff --git a/integration/shim_dial_unix_test.go b/integration/shim_dial_unix_test.go index ddf611a8141fd..7308bf021f10b 100644 --- a/integration/shim_dial_unix_test.go +++ b/integration/shim_dial_unix_test.go @@ -21,6 +21,7 @@ package integration import ( "context" + "errors" "net" "os" "path/filepath" @@ -33,7 +34,6 @@ import ( v1shimcli "github.com/containerd/containerd/runtime/v1/shim/client" v2shimcli "github.com/containerd/containerd/runtime/v2/shim" "github.com/containerd/ttrpc" - "github.com/pkg/errors" ) const abstractSocketPrefix = "\x00" diff --git a/integration/volume_copy_up_test.go b/integration/volume_copy_up_test.go index 664f4de35cf51..1e0e20730e7ec 100644 --- a/integration/volume_copy_up_test.go +++ b/integration/volume_copy_up_test.go @@ -18,7 +18,6 @@ package integration import ( "fmt" - "io/ioutil" "os" "path/filepath" goruntime "runtime" @@ -76,7 +75,7 @@ func TestVolumeCopyUp(t *testing.T) { assert.Equal(t, len(volumePaths), 1, "expected exactly 1 volume") testFilePath := filepath.Join(volumePaths[0], "test_file") - contents, err := ioutil.ReadFile(testFilePath) + contents, err := os.ReadFile(testFilePath) require.NoError(t, err) assert.Equal(t, "test_content\n", string(contents)) @@ -89,7 +88,7 @@ func TestVolumeCopyUp(t *testing.T) { require.NoError(t, err) t.Logf("Check whether host path of the volume is updated") - contents, err = ioutil.ReadFile(testFilePath) + contents, err = os.ReadFile(testFilePath) require.NoError(t, err) assert.Equal(t, "new_content\n", string(contents)) } @@ -159,7 +158,7 @@ func getHostPathForVolumes(criRoot, containerID string) ([]string, error) { return nil, err } - volumes, err := ioutil.ReadDir(hostPath) + volumes, err := os.ReadDir(hostPath) if err != nil { return nil, err } diff --git a/labels/labels.go b/labels/labels.go index 6be006c3e1fce..d76ff2cf9c999 100644 --- a/labels/labels.go +++ b/labels/labels.go @@ -19,7 +19,3 @@ package labels // LabelUncompressed is added to compressed layer contents. // The value is digest of the uncompressed content. const LabelUncompressed = "containerd.io/uncompressed" - -// LabelSharedNamespace is added to a namespace to allow that namespaces -// contents to be shared. -const LabelSharedNamespace = "containerd.io/namespace.shareable" diff --git a/labels/validate.go b/labels/validate.go index 0de461663aacb..1fd527adb35fa 100644 --- a/labels/validate.go +++ b/labels/validate.go @@ -17,8 +17,9 @@ package labels import ( + "fmt" + "github.com/containerd/containerd/errdefs" - "github.com/pkg/errors" ) const ( @@ -31,7 +32,7 @@ func Validate(k, v string) error { 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 fmt.Errorf("label key and value greater than maximum size (%d bytes), key: %s: %w", maxSize, k, errdefs.ErrInvalidArgument) } return nil } diff --git a/metadata/bolt.go b/metadata/bolt.go index 6ea4608663612..9edfab565bee8 100644 --- a/metadata/bolt.go +++ b/metadata/bolt.go @@ -18,8 +18,8 @@ package metadata import ( "context" + "fmt" - "github.com/pkg/errors" bolt "go.etcd.io/bbolt" ) @@ -55,7 +55,7 @@ func update(ctx context.Context, db transactor, fn func(*bolt.Tx) error) error { if !ok { return db.Update(fn) } else if !tx.Writable() { - return errors.Wrap(bolt.ErrTxNotWritable, "unable to use transaction from context") + return fmt.Errorf("unable to use transaction from context: %w", bolt.ErrTxNotWritable) } return fn(tx) } diff --git a/metadata/boltutil/helpers.go b/metadata/boltutil/helpers.go index 6995917c92d7b..4722a522692e8 100644 --- a/metadata/boltutil/helpers.go +++ b/metadata/boltutil/helpers.go @@ -17,11 +17,11 @@ package boltutil import ( + "fmt" "time" "github.com/gogo/protobuf/proto" "github.com/gogo/protobuf/types" - "github.com/pkg/errors" bolt "go.etcd.io/bbolt" ) @@ -99,7 +99,7 @@ func writeMap(bkt *bolt.Bucket, bucketName []byte, labels map[string]string) err } if err := lbkt.Put([]byte(k), []byte(v)); err != nil { - return errors.Wrapf(err, "failed to set label %q=%q", k, v) + return fmt.Errorf("failed to set label %q=%q: %w", k, v, err) } } @@ -228,7 +228,7 @@ func ReadAny(bkt *bolt.Bucket, name []byte) (*types.Any, error) { out := types.Any{} if err := proto.Unmarshal(bytes, &out); err != nil { - return nil, errors.Wrap(err, "failed to unmarshal any") + return nil, fmt.Errorf("failed to unmarshal any: %w", err) } return &out, nil diff --git a/metadata/buckets.go b/metadata/buckets.go index 9103d16ed7e12..d23be84fea72a 100644 --- a/metadata/buckets.go +++ b/metadata/buckets.go @@ -115,7 +115,6 @@ package metadata import ( - "github.com/containerd/containerd/labels" digest "github.com/opencontainers/go-digest" bolt "go.etcd.io/bbolt" ) @@ -183,45 +182,6 @@ func createBucketIfNotExists(tx *bolt.Tx, keys ...[]byte) (*bolt.Bucket, error) return bkt, nil } -func namespacesBucketPath() []byte { - return bucketKeyVersion -} - -func getNamespacesBucket(tx *bolt.Tx) *bolt.Bucket { - return getBucket(tx, namespacesBucketPath()) -} - -// Given a namespace string and a bolt transaction -// return true if the ns has the shared label in it. -func hasSharedLabel(tx *bolt.Tx, ns string) bool { - labelsBkt := getNamespaceLabelsBucket(tx, ns) - if labelsBkt == nil { - return false - } - cur := labelsBkt.Cursor() - for k, v := cur.First(); k != nil; k, v = cur.Next() { - if string(k) == labels.LabelSharedNamespace && string(v) == "true" { - return true - } - } - return false -} - -func getShareableBucket(tx *bolt.Tx, dgst digest.Digest) *bolt.Bucket { - var bkt *bolt.Bucket - nsbkt := getNamespacesBucket(tx) - cur := nsbkt.Cursor() - for k, _ := cur.First(); k != nil; k, _ = cur.Next() { - // If this bucket has shared label - // get the bucket and return it. - if hasSharedLabel(tx, string(k)) { - bkt = getBlobBucket(tx, string(k), dgst) - break - } - } - return bkt -} - func namespaceLabelsBucketPath(namespace string) [][]byte { return [][]byte{bucketKeyVersion, []byte(namespace), bucketKeyObjectLabels} } diff --git a/metadata/buckets_test.go b/metadata/buckets_test.go deleted file mode 100644 index b5a73d0d05ef5..0000000000000 --- a/metadata/buckets_test.go +++ /dev/null @@ -1,171 +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 ( - "os" - "path/filepath" - "testing" - - "github.com/containerd/containerd/labels" - digest "github.com/opencontainers/go-digest" - "github.com/pkg/errors" - bolt "go.etcd.io/bbolt" -) - -func TestHasSharedLabel(t *testing.T) { - tmpdir, err := os.MkdirTemp("", "bucket-testing-") - if err != nil { - t.Error(err) - } - - db, err := bolt.Open(filepath.Join(tmpdir, "metadata.db"), 0660, nil) - if err != nil { - t.Error(err) - } - - err = createNamespaceLabelsBucket(db, "testing-with-shareable", true) - if err != nil { - t.Error(err) - } - - err = createNamespaceLabelsBucket(db, "testing-without-shareable", false) - if err != nil { - t.Error(err) - } - - err = db.View(func(tx *bolt.Tx) error { - if !hasSharedLabel(tx, "testing-with-shareable") { - return errors.New("hasSharedLabel should return true when label is set") - } - if hasSharedLabel(tx, "testing-without-shareable") { - return errors.New("hasSharedLabel should return false when label is not set") - } - return nil - }) - - if err != nil { - t.Error(err) - } -} - -func TestGetShareableBucket(t *testing.T) { - tmpdir, err := os.MkdirTemp("", "bucket-testing-") - if err != nil { - t.Error(err) - } - - db, err := bolt.Open(filepath.Join(tmpdir, "metadata.db"), 0660, nil) - if err != nil { - t.Error(err) - } - - goodDigest := digest.FromString("gooddigest") - imagePresentNS := "has-image-is-shareable" - imageAbsentNS := "image-absent" - - // Create two namespaces, empty for now - err = db.Update(func(tx *bolt.Tx) error { - _, err := createImagesBucket(tx, imagePresentNS) - if err != nil { - return err - } - - _, err = createImagesBucket(tx, imageAbsentNS) - if err != nil { - return err - } - - return nil - }) - - if err != nil { - t.Error(err) - } - - // Test that getShareableBucket is correctly returning nothing when a - // a bucket with that digest is not present in any namespace. - err = db.View(func(tx *bolt.Tx) error { - if bkt := getShareableBucket(tx, goodDigest); bkt != nil { - return errors.New("getShareableBucket should return nil if digest is not present") - } - return nil - }) - - if err != nil { - t.Error(err) - } - - // Create a blob bucket in one of the namespaces with a well-known digest - err = db.Update(func(tx *bolt.Tx) error { - _, err = createBlobBucket(tx, imagePresentNS, goodDigest) - if err != nil { - return err - } - return nil - }) - - if err != nil { - t.Error(err) - } - - // Verify that it is still not retrievable if the shareable label is not present - err = db.View(func(tx *bolt.Tx) error { - if bkt := getShareableBucket(tx, goodDigest); bkt != nil { - return errors.New("getShareableBucket should return nil if digest is present but doesn't have shareable label") - } - return nil - }) - - if err != nil { - t.Error(err) - } - - // Create the namespace labels bucket and mark it as shareable - err = createNamespaceLabelsBucket(db, imagePresentNS, true) - if err != nil { - t.Error(err) - } - - // Verify that this digest is retrievable from getShareableBucket - err = db.View(func(tx *bolt.Tx) error { - if bkt := getShareableBucket(tx, goodDigest); bkt == nil { - return errors.New("getShareableBucket should not return nil if digest is present") - } - return nil - }) - - if err != nil { - t.Error(err) - } -} - -func createNamespaceLabelsBucket(db transactor, ns string, shareable bool) error { - err := db.Update(func(tx *bolt.Tx) error { - err := withNamespacesLabelsBucket(tx, ns, func(bkt *bolt.Bucket) error { - if shareable { - err := bkt.Put([]byte(labels.LabelSharedNamespace), []byte("true")) - if err != nil { - return err - } - } - return nil - }) - return err - }) - return err -} diff --git a/metadata/containers.go b/metadata/containers.go index 26e86d8583b39..97002e5886e1c 100644 --- a/metadata/containers.go +++ b/metadata/containers.go @@ -18,6 +18,7 @@ package metadata import ( "context" + "fmt" "strings" "sync/atomic" "time" @@ -31,7 +32,6 @@ import ( "github.com/containerd/containerd/namespaces" "github.com/gogo/protobuf/proto" "github.com/gogo/protobuf/types" - "github.com/pkg/errors" bolt "go.etcd.io/bbolt" ) @@ -57,11 +57,11 @@ func (s *containerStore) Get(ctx context.Context, id string) (containers.Contain if err := view(ctx, s.db, func(tx *bolt.Tx) error { bkt := getContainerBucket(tx, namespace, id) if bkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "container %q in namespace %q", id, namespace) + return fmt.Errorf("container %q in namespace %q: %w", id, namespace, errdefs.ErrNotFound) } if err := readContainer(&container, bkt); err != nil { - return errors.Wrapf(err, "failed to read container %q", id) + return fmt.Errorf("failed to read container %q: %w", id, err) } return nil @@ -80,7 +80,7 @@ func (s *containerStore) List(ctx context.Context, fs ...string) ([]containers.C filter, err := filters.ParseAll(fs...) if err != nil { - return nil, errors.Wrap(errdefs.ErrInvalidArgument, err.Error()) + return nil, fmt.Errorf("%s: %w", err.Error(), errdefs.ErrInvalidArgument) } var m []containers.Container @@ -99,7 +99,7 @@ func (s *containerStore) List(ctx context.Context, fs ...string) ([]containers.C container := containers.Container{ID: string(k)} if err := readContainer(&container, cbkt); err != nil { - return errors.Wrapf(err, "failed to read container %q", string(k)) + return fmt.Errorf("failed to read container %q: %w", string(k), err) } if filter.Match(adaptContainer(container)) { @@ -121,7 +121,7 @@ func (s *containerStore) Create(ctx context.Context, container containers.Contai } if err := validateContainer(&container); err != nil { - return containers.Container{}, errors.Wrap(err, "create container failed validation") + return containers.Container{}, fmt.Errorf("create container failed validation: %w", err) } if err := update(ctx, s.db, func(tx *bolt.Tx) error { @@ -133,7 +133,7 @@ func (s *containerStore) Create(ctx context.Context, container containers.Contai cbkt, err := bkt.CreateBucket([]byte(container.ID)) if err != nil { if err == bolt.ErrBucketExists { - err = errors.Wrapf(errdefs.ErrAlreadyExists, "container %q", container.ID) + err = fmt.Errorf("container %q: %w", container.ID, errdefs.ErrAlreadyExists) } return err } @@ -141,7 +141,7 @@ func (s *containerStore) Create(ctx context.Context, container containers.Contai container.CreatedAt = time.Now().UTC() container.UpdatedAt = container.CreatedAt if err := writeContainer(cbkt, &container); err != nil { - return errors.Wrapf(err, "failed to write container %q", container.ID) + return fmt.Errorf("failed to write container %q: %w", container.ID, err) } return nil @@ -159,23 +159,23 @@ func (s *containerStore) Update(ctx context.Context, container containers.Contai } if container.ID == "" { - return containers.Container{}, errors.Wrapf(errdefs.ErrInvalidArgument, "must specify a container id") + return containers.Container{}, fmt.Errorf("must specify a container id: %w", errdefs.ErrInvalidArgument) } var updated containers.Container if err := update(ctx, s.db, func(tx *bolt.Tx) error { bkt := getContainersBucket(tx, namespace) if bkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "cannot update container %q in namespace %q", container.ID, namespace) + return fmt.Errorf("cannot update container %q in namespace %q: %w", container.ID, namespace, errdefs.ErrNotFound) } cbkt := bkt.Bucket([]byte(container.ID)) if cbkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "container %q", container.ID) + return fmt.Errorf("container %q: %w", container.ID, errdefs.ErrNotFound) } if err := readContainer(&updated, cbkt); err != nil { - return errors.Wrapf(err, "failed to read container %q", container.ID) + return fmt.Errorf("failed to read container %q: %w", container.ID, err) } createdat := updated.CreatedAt updated.ID = container.ID @@ -188,11 +188,11 @@ func (s *containerStore) Update(ctx context.Context, container containers.Contai // are provided. This allows these fields to become mutable in the // future. if updated.Snapshotter != container.Snapshotter { - return errors.Wrapf(errdefs.ErrInvalidArgument, "container.Snapshotter field is immutable") + return fmt.Errorf("container.Snapshotter field is immutable: %w", errdefs.ErrInvalidArgument) } if updated.Runtime.Name != container.Runtime.Name { - return errors.Wrapf(errdefs.ErrInvalidArgument, "container.Runtime.Name field is immutable") + return fmt.Errorf("container.Runtime.Name field is immutable: %w", errdefs.ErrInvalidArgument) } } @@ -230,18 +230,18 @@ func (s *containerStore) Update(ctx context.Context, container containers.Contai case "snapshotkey": updated.SnapshotKey = container.SnapshotKey default: - return errors.Wrapf(errdefs.ErrInvalidArgument, "cannot update %q field on %q", path, container.ID) + return fmt.Errorf("cannot update %q field on %q: %w", path, container.ID, errdefs.ErrInvalidArgument) } } if err := validateContainer(&updated); err != nil { - return errors.Wrap(err, "update failed validation") + return fmt.Errorf("update failed validation: %w", err) } updated.CreatedAt = createdat updated.UpdatedAt = time.Now().UTC() if err := writeContainer(cbkt, &updated); err != nil { - return errors.Wrapf(err, "failed to write container %q", container.ID) + return fmt.Errorf("failed to write container %q: %w", container.ID, err) } return nil @@ -261,12 +261,12 @@ func (s *containerStore) Delete(ctx context.Context, id string) error { return update(ctx, s.db, func(tx *bolt.Tx) error { bkt := getContainersBucket(tx, namespace) if bkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "cannot delete container %q in namespace %q", id, namespace) + return fmt.Errorf("cannot delete container %q in namespace %q: %w", id, namespace, errdefs.ErrNotFound) } if err := bkt.DeleteBucket([]byte(id)); err != nil { if err == bolt.ErrBucketNotFound { - err = errors.Wrapf(errdefs.ErrNotFound, "container %v", id) + err = fmt.Errorf("container %v: %w", id, errdefs.ErrNotFound) } return err } @@ -279,32 +279,32 @@ func (s *containerStore) Delete(ctx context.Context, id string) error { func validateContainer(container *containers.Container) error { if err := identifiers.Validate(container.ID); err != nil { - return errors.Wrap(err, "container.ID") + return fmt.Errorf("container.ID: %w", err) } for k := range container.Extensions { if k == "" { - return errors.Wrapf(errdefs.ErrInvalidArgument, "container.Extension keys must not be zero-length") + return fmt.Errorf("container.Extension keys must not be zero-length: %w", errdefs.ErrInvalidArgument) } } // image has no validation for k, v := range container.Labels { if err := labels.Validate(k, v); err != nil { - return errors.Wrapf(err, "containers.Labels") + return fmt.Errorf("containers.Labels: %w", err) } } if container.Runtime.Name == "" { - return errors.Wrapf(errdefs.ErrInvalidArgument, "container.Runtime.Name must be set") + return fmt.Errorf("container.Runtime.Name must be set: %w", errdefs.ErrInvalidArgument) } if container.Spec == nil { - return errors.Wrapf(errdefs.ErrInvalidArgument, "container.Spec must be set") + return fmt.Errorf("container.Spec must be set: %w", errdefs.ErrInvalidArgument) } if container.SnapshotKey != "" && container.Snapshotter == "" { - return errors.Wrapf(errdefs.ErrInvalidArgument, "container.Snapshotter must be set if container.SnapshotKey is set") + return fmt.Errorf("container.Snapshotter must be set if container.SnapshotKey is set: %w", errdefs.ErrInvalidArgument) } return nil diff --git a/metadata/containers_test.go b/metadata/containers_test.go index f207e569ea8f4..c0192a4585a30 100644 --- a/metadata/containers_test.go +++ b/metadata/containers_test.go @@ -18,6 +18,7 @@ package metadata import ( "context" + "errors" "fmt" "os" "path/filepath" @@ -34,7 +35,6 @@ import ( "github.com/containerd/typeurl" "github.com/gogo/protobuf/types" specs "github.com/opencontainers/runtime-spec/specs-go" - "github.com/pkg/errors" bolt "go.etcd.io/bbolt" ) @@ -639,7 +639,7 @@ func TestContainersCreateUpdateDelete(t *testing.T) { if testcase.createerr == nil { t.Fatalf("unexpected error: %v", err) } else { - t.Fatalf("cause of %v (cause: %v) != %v", err, errors.Cause(err), testcase.createerr) + t.Fatalf("cause of %v (cause: %v) != %v", err, errors.Unwrap(err), testcase.createerr) } } else if testcase.createerr != nil { return @@ -661,7 +661,7 @@ func TestContainersCreateUpdateDelete(t *testing.T) { if testcase.cause == nil { t.Fatalf("unexpected error: %v", err) } else { - t.Fatalf("cause of %v (cause: %v) != %v", err, errors.Cause(err), testcase.cause) + t.Fatalf("cause of %v (cause: %v) != %v", err, errors.Unwrap(err), testcase.cause) } } else if testcase.cause != nil { return diff --git a/metadata/content.go b/metadata/content.go index f534bff18c062..66d0ee263ef67 100644 --- a/metadata/content.go +++ b/metadata/content.go @@ -19,6 +19,7 @@ package metadata import ( "context" "encoding/binary" + "fmt" "strings" "sync" "sync/atomic" @@ -33,7 +34,6 @@ import ( "github.com/containerd/containerd/namespaces" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" bolt "go.etcd.io/bbolt" ) @@ -77,11 +77,7 @@ func (cs *contentStore) Info(ctx context.Context, dgst digest.Digest) (content.I if err := view(ctx, cs.db, func(tx *bolt.Tx) error { bkt := getBlobBucket(tx, ns, dgst) if bkt == nil { - // try to find shareable bkt before erroring - bkt = getShareableBucket(tx, dgst) - } - if bkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "content digest %v", dgst) + return fmt.Errorf("content digest %v: %w", dgst, errdefs.ErrNotFound) } info.Digest = dgst @@ -108,14 +104,11 @@ func (cs *contentStore) Update(ctx context.Context, info content.Info, fieldpath if err := update(ctx, cs.db, func(tx *bolt.Tx) error { bkt := getBlobBucket(tx, ns, info.Digest) if bkt == nil { - // try to find a shareable bkt before erroring - bkt = getShareableBucket(tx, info.Digest) - } - if bkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "content digest %v", info.Digest) + return fmt.Errorf("content digest %v: %w", info.Digest, errdefs.ErrNotFound) } + if err := readInfo(&updated, bkt); err != nil { - return errors.Wrapf(err, "info %q", info.Digest) + return fmt.Errorf("info %q: %w", info.Digest, err) } if len(fieldpaths) > 0 { @@ -134,7 +127,7 @@ func (cs *contentStore) Update(ctx context.Context, info content.Info, fieldpath case "labels": updated.Labels = info.Labels default: - return errors.Wrapf(errdefs.ErrInvalidArgument, "cannot update %q field on content info %q", path, info.Digest) + return fmt.Errorf("cannot update %q field on content info %q: %w", path, info.Digest, errdefs.ErrInvalidArgument) } } } else { @@ -218,7 +211,7 @@ func (cs *contentStore) Delete(ctx context.Context, dgst digest.Digest) error { return update(ctx, cs.db, func(tx *bolt.Tx) error { bkt := getBlobBucket(tx, ns, dgst) if bkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "content digest %v", dgst) + return fmt.Errorf("content digest %v: %w", dgst, errdefs.ErrNotFound) } if err := getBlobsBucket(tx, ns).DeleteBucket([]byte(dgst.String())); err != nil { @@ -307,7 +300,7 @@ func (cs *contentStore) Status(ctx context.Context, ref string) (content.Status, if err := view(ctx, cs.db, func(tx *bolt.Tx) error { bref = getRef(tx, ns, ref) if bref == "" { - return errors.Wrapf(errdefs.ErrNotFound, "reference %v", ref) + return fmt.Errorf("reference %v: %w", ref, errdefs.ErrNotFound) } return nil @@ -335,15 +328,15 @@ func (cs *contentStore) Abort(ctx context.Context, ref string) error { return update(ctx, cs.db, func(tx *bolt.Tx) error { ibkt := getIngestsBucket(tx, ns) if ibkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "reference %v", ref) + return fmt.Errorf("reference %v: %w", ref, errdefs.ErrNotFound) } bkt := ibkt.Bucket([]byte(ref)) if bkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "reference %v", ref) + return fmt.Errorf("reference %v: %w", ref, errdefs.ErrNotFound) } bref := string(bkt.Get(bucketKeyRef)) if bref == "" { - return errors.Wrapf(errdefs.ErrNotFound, "reference %v", ref) + return fmt.Errorf("reference %v: %w", ref, errdefs.ErrNotFound) } expected := string(bkt.Get(bucketKeyExpected)) if err := ibkt.DeleteBucket([]byte(ref)); err != nil { @@ -374,7 +367,7 @@ func (cs *contentStore) Writer(ctx context.Context, opts ...content.WriterOpt) ( // 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") + return nil, fmt.Errorf("ref must not be empty: %w", errdefs.ErrInvalidArgument) } ns, err := namespaces.NamespaceRequired(ctx) if err != nil { @@ -397,7 +390,7 @@ func (cs *contentStore) Writer(ctx context.Context, opts ...content.WriterOpt) ( // Add content to lease to prevent other reference removals // from effecting this object during a provided lease if err := addContentLease(ctx, tx, wOpts.Desc.Digest); err != nil { - return errors.Wrap(err, "unable to lease content") + return fmt.Errorf("unable to lease content: %w", err) } // Return error outside of transaction to ensure // commit succeeds with the lease. @@ -473,7 +466,7 @@ func (cs *contentStore) Writer(ctx context.Context, opts ...content.WriterOpt) ( return nil, err } if exists { - return nil, errors.Wrapf(errdefs.ErrAlreadyExists, "content %v", wOpts.Desc.Digest) + return nil, fmt.Errorf("content %v: %w", wOpts.Desc.Digest, errdefs.ErrAlreadyExists) } return &namespacedWriter{ @@ -626,10 +619,10 @@ func (nw *namespacedWriter) commit(ctx context.Context, tx *bolt.Tx, size int64, var actual digest.Digest if nw.w == nil { if size != 0 && size != nw.desc.Size { - return "", errors.Wrapf(errdefs.ErrFailedPrecondition, "%q failed size validation: %v != %v", nw.ref, nw.desc.Size, size) + return "", fmt.Errorf("%q failed size validation: %v != %v: %w", nw.ref, nw.desc.Size, size, errdefs.ErrFailedPrecondition) } if expected != "" && expected != nw.desc.Digest { - return "", errors.Wrapf(errdefs.ErrFailedPrecondition, "%q unexpected digest", nw.ref) + return "", fmt.Errorf("%q unexpected digest: %w", nw.ref, errdefs.ErrFailedPrecondition) } size = nw.desc.Size actual = nw.desc.Digest @@ -641,7 +634,7 @@ func (nw *namespacedWriter) commit(ctx context.Context, tx *bolt.Tx, size int64, } if size != 0 && size != status.Offset { nw.w.Close() - return "", errors.Wrapf(errdefs.ErrFailedPrecondition, "%q failed size validation: %v != %v", nw.ref, status.Offset, size) + return "", fmt.Errorf("%q failed size validation: %v != %v: %w", nw.ref, status.Offset, size, errdefs.ErrFailedPrecondition) } size = status.Offset @@ -654,7 +647,7 @@ func (nw *namespacedWriter) commit(ctx context.Context, tx *bolt.Tx, size int64, bkt, err := createBlobBucket(tx, nw.namespace, actual) if err != nil { if err == bolt.ErrBucketExists { - return actual, errors.Wrapf(errdefs.ErrAlreadyExists, "content %v", actual) + return actual, fmt.Errorf("content %v: %w", actual, errdefs.ErrAlreadyExists) } return "", err } @@ -707,11 +700,7 @@ func (cs *contentStore) checkAccess(ctx context.Context, dgst digest.Digest) err return view(ctx, cs.db, func(tx *bolt.Tx) error { bkt := getBlobBucket(tx, ns, dgst) if bkt == nil { - // try to find shareable bkt before erroring - bkt = getShareableBucket(tx, dgst) - } - if bkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "content digest %v", dgst) + return fmt.Errorf("content digest %v: %w", dgst, errdefs.ErrNotFound) } return nil }) @@ -720,7 +709,7 @@ func (cs *contentStore) checkAccess(ctx context.Context, dgst digest.Digest) err func validateInfo(info *content.Info) error { for k, v := range info.Labels { if err := labels.Validate(k, v); err != nil { - return errors.Wrapf(err, "info.Labels") + return fmt.Errorf("info.Labels: %w", err) } } @@ -751,7 +740,7 @@ func writeInfo(info *content.Info, bkt *bolt.Bucket) error { } if err := boltutil.WriteLabels(bkt, info.Labels); err != nil { - return errors.Wrapf(err, "writing labels for info %v", info.Digest) + return fmt.Errorf("writing labels for info %v: %w", info.Digest, err) } // Write size @@ -783,6 +772,7 @@ func writeExpireAt(expire time.Time, bkt *bolt.Bucket) error { return bkt.Put(bucketKeyExpireAt, expireAt) } +// garbageCollect removes all contents that are no longer used. func (cs *contentStore) garbageCollect(ctx context.Context) (d time.Duration, err error) { cs.l.Lock() t1 := time.Now() diff --git a/metadata/content_test.go b/metadata/content_test.go index a97ec4f2e13df..061095c0f19b1 100644 --- a/metadata/content_test.go +++ b/metadata/content_test.go @@ -19,6 +19,7 @@ package metadata import ( "bytes" "context" + "errors" "fmt" "path/filepath" "sync/atomic" @@ -32,7 +33,6 @@ import ( "github.com/containerd/containerd/namespaces" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" bolt "go.etcd.io/bbolt" ) @@ -190,11 +190,11 @@ func checkContentLeased(ctx context.Context, db *DB, dgst digest.Digest) error { return db.View(func(tx *bolt.Tx) error { bkt := getBucket(tx, bucketKeyVersion, []byte(ns), bucketKeyObjectLeases, []byte(lease), bucketKeyObjectContent) if bkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "bucket not found %s", lease) + return fmt.Errorf("bucket not found %s: %w", lease, errdefs.ErrNotFound) } v := bkt.Get([]byte(dgst.String())) if v == nil { - return errors.Wrap(errdefs.ErrNotFound, "object not leased") + return fmt.Errorf("object not leased: %w", errdefs.ErrNotFound) } return nil @@ -214,11 +214,11 @@ func checkIngestLeased(ctx context.Context, db *DB, ref string) error { return db.View(func(tx *bolt.Tx) error { bkt := getBucket(tx, bucketKeyVersion, []byte(ns), bucketKeyObjectLeases, []byte(lease), bucketKeyObjectIngests) if bkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "bucket not found %s", lease) + return fmt.Errorf("bucket not found %s: %w", lease, errdefs.ErrNotFound) } v := bkt.Get([]byte(ref)) if v == nil { - return errors.Wrap(errdefs.ErrNotFound, "object not leased") + return fmt.Errorf("object not leased: %w", errdefs.ErrNotFound) } return nil diff --git a/metadata/db.go b/metadata/db.go index 40d045f05d3e5..2d9cbf31a6754 100644 --- a/metadata/db.go +++ b/metadata/db.go @@ -19,6 +19,8 @@ package metadata import ( "context" "encoding/binary" + "errors" + "fmt" "strings" "sync" "sync/atomic" @@ -28,7 +30,6 @@ import ( "github.com/containerd/containerd/gc" "github.com/containerd/containerd/log" "github.com/containerd/containerd/snapshots" - "github.com/pkg/errors" bolt "go.etcd.io/bbolt" ) @@ -181,7 +182,7 @@ func (m *DB) Init(ctx context.Context) error { for _, m := range updates { t0 := time.Now() if err := m.migrate(tx); err != nil { - return errors.Wrapf(err, "failed to migrate to %s.%d", m.schema, m.version) + return fmt.Errorf("failed to migrate to %s.%d: %w", m.schema, m.version, err) } log.G(ctx).WithField("d", time.Since(t0)).Debugf("finished database migration to %s.%d", m.schema, m.version) } @@ -276,7 +277,7 @@ func (s GCStats) Elapsed() time.Duration { return s.MetaD } -// GarbageCollect starts garbage collection +// GarbageCollect removes resources (snapshots, contents, ...) that are no longer used. func (m *DB) GarbageCollect(ctx context.Context) (gc.Stats, error) { m.wlock.Lock() t1 := time.Now() @@ -307,7 +308,7 @@ func (m *DB) GarbageCollect(ctx context.Context) (gc.Stats, error) { } if err := scanAll(ctx, tx, rm); err != nil { - return errors.Wrap(err, "failed to scan and remove") + return fmt.Errorf("failed to scan and remove: %w", err) } return nil @@ -362,6 +363,7 @@ func (m *DB) GarbageCollect(ctx context.Context) (gc.Stats, error) { return stats, err } +// getMarked returns all resources that are used. func (m *DB) getMarked(ctx context.Context) (map[gc.Node]struct{}, error) { var marked map[gc.Node]struct{} if err := m.db.View(func(tx *bolt.Tx) error { diff --git a/metadata/db_test.go b/metadata/db_test.go index 5b59399a94583..d66408bdd0207 100644 --- a/metadata/db_test.go +++ b/metadata/db_test.go @@ -19,6 +19,7 @@ package metadata import ( "context" "encoding/binary" + "errors" "fmt" "io" "math/rand" @@ -43,7 +44,6 @@ import ( "github.com/gogo/protobuf/types" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" bolt "go.etcd.io/bbolt" ) @@ -208,7 +208,7 @@ func TestMigrations(t *testing.T) { check: func(tx *bolt.Tx) error { bkt := getSnapshotterBucket(tx, "testing", "testing") if bkt == nil { - return errors.Wrap(errdefs.ErrNotFound, "snapshots bucket not found") + return fmt.Errorf("snapshots bucket not found: %w", errdefs.ErrNotFound) } snapshots := []struct { key string @@ -235,7 +235,7 @@ func TestMigrations(t *testing.T) { for _, s := range snapshots { sbkt := bkt.Bucket([]byte(s.key)) if sbkt == nil { - return errors.Wrap(errdefs.ErrNotFound, "key does not exist") + return fmt.Errorf("key does not exist: %w", errdefs.ErrNotFound) } cbkt := sbkt.Bucket(bucketKeyChildren) @@ -245,12 +245,12 @@ func TestMigrations(t *testing.T) { } if cn != len(s.children) { - return errors.Errorf("unexpected number of children %d, expected %d", cn, len(s.children)) + return fmt.Errorf("unexpected number of children %d, expected %d", cn, len(s.children)) } for _, ch := range s.children { if v := cbkt.Get([]byte(ch)); v == nil { - return errors.Errorf("missing child record for %s", ch) + return fmt.Errorf("missing child record for %s", ch) } } } @@ -277,18 +277,18 @@ func TestMigrations(t *testing.T) { check: func(tx *bolt.Tx) error { bkt := getIngestsBucket(tx, "testing") if bkt == nil { - return errors.Wrap(errdefs.ErrNotFound, "ingests bucket not found") + return fmt.Errorf("ingests bucket not found: %w", errdefs.ErrNotFound) } for _, s := range testRefs { sbkt := bkt.Bucket([]byte(s.ref)) if sbkt == nil { - return errors.Wrap(errdefs.ErrNotFound, "ref does not exist") + return fmt.Errorf("ref does not exist: %w", errdefs.ErrNotFound) } bref := string(sbkt.Get(bucketKeyRef)) if bref != s.bref { - return errors.Errorf("unexpected reference key %q, expected %q", bref, s.bref) + return fmt.Errorf("unexpected reference key %q, expected %q", bref, s.bref) } } @@ -345,11 +345,11 @@ func readDBVersion(db *bolt.DB, schema []byte) (int, error) { if err := db.View(func(tx *bolt.Tx) error { bkt := tx.Bucket(schema) if bkt == nil { - return errors.Wrap(errdefs.ErrNotFound, "no version bucket") + return fmt.Errorf("no version bucket: %w", errdefs.ErrNotFound) } vb := bkt.Get(bucketKeyDBVersion) if vb == nil { - return errors.Wrap(errdefs.ErrNotFound, "no version value") + return fmt.Errorf("no version value: %w", errdefs.ErrNotFound) } v, _ := binary.Varint(vb) version = int(v) @@ -588,13 +588,13 @@ func create(obj object, tx *bolt.Tx, db *DB, cs content.Store, sn snapshots.Snap content.WithRef("test-ref"), content.WithDescriptor(ocispec.Descriptor{Size: int64(len(v.data)), Digest: expected})) if err != nil { - return nil, errors.Wrap(err, "failed to create writer") + return nil, fmt.Errorf("failed to create writer: %w", err) } if _, err := w.Write(v.data); err != nil { - return nil, errors.Wrap(err, "write blob failed") + return nil, fmt.Errorf("write blob failed: %w", err) } if err := w.Commit(ctx, int64(len(v.data)), expected, content.WithLabels(obj.labels)); err != nil { - return nil, errors.Wrap(err, "failed to commit blob") + return nil, fmt.Errorf("failed to commit blob: %w", err) } if !obj.removed { node = &gc.Node{ @@ -635,7 +635,7 @@ func create(obj object, tx *bolt.Tx, db *DB, cs content.Store, sn snapshots.Snap _, err := NewImageStore(db).Create(ctx, image) if err != nil { - return nil, errors.Wrap(err, "failed to create image") + return nil, fmt.Errorf("failed to create image: %w", err) } case testContainer: container := containers.Container{ diff --git a/metadata/gc.go b/metadata/gc.go index afe16c9222d77..60bf410a6dd87 100644 --- a/metadata/gc.go +++ b/metadata/gc.go @@ -25,7 +25,6 @@ import ( "github.com/containerd/containerd/gc" "github.com/containerd/containerd/log" - "github.com/pkg/errors" bolt "go.etcd.io/bbolt" ) @@ -59,6 +58,8 @@ var ( labelGCFlat = []byte("containerd.io/gc.flat") ) +// scanRoots sends the given channel "root" resources that are certainly used. +// The caller could look the references of the resources to find all resources that are used. func scanRoots(ctx context.Context, tx *bolt.Tx, nc chan<- gc.Node) error { v1bkt := tx.Bucket(bucketKeyVersion) if v1bkt == nil { @@ -277,6 +278,7 @@ func scanRoots(ctx context.Context, tx *bolt.Tx, nc chan<- gc.Node) error { return cerr } +// references finds the resources that are reachable from the given node. func references(ctx context.Context, tx *bolt.Tx, node gc.Node, fn func(gc.Node)) error { switch node.Type { case ResourceContent: @@ -290,7 +292,7 @@ func references(ctx context.Context, tx *bolt.Tx, node gc.Node, fn func(gc.Node) case ResourceSnapshot, resourceSnapshotFlat: parts := strings.SplitN(node.Key, "/", 2) if len(parts) != 2 { - return errors.Errorf("invalid snapshot gc key %s", node.Key) + return fmt.Errorf("invalid snapshot gc key %s", node.Key) } ss := parts[0] name := parts[1] @@ -329,6 +331,7 @@ func references(ctx context.Context, tx *bolt.Tx, node gc.Node, fn func(gc.Node) return nil } +// scanAll finds all resources regardless whether the resources are used or not. func scanAll(ctx context.Context, tx *bolt.Tx, fn func(ctx context.Context, n gc.Node) error) error { v1bkt := tx.Bucket(bucketKeyVersion) if v1bkt == nil { @@ -409,6 +412,7 @@ func scanAll(ctx context.Context, tx *bolt.Tx, fn func(ctx context.Context, n gc return nil } +// remove all buckets for the given node. func remove(ctx context.Context, tx *bolt.Tx, node gc.Node) error { v1bkt := tx.Bucket(bucketKeyVersion) if v1bkt == nil { @@ -435,7 +439,7 @@ func remove(ctx context.Context, tx *bolt.Tx, node gc.Node) error { if sbkt != nil { parts := strings.SplitN(node.Key, "/", 2) if len(parts) != 2 { - return errors.Errorf("invalid snapshot gc key %s", node.Key) + return fmt.Errorf("invalid snapshot gc key %s", node.Key) } ssbkt := sbkt.Bucket([]byte(parts[0])) if ssbkt != nil { diff --git a/metadata/images.go b/metadata/images.go index 46553c0c81d3a..8355b712ef9cc 100644 --- a/metadata/images.go +++ b/metadata/images.go @@ -19,6 +19,7 @@ package metadata import ( "context" "encoding/binary" + "errors" "fmt" "strings" "sync/atomic" @@ -32,7 +33,6 @@ import ( "github.com/containerd/containerd/namespaces" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" bolt "go.etcd.io/bbolt" ) @@ -55,40 +55,18 @@ func (s *imageStore) Get(ctx context.Context, name string) (images.Image, error) if err := view(ctx, s.db, func(tx *bolt.Tx) error { bkt := getImagesBucket(tx, namespace) - if bkt == nil || bkt.Bucket([]byte(name)) == nil { - nsbkt := getNamespacesBucket(tx) - cur := nsbkt.Cursor() - for k, _ := cur.First(); k != nil; k, _ = cur.Next() { - // If this namespace has the sharedlabel - if hasSharedLabel(tx, string(k)) { - // and has the image we are looking for - bkt = getImagesBucket(tx, string(k)) - if bkt == nil { - continue - } - - ibkt := bkt.Bucket([]byte(name)) - if ibkt == nil { - continue - } - // we are done - break - } - - } - } if bkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "image %q", name) + return fmt.Errorf("image %q: %w", name, errdefs.ErrNotFound) } ibkt := bkt.Bucket([]byte(name)) if ibkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "image %q", name) + return fmt.Errorf("image %q: %w", name, errdefs.ErrNotFound) } image.Name = name if err := readImage(&image, ibkt); err != nil { - return errors.Wrapf(err, "image %q", name) + return fmt.Errorf("image %q: %w", name, err) } return nil @@ -107,7 +85,7 @@ func (s *imageStore) List(ctx context.Context, fs ...string) ([]images.Image, er filter, err := filters.ParseAll(fs...) if err != nil { - return nil, errors.Wrap(errdefs.ErrInvalidArgument, err.Error()) + return nil, fmt.Errorf("%s: %w", err.Error(), errdefs.ErrInvalidArgument) } var m []images.Image @@ -163,7 +141,7 @@ func (s *imageStore) Create(ctx context.Context, image images.Image) (images.Ima return err } - return errors.Wrapf(errdefs.ErrAlreadyExists, "image %q", image.Name) + return fmt.Errorf("image %q: %w", image.Name, errdefs.ErrAlreadyExists) } image.CreatedAt = time.Now().UTC() @@ -183,7 +161,7 @@ func (s *imageStore) Update(ctx context.Context, image images.Image, fieldpaths } if image.Name == "" { - return images.Image{}, errors.Wrapf(errdefs.ErrInvalidArgument, "image name is required for update") + return images.Image{}, fmt.Errorf("image name is required for update: %w", errdefs.ErrInvalidArgument) } var updated images.Image @@ -196,11 +174,11 @@ func (s *imageStore) Update(ctx context.Context, image images.Image, fieldpaths ibkt := bkt.Bucket([]byte(image.Name)) if ibkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "image %q", image.Name) + return fmt.Errorf("image %q: %w", image.Name, errdefs.ErrNotFound) } if err := readImage(&updated, ibkt); err != nil { - return errors.Wrapf(err, "image %q", image.Name) + return fmt.Errorf("image %q: %w", image.Name, err) } createdat := updated.CreatedAt updated.Name = image.Name @@ -238,7 +216,7 @@ func (s *imageStore) Update(ctx context.Context, image images.Image, fieldpaths case "annotations": updated.Target.Annotations = image.Target.Annotations default: - return errors.Wrapf(errdefs.ErrInvalidArgument, "cannot update %q field on image %q", path, image.Name) + return fmt.Errorf("cannot update %q field on image %q: %w", path, image.Name, errdefs.ErrInvalidArgument) } } } else { @@ -269,12 +247,12 @@ func (s *imageStore) Delete(ctx context.Context, name string, opts ...images.Del return update(ctx, s.db, func(tx *bolt.Tx) error { bkt := getImagesBucket(tx, namespace) if bkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "image %q", name) + return fmt.Errorf("image %q: %w", name, errdefs.ErrNotFound) } if err = bkt.DeleteBucket([]byte(name)); err != nil { if err == bolt.ErrBucketNotFound { - err = errors.Wrapf(errdefs.ErrNotFound, "image %q", name) + err = fmt.Errorf("image %q: %w", name, errdefs.ErrNotFound) } return err } @@ -287,12 +265,12 @@ func (s *imageStore) Delete(ctx context.Context, name string, opts ...images.Del func validateImage(image *images.Image) error { if image.Name == "" { - return errors.Wrapf(errdefs.ErrInvalidArgument, "image name must not be empty") + return fmt.Errorf("image name must not be empty: %w", errdefs.ErrInvalidArgument) } for k, v := range image.Labels { if err := labels.Validate(k, v); err != nil { - return errors.Wrapf(err, "image.Labels") + return fmt.Errorf("image.Labels: %w", err) } } @@ -303,15 +281,15 @@ func validateTarget(target *ocispec.Descriptor) error { // NOTE(stevvooe): Only validate fields we actually store. if err := target.Digest.Validate(); err != nil { - return errors.Wrapf(errdefs.ErrInvalidArgument, "Target.Digest %q invalid: %v", target.Digest, err) + return fmt.Errorf("Target.Digest %q invalid: %v: %w", target.Digest, err, errdefs.ErrInvalidArgument) } if target.Size <= 0 { - return errors.Wrapf(errdefs.ErrInvalidArgument, "Target.Size must be greater than zero") + return fmt.Errorf("Target.Size must be greater than zero: %w", errdefs.ErrInvalidArgument) } if target.MediaType == "" { - return errors.Wrapf(errdefs.ErrInvalidArgument, "Target.MediaType must be set") + return fmt.Errorf("Target.MediaType must be set: %w", errdefs.ErrInvalidArgument) } return nil @@ -363,11 +341,11 @@ func writeImage(bkt *bolt.Bucket, image *images.Image) error { } if err := boltutil.WriteLabels(bkt, image.Labels); err != nil { - return errors.Wrapf(err, "writing labels for image %v", image.Name) + return fmt.Errorf("writing labels for image %v: %w", image.Name, err) } if err := boltutil.WriteAnnotations(bkt, image.Target.Annotations); err != nil { - return errors.Wrapf(err, "writing Annotations for image %v", image.Name) + return fmt.Errorf("writing Annotations for image %v: %w", image.Name, err) } // write the target bucket diff --git a/metadata/images_test.go b/metadata/images_test.go index 6d87588169d56..7d556b00053fb 100644 --- a/metadata/images_test.go +++ b/metadata/images_test.go @@ -17,6 +17,7 @@ package metadata import ( + "errors" "fmt" "reflect" "testing" @@ -27,7 +28,6 @@ import ( "github.com/containerd/containerd/images" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" ) func TestImagesList(t *testing.T) { @@ -500,7 +500,7 @@ func TestImagesCreateUpdateDelete(t *testing.T) { if testcase.createerr == nil { t.Fatalf("unexpected error: %v", err) } else { - t.Fatalf("cause of %v (cause: %v) != %v", err, errors.Cause(err), testcase.createerr) + t.Fatalf("cause of %v (cause: %v) != %v", err, errors.Unwrap(err), testcase.createerr) } } else if testcase.createerr != nil { return @@ -522,7 +522,7 @@ func TestImagesCreateUpdateDelete(t *testing.T) { if testcase.cause == nil { t.Fatalf("unexpected error: %v", err) } else { - t.Fatalf("cause of %v (cause: %v) != %v", err, errors.Cause(err), testcase.cause) + t.Fatalf("cause of %v (cause: %v) != %v", err, errors.Unwrap(err), testcase.cause) } } else if testcase.cause != nil { return diff --git a/metadata/leases.go b/metadata/leases.go index c559fca85ff63..03fa75af34651 100644 --- a/metadata/leases.go +++ b/metadata/leases.go @@ -18,6 +18,7 @@ package metadata import ( "context" + "errors" "fmt" "strings" "sync/atomic" @@ -29,7 +30,6 @@ import ( "github.com/containerd/containerd/metadata/boltutil" "github.com/containerd/containerd/namespaces" digest "github.com/opencontainers/go-digest" - "github.com/pkg/errors" bolt "go.etcd.io/bbolt" ) @@ -75,7 +75,7 @@ func (lm *leaseManager) Create(ctx context.Context, opts ...leases.Opt) (leases. if err == bolt.ErrBucketExists { err = errdefs.ErrAlreadyExists } - return errors.Wrapf(err, "lease %q", l.ID) + return fmt.Errorf("lease %q: %w", l.ID, err) } t := time.Now().UTC() @@ -111,11 +111,11 @@ func (lm *leaseManager) Delete(ctx context.Context, lease leases.Lease, _ ...lea return update(ctx, lm.db, func(tx *bolt.Tx) error { topbkt := getBucket(tx, bucketKeyVersion, []byte(namespace), bucketKeyObjectLeases) if topbkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "lease %q", lease.ID) + return fmt.Errorf("lease %q: %w", lease.ID, errdefs.ErrNotFound) } if err := topbkt.DeleteBucket([]byte(lease.ID)); err != nil { if err == bolt.ErrBucketNotFound { - err = errors.Wrapf(errdefs.ErrNotFound, "lease %q", lease.ID) + err = fmt.Errorf("lease %q: %w", lease.ID, errdefs.ErrNotFound) } return err } @@ -135,7 +135,7 @@ func (lm *leaseManager) List(ctx context.Context, fs ...string) ([]leases.Lease, filter, err := filters.ParseAll(fs...) if err != nil { - return nil, errors.Wrap(errdefs.ErrInvalidArgument, err.Error()) + return nil, fmt.Errorf("%s: %w", err.Error(), errdefs.ErrInvalidArgument) } var ll []leases.Lease @@ -192,7 +192,7 @@ func (lm *leaseManager) AddResource(ctx context.Context, lease leases.Lease, r l return update(ctx, lm.db, func(tx *bolt.Tx) error { topbkt := getBucket(tx, bucketKeyVersion, []byte(namespace), bucketKeyObjectLeases, []byte(lease.ID)) if topbkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "lease %q", lease.ID) + return fmt.Errorf("lease %q: %w", lease.ID, errdefs.ErrNotFound) } keys, ref, err := parseLeaseResource(r) @@ -221,7 +221,7 @@ func (lm *leaseManager) DeleteResource(ctx context.Context, lease leases.Lease, return update(ctx, lm.db, func(tx *bolt.Tx) error { topbkt := getBucket(tx, bucketKeyVersion, []byte(namespace), bucketKeyObjectLeases, []byte(lease.ID)) if topbkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "lease %q", lease.ID) + return fmt.Errorf("lease %q: %w", lease.ID, errdefs.ErrNotFound) } keys, ref, err := parseLeaseResource(r) @@ -262,7 +262,7 @@ func (lm *leaseManager) ListResources(ctx context.Context, lease leases.Lease) ( topbkt := getBucket(tx, bucketKeyVersion, []byte(namespace), bucketKeyObjectLeases, []byte(lease.ID)) if topbkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "lease %q", lease.ID) + return fmt.Errorf("lease %q: %w", lease.ID, errdefs.ErrNotFound) } // content resources @@ -333,7 +333,7 @@ func addSnapshotLease(ctx context.Context, tx *bolt.Tx, snapshotter, key string) bkt := getBucket(tx, bucketKeyVersion, []byte(namespace), bucketKeyObjectLeases, []byte(lid)) if bkt == nil { - return errors.Wrap(errdefs.ErrNotFound, "lease does not exist") + return fmt.Errorf("lease does not exist: %w", errdefs.ErrNotFound) } bkt, err := bkt.CreateBucketIfNotExists(bucketKeyObjectSnapshots) @@ -382,7 +382,7 @@ func addContentLease(ctx context.Context, tx *bolt.Tx, dgst digest.Digest) error bkt := getBucket(tx, bucketKeyVersion, []byte(namespace), bucketKeyObjectLeases, []byte(lid)) if bkt == nil { - return errors.Wrap(errdefs.ErrNotFound, "lease does not exist") + return fmt.Errorf("lease does not exist: %w", errdefs.ErrNotFound) } bkt, err := bkt.CreateBucketIfNotExists(bucketKeyObjectContent) @@ -426,7 +426,7 @@ func addIngestLease(ctx context.Context, tx *bolt.Tx, ref string) (bool, error) bkt := getBucket(tx, bucketKeyVersion, []byte(namespace), bucketKeyObjectLeases, []byte(lid)) if bkt == nil { - return false, errors.Wrap(errdefs.ErrNotFound, "lease does not exist") + return false, fmt.Errorf("lease does not exist: %w", errdefs.ErrNotFound) } bkt, err := bkt.CreateBucketIfNotExists(bucketKeyObjectIngests) @@ -473,22 +473,22 @@ func parseLeaseResource(r leases.Resource) ([]string, string, error) { string(bucketKeyObjectIngests): if len(keys) != 1 { - return nil, "", errors.Wrapf(errdefs.ErrInvalidArgument, "invalid resource type %s", typ) + return nil, "", fmt.Errorf("invalid resource type %s: %w", typ, errdefs.ErrInvalidArgument) } if k == string(bucketKeyObjectContent) { dgst, err := digest.Parse(ref) if err != nil { - return nil, "", errors.Wrapf(errdefs.ErrInvalidArgument, "invalid content resource id %s: %v", ref, err) + return nil, "", fmt.Errorf("invalid content resource id %s: %v: %w", ref, err, errdefs.ErrInvalidArgument) } ref = dgst.String() } case string(bucketKeyObjectSnapshots): if len(keys) != 2 { - return nil, "", errors.Wrapf(errdefs.ErrInvalidArgument, "invalid snapshot resource type %s", typ) + return nil, "", fmt.Errorf("invalid snapshot resource type %s: %w", typ, errdefs.ErrInvalidArgument) } default: - return nil, "", errors.Wrapf(errdefs.ErrNotImplemented, "resource type %s not supported yet", typ) + return nil, "", fmt.Errorf("resource type %s not supported yet: %w", typ, errdefs.ErrNotImplemented) } return keys, ref, nil diff --git a/metadata/leases_test.go b/metadata/leases_test.go index 383c842b2fe5e..be120ce7740a7 100644 --- a/metadata/leases_test.go +++ b/metadata/leases_test.go @@ -18,11 +18,12 @@ package metadata import ( _ "crypto/sha256" + "errors" + "fmt" "testing" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/leases" - "github.com/pkg/errors" bolt "go.etcd.io/bbolt" ) @@ -365,7 +366,7 @@ func TestLeaseResource(t *testing.T) { if err := db.Update(func(tx *bolt.Tx) error { err0 := lm.AddResource(WithTransactionContext(ctx, tx), tc.lease, tc.resource) if !errors.Is(err0, tc.err) { - return errors.Errorf("expect error (%v), but got (%v)", tc.err, err0) + return fmt.Errorf("expect error (%v), but got (%v)", tc.err, err0) } if err0 == nil { diff --git a/metadata/namespaces.go b/metadata/namespaces.go index 540fb83596b91..84eb83f2733e4 100644 --- a/metadata/namespaces.go +++ b/metadata/namespaces.go @@ -25,7 +25,6 @@ import ( "github.com/containerd/containerd/identifiers" l "github.com/containerd/containerd/labels" "github.com/containerd/containerd/namespaces" - "github.com/pkg/errors" bolt "go.etcd.io/bbolt" ) @@ -50,7 +49,7 @@ func (s *namespaceStore) Create(ctx context.Context, namespace string, labels ma for k, v := range labels { if err := l.Validate(k, v); err != nil { - return errors.Wrapf(err, "namespace.Labels") + return fmt.Errorf("namespace.Labels: %w", err) } } @@ -58,7 +57,7 @@ func (s *namespaceStore) Create(ctx context.Context, namespace string, labels ma bkt, err := topbkt.CreateBucket([]byte(namespace)) if err != nil { if err == bolt.ErrBucketExists { - return errors.Wrapf(errdefs.ErrAlreadyExists, "namespace %q", namespace) + return fmt.Errorf("namespace %q: %w", namespace, errdefs.ErrAlreadyExists) } return err @@ -98,7 +97,7 @@ func (s *namespaceStore) Labels(ctx context.Context, namespace string) (map[stri func (s *namespaceStore) SetLabel(ctx context.Context, namespace, key, value string) error { if err := l.Validate(key, value); err != nil { - return errors.Wrapf(err, "namespace.Labels") + return fmt.Errorf("namespace.Labels: %w", err) } return withNamespacesLabelsBucket(s.tx, namespace, func(bkt *bolt.Bucket) error { @@ -148,16 +147,16 @@ func (s *namespaceStore) Delete(ctx context.Context, namespace string, opts ...n } if len(types) > 0 { - return errors.Wrapf( - errdefs.ErrFailedPrecondition, - "namespace %q must be empty, but it still has %s", + return fmt.Errorf( + "namespace %q must be empty, but it still has %s: %w", namespace, strings.Join(types, ", "), + errdefs.ErrFailedPrecondition, ) } if err := bkt.DeleteBucket([]byte(namespace)); err != nil { if err == bolt.ErrBucketNotFound { - return errors.Wrapf(errdefs.ErrNotFound, "namespace %q", namespace) + return fmt.Errorf("namespace %q: %w", namespace, errdefs.ErrNotFound) } return err diff --git a/metadata/snapshot.go b/metadata/snapshot.go index 389aeda45eca6..348602093a616 100644 --- a/metadata/snapshot.go +++ b/metadata/snapshot.go @@ -32,7 +32,6 @@ import ( "github.com/containerd/containerd/mount" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/snapshots" - "github.com/pkg/errors" bolt "go.etcd.io/bbolt" ) @@ -88,7 +87,7 @@ func (s *snapshotter) resolveKey(ctx context.Context, key string) (string, error if err := view(ctx, s.db, func(tx *bolt.Tx) error { id = getKey(tx, ns, s.name, key) if id == "" { - return errors.Wrapf(errdefs.ErrNotFound, "snapshot %v does not exist", key) + return fmt.Errorf("snapshot %v does not exist: %w", key, errdefs.ErrNotFound) } return nil }); err != nil { @@ -113,18 +112,18 @@ func (s *snapshotter) Stat(ctx context.Context, key string) (snapshots.Info, err if err := view(ctx, s.db, func(tx *bolt.Tx) error { bkt := getSnapshotterBucket(tx, ns, s.name) if bkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "snapshot %v does not exist", key) + return fmt.Errorf("snapshot %v does not exist: %w", key, errdefs.ErrNotFound) } sbkt := bkt.Bucket([]byte(key)) if sbkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "snapshot %v does not exist", key) + return fmt.Errorf("snapshot %v does not exist: %w", key, errdefs.ErrNotFound) } local.Labels, err = boltutil.ReadLabels(sbkt) if err != nil { - return errors.Wrap(err, "failed to read labels") + return fmt.Errorf("failed to read labels: %w", err) } if err := boltutil.ReadTimestamps(sbkt, &local.Created, &local.Updated); err != nil { - return errors.Wrap(err, "failed to read timestamps") + return fmt.Errorf("failed to read timestamps: %w", err) } bkey = string(sbkt.Get(bucketKeyName)) local.Parent = string(sbkt.Get(bucketKeyParent)) @@ -152,7 +151,7 @@ func (s *snapshotter) Update(ctx context.Context, info snapshots.Info, fieldpath } if info.Name == "" { - return snapshots.Info{}, errors.Wrap(errdefs.ErrInvalidArgument, "") + return snapshots.Info{}, errdefs.ErrInvalidArgument } var ( @@ -165,19 +164,19 @@ func (s *snapshotter) Update(ctx context.Context, info snapshots.Info, fieldpath if err := update(ctx, s.db, func(tx *bolt.Tx) error { bkt := getSnapshotterBucket(tx, ns, s.name) if bkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "snapshot %v does not exist", info.Name) + return fmt.Errorf("snapshot %v does not exist: %w", info.Name, errdefs.ErrNotFound) } sbkt := bkt.Bucket([]byte(info.Name)) if sbkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "snapshot %v does not exist", info.Name) + return fmt.Errorf("snapshot %v does not exist: %w", info.Name, errdefs.ErrNotFound) } local.Labels, err = boltutil.ReadLabels(sbkt) if err != nil { - return errors.Wrap(err, "failed to read labels") + return fmt.Errorf("failed to read labels: %w", err) } if err := boltutil.ReadTimestamps(sbkt, &local.Created, &local.Updated); err != nil { - return errors.Wrap(err, "failed to read timestamps") + return fmt.Errorf("failed to read timestamps: %w", err) } // Handle field updates @@ -197,7 +196,7 @@ func (s *snapshotter) Update(ctx context.Context, info snapshots.Info, fieldpath case "labels": local.Labels = info.Labels default: - return errors.Wrapf(errdefs.ErrInvalidArgument, "cannot update %q field on snapshot %q", path, info.Name) + return fmt.Errorf("cannot update %q field on snapshot %q: %w", path, info.Name, errdefs.ErrInvalidArgument) } } } else { @@ -209,10 +208,10 @@ func (s *snapshotter) Update(ctx context.Context, info snapshots.Info, fieldpath local.Updated = time.Now().UTC() if err := boltutil.WriteTimestamps(sbkt, local.Created, local.Updated); err != nil { - return errors.Wrap(err, "failed to read timestamps") + return fmt.Errorf("failed to read timestamps: %w", err) } if err := boltutil.WriteLabels(sbkt, local.Labels); err != nil { - return errors.Wrap(err, "failed to read labels") + return fmt.Errorf("failed to read labels: %w", err) } bkey = string(sbkt.Get(bucketKeyName)) local.Parent = string(sbkt.Get(bucketKeyParent)) @@ -319,18 +318,18 @@ func (s *snapshotter) createSnapshot(ctx context.Context, key, parent string, re // Check if target exists, if so, return already exists if target != "" { if tbkt := bkt.Bucket([]byte(target)); tbkt != nil { - return errors.Wrapf(errdefs.ErrAlreadyExists, "target snapshot %q", target) + return fmt.Errorf("target snapshot %q: %w", target, errdefs.ErrAlreadyExists) } } if bbkt := bkt.Bucket([]byte(key)); bbkt != nil { - return errors.Wrapf(errdefs.ErrAlreadyExists, "snapshot %q", key) + return fmt.Errorf("snapshot %q: %w", key, errdefs.ErrAlreadyExists) } if parent != "" { pbkt := bkt.Bucket([]byte(parent)) if pbkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "parent snapshot %v does not exist", parent) + return fmt.Errorf("parent snapshot %v does not exist: %w", parent, errdefs.ErrNotFound) } bparent = string(pbkt.Get(bucketKeyName)) } @@ -378,11 +377,11 @@ func (s *snapshotter) createSnapshot(ctx context.Context, key, parent string, re return nil }, filter); err != nil { - return nil, errors.Wrap(err, "failed walking backend snapshots") + return nil, fmt.Errorf("failed walking backend snapshots: %w", err) } if tinfo == nil { - return nil, errors.Wrapf(errdefs.ErrNotFound, "target snapshot %q in backend", target) + return nil, fmt.Errorf("target snapshot %q in backend: %w", target, errdefs.ErrNotFound) } key = target @@ -401,12 +400,12 @@ func (s *snapshotter) createSnapshot(ctx context.Context, key, parent string, re } // Propagate this error after the final update - rerr = errors.Wrapf(errdefs.ErrAlreadyExists, "target snapshot %q from snapshotter", target) + rerr = fmt.Errorf("target snapshot %q from snapshotter: %w", target, errdefs.ErrAlreadyExists) } else { // This condition is unexpected as the key provided is expected // to be new and unique, return as unknown response from backend // to avoid confusing callers handling already exists. - return nil, errors.Wrapf(errdefs.ErrUnknown, "unexpected error from snapshotter: %v", err) + return nil, fmt.Errorf("unexpected error from snapshotter: %v: %w", err, errdefs.ErrUnknown) } } else if err != nil { return nil, err @@ -420,7 +419,7 @@ func (s *snapshotter) createSnapshot(ctx context.Context, key, parent string, re if txerr := update(ctx, s.db, func(tx *bolt.Tx) error { bkt := getSnapshotterBucket(tx, ns, s.name) if bkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "can not find snapshotter %q", s.name) + return fmt.Errorf("can not find snapshotter %q: %w", s.name, errdefs.ErrNotFound) } if err := addSnapshotLease(ctx, tx, s.name, key); err != nil { @@ -433,7 +432,7 @@ func (s *snapshotter) createSnapshot(ctx context.Context, key, parent string, re return err } if rerr == nil { - rerr = errors.Wrapf(errdefs.ErrAlreadyExists, "snapshot %q", key) + rerr = fmt.Errorf("snapshot %q: %w", key, errdefs.ErrAlreadyExists) } return nil } @@ -441,7 +440,7 @@ func (s *snapshotter) createSnapshot(ctx context.Context, key, parent string, re if parent != "" { pbkt := bkt.Bucket([]byte(parent)) if pbkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "parent snapshot %v does not exist", parent) + return fmt.Errorf("parent snapshot %v does not exist: %w", parent, errdefs.ErrNotFound) } // Ensure the backend's parent matches the metadata store's parent @@ -451,7 +450,7 @@ func (s *snapshotter) createSnapshot(ctx context.Context, key, parent string, re // uniqueness of the reference relationships, the metadata store // can only error out to prevent inconsistent data. if bparent != string(pbkt.Get(bucketKeyName)) { - return errors.Wrapf(errdefs.ErrInvalidArgument, "mismatched parent %s from target %s", parent, target) + return fmt.Errorf("mismatched parent %s from target %s: %w", parent, target, errdefs.ErrInvalidArgument) } cbkt, err := pbkt.CreateBucketIfNotExists(bucketKeyChildren) @@ -516,14 +515,14 @@ func (s *snapshotter) Commit(ctx context.Context, name, key string, opts ...snap if err := update(ctx, s.db, func(tx *bolt.Tx) error { bkt := getSnapshotterBucket(tx, ns, s.name) if bkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, - "can not find snapshotter %q", s.name) + return fmt.Errorf("can not find snapshotter %q: %w", + s.name, errdefs.ErrNotFound) } bbkt, err := bkt.CreateBucket([]byte(name)) if err != nil { if err == bolt.ErrBucketExists { - err = errors.Wrapf(errdefs.ErrAlreadyExists, "snapshot %q", name) + err = fmt.Errorf("snapshot %q: %w", name, errdefs.ErrAlreadyExists) } return err } @@ -533,7 +532,7 @@ func (s *snapshotter) Commit(ctx context.Context, name, key string, opts ...snap obkt := bkt.Bucket([]byte(key)) if obkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "snapshot %v does not exist", key) + return fmt.Errorf("snapshot %v does not exist: %w", key, errdefs.ErrNotFound) } bkey := string(obkt.Get(bucketKeyName)) @@ -553,7 +552,7 @@ func (s *snapshotter) Commit(ctx context.Context, name, key string, opts ...snap if len(parent) > 0 { pbkt := bkt.Bucket(parent) if pbkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "parent snapshot %v does not exist", string(parent)) + return fmt.Errorf("parent snapshot %v does not exist: %w", string(parent), errdefs.ErrNotFound) } cbkt, err := pbkt.CreateBucketIfNotExists(bucketKeyChildren) @@ -639,13 +638,13 @@ func (s *snapshotter) Remove(ctx context.Context, key string) error { sbkt = bkt.Bucket([]byte(key)) } if sbkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "snapshot %v does not exist", key) + return fmt.Errorf("snapshot %v does not exist: %w", key, errdefs.ErrNotFound) } cbkt := sbkt.Bucket(bucketKeyChildren) if cbkt != nil { if child, _ := cbkt.Cursor().First(); child != nil { - return errors.Wrap(errdefs.ErrFailedPrecondition, "cannot remove snapshot with child") + return fmt.Errorf("cannot remove snapshot with child: %w", errdefs.ErrFailedPrecondition) } } @@ -653,12 +652,12 @@ func (s *snapshotter) Remove(ctx context.Context, key string) error { if len(parent) > 0 { pbkt := bkt.Bucket(parent) if pbkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "parent snapshot %v does not exist", string(parent)) + return fmt.Errorf("parent snapshot %v does not exist: %w", string(parent), errdefs.ErrNotFound) } cbkt := pbkt.Bucket(bucketKeyChildren) if cbkt != nil { if err := cbkt.Delete([]byte(key)); err != nil { - return errors.Wrap(err, "failed to remove child link") + return fmt.Errorf("failed to remove child link: %w", err) } } } @@ -784,13 +783,14 @@ func (s *snapshotter) Walk(ctx context.Context, fn snapshots.WalkFunc, fs ...str func validateSnapshot(info *snapshots.Info) error { for k, v := range info.Labels { if err := labels.Validate(k, v); err != nil { - return errors.Wrapf(err, "info.Labels") + return fmt.Errorf("info.Labels: %w", err) } } return nil } +// garbageCollect removes all snapshots that are no longer used. func (s *snapshotter) garbageCollect(ctx context.Context) (d time.Duration, err error) { s.l.Lock() t1 := time.Now() diff --git a/metadata/snapshot_test.go b/metadata/snapshot_test.go index 93c3c9d729a47..9cfb205e70915 100644 --- a/metadata/snapshot_test.go +++ b/metadata/snapshot_test.go @@ -18,6 +18,7 @@ package metadata import ( "context" + "fmt" "os" "path/filepath" "reflect" @@ -34,7 +35,6 @@ import ( "github.com/containerd/containerd/snapshots" "github.com/containerd/containerd/snapshots/native" "github.com/containerd/containerd/snapshots/testsuite" - "github.com/pkg/errors" bolt "go.etcd.io/bbolt" ) @@ -319,7 +319,7 @@ func (s *tmpSnapshotter) create(ctx context.Context, key, parent string, kind sn if target != "" { for _, name := range s.targets[target] { if s.snapshots[name].Parent == parent { - return nil, errors.Wrap(errdefs.ErrAlreadyExists, "found target") + return nil, fmt.Errorf("found target: %w", errdefs.ErrAlreadyExists) } } } @@ -355,7 +355,7 @@ func (s *tmpSnapshotter) Commit(ctx context.Context, name, key string, opts ...s base.Kind = snapshots.KindCommitted if _, ok := s.snapshots[name]; ok { - return errors.Wrap(errdefs.ErrAlreadyExists, "found name") + return fmt.Errorf("found name: %w", errdefs.ErrAlreadyExists) } src, ok := s.snapshots[key] diff --git a/mount/fmountat_linux.go b/mount/fmountat_linux.go index 705b95ede47da..850a92acf6c5c 100644 --- a/mount/fmountat_linux.go +++ b/mount/fmountat_linux.go @@ -17,12 +17,12 @@ package mount import ( + "fmt" "runtime" "syscall" "unsafe" "github.com/containerd/containerd/log" - "github.com/pkg/errors" "golang.org/x/sys/unix" ) @@ -62,7 +62,7 @@ func fMountat(dirfd uintptr, source, target, fstype string, flags uintptr, data var pipefds [2]int if err := syscall.Pipe2(pipefds[:], syscall.O_CLOEXEC); err != nil { - return errors.Wrap(err, "failed to open pipe") + return fmt.Errorf("failed to open pipe: %w", err) } defer func() { @@ -82,7 +82,7 @@ func fMountat(dirfd uintptr, source, target, fstype string, flags uintptr, data ) if errno != 0 { - return errors.Wrap(errno, "failed to fork thread") + return fmt.Errorf("failed to fork thread: %w", errno) } defer func() { @@ -101,11 +101,11 @@ func fMountat(dirfd uintptr, source, target, fstype string, flags uintptr, data uintptr(unsafe.Pointer(&status)), unsafe.Sizeof(status)) if errno != 0 { - return errors.Wrap(errno, "failed to read pipe") + return fmt.Errorf("failed to read pipe: %w", errno) } if status != 0 { - return errors.Wrap(status, "failed to mount") + return fmt.Errorf("failed to mount: %w", status) } return nil diff --git a/mount/fmountat_linux_test.go b/mount/fmountat_linux_test.go index a74c1617379ff..026effe6bdba0 100644 --- a/mount/fmountat_linux_test.go +++ b/mount/fmountat_linux_test.go @@ -17,6 +17,7 @@ package mount import ( + "errors" "os" "path/filepath" "syscall" @@ -24,7 +25,6 @@ import ( "time" "github.com/containerd/continuity/fs/fstest" - "github.com/pkg/errors" "golang.org/x/sys/unix" ) @@ -125,7 +125,7 @@ func testFMountatWithFileFd(t *testing.T, root string) { err = fMountat(f.Fd(), filepath.Join(root, "empty"), filepath.Join(root, "work"), "", 0, "") if !errors.Is(err, expectedErr) { - t.Fatalf("expected error %v, but got %v", expectedErr, errors.Cause(err)) + t.Fatalf("expected error %v, but got %v", expectedErr, errors.Unwrap(err)) } } diff --git a/mount/lookup_unix.go b/mount/lookup_unix.go index 7a4683e953e2d..44881750b265f 100644 --- a/mount/lookup_unix.go +++ b/mount/lookup_unix.go @@ -20,10 +20,10 @@ package mount import ( + "fmt" "path/filepath" "github.com/moby/sys/mountinfo" - "github.com/pkg/errors" ) // Lookup returns the mount info corresponds to the path. @@ -32,10 +32,10 @@ func Lookup(dir string) (Info, error) { m, err := mountinfo.GetMounts(mountinfo.ParentsFilter(dir)) if err != nil { - return Info{}, errors.Wrapf(err, "failed to find the mount info for %q", dir) + return Info{}, fmt.Errorf("failed to find the mount info for %q: %w", dir, err) } if len(m) == 0 { - return Info{}, errors.Errorf("failed to find the mount info for %q", dir) + return Info{}, fmt.Errorf("failed to find the mount info for %q", dir) } // find the longest matching mount point diff --git a/mount/losetup_linux.go b/mount/losetup_linux.go index e99e962f12c76..9a68017901a22 100644 --- a/mount/losetup_linux.go +++ b/mount/losetup_linux.go @@ -17,6 +17,7 @@ package mount import ( + "errors" "fmt" "math/rand" "os" @@ -25,7 +26,6 @@ import ( "time" "unsafe" - "github.com/pkg/errors" "golang.org/x/sys/unix" ) @@ -59,12 +59,12 @@ func ioctl(fd, req, args uintptr) (uintptr, uintptr, error) { func getFreeLoopDev() (uint32, error) { ctrl, err := os.OpenFile(loopControlPath, os.O_RDWR, 0) if err != nil { - return 0, errors.Errorf("could not open %v: %v", loopControlPath, err) + return 0, fmt.Errorf("could not open %v: %v", loopControlPath, err) } defer ctrl.Close() num, _, err := ioctl(ctrl.Fd(), unix.LOOP_CTL_GET_FREE, 0) if err != nil { - return 0, errors.Wrap(err, "could not get free loop device") + return 0, fmt.Errorf("could not get free loop device: %w", err) } return uint32(num), nil } @@ -81,13 +81,13 @@ func setupLoopDev(backingFile, loopDev string, param LoopParams) (_ *os.File, re back, err := os.OpenFile(backingFile, flags, 0) if err != nil { - return nil, errors.Wrapf(err, "could not open backing file: %s", backingFile) + return nil, fmt.Errorf("could not open backing file: %s: %w", backingFile, err) } defer back.Close() loop, err := os.OpenFile(loopDev, flags, 0) if err != nil { - return nil, errors.Wrapf(err, "could not open loop device: %s", loopDev) + return nil, fmt.Errorf("could not open loop device: %s: %w", loopDev, err) } defer func() { if retErr != nil { @@ -97,7 +97,7 @@ func setupLoopDev(backingFile, loopDev string, param LoopParams) (_ *os.File, re // 2. Set FD if _, _, err = ioctl(loop.Fd(), unix.LOOP_SET_FD, back.Fd()); err != nil { - return nil, errors.Wrapf(err, "could not set loop fd for device: %s", loopDev) + return nil, fmt.Errorf("could not set loop fd for device: %s: %w", loopDev, err) } // 3. Set Info @@ -131,7 +131,7 @@ func setupLoopDev(backingFile, loopDev string, param LoopParams) (_ *os.File, re } _, _, _ = ioctl(loop.Fd(), unix.LOOP_CLR_FD, 0) - return nil, errors.Errorf("failed to set loop device info: %v", err) + return nil, fmt.Errorf("failed to set loop device info: %v", err) } // setupLoop looks for (and possibly creates) a free loop device, and @@ -200,7 +200,7 @@ func AttachLoopDevice(backingFile string) (string, error) { func DetachLoopDevice(devices ...string) error { for _, dev := range devices { if err := removeLoop(dev); err != nil { - return errors.Wrapf(err, "failed to remove loop device: %s", dev) + return fmt.Errorf("failed to remove loop device: %s: %w", dev, err) } } diff --git a/mount/mount_freebsd.go b/mount/mount_freebsd.go index c7c48568e729a..3711383c61344 100644 --- a/mount/mount_freebsd.go +++ b/mount/mount_freebsd.go @@ -17,10 +17,11 @@ package mount import ( + "errors" + "fmt" "os" "time" - "github.com/pkg/errors" exec "golang.org/x/sys/execabs" "golang.org/x/sys/unix" ) @@ -64,7 +65,7 @@ func (m *Mount) mountWithHelper(target string) error { return nil } if !errors.Is(err, unix.ECHILD) { - return errors.Wrapf(err, "mount [%v] failed: %q", args, string(out)) + return fmt.Errorf("mount [%v] failed: %q: %w", args, string(out), err) } // We got ECHILD, we are not sure whether the mount was successful. // If the mount ID has changed, we are sure we got some new mount, but still not sure it is fully completed. @@ -77,7 +78,7 @@ func (m *Mount) mountWithHelper(target string) error { _ = unmount(target, 0) } } - return errors.Errorf("mount [%v] failed with ECHILD (retired %d times)", args, retriesOnECHILD) + return fmt.Errorf("mount [%v] failed with ECHILD (retired %d times)", args, retriesOnECHILD) } // Unmount the provided mount path with the flags @@ -101,7 +102,7 @@ func unmount(target string, flags int) error { } return nil } - return errors.Wrapf(unix.EBUSY, "failed to unmount target %s", target) + return fmt.Errorf("failed to unmount target %s: %w", target, unix.EBUSY) } // UnmountAll repeatedly unmounts the given mount point until there diff --git a/mount/mount_linux.go b/mount/mount_linux.go index 42a53dbf6cb94..a69f65c2ddd32 100644 --- a/mount/mount_linux.go +++ b/mount/mount_linux.go @@ -17,13 +17,13 @@ package mount import ( + "errors" "fmt" "os" "path" "strings" "time" - "github.com/pkg/errors" exec "golang.org/x/sys/execabs" "golang.org/x/sys/unix" ) @@ -163,7 +163,7 @@ func unmount(target string, flags int) error { } return nil } - return errors.Wrapf(unix.EBUSY, "failed to unmount target %s", target) + return fmt.Errorf("failed to unmount target %s: %w", target, unix.EBUSY) } // UnmountAll repeatedly unmounts the given mount point until there @@ -365,19 +365,22 @@ func mountAt(chdir string, source, target, fstype string, flags uintptr, data st f, err := os.Open(chdir) if err != nil { - return errors.Wrap(err, "failed to mountat") + return fmt.Errorf("failed to mountat: %w", err) } defer f.Close() fs, err := f.Stat() if err != nil { - return errors.Wrap(err, "failed to mountat") + return fmt.Errorf("failed to mountat: %w", err) } if !fs.IsDir() { - return errors.Wrap(errors.Errorf("%s is not dir", chdir), "failed to mountat") + return fmt.Errorf("failed to mountat: %s is not dir", chdir) } - return errors.Wrap(fMountat(f.Fd(), source, target, fstype, flags, data), "failed to mountat") + if err := fMountat(f.Fd(), source, target, fstype, flags, data); err != nil { + return fmt.Errorf("failed to mountat: %w", err) + } + return nil } func (m *Mount) mountWithHelper(helperBinary, typePrefix, target string) error { @@ -406,7 +409,7 @@ func (m *Mount) mountWithHelper(helperBinary, typePrefix, target string) error { return nil } if !errors.Is(err, unix.ECHILD) { - return errors.Wrapf(err, "mount helper [%s %v] failed: %q", helperBinary, args, string(out)) + return fmt.Errorf("mount helper [%s %v] failed: %q: %w", helperBinary, args, string(out), err) } // We got ECHILD, we are not sure whether the mount was successful. // If the mount ID has changed, we are sure we got some new mount, but still not sure it is fully completed. @@ -419,5 +422,5 @@ func (m *Mount) mountWithHelper(helperBinary, typePrefix, target string) error { _ = unmount(target, 0) } } - return errors.Errorf("mount helper [%s %v] failed with ECHILD (retired %d times)", helperBinary, args, retriesOnECHILD) + return fmt.Errorf("mount helper [%s %v] failed with ECHILD (retired %d times)", helperBinary, args, retriesOnECHILD) } diff --git a/mount/mount_unix.go b/mount/mount_unix.go index 0e5306073050b..795bb4bfe1d0b 100644 --- a/mount/mount_unix.go +++ b/mount/mount_unix.go @@ -19,7 +19,7 @@ package mount -import "github.com/pkg/errors" +import "errors" var ( // ErrNotImplementOnUnix is returned for methods that are not implemented diff --git a/mount/mount_windows.go b/mount/mount_windows.go index 57e589f034ac8..87fed8268ead4 100644 --- a/mount/mount_windows.go +++ b/mount/mount_windows.go @@ -18,12 +18,13 @@ package mount import ( "encoding/json" + "errors" + "fmt" "os" "path/filepath" "strings" "github.com/Microsoft/hcsshim" - "github.com/pkg/errors" ) var ( @@ -34,7 +35,7 @@ var ( // Mount to the provided target func (m *Mount) Mount(target string) error { if m.Type != "windows-layer" { - return errors.Errorf("invalid windows mount type: '%s'", m.Type) + return fmt.Errorf("invalid windows mount type: '%s'", m.Type) } home, layerID := filepath.Split(m.Source) @@ -49,22 +50,22 @@ func (m *Mount) Mount(target string) error { } if err = hcsshim.ActivateLayer(di, layerID); err != nil { - return errors.Wrapf(err, "failed to activate layer %s", m.Source) + return fmt.Errorf("failed to activate layer %s: %w", m.Source, err) } if err = hcsshim.PrepareLayer(di, layerID, parentLayerPaths); err != nil { - return errors.Wrapf(err, "failed to prepare layer %s", m.Source) + return fmt.Errorf("failed to prepare layer %s: %w", m.Source, err) } // We can link the layer mount path to the given target. It is an UNC path, and it needs // a trailing backslash. mountPath, err := hcsshim.GetLayerMountPath(di, layerID) if err != nil { - return errors.Wrapf(err, "failed to get layer mount path for %s", m.Source) + return fmt.Errorf("failed to get layer mount path for %s: %w", m.Source, err) } mountPath = mountPath + `\` if err = os.Symlink(mountPath, target); err != nil { - return errors.Wrapf(err, "failed to link mount to taget %s", target) + return fmt.Errorf("failed to link mount to taget %s: %w", target, err) } return nil } @@ -80,7 +81,7 @@ func (m *Mount) GetParentPaths() ([]string, error) { if strings.HasPrefix(option, ParentLayerPathsFlag) { err := json.Unmarshal([]byte(option[len(ParentLayerPathsFlag):]), &parentLayerPaths) if err != nil { - return nil, errors.Wrap(err, "failed to unmarshal parent layer paths from mount") + return nil, fmt.Errorf("failed to unmarshal parent layer paths from mount: %w", err) } } } @@ -97,10 +98,10 @@ func Unmount(mount string, flags int) error { ) if err := hcsshim.UnprepareLayer(di, layerID); err != nil { - return errors.Wrapf(err, "failed to unprepare layer %s", mount) + return fmt.Errorf("failed to unprepare layer %s: %w", mount, err) } if err := hcsshim.DeactivateLayer(di, layerID); err != nil { - return errors.Wrapf(err, "failed to deactivate layer %s", mount) + return fmt.Errorf("failed to deactivate layer %s: %w", mount, err) } return nil diff --git a/mount/temp.go b/mount/temp.go index e304d4c33e52a..13eedaf035994 100644 --- a/mount/temp.go +++ b/mount/temp.go @@ -18,10 +18,10 @@ package mount import ( "context" + "fmt" "os" "github.com/containerd/containerd/log" - "github.com/pkg/errors" ) var tempMountLocation = getTempDir() @@ -32,7 +32,7 @@ var tempMountLocation = getTempDir() func WithTempMount(ctx context.Context, mounts []Mount, f func(root string) error) (err error) { root, uerr := os.MkdirTemp(tempMountLocation, "containerd-mount") if uerr != nil { - return errors.Wrapf(uerr, "failed to create temp dir") + return fmt.Errorf("failed to create temp dir: %w", uerr) } // We use Remove here instead of RemoveAll. // The RemoveAll will delete the temp dir and all children it contains. @@ -50,18 +50,21 @@ func WithTempMount(ctx context.Context, mounts []Mount, f func(root string) erro // We should do defer first, if not we will not do Unmount when only a part of Mounts are failed. defer func() { if uerr = UnmountAll(root, 0); uerr != nil { - uerr = errors.Wrapf(uerr, "failed to unmount %s", root) + uerr = fmt.Errorf("failed to unmount %s: %w", root, uerr) if err == nil { err = uerr } else { - err = errors.Wrap(err, uerr.Error()) + err = fmt.Errorf("%s: %w", uerr.Error(), err) } } }() if uerr = All(mounts, root); uerr != nil { - return errors.Wrapf(uerr, "failed to mount %s", root) + return fmt.Errorf("failed to mount %s: %w", root, uerr) } - return errors.Wrapf(f(root), "mount callback failed on %s", root) + if err := f(root); err != nil { + return fmt.Errorf("mount callback failed on %s: %w", root, err) + } + return nil } func getTempDir() string { diff --git a/namespaces/context.go b/namespaces/context.go index b53c9012c1b4c..e5e23fe430147 100644 --- a/namespaces/context.go +++ b/namespaces/context.go @@ -18,11 +18,11 @@ package namespaces import ( "context" + "fmt" "os" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/identifiers" - "github.com/pkg/errors" ) const ( @@ -69,10 +69,10 @@ func Namespace(ctx context.Context) (string, bool) { func NamespaceRequired(ctx context.Context) (string, error) { namespace, ok := Namespace(ctx) if !ok || namespace == "" { - return "", errors.Wrapf(errdefs.ErrFailedPrecondition, "namespace is required") + return "", fmt.Errorf("namespace is required: %w", errdefs.ErrFailedPrecondition) } if err := identifiers.Validate(namespace); err != nil { - return "", errors.Wrap(err, "namespace validation") + return "", fmt.Errorf("namespace validation: %w", err) } return namespace, nil } diff --git a/oci/spec_opts.go b/oci/spec_opts.go index b89b83c162397..9b0cfc3f17986 100644 --- a/oci/spec_opts.go +++ b/oci/spec_opts.go @@ -20,6 +20,7 @@ import ( "bufio" "context" "encoding/json" + "errors" "fmt" "os" "path/filepath" @@ -37,7 +38,6 @@ import ( v1 "github.com/opencontainers/image-spec/specs-go/v1" "github.com/opencontainers/runc/libcontainer/user" "github.com/opencontainers/runtime-spec/specs-go" - "github.com/pkg/errors" ) // SpecOpts sets spec specific information to a newly generated OCI spec @@ -138,7 +138,7 @@ func WithSpecFromBytes(p []byte) SpecOpts { return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error { *s = Spec{} // make sure spec is cleared. if err := json.Unmarshal(p, s); err != nil { - return errors.Wrapf(err, "decoding spec config file failed, current supported OCI runtime-spec : v%s", specs.Version) + return fmt.Errorf("decoding spec config file failed, current supported OCI runtime-spec : v%s: %w", specs.Version, err) } return nil } @@ -149,7 +149,7 @@ func WithSpecFromFile(filename string) SpecOpts { return func(ctx context.Context, c Client, container *containers.Container, s *Spec) error { p, err := os.ReadFile(filename) if err != nil { - return errors.Wrap(err, "cannot load spec config file") + return fmt.Errorf("cannot load spec config file: %w", err) } return WithSpecFromBytes(p)(ctx, c, container, s) } @@ -602,6 +602,8 @@ func WithUser(userstr string) SpecOpts { if err != nil { return err } + + mounts = tryReadonlyMounts(mounts) return mount.WithTempMount(ctx, mounts, f) default: return fmt.Errorf("invalid USER value %s", userstr) @@ -655,6 +657,8 @@ func WithUserID(uid uint32) SpecOpts { if err != nil { return err } + + mounts = tryReadonlyMounts(mounts) return mount.WithTempMount(ctx, mounts, func(root string) error { user, err := UserFromPath(root, func(u user.User) bool { return u.Uid == int(uid) @@ -706,6 +710,8 @@ func WithUsername(username string) SpecOpts { if err != nil { return err } + + mounts = tryReadonlyMounts(mounts) return mount.WithTempMount(ctx, mounts, func(root string) error { user, err := UserFromPath(root, func(u user.User) bool { return u.Name == username @@ -790,6 +796,8 @@ func WithAdditionalGIDs(userstr string) SpecOpts { if err != nil { return err } + + mounts = tryReadonlyMounts(mounts) return mount.WithTempMount(ctx, mounts, setAdditionalGids) } } @@ -1278,3 +1286,21 @@ func WithDevShmSize(kb int64) SpecOpts { return ErrNoShmMount } } + +// tryReadonlyMounts is used by the options which are trying to get user/group +// information from container's rootfs. Since the option does read operation +// only, this helper will append ReadOnly mount option to prevent linux kernel +// from syncing whole filesystem in umount syscall. +// +// TODO(fuweid): +// +// Currently, it only works for overlayfs. I think we can apply it to other +// kinds of filesystem. Maybe we can return `ro` option by `snapshotter.Mount` +// API, when the caller passes that experimental annotation +// `containerd.io/snapshot/readonly.mount` something like that. +func tryReadonlyMounts(mounts []mount.Mount) []mount.Mount { + if len(mounts) == 1 && mounts[0].Type == "overlay" { + mounts[0].Options = append(mounts[0].Options, "ro") + } + return mounts +} diff --git a/oci/spec_opts_nonlinux.go b/oci/spec_opts_nonlinux.go index b241e384f0854..c990fc6349260 100644 --- a/oci/spec_opts_nonlinux.go +++ b/oci/spec_opts_nonlinux.go @@ -21,9 +21,9 @@ package oci import ( "context" + "errors" "github.com/containerd/containerd/containers" - "github.com/pkg/errors" ) // WithAllCurrentCapabilities propagates the effective capabilities of the caller process to the container process. diff --git a/oci/spec_opts_windows.go b/oci/spec_opts_windows.go index 5c386b9d44327..5502257a48ac2 100644 --- a/oci/spec_opts_windows.go +++ b/oci/spec_opts_windows.go @@ -18,10 +18,10 @@ package oci import ( "context" + "errors" "github.com/containerd/containerd/containers" specs "github.com/opencontainers/runtime-spec/specs-go" - "github.com/pkg/errors" ) // WithWindowsCPUCount sets the `Windows.Resources.CPU.Count` section to the diff --git a/oci/utils_unix.go b/oci/utils_unix.go index f43d894c3afce..db75b0bade0a1 100644 --- a/oci/utils_unix.go +++ b/oci/utils_unix.go @@ -20,12 +20,13 @@ package oci import ( + "errors" + "fmt" "os" "path/filepath" "github.com/containerd/containerd/pkg/userns" specs "github.com/opencontainers/runtime-spec/specs-go" - "github.com/pkg/errors" "golang.org/x/sys/unix" ) @@ -47,7 +48,7 @@ func HostDevices() ([]specs.LinuxDevice, error) { func getDevices(path, containerPath string) ([]specs.LinuxDevice, error) { stat, err := os.Stat(path) if err != nil { - return nil, errors.Wrap(err, "error stating device path") + return nil, fmt.Errorf("error stating device path: %w", err) } if !stat.IsDir() { diff --git a/pkg/cap/cap_linux.go b/pkg/cap/cap_linux.go index 9c37fba161dc0..26212573dc723 100644 --- a/pkg/cap/cap_linux.go +++ b/pkg/cap/cap_linux.go @@ -19,12 +19,11 @@ package cap import ( "bufio" + "fmt" "io" "os" "strconv" "strings" - - "github.com/pkg/errors" ) // FromNumber returns a cap string like "CAP_SYS_ADMIN" @@ -91,7 +90,7 @@ func ParseProcPIDStatus(r io.Reader) (map[Type]uint64, error) { case "CapInh", "CapPrm", "CapEff", "CapBnd", "CapAmb": ui64, err := strconv.ParseUint(v, 16, 64) if err != nil { - return nil, errors.Errorf("failed to parse line %q", line) + return nil, fmt.Errorf("failed to parse line %q", line) } switch k { case "CapInh": diff --git a/pkg/cri/config/config.go b/pkg/cri/config/config.go index 54fb4b16d18dd..9a986efb7cc41 100644 --- a/pkg/cri/config/config.go +++ b/pkg/cri/config/config.go @@ -18,12 +18,13 @@ package config import ( "context" + "errors" + "fmt" "net/url" "time" "github.com/containerd/containerd/log" "github.com/containerd/containerd/plugin" - "github.com/pkg/errors" ) // Runtime struct to contain the type(ID), engine, and root variables for a default runtime @@ -346,7 +347,7 @@ func ValidatePluginConfig(ctx context.Context, c *PluginConfig) error { if c.ContainerdConfig.UntrustedWorkloadRuntime.Type != "" { log.G(ctx).Warning("`untrusted_workload_runtime` is deprecated, please use `untrusted` runtime in `runtimes` instead") if _, ok := c.ContainerdConfig.Runtimes[RuntimeUntrusted]; ok { - return errors.Errorf("conflicting definitions: configuration includes both `untrusted_workload_runtime` and `runtimes[%q]`", RuntimeUntrusted) + return fmt.Errorf("conflicting definitions: configuration includes both `untrusted_workload_runtime` and `runtimes[%q]`", RuntimeUntrusted) } c.ContainerdConfig.Runtimes[RuntimeUntrusted] = c.ContainerdConfig.UntrustedWorkloadRuntime } @@ -363,19 +364,19 @@ func ValidatePluginConfig(ctx context.Context, c *PluginConfig) error { return errors.New("`default_runtime_name` is empty") } if _, ok := c.ContainerdConfig.Runtimes[c.ContainerdConfig.DefaultRuntimeName]; !ok { - return errors.Errorf("no corresponding runtime configured in `containerd.runtimes` for `containerd` `default_runtime_name = \"%s\"", c.ContainerdConfig.DefaultRuntimeName) + return fmt.Errorf("no corresponding runtime configured in `containerd.runtimes` for `containerd` `default_runtime_name = \"%s\"", c.ContainerdConfig.DefaultRuntimeName) } // Validation for deprecated runtime options. if c.SystemdCgroup { if c.ContainerdConfig.Runtimes[c.ContainerdConfig.DefaultRuntimeName].Type != plugin.RuntimeLinuxV1 { - return errors.Errorf("`systemd_cgroup` only works for runtime %s", plugin.RuntimeLinuxV1) + return fmt.Errorf("`systemd_cgroup` only works for runtime %s", plugin.RuntimeLinuxV1) } log.G(ctx).Warning("`systemd_cgroup` is deprecated, please use runtime `options` instead") } if c.NoPivot { if c.ContainerdConfig.Runtimes[c.ContainerdConfig.DefaultRuntimeName].Type != plugin.RuntimeLinuxV1 { - return errors.Errorf("`no_pivot` only works for runtime %s", plugin.RuntimeLinuxV1) + return fmt.Errorf("`no_pivot` only works for runtime %s", plugin.RuntimeLinuxV1) } // NoPivot can't be deprecated yet, because there is no alternative config option // for `io.containerd.runtime.v1.linux`. @@ -383,13 +384,13 @@ func ValidatePluginConfig(ctx context.Context, c *PluginConfig) error { for _, r := range c.ContainerdConfig.Runtimes { if r.Engine != "" { if r.Type != plugin.RuntimeLinuxV1 { - return errors.Errorf("`runtime_engine` only works for runtime %s", plugin.RuntimeLinuxV1) + return fmt.Errorf("`runtime_engine` only works for runtime %s", plugin.RuntimeLinuxV1) } log.G(ctx).Warning("`runtime_engine` is deprecated, please use runtime `options` instead") } if r.Root != "" { if r.Type != plugin.RuntimeLinuxV1 { - return errors.Errorf("`runtime_root` only works for runtime %s", plugin.RuntimeLinuxV1) + return fmt.Errorf("`runtime_root` only works for runtime %s", plugin.RuntimeLinuxV1) } log.G(ctx).Warning("`runtime_root` is deprecated, please use runtime `options` instead") } @@ -425,7 +426,7 @@ func ValidatePluginConfig(ctx context.Context, c *PluginConfig) error { auth := auth u, err := url.Parse(endpoint) if err != nil { - return errors.Wrapf(err, "failed to parse registry url %q from `registry.auths`", endpoint) + return fmt.Errorf("failed to parse registry url %q from `registry.auths`: %w", endpoint, err) } if u.Scheme != "" { // Do not include the scheme in the new registry config. @@ -441,7 +442,7 @@ func ValidatePluginConfig(ctx context.Context, c *PluginConfig) error { // Validation for stream_idle_timeout if c.StreamIdleTimeout != "" { if _, err := time.ParseDuration(c.StreamIdleTimeout); err != nil { - return errors.Wrap(err, "invalid stream idle timeout") + return fmt.Errorf("invalid stream idle timeout: %w", err) } } return nil diff --git a/pkg/cri/cri.go b/pkg/cri/cri.go index d798e873264f9..7182716b616da 100644 --- a/pkg/cri/cri.go +++ b/pkg/cri/cri.go @@ -18,6 +18,7 @@ package cri import ( "flag" + "fmt" "path/filepath" "github.com/containerd/containerd" @@ -35,7 +36,6 @@ import ( "github.com/containerd/containerd/services" "github.com/containerd/containerd/snapshots" imagespec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" "github.com/sirupsen/logrus" "k8s.io/klog/v2" @@ -44,7 +44,6 @@ import ( "github.com/containerd/containerd/pkg/cri/server" ) -// TODO(random-liu): Use github.com/pkg/errors for our errors. // Register CRI service plugin func init() { config := criconfig.DefaultConfig() @@ -66,7 +65,7 @@ func initCRIService(ic *plugin.InitContext) (interface{}, error) { ctx := ic.Context pluginConfig := ic.Config.(*criconfig.PluginConfig) if err := criconfig.ValidatePluginConfig(ctx, pluginConfig); err != nil { - return nil, errors.Wrap(err, "invalid plugin config") + return nil, fmt.Errorf("invalid plugin config: %w", err) } c := criconfig.Config{ @@ -79,12 +78,12 @@ func initCRIService(ic *plugin.InitContext) (interface{}, error) { log.G(ctx).Infof("Start cri plugin with config %+v", c) if err := setGLogLevel(); err != nil { - return nil, errors.Wrap(err, "failed to set glog level") + return nil, fmt.Errorf("failed to set glog level: %w", err) } servicesOpts, err := getServicesOpts(ic) if err != nil { - return nil, errors.Wrap(err, "failed to get services") + return nil, fmt.Errorf("failed to get services: %w", err) } log.G(ctx).Info("Connect containerd service") @@ -95,12 +94,12 @@ func initCRIService(ic *plugin.InitContext) (interface{}, error) { containerd.WithServices(servicesOpts...), ) if err != nil { - return nil, errors.Wrap(err, "failed to create containerd client") + return nil, fmt.Errorf("failed to create containerd client: %w", err) } s, err := server.NewCRIService(c, client) if err != nil { - return nil, errors.Wrap(err, "failed to create CRI service") + return nil, fmt.Errorf("failed to create CRI service: %w", err) } go func() { @@ -116,12 +115,12 @@ func initCRIService(ic *plugin.InitContext) (interface{}, error) { func getServicesOpts(ic *plugin.InitContext) ([]containerd.ServicesOpt, error) { plugins, err := ic.GetByType(plugin.ServicePlugin) if err != nil { - return nil, errors.Wrap(err, "failed to get service plugin") + return nil, fmt.Errorf("failed to get service plugin: %w", err) } ep, err := ic.Get(plugin.EventPlugin) if err != nil { - return nil, errors.Wrap(err, "failed to get event plugin") + return nil, fmt.Errorf("failed to get event plugin: %w", err) } opts := []containerd.ServicesOpt{ @@ -158,14 +157,14 @@ func getServicesOpts(ic *plugin.InitContext) ([]containerd.ServicesOpt, error) { } { p := plugins[s] if p == nil { - return nil, errors.Errorf("service %q not found", s) + return nil, fmt.Errorf("service %q not found", s) } i, err := p.Instance() if err != nil { - return nil, errors.Wrapf(err, "failed to get instance of service %q", s) + return nil, fmt.Errorf("failed to get instance of service %q: %w", s, err) } if i == nil { - return nil, errors.Errorf("instance of service %q not found", s) + return nil, fmt.Errorf("instance of service %q not found", s) } opts = append(opts, fn(i)) } diff --git a/pkg/cri/io/helpers_windows.go b/pkg/cri/io/helpers_windows.go index 1dbb1aa61dfda..b6c9c12028fc8 100644 --- a/pkg/cri/io/helpers_windows.go +++ b/pkg/cri/io/helpers_windows.go @@ -17,13 +17,13 @@ package io import ( + "fmt" "io" "net" "os" "sync" winio "github.com/Microsoft/go-winio" - "github.com/pkg/errors" "golang.org/x/net/context" ) @@ -60,7 +60,7 @@ func openPipe(ctx context.Context, fn string, flag int, perm os.FileMode) (io.Re func (p *pipe) Write(b []byte) (int, error) { p.conWg.Wait() if p.conErr != nil { - return 0, errors.Wrap(p.conErr, "connection error") + return 0, fmt.Errorf("connection error: %w", p.conErr) } return p.con.Write(b) } @@ -68,7 +68,7 @@ func (p *pipe) Write(b []byte) (int, error) { func (p *pipe) Read(b []byte) (int, error) { p.conWg.Wait() if p.conErr != nil { - return 0, errors.Wrap(p.conErr, "connection error") + return 0, fmt.Errorf("connection error: %w", p.conErr) } return p.con.Read(b) } diff --git a/pkg/cri/opts/container.go b/pkg/cri/opts/container.go index f619bc311a86f..b3e358b2ebbf6 100644 --- a/pkg/cri/opts/container.go +++ b/pkg/cri/opts/container.go @@ -18,6 +18,8 @@ package opts import ( "context" + "errors" + "fmt" "os" "path/filepath" goruntime "runtime" @@ -30,7 +32,6 @@ import ( "github.com/containerd/containerd/mount" "github.com/containerd/containerd/snapshots" "github.com/containerd/continuity/fs" - "github.com/pkg/errors" ) // WithNewSnapshot wraps `containerd.WithNewSnapshot` so that if creating the @@ -44,7 +45,7 @@ func WithNewSnapshot(id string, i containerd.Image, opts ...snapshots.Opt) conta } if err := i.Unpack(ctx, c.Snapshotter); err != nil { - return errors.Wrap(err, "error unpacking image") + return fmt.Errorf("error unpacking image: %w", err) } return f(ctx, client, c) } @@ -102,7 +103,7 @@ func WithVolumes(volumeMounts map[string]string) containerd.NewContainerOpts { } else { mountPaths = append(mountPaths, root) if err := mount.All(mounts, root); err != nil { - return errors.Wrap(err, "failed to mount") + return fmt.Errorf("failed to mount: %w", err) } defer unmounter(root) } @@ -117,10 +118,10 @@ func WithVolumes(volumeMounts map[string]string) containerd.NewContainerOpts { // Skip copying directory if it does not exist. continue } - return errors.Wrap(err, "stat volume in rootfs") + return fmt.Errorf("stat volume in rootfs: %w", err) } if err := copyExistingContents(src, host); err != nil { - return errors.Wrap(err, "taking runtime copy of volume") + return fmt.Errorf("taking runtime copy of volume: %w", err) } } } @@ -136,7 +137,7 @@ func copyExistingContents(source, destination string) error { return err } if len(dstList) != 0 { - return errors.Errorf("volume at %q is not initially empty", destination) + return fmt.Errorf("volume at %q is not initially empty", destination) } return fs.CopyDir(destination, source, fs.WithXAttrExclude("security.selinux")) } diff --git a/pkg/cri/opts/spec.go b/pkg/cri/opts/spec.go index 17d1c08e4d78f..df10fbf501c38 100644 --- a/pkg/cri/opts/spec.go +++ b/pkg/cri/opts/spec.go @@ -18,16 +18,15 @@ package opts import ( "context" + "errors" "os" "path/filepath" "strings" "github.com/containerd/containerd/containers" "github.com/containerd/containerd/oci" - imagespec "github.com/opencontainers/image-spec/specs-go/v1" runtimespec "github.com/opencontainers/runtime-spec/specs-go" - "github.com/pkg/errors" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/opts/spec_linux.go b/pkg/cri/opts/spec_linux.go index 7babd23d9ec1f..9306d42b656a0 100644 --- a/pkg/cri/opts/spec_linux.go +++ b/pkg/cri/opts/spec_linux.go @@ -18,6 +18,7 @@ package opts import ( "context" + "errors" "fmt" "os" "path/filepath" @@ -33,7 +34,6 @@ import ( "github.com/containerd/containerd/oci" runtimespec "github.com/opencontainers/runtime-spec/specs-go" "github.com/opencontainers/selinux/go-selinux/label" - "github.com/pkg/errors" "github.com/sirupsen/logrus" "golang.org/x/sys/unix" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" @@ -159,17 +159,17 @@ func WithMounts(osi osinterface.OS, config *runtime.ContainerConfig, extra []*ru // TODO(random-liu): Add CRI validation test for this case. if _, err := osi.Stat(src); err != nil { if !os.IsNotExist(err) { - return errors.Wrapf(err, "failed to stat %q", src) + return fmt.Errorf("failed to stat %q: %w", src, err) } if err := osi.MkdirAll(src, 0755); err != nil { - return errors.Wrapf(err, "failed to mkdir %q", src) + return fmt.Errorf("failed to mkdir %q: %w", src, err) } } // TODO(random-liu): Add cri-containerd integration test or cri validation test // for this. src, err := osi.ResolveSymbolicLink(src) if err != nil { - return errors.Wrapf(err, "failed to resolve symlink %q", src) + return fmt.Errorf("failed to resolve symlink %q: %w", src, err) } if s.Linux == nil { s.Linux = &runtimespec.Linux{} @@ -210,7 +210,7 @@ func WithMounts(osi osinterface.OS, config *runtime.ContainerConfig, extra []*ru if mount.GetSelinuxRelabel() { if err := label.Relabel(src, mountLabel, false); err != nil && err != unix.ENOTSUP { - return errors.Wrapf(err, "relabel %q with %q failed", src, mountLabel) + return fmt.Errorf("relabel %q with %q failed: %w", src, mountLabel, err) } } s.Mounts = append(s.Mounts, runtimespec.Mount{ @@ -239,7 +239,7 @@ func ensureShared(path string, lookupMount func(string) (mount.Info, error)) err } } - return errors.Errorf("path %q is mounted on %q but it is not a shared mount", path, mountInfo.Mountpoint) + return fmt.Errorf("path %q is mounted on %q but it is not a shared mount", path, mountInfo.Mountpoint) } // ensure mount point on which path is mounted, is either shared or slave. @@ -257,7 +257,7 @@ func ensureSharedOrSlave(path string, lookupMount func(string) (mount.Info, erro return nil } } - return errors.Errorf("path %q is mounted on %q but it is not a shared or slave mount", path, mountInfo.Mountpoint) + return fmt.Errorf("path %q is mounted on %q but it is not a shared or slave mount", path, mountInfo.Mountpoint) } // getDeviceUserGroupID() is used to find the right uid/gid @@ -514,7 +514,7 @@ var ( func cgroupv1HasHugetlb() (bool, error) { _cgroupv1HasHugetlbOnce.Do(func() { if _, err := os.ReadDir("/sys/fs/cgroup/hugetlb"); err != nil { - _cgroupv1HasHugetlbErr = errors.Wrap(err, "readdir /sys/fs/cgroup/hugetlb") + _cgroupv1HasHugetlbErr = fmt.Errorf("readdir /sys/fs/cgroup/hugetlb: %w", err) _cgroupv1HasHugetlb = false } else { _cgroupv1HasHugetlbErr = nil @@ -530,7 +530,7 @@ func cgroupv2HasHugetlb() (bool, error) { _cgroupv2HasHugetlbOnce.Do(func() { controllers, err := os.ReadFile("/sys/fs/cgroup/cgroup.controllers") if err != nil { - _cgroupv2HasHugetlbErr = errors.Wrap(err, "read /sys/fs/cgroup/cgroup.controllers") + _cgroupv2HasHugetlbErr = fmt.Errorf("read /sys/fs/cgroup/cgroup.controllers: %w", err) return } _cgroupv2HasHugetlb = strings.Contains(string(controllers), "hugetlb") @@ -678,12 +678,12 @@ func nullOpt(_ context.Context, _ oci.Client, _ *containers.Container, _ *runtim func getCurrentOOMScoreAdj() (int, error) { b, err := os.ReadFile("/proc/self/oom_score_adj") if err != nil { - return 0, errors.Wrap(err, "could not get the daemon oom_score_adj") + return 0, fmt.Errorf("could not get the daemon oom_score_adj: %w", err) } s := strings.TrimSpace(string(b)) i, err := strconv.Atoi(s) if err != nil { - return 0, errors.Wrap(err, "could not get the daemon oom_score_adj") + return 0, fmt.Errorf("could not get the daemon oom_score_adj: %w", err) } return i, nil } diff --git a/pkg/cri/opts/spec_windows.go b/pkg/cri/opts/spec_windows.go index 213095eeeb178..c534c180c4751 100644 --- a/pkg/cri/opts/spec_windows.go +++ b/pkg/cri/opts/spec_windows.go @@ -18,6 +18,7 @@ package opts import ( "context" + "fmt" "os" "path/filepath" "sort" @@ -26,7 +27,6 @@ import ( "github.com/containerd/containerd/containers" "github.com/containerd/containerd/oci" runtimespec "github.com/opencontainers/runtime-spec/specs-go" - "github.com/pkg/errors" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" osinterface "github.com/containerd/containerd/pkg/os" @@ -124,16 +124,16 @@ func WithWindowsMounts(osi osinterface.OS, config *runtime.ContainerConfig, extr // the behavior with the Linux implementation, but it doesn't // align with Docker's behavior on Windows. if !os.IsNotExist(err) { - return errors.Wrapf(err, "failed to stat %q", src) + return fmt.Errorf("failed to stat %q: %w", src, err) } if err := osi.MkdirAll(src, 0755); err != nil { - return errors.Wrapf(err, "failed to mkdir %q", src) + return fmt.Errorf("failed to mkdir %q: %w", src, err) } } var err error src, err = osi.ResolveSymbolicLink(src) if err != nil { - return errors.Wrapf(err, "failed to resolve symlink %q", src) + return fmt.Errorf("failed to resolve symlink %q: %w", src, err) } // hcsshim requires clean path, especially '/' -> '\'. Additionally, // for the destination, absolute paths should have the C: prefix. diff --git a/pkg/cri/server/cni_conf_syncer.go b/pkg/cri/server/cni_conf_syncer.go index 401cb34a34a14..2d3940056b976 100644 --- a/pkg/cri/server/cni_conf_syncer.go +++ b/pkg/cri/server/cni_conf_syncer.go @@ -17,12 +17,12 @@ package server import ( + "fmt" "os" "sync" cni "github.com/containerd/go-cni" "github.com/fsnotify/fsnotify" - "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -43,15 +43,15 @@ type cniNetConfSyncer struct { func newCNINetConfSyncer(confDir string, netPlugin cni.CNI, loadOpts []cni.Opt) (*cniNetConfSyncer, error) { watcher, err := fsnotify.NewWatcher() if err != nil { - return nil, errors.Wrap(err, "failed to create fsnotify watcher") + return nil, fmt.Errorf("failed to create fsnotify watcher: %w", err) } if err := os.MkdirAll(confDir, 0700); err != nil { - return nil, errors.Wrapf(err, "failed to create cni conf dir=%s for watch", confDir) + return nil, fmt.Errorf("failed to create cni conf dir=%s for watch: %w", confDir, err) } if err := watcher.Add(confDir); err != nil { - return nil, errors.Wrapf(err, "failed to watch cni conf dir %s", confDir) + return nil, fmt.Errorf("failed to watch cni conf dir %s: %w", confDir, err) } syncer := &cniNetConfSyncer{ diff --git a/pkg/cri/server/container_attach.go b/pkg/cri/server/container_attach.go index f5ba0fcf75729..a9521505164e9 100644 --- a/pkg/cri/server/container_attach.go +++ b/pkg/cri/server/container_attach.go @@ -17,11 +17,11 @@ package server import ( + "fmt" "io" "github.com/containerd/containerd" "github.com/containerd/containerd/log" - "github.com/pkg/errors" "golang.org/x/net/context" "k8s.io/client-go/tools/remotecommand" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" @@ -33,11 +33,11 @@ import ( func (c *criService) Attach(ctx context.Context, r *runtime.AttachRequest) (*runtime.AttachResponse, error) { cntr, err := c.containerStore.Get(r.GetContainerId()) if err != nil { - return nil, errors.Wrap(err, "failed to find container in store") + return nil, fmt.Errorf("failed to find container in store: %w", err) } state := cntr.Status.Get().State() if state != runtime.ContainerState_CONTAINER_RUNNING { - return nil, errors.Errorf("container is in %s state", criContainerStateToString(state)) + return nil, fmt.Errorf("container is in %s state", criContainerStateToString(state)) } return c.streamServer.GetAttach(r) } @@ -49,18 +49,18 @@ func (c *criService) attachContainer(ctx context.Context, id string, stdin io.Re // Get container from our container store. cntr, err := c.containerStore.Get(id) if err != nil { - return errors.Wrapf(err, "failed to find container %q in store", id) + return fmt.Errorf("failed to find container %q in store: %w", id, err) } id = cntr.ID state := cntr.Status.Get().State() if state != runtime.ContainerState_CONTAINER_RUNNING { - return errors.Errorf("container is in %s state", criContainerStateToString(state)) + return fmt.Errorf("container is in %s state", criContainerStateToString(state)) } task, err := cntr.Container.Task(ctx, nil) if err != nil { - return errors.Wrap(err, "failed to load task") + return fmt.Errorf("failed to load task: %w", err) } handleResizing(ctx, resize, func(size remotecommand.TerminalSize) { if err := task.Resize(ctx, uint32(size.Width), uint32(size.Height)); err != nil { diff --git a/pkg/cri/server/container_create.go b/pkg/cri/server/container_create.go index 39ac33a9eb53c..abfdb937a9064 100644 --- a/pkg/cri/server/container_create.go +++ b/pkg/cri/server/container_create.go @@ -17,6 +17,8 @@ package server import ( + "errors" + "fmt" "path/filepath" "time" @@ -30,7 +32,6 @@ import ( imagespec "github.com/opencontainers/image-spec/specs-go/v1" runtimespec "github.com/opencontainers/runtime-spec/specs-go" selinux "github.com/opencontainers/selinux/go-selinux" - "github.com/pkg/errors" "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" @@ -53,12 +54,12 @@ func (c *criService) CreateContainer(ctx context.Context, r *runtime.CreateConta sandboxConfig := r.GetSandboxConfig() sandbox, err := c.sandboxStore.Get(r.GetPodSandboxId()) if err != nil { - return nil, errors.Wrapf(err, "failed to find sandbox id %q", r.GetPodSandboxId()) + return nil, fmt.Errorf("failed to find sandbox id %q: %w", r.GetPodSandboxId(), err) } sandboxID := sandbox.ID s, err := sandbox.Container.Task(ctx, nil) if err != nil { - return nil, errors.Wrap(err, "failed to get sandbox container task") + return nil, fmt.Errorf("failed to get sandbox container task: %w", err) } sandboxPid := s.Pid() @@ -74,7 +75,7 @@ func (c *criService) CreateContainer(ctx context.Context, r *runtime.CreateConta name := makeContainerName(metadata, sandboxConfig.GetMetadata()) log.G(ctx).Debugf("Generated id %q for container %q", id, name) if err = c.containerNameIndex.Reserve(name, id); err != nil { - return nil, errors.Wrapf(err, "failed to reserve container name %q", name) + return nil, fmt.Errorf("failed to reserve container name %q: %w", name, err) } defer func() { // Release the name if the function returns with an error. @@ -95,25 +96,25 @@ func (c *criService) CreateContainer(ctx context.Context, r *runtime.CreateConta // been pulled before creating the container, so do not ensure the image. image, err := c.localResolve(config.GetImage().GetImage()) if err != nil { - return nil, errors.Wrapf(err, "failed to resolve image %q", config.GetImage().GetImage()) + return nil, fmt.Errorf("failed to resolve image %q: %w", config.GetImage().GetImage(), err) } containerdImage, err := c.toContainerdImage(ctx, image) if err != nil { - return nil, errors.Wrapf(err, "failed to get image from containerd %q", image.ID) + return nil, fmt.Errorf("failed to get image from containerd %q: %w", image.ID, err) } start := time.Now() // Run container using the same runtime with sandbox. sandboxInfo, err := sandbox.Container.Info(ctx) if err != nil { - return nil, errors.Wrapf(err, "failed to get sandbox %q info", sandboxID) + return nil, fmt.Errorf("failed to get sandbox %q info: %w", sandboxID, err) } // Create container root directory. containerRootDir := c.getContainerRootDir(id) if err = c.os.MkdirAll(containerRootDir, 0755); err != nil { - return nil, errors.Wrapf(err, "failed to create container root directory %q", - containerRootDir) + return nil, fmt.Errorf("failed to create container root directory %q: %w", + containerRootDir, err) } defer func() { if retErr != nil { @@ -126,8 +127,8 @@ func (c *criService) CreateContainer(ctx context.Context, r *runtime.CreateConta }() volatileContainerRootDir := c.getVolatileContainerRootDir(id) if err = c.os.MkdirAll(volatileContainerRootDir, 0755); err != nil { - return nil, errors.Wrapf(err, "failed to create volatile container root directory %q", - volatileContainerRootDir) + return nil, fmt.Errorf("failed to create volatile container root directory %q: %w", + volatileContainerRootDir, err) } defer func() { if retErr != nil { @@ -152,14 +153,14 @@ func (c *criService) CreateContainer(ctx context.Context, r *runtime.CreateConta ociRuntime, err := c.getSandboxRuntime(sandboxConfig, sandbox.Metadata.RuntimeHandler) if err != nil { - return nil, errors.Wrap(err, "failed to get sandbox runtime") + return nil, fmt.Errorf("failed to get sandbox runtime: %w", err) } log.G(ctx).Debugf("Use OCI runtime %+v for sandbox %q and container %q", ociRuntime, sandboxID, id) spec, err := c.containerSpec(id, sandboxID, sandboxPid, sandbox.NetNSPath, containerName, containerdImage.Name(), config, sandboxConfig, &image.ImageSpec.Config, append(mounts, volumeMounts...), ociRuntime) if err != nil { - return nil, errors.Wrapf(err, "failed to generate container %q spec", id) + return nil, fmt.Errorf("failed to generate container %q spec: %w", id, err) } meta.ProcessLabel = spec.Process.SelinuxLabel @@ -216,7 +217,7 @@ func (c *criService) CreateContainer(ctx context.Context, r *runtime.CreateConta containerIO, err := cio.NewContainerIO(id, cio.WithNewFIFOs(volatileContainerRootDir, config.GetTty(), config.GetStdin())) if err != nil { - return nil, errors.Wrap(err, "failed to create container io") + return nil, fmt.Errorf("failed to create container io: %w", err) } defer func() { if retErr != nil { @@ -228,14 +229,14 @@ func (c *criService) CreateContainer(ctx context.Context, r *runtime.CreateConta specOpts, err := c.containerSpecOpts(config, &image.ImageSpec.Config) if err != nil { - return nil, errors.Wrap(err, "failed to get container spec opts") + return nil, fmt.Errorf("failed to get container spec opts: %w", err) } containerLabels := buildLabels(config.Labels, image.ImageSpec.Config.Labels, containerKindContainer) runtimeOptions, err := getRuntimeOptions(sandboxInfo) if err != nil { - return nil, errors.Wrap(err, "failed to get runtime options") + return nil, fmt.Errorf("failed to get runtime options: %w", err) } opts = append(opts, containerd.WithSpec(spec, specOpts...), @@ -244,7 +245,7 @@ func (c *criService) CreateContainer(ctx context.Context, r *runtime.CreateConta containerd.WithContainerExtension(containerMetadataExtension, &meta)) var cntr containerd.Container if cntr, err = c.client.NewContainer(ctx, id, opts...); err != nil { - return nil, errors.Wrap(err, "failed to create containerd container") + return nil, fmt.Errorf("failed to create containerd container: %w", err) } defer func() { if retErr != nil { @@ -263,7 +264,7 @@ func (c *criService) CreateContainer(ctx context.Context, r *runtime.CreateConta containerstore.WithContainerIO(containerIO), ) if err != nil { - return nil, errors.Wrapf(err, "failed to create internal container object for %q", id) + return nil, fmt.Errorf("failed to create internal container object for %q: %w", id, err) } defer func() { if retErr != nil { @@ -276,7 +277,7 @@ func (c *criService) CreateContainer(ctx context.Context, r *runtime.CreateConta // Add container into container store. if err := c.containerStore.Add(container); err != nil { - return nil, errors.Wrapf(err, "failed to add container %q into store", id) + return nil, fmt.Errorf("failed to add container %q into store: %w", id, err) } containerCreateTimer.WithValues(ociRuntime.Type).UpdateSince(start) @@ -321,19 +322,19 @@ func (c *criService) runtimeSpec(id string, baseSpecFile string, opts ...oci.Spe if baseSpecFile != "" { baseSpec, ok := c.baseOCISpecs[baseSpecFile] if !ok { - return nil, errors.Errorf("can't find base OCI spec %q", baseSpecFile) + return nil, fmt.Errorf("can't find base OCI spec %q", baseSpecFile) } spec := oci.Spec{} if err := util.DeepCopy(&spec, &baseSpec); err != nil { - return nil, errors.Wrap(err, "failed to clone OCI spec") + return nil, fmt.Errorf("failed to clone OCI spec: %w", err) } // Fix up cgroups path applyOpts := append([]oci.SpecOpts{oci.WithNamespacedCgroup()}, opts...) if err := oci.ApplyOpts(ctx, nil, container, &spec, applyOpts...); err != nil { - return nil, errors.Wrap(err, "failed to apply OCI options") + return nil, fmt.Errorf("failed to apply OCI options: %w", err) } return &spec, nil @@ -341,7 +342,7 @@ func (c *criService) runtimeSpec(id string, baseSpecFile string, opts ...oci.Spe spec, err := oci.GenerateSpec(ctx, nil, container, opts...) if err != nil { - return nil, errors.Wrap(err, "failed to generate spec") + return nil, fmt.Errorf("failed to generate spec: %w", err) } return spec, nil diff --git a/pkg/cri/server/container_create_linux.go b/pkg/cri/server/container_create_linux.go index 359f2ada99706..8fb41e21009ed 100644 --- a/pkg/cri/server/container_create_linux.go +++ b/pkg/cri/server/container_create_linux.go @@ -18,6 +18,8 @@ package server import ( "bufio" + "errors" + "fmt" "io" "os" "strconv" @@ -31,7 +33,6 @@ import ( runtimespec "github.com/opencontainers/runtime-spec/specs-go" selinux "github.com/opencontainers/selinux/go-selinux" "github.com/opencontainers/selinux/go-selinux/label" - "github.com/pkg/errors" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" "github.com/containerd/containerd/pkg/cri/annotations" @@ -187,7 +188,7 @@ func (c *criService) containerSpec( processLabel, mountLabel, err := label.InitLabels(labelOptions) if err != nil { - return nil, errors.Wrapf(err, "failed to init selinux options %+v", securityContext.GetSelinuxOptions()) + return nil, fmt.Errorf("failed to init selinux options %+v: %w", securityContext.GetSelinuxOptions(), err) } defer func() { if retErr != nil { @@ -262,7 +263,7 @@ func (c *criService) containerSpec( // Get RDT class rdtClass, err := c.rdtClassFromAnnotations(config.GetMetadata().GetName(), config.Annotations, sandboxConfig.Annotations) if err != nil { - return nil, errors.Wrap(err, "failed to set RDT class") + return nil, fmt.Errorf("failed to set RDT class: %w", err) } if rdtClass != "" { specOpts = append(specOpts, oci.WithRdt(rdtClass, "", "")) @@ -286,7 +287,7 @@ func (c *criService) containerSpec( if nsOpts.GetPid() == runtime.NamespaceMode_TARGET { targetContainer, err := c.validateTargetContainer(sandboxID, nsOpts.TargetId) if err != nil { - return nil, errors.Wrapf(err, "invalid target container") + return nil, fmt.Errorf("invalid target container: %w", err) } status := targetContainer.Status.Get() @@ -328,7 +329,7 @@ func (c *criService) containerSpecOpts(config *runtime.ContainerConfig, imageCon securityContext.GetRunAsUser(), securityContext.GetRunAsGroup()) if err != nil { - return nil, errors.Wrap(err, "failed to generate user string") + return nil, fmt.Errorf("failed to generate user string: %w", err) } if userstr == "" { // Lastly, since no user override was passed via CRI try to set via OCI @@ -352,7 +353,7 @@ func (c *criService) containerSpecOpts(config *runtime.ContainerConfig, imageCon if asp == nil { asp, err = generateApparmorSecurityProfile(securityContext.GetApparmorProfile()) //nolint:staticcheck // Deprecated but we don't want to remove yet if err != nil { - return nil, errors.Wrap(err, "failed to generate apparmor spec opts") + return nil, fmt.Errorf("failed to generate apparmor spec opts: %w", err) } } apparmorSpecOpts, err := generateApparmorSpecOpts( @@ -360,7 +361,7 @@ func (c *criService) containerSpecOpts(config *runtime.ContainerConfig, imageCon securityContext.GetPrivileged(), c.apparmorEnabled()) if err != nil { - return nil, errors.Wrap(err, "failed to generate apparmor spec opts") + return nil, fmt.Errorf("failed to generate apparmor spec opts: %w", err) } if apparmorSpecOpts != nil { specOpts = append(specOpts, apparmorSpecOpts) @@ -372,7 +373,7 @@ func (c *criService) containerSpecOpts(config *runtime.ContainerConfig, imageCon securityContext.GetSeccompProfilePath(), //nolint:staticcheck // Deprecated but we don't want to remove yet c.config.UnsetSeccompProfile) if err != nil { - return nil, errors.Wrap(err, "failed to generate seccomp spec opts") + return nil, fmt.Errorf("failed to generate seccomp spec opts: %w", err) } } seccompSpecOpts, err := c.generateSeccompSpecOpts( @@ -380,7 +381,7 @@ func (c *criService) containerSpecOpts(config *runtime.ContainerConfig, imageCon securityContext.GetPrivileged(), c.seccompEnabled()) if err != nil { - return nil, errors.Wrap(err, "failed to generate seccomp spec opts") + return nil, fmt.Errorf("failed to generate seccomp spec opts: %w", err) } if seccompSpecOpts != nil { specOpts = append(specOpts, seccompSpecOpts) @@ -417,7 +418,7 @@ func generateSecurityProfile(profilePath string) (*runtime.SecurityProfile, erro default: // Require and Trim default profile name prefix if !strings.HasPrefix(profilePath, profileNamePrefix) { - return nil, errors.Errorf("invalid profile %q", profilePath) + return nil, fmt.Errorf("invalid profile %q", profilePath) } return &runtime.SecurityProfile{ ProfileType: runtime.SecurityProfile_Localhost, @@ -503,9 +504,9 @@ func generateApparmorSpecOpts(sp *runtime.SecurityProfile, privileged, apparmorE appArmorProfile := strings.TrimPrefix(sp.LocalhostRef, profileNamePrefix) if profileExists, err := appArmorProfileExists(appArmorProfile); !profileExists { if err != nil { - return nil, errors.Wrap(err, "failed to generate apparmor spec opts") + return nil, fmt.Errorf("failed to generate apparmor spec opts: %w", err) } - return nil, errors.Errorf("apparmor profile not found %s", appArmorProfile) + return nil, fmt.Errorf("apparmor profile not found %s", appArmorProfile) } return apparmor.WithProfile(appArmorProfile), nil default: @@ -568,7 +569,7 @@ func generateUserString(username string, uid, gid *runtime.Int64Value) (string, } if userstr == "" { if groupstr != "" { - return "", errors.Errorf("user group %q is specified without user", groupstr) + return "", fmt.Errorf("user group %q is specified without user", groupstr) } return "", nil } diff --git a/pkg/cri/server/container_create_linux_test.go b/pkg/cri/server/container_create_linux_test.go index d41f3b6863dd6..95f2aa6de7aad 100644 --- a/pkg/cri/server/container_create_linux_test.go +++ b/pkg/cri/server/container_create_linux_test.go @@ -18,6 +18,7 @@ package server import ( "context" + "errors" "fmt" "os" "path/filepath" @@ -33,7 +34,6 @@ import ( imagespec "github.com/opencontainers/image-spec/specs-go/v1" runtimespec "github.com/opencontainers/runtime-spec/specs-go" "github.com/opencontainers/selinux/go-selinux" - "github.com/pkg/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" diff --git a/pkg/cri/server/container_exec.go b/pkg/cri/server/container_exec.go index e870ffa42f9b5..0a27792ec0dfb 100644 --- a/pkg/cri/server/container_exec.go +++ b/pkg/cri/server/container_exec.go @@ -17,7 +17,8 @@ package server import ( - "github.com/pkg/errors" + "fmt" + "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) @@ -26,11 +27,11 @@ import ( func (c *criService) Exec(ctx context.Context, r *runtime.ExecRequest) (*runtime.ExecResponse, error) { cntr, err := c.containerStore.Get(r.GetContainerId()) if err != nil { - return nil, errors.Wrapf(err, "failed to find container %q in store", r.GetContainerId()) + return nil, fmt.Errorf("failed to find container %q in store: %w", r.GetContainerId(), err) } state := cntr.Status.Get().State() if state != runtime.ContainerState_CONTAINER_RUNNING { - return nil, errors.Errorf("container is in %s state", criContainerStateToString(state)) + return nil, fmt.Errorf("container is in %s state", criContainerStateToString(state)) } return c.streamServer.GetExec(r) } diff --git a/pkg/cri/server/container_execsync.go b/pkg/cri/server/container_execsync.go index 3b1c58c464447..9be392f9c4964 100644 --- a/pkg/cri/server/container_execsync.go +++ b/pkg/cri/server/container_execsync.go @@ -18,6 +18,7 @@ package server import ( "bytes" + "fmt" "io" "syscall" "time" @@ -27,7 +28,6 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/log" "github.com/containerd/containerd/oci" - "github.com/pkg/errors" "golang.org/x/net/context" "k8s.io/client-go/tools/remotecommand" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" @@ -49,7 +49,7 @@ func (c *criService) ExecSync(ctx context.Context, r *runtime.ExecSyncRequest) ( timeout: time.Duration(r.GetTimeout()) * time.Second, }) if err != nil { - return nil, errors.Wrap(err, "failed to exec in container") + return nil, fmt.Errorf("failed to exec in container: %w", err) } return &runtime.ExecSyncResponse{ @@ -79,18 +79,18 @@ func (c *criService) execInternal(ctx context.Context, container containerd.Cont spec, err := container.Spec(ctx) if err != nil { - return nil, errors.Wrap(err, "failed to get container spec") + return nil, fmt.Errorf("failed to get container spec: %w", err) } task, err := container.Task(ctx, nil) if err != nil { - return nil, errors.Wrap(err, "failed to load task") + return nil, fmt.Errorf("failed to load task: %w", err) } pspec := spec.Process pspec.Terminal = opts.tty if opts.tty { if err := oci.WithEnv([]string{"TERM=xterm"})(ctx, nil, nil, spec); err != nil { - return nil, errors.Wrap(err, "add TERM env var to spec") + return nil, fmt.Errorf("add TERM env var to spec: %w", err) } } @@ -114,7 +114,7 @@ func (c *criService) execInternal(ctx context.Context, container containerd.Cont }, ) if err != nil { - return nil, errors.Wrapf(err, "failed to create exec %q", execID) + return nil, fmt.Errorf("failed to create exec %q: %w", execID, err) } defer func() { deferCtx, deferCancel := ctrdutil.DeferContext() @@ -126,10 +126,10 @@ func (c *criService) execInternal(ctx context.Context, container containerd.Cont exitCh, err := process.Wait(ctx) if err != nil { - return nil, errors.Wrapf(err, "failed to wait for process %q", execID) + return nil, fmt.Errorf("failed to wait for process %q: %w", execID, err) } if err := process.Start(ctx); err != nil { - return nil, errors.Wrapf(err, "failed to start exec %q", execID) + return nil, fmt.Errorf("failed to start exec %q: %w", execID, err) } handleResizing(ctx, opts.resize, func(size remotecommand.TerminalSize) { @@ -160,7 +160,7 @@ func (c *criService) execInternal(ctx context.Context, container containerd.Cont case <-execCtx.Done(): // Ignore the not found error because the process may exit itself before killing. if err := process.Kill(ctx, syscall.SIGKILL); err != nil && !errdefs.IsNotFound(err) { - return nil, errors.Wrapf(err, "failed to kill exec %q", execID) + return nil, fmt.Errorf("failed to kill exec %q: %w", execID, err) } // Wait for the process to be killed. exitRes := <-exitCh @@ -168,12 +168,12 @@ func (c *criService) execInternal(ctx context.Context, container containerd.Cont execID, exitRes.ExitCode(), exitRes.Error()) <-attachDone log.G(ctx).Debugf("Stream pipe for exec process %q done", execID) - return nil, errors.Wrapf(execCtx.Err(), "timeout %v exceeded", opts.timeout) + return nil, fmt.Errorf("timeout %v exceeded: %w", opts.timeout, execCtx.Err()) case exitRes := <-exitCh: code, _, err := exitRes.Result() log.G(ctx).Debugf("Exec process %q exits with exit code %d and error %v", execID, code, err) if err != nil { - return nil, errors.Wrapf(err, "failed while waiting for exec %q", execID) + return nil, fmt.Errorf("failed while waiting for exec %q: %w", execID, err) } <-attachDone log.G(ctx).Debugf("Stream pipe for exec process %q done", execID) @@ -198,13 +198,13 @@ func (c *criService) execInContainer(ctx context.Context, id string, opts execOp cntr, err := c.containerStore.Get(id) if err != nil { - return nil, errors.Wrapf(err, "failed to find container %q in store", id) + return nil, fmt.Errorf("failed to find container %q in store: %w", id, err) } id = cntr.ID state := cntr.Status.Get().State() if state != runtime.ContainerState_CONTAINER_RUNNING { - return nil, errors.Errorf("container is in %s state", criContainerStateToString(state)) + return nil, fmt.Errorf("container is in %s state", criContainerStateToString(state)) } return c.execInternal(ctx, cntr.Container, id, opts) diff --git a/pkg/cri/server/container_log_reopen.go b/pkg/cri/server/container_log_reopen.go index d7f7403ccfbeb..292d92d37e199 100644 --- a/pkg/cri/server/container_log_reopen.go +++ b/pkg/cri/server/container_log_reopen.go @@ -17,7 +17,9 @@ package server import ( - "github.com/pkg/errors" + "errors" + "fmt" + "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" @@ -28,7 +30,7 @@ import ( func (c *criService) ReopenContainerLog(ctx context.Context, r *runtime.ReopenContainerLogRequest) (*runtime.ReopenContainerLogResponse, error) { container, err := c.containerStore.Get(r.GetContainerId()) if err != nil { - return nil, errors.Wrapf(err, "an error occurred when try to find container %q", r.GetContainerId()) + return nil, fmt.Errorf("an error occurred when try to find container %q: %w", r.GetContainerId(), err) } if container.Status.Get().State() != runtime.ContainerState_CONTAINER_RUNNING { diff --git a/pkg/cri/server/container_remove.go b/pkg/cri/server/container_remove.go index f9d38ab44aca3..86a52550ad866 100644 --- a/pkg/cri/server/container_remove.go +++ b/pkg/cri/server/container_remove.go @@ -17,14 +17,14 @@ package server import ( + "errors" + "fmt" "time" "github.com/containerd/containerd" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/log" containerstore "github.com/containerd/containerd/pkg/cri/store/container" - - "github.com/pkg/errors" "github.com/sirupsen/logrus" "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" @@ -36,7 +36,7 @@ func (c *criService) RemoveContainer(ctx context.Context, r *runtime.RemoveConta container, err := c.containerStore.Get(r.GetContainerId()) if err != nil { if !errdefs.IsNotFound(err) { - return nil, errors.Wrapf(err, "an error occurred when try to find container %q", r.GetContainerId()) + return nil, fmt.Errorf("an error occurred when try to find container %q: %w", r.GetContainerId(), err) } // Do not return error if container metadata doesn't exist. log.G(ctx).Tracef("RemoveContainer called for container %q that does not exist", r.GetContainerId()) @@ -45,7 +45,7 @@ func (c *criService) RemoveContainer(ctx context.Context, r *runtime.RemoveConta id := container.ID i, err := container.Container.Info(ctx) if err != nil { - return nil, errors.Wrap(err, "get container info") + return nil, fmt.Errorf("get container info: %w", err) } // Forcibly stop the containers if they are in running or unknown state @@ -54,7 +54,7 @@ func (c *criService) RemoveContainer(ctx context.Context, r *runtime.RemoveConta state == runtime.ContainerState_CONTAINER_UNKNOWN { logrus.Infof("Forcibly stopping container %q", id) if err := c.stopContainer(ctx, container, 0); err != nil { - return nil, errors.Wrapf(err, "failed to forcibly stop container %q", id) + return nil, fmt.Errorf("failed to forcibly stop container %q: %w", id, err) } } @@ -62,7 +62,7 @@ func (c *criService) RemoveContainer(ctx context.Context, r *runtime.RemoveConta // Set removing state to prevent other start/remove operations against this container // while it's being removed. if err := setContainerRemoving(container); err != nil { - return nil, errors.Wrapf(err, "failed to set removing state for container %q", id) + return nil, fmt.Errorf("failed to set removing state for container %q: %w", id, err) } defer func() { if retErr != nil { @@ -81,25 +81,25 @@ func (c *criService) RemoveContainer(ctx context.Context, r *runtime.RemoveConta // Delete containerd container. if err := container.Container.Delete(ctx, containerd.WithSnapshotCleanup); err != nil { if !errdefs.IsNotFound(err) { - return nil, errors.Wrapf(err, "failed to delete containerd container %q", id) + return nil, fmt.Errorf("failed to delete containerd container %q: %w", id, err) } log.G(ctx).Tracef("Remove called for containerd container %q that does not exist", id) } // Delete container checkpoint. if err := container.Delete(); err != nil { - return nil, errors.Wrapf(err, "failed to delete container checkpoint for %q", id) + return nil, fmt.Errorf("failed to delete container checkpoint for %q: %w", id, err) } containerRootDir := c.getContainerRootDir(id) if err := ensureRemoveAll(ctx, containerRootDir); err != nil { - return nil, errors.Wrapf(err, "failed to remove container root directory %q", - containerRootDir) + return nil, fmt.Errorf("failed to remove container root directory %q: %w", + containerRootDir, err) } volatileContainerRootDir := c.getVolatileContainerRootDir(id) if err := ensureRemoveAll(ctx, volatileContainerRootDir); err != nil { - return nil, errors.Wrapf(err, "failed to remove volatile container root directory %q", - volatileContainerRootDir) + return nil, fmt.Errorf("failed to remove volatile container root directory %q: %w", + volatileContainerRootDir, err) } c.containerStore.Delete(id) diff --git a/pkg/cri/server/container_start.go b/pkg/cri/server/container_start.go index be5532a64834a..35ec64b50c943 100644 --- a/pkg/cri/server/container_start.go +++ b/pkg/cri/server/container_start.go @@ -17,6 +17,8 @@ package server import ( + "errors" + "fmt" "io" "time" @@ -26,7 +28,6 @@ import ( "github.com/containerd/containerd/log" "github.com/containerd/nri" v1 "github.com/containerd/nri/types/v1" - "github.com/pkg/errors" "github.com/sirupsen/logrus" "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" @@ -43,12 +44,12 @@ func (c *criService) StartContainer(ctx context.Context, r *runtime.StartContain start := time.Now() cntr, err := c.containerStore.Get(r.GetContainerId()) if err != nil { - return nil, errors.Wrapf(err, "an error occurred when try to find container %q", r.GetContainerId()) + return nil, fmt.Errorf("an error occurred when try to find container %q: %w", r.GetContainerId(), err) } info, err := cntr.Container.Info(ctx) if err != nil { - return nil, errors.Wrap(err, "get container info") + return nil, fmt.Errorf("get container info: %w", err) } id := cntr.ID @@ -59,7 +60,7 @@ func (c *criService) StartContainer(ctx context.Context, r *runtime.StartContain // Set starting state to prevent other start/remove operations against this container // while it's being started. if err := setContainerStarting(cntr); err != nil { - return nil, errors.Wrapf(err, "failed to set starting state for container %q", id) + return nil, fmt.Errorf("failed to set starting state for container %q: %w", id, err) } defer func() { if retErr != nil { @@ -83,11 +84,11 @@ func (c *criService) StartContainer(ctx context.Context, r *runtime.StartContain // Get sandbox config from sandbox store. sandbox, err := c.sandboxStore.Get(meta.SandboxID) if err != nil { - return nil, errors.Wrapf(err, "sandbox %q not found", meta.SandboxID) + return nil, fmt.Errorf("sandbox %q not found: %w", meta.SandboxID, err) } sandboxID := meta.SandboxID if sandbox.Status.Get().State != sandboxstore.StateReady { - return nil, errors.Errorf("sandbox container %q is not running", sandboxID) + return nil, fmt.Errorf("sandbox container %q is not running", sandboxID) } // Recheck target container validity in Linux namespace options. @@ -96,7 +97,7 @@ func (c *criService) StartContainer(ctx context.Context, r *runtime.StartContain if nsOpts.GetPid() == runtime.NamespaceMode_TARGET { _, err := c.validateTargetContainer(sandboxID, nsOpts.TargetId) if err != nil { - return nil, errors.Wrap(err, "invalid target container") + return nil, fmt.Errorf("invalid target container: %w", err) } } } @@ -104,7 +105,7 @@ func (c *criService) StartContainer(ctx context.Context, r *runtime.StartContain ioCreation := func(id string) (_ containerdio.IO, err error) { stdoutWC, stderrWC, err := c.createContainerLoggers(meta.LogPath, config.GetTty()) if err != nil { - return nil, errors.Wrap(err, "failed to create container loggers") + return nil, fmt.Errorf("failed to create container loggers: %w", err) } cntr.IO.AddOutput("log", stdoutWC, stderrWC) cntr.IO.Pipe() @@ -113,12 +114,12 @@ func (c *criService) StartContainer(ctx context.Context, r *runtime.StartContain ctrInfo, err := container.Info(ctx) if err != nil { - return nil, errors.Wrap(err, "failed to get container info") + return nil, fmt.Errorf("failed to get container info: %w", err) } ociRuntime, err := c.getSandboxRuntime(sandbox.Config, sandbox.Metadata.RuntimeHandler) if err != nil { - return nil, errors.Wrap(err, "failed to get sandbox runtime") + return nil, fmt.Errorf("failed to get sandbox runtime: %w", err) } taskOpts := c.taskOpts(ctrInfo.Runtime.Name) @@ -127,7 +128,7 @@ func (c *criService) StartContainer(ctx context.Context, r *runtime.StartContain } task, err := container.NewTask(ctx, ioCreation, taskOpts...) if err != nil { - return nil, errors.Wrap(err, "failed to create containerd task") + return nil, fmt.Errorf("failed to create containerd task: %w", err) } defer func() { if retErr != nil { @@ -143,7 +144,7 @@ func (c *criService) StartContainer(ctx context.Context, r *runtime.StartContain // wait is a long running background request, no timeout needed. exitCh, err := task.Wait(ctrdutil.NamespacedContext()) if err != nil { - return nil, errors.Wrap(err, "failed to wait for containerd task") + return nil, fmt.Errorf("failed to wait for containerd task: %w", err) } nric, err := nri.New() if err != nil { @@ -155,13 +156,13 @@ func (c *criService) StartContainer(ctx context.Context, r *runtime.StartContain Labels: sandbox.Config.Labels, } if _, err := nric.InvokeWithSandbox(ctx, task, v1.Create, nriSB); err != nil { - return nil, errors.Wrap(err, "nri invoke") + return nil, fmt.Errorf("nri invoke: %w", err) } } // Start containerd task. if err := task.Start(ctx); err != nil { - return nil, errors.Wrapf(err, "failed to start containerd task %q", id) + return nil, fmt.Errorf("failed to start containerd task %q: %w", id, err) } // Update container start timestamp. @@ -170,7 +171,7 @@ func (c *criService) StartContainer(ctx context.Context, r *runtime.StartContain status.StartedAt = time.Now().UnixNano() return status, nil }); err != nil { - return nil, errors.Wrapf(err, "failed to update container %q state", id) + return nil, fmt.Errorf("failed to update container %q state: %w", id, err) } // It handles the TaskExit event and update container state after this. @@ -187,7 +188,7 @@ func setContainerStarting(container containerstore.Container) error { return container.Status.Update(func(status containerstore.Status) (containerstore.Status, error) { // Return error if container is not in created state. if status.State() != runtime.ContainerState_CONTAINER_CREATED { - return status, errors.Errorf("container is in %s state", criContainerStateToString(status.State())) + return status, fmt.Errorf("container is in %s state", criContainerStateToString(status.State())) } // Do not start the container when there is a removal in progress. if status.Removing { @@ -216,7 +217,7 @@ func (c *criService) createContainerLoggers(logPath string, tty bool) (stdout io // Only generate container log when log path is specified. f, err := openLogFile(logPath) if err != nil { - return nil, nil, errors.Wrap(err, "failed to create and open log file") + return nil, nil, fmt.Errorf("failed to create and open log file: %w", err) } defer func() { if err != nil { diff --git a/pkg/cri/server/container_stats.go b/pkg/cri/server/container_stats.go index da45b61aaab82..c2a829635d57a 100644 --- a/pkg/cri/server/container_stats.go +++ b/pkg/cri/server/container_stats.go @@ -17,8 +17,9 @@ package server import ( + "fmt" + tasks "github.com/containerd/containerd/api/services/tasks/v1" - "github.com/pkg/errors" "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) @@ -28,20 +29,20 @@ import ( func (c *criService) ContainerStats(ctx context.Context, in *runtime.ContainerStatsRequest) (*runtime.ContainerStatsResponse, error) { cntr, err := c.containerStore.Get(in.GetContainerId()) if err != nil { - return nil, errors.Wrap(err, "failed to find container") + return nil, fmt.Errorf("failed to find container: %w", err) } request := &tasks.MetricsRequest{Filters: []string{"id==" + cntr.ID}} resp, err := c.client.TaskService().Metrics(ctx, request) if err != nil { - return nil, errors.Wrap(err, "failed to fetch metrics for task") + return nil, fmt.Errorf("failed to fetch metrics for task: %w", err) } if len(resp.Metrics) != 1 { - return nil, errors.Errorf("unexpected metrics response: %+v", resp.Metrics) + return nil, fmt.Errorf("unexpected metrics response: %+v", resp.Metrics) } cs, err := c.containerMetrics(cntr.Metadata, resp.Metrics[0]) if err != nil { - return nil, errors.Wrap(err, "failed to decode container metrics") + return nil, fmt.Errorf("failed to decode container metrics: %w", err) } return &runtime.ContainerStatsResponse{Stats: cs}, nil } diff --git a/pkg/cri/server/container_stats_list.go b/pkg/cri/server/container_stats_list.go index 6248f5552ab0d..bc796fb9813c2 100644 --- a/pkg/cri/server/container_stats_list.go +++ b/pkg/cri/server/container_stats_list.go @@ -17,9 +17,10 @@ package server import ( + "fmt" + tasks "github.com/containerd/containerd/api/services/tasks/v1" "github.com/containerd/containerd/api/types" - "github.com/pkg/errors" "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" @@ -33,15 +34,15 @@ func (c *criService) ListContainerStats( ) (*runtime.ListContainerStatsResponse, error) { request, containers, err := c.buildTaskMetricsRequest(in) if err != nil { - return nil, errors.Wrap(err, "failed to build metrics request") + return nil, fmt.Errorf("failed to build metrics request: %w", err) } resp, err := c.client.TaskService().Metrics(ctx, &request) if err != nil { - return nil, errors.Wrap(err, "failed to fetch metrics for tasks") + return nil, fmt.Errorf("failed to fetch metrics for tasks: %w", err) } criStats, err := c.toCRIContainerStats(resp.Metrics, containers) if err != nil { - return nil, errors.Wrap(err, "failed to convert to cri containerd stats format") + return nil, fmt.Errorf("failed to convert to cri containerd stats format: %w", err) } return criStats, nil } @@ -58,7 +59,7 @@ func (c *criService) toCRIContainerStats( for _, cntr := range containers { cs, err := c.containerMetrics(cntr.Metadata, statsMap[cntr.ID]) if err != nil { - return nil, errors.Wrapf(err, "failed to decode container metrics for %q", cntr.ID) + return nil, fmt.Errorf("failed to decode container metrics for %q: %w", cntr.ID, err) } containerStats.Stats = append(containerStats.Stats, cs) } diff --git a/pkg/cri/server/container_stats_list_linux.go b/pkg/cri/server/container_stats_list_linux.go index bac0de3396e85..77372d176313a 100644 --- a/pkg/cri/server/container_stats_list_linux.go +++ b/pkg/cri/server/container_stats_list_linux.go @@ -17,13 +17,13 @@ package server import ( + "fmt" "time" "github.com/containerd/containerd/api/types" v1 "github.com/containerd/containerd/metrics/types/v1" v2 "github.com/containerd/containerd/metrics/types/v2" "github.com/containerd/typeurl" - "github.com/pkg/errors" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" containerstore "github.com/containerd/containerd/pkg/cri/store/container" @@ -61,18 +61,18 @@ func (c *criService) containerMetrics( if stats != nil { s, err := typeurl.UnmarshalAny(stats.Data) if err != nil { - return nil, errors.Wrap(err, "failed to extract container metrics") + return nil, fmt.Errorf("failed to extract container metrics: %w", err) } cpuStats, err := c.cpuContainerStats(meta.ID, false /* isSandbox */, s, stats.Timestamp) if err != nil { - return nil, errors.Wrap(err, "failed to obtain cpu stats") + return nil, fmt.Errorf("failed to obtain cpu stats: %w", err) } cs.Cpu = cpuStats memoryStats, err := c.memoryContainerStats(meta.ID, s, stats.Timestamp) if err != nil { - return nil, errors.Wrap(err, "failed to obtain memory stats") + return nil, fmt.Errorf("failed to obtain memory stats: %w", err) } cs.Memory = memoryStats } @@ -86,13 +86,13 @@ func (c *criService) getUsageNanoCores(containerID string, isSandbox bool, curre if isSandbox { sandbox, err := c.sandboxStore.Get(containerID) if err != nil { - return 0, errors.Wrapf(err, "failed to get sandbox container: %s", containerID) + return 0, fmt.Errorf("failed to get sandbox container: %s: %w", containerID, err) } oldStats = sandbox.Stats } else { container, err := c.containerStore.Get(containerID) if err != nil { - return 0, errors.Wrapf(err, "failed to get container ID: %s", containerID) + return 0, fmt.Errorf("failed to get container ID: %s: %w", containerID, err) } oldStats = container.Stats } @@ -105,12 +105,12 @@ func (c *criService) getUsageNanoCores(containerID string, isSandbox bool, curre if isSandbox { err := c.sandboxStore.UpdateContainerStats(containerID, newStats) if err != nil { - return 0, errors.Wrapf(err, "failed to update sandbox stats container ID: %s", containerID) + return 0, fmt.Errorf("failed to update sandbox stats container ID: %s: %w", containerID, err) } } else { err := c.containerStore.UpdateContainerStats(containerID, newStats) if err != nil { - return 0, errors.Wrapf(err, "failed to update container stats ID: %s", containerID) + return 0, fmt.Errorf("failed to update container stats ID: %s: %w", containerID, err) } } return 0, nil @@ -133,13 +133,13 @@ func (c *criService) getUsageNanoCores(containerID string, isSandbox bool, curre if isSandbox { err := c.sandboxStore.UpdateContainerStats(containerID, newStats) if err != nil { - return 0, errors.Wrapf(err, "failed to update sandbox container stats: %s", containerID) + return 0, fmt.Errorf("failed to update sandbox container stats: %s: %w", containerID, err) } } else { err := c.containerStore.UpdateContainerStats(containerID, newStats) if err != nil { - return 0, errors.Wrapf(err, "failed to update container stats ID: %s", containerID) + return 0, fmt.Errorf("failed to update container stats ID: %s: %w", containerID, err) } } @@ -204,7 +204,7 @@ func (c *criService) cpuContainerStats(ID string, isSandbox bool, stats interfac usageNanoCores, err := c.getUsageNanoCores(ID, isSandbox, metrics.CPU.Usage.Total, timestamp) if err != nil { - return nil, errors.Wrapf(err, "failed to get usage nano cores, containerID: %s", ID) + return nil, fmt.Errorf("failed to get usage nano cores, containerID: %s: %w", ID, err) } return &runtime.CpuUsage{ @@ -220,7 +220,7 @@ func (c *criService) cpuContainerStats(ID string, isSandbox bool, stats interfac usageNanoCores, err := c.getUsageNanoCores(ID, isSandbox, usageCoreNanoSeconds, timestamp) if err != nil { - return nil, errors.Wrapf(err, "failed to get usage nano cores, containerID: %s", ID) + return nil, fmt.Errorf("failed to get usage nano cores, containerID: %s: %w", ID, err) } return &runtime.CpuUsage{ @@ -230,7 +230,7 @@ func (c *criService) cpuContainerStats(ID string, isSandbox bool, stats interfac }, nil } default: - return nil, errors.Errorf("unexpected metrics type: %v", metrics) + return nil, fmt.Errorf("unexpected metrics type: %v", metrics) } return nil, nil } @@ -272,7 +272,7 @@ func (c *criService) memoryContainerStats(ID string, stats interface{}, timestam }, nil } default: - return nil, errors.Errorf("unexpected metrics type: %v", metrics) + return nil, fmt.Errorf("unexpected metrics type: %v", metrics) } return nil, nil } diff --git a/pkg/cri/server/container_stats_list_other.go b/pkg/cri/server/container_stats_list_other.go index b86926128a742..bed0b6b6a6e70 100644 --- a/pkg/cri/server/container_stats_list_other.go +++ b/pkg/cri/server/container_stats_list_other.go @@ -20,9 +20,10 @@ package server import ( + "fmt" + "github.com/containerd/containerd/api/types" "github.com/containerd/containerd/errdefs" - "github.com/pkg/errors" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" containerstore "github.com/containerd/containerd/pkg/cri/store/container" @@ -33,5 +34,5 @@ func (c *criService) containerMetrics( stats *types.Metric, ) (*runtime.ContainerStats, error) { var cs runtime.ContainerStats - return &cs, errors.Wrap(errdefs.ErrNotImplemented, "container metrics") + return &cs, fmt.Errorf("container metrics: %w", errdefs.ErrNotImplemented) } diff --git a/pkg/cri/server/container_stats_list_windows.go b/pkg/cri/server/container_stats_list_windows.go index cd1d76e503bec..e2ec1918bb898 100644 --- a/pkg/cri/server/container_stats_list_windows.go +++ b/pkg/cri/server/container_stats_list_windows.go @@ -17,10 +17,12 @@ package server import ( + "errors" + "fmt" + wstats "github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/stats" "github.com/containerd/containerd/api/types" "github.com/containerd/typeurl" - "github.com/pkg/errors" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" containerstore "github.com/containerd/containerd/pkg/cri/store/container" @@ -57,7 +59,7 @@ func (c *criService) containerMetrics( if stats != nil { s, err := typeurl.UnmarshalAny(stats.Data) if err != nil { - return nil, errors.Wrap(err, "failed to extract container metrics") + return nil, fmt.Errorf("failed to extract container metrics: %w", err) } wstats := s.(*wstats.Statistics).GetWindows() if wstats == nil { diff --git a/pkg/cri/server/container_status.go b/pkg/cri/server/container_status.go index 88c3fa6bb5d71..9779a090f7c5b 100644 --- a/pkg/cri/server/container_status.go +++ b/pkg/cri/server/container_status.go @@ -18,12 +18,12 @@ package server import ( "encoding/json" + "fmt" "github.com/containerd/containerd/errdefs" containerstore "github.com/containerd/containerd/pkg/cri/store/container" runtimespec "github.com/opencontainers/runtime-spec/specs-go" - "github.com/pkg/errors" "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) @@ -32,7 +32,7 @@ import ( func (c *criService) ContainerStatus(ctx context.Context, r *runtime.ContainerStatusRequest) (*runtime.ContainerStatusResponse, error) { container, err := c.containerStore.Get(r.GetContainerId()) if err != nil { - return nil, errors.Wrapf(err, "an error occurred when try to find container %q", r.GetContainerId()) + return nil, fmt.Errorf("an error occurred when try to find container %q: %w", r.GetContainerId(), err) } // TODO(random-liu): Clean up the following logic in CRI. @@ -45,7 +45,7 @@ func (c *criService) ContainerStatus(ctx context.Context, r *runtime.ContainerSt image, err := c.imageStore.Get(imageRef) if err != nil { if !errdefs.IsNotFound(err) { - return nil, errors.Wrapf(err, "failed to get image %q", imageRef) + return nil, fmt.Errorf("failed to get image %q: %w", imageRef, err) } } else { repoTags, repoDigests := parseImageReferences(image.References) @@ -64,14 +64,14 @@ func (c *criService) ContainerStatus(ctx context.Context, r *runtime.ContainerSt // CRI doesn't allow CreatedAt == 0. info, err := container.Container.Info(ctx) if err != nil { - return nil, errors.Wrapf(err, "failed to get CreatedAt in %q state", status.State) + return nil, fmt.Errorf("failed to get CreatedAt in %q state: %w", status.State, err) } status.CreatedAt = info.CreatedAt.UnixNano() } info, err := toCRIContainerInfo(ctx, container, r.GetVerbose()) if err != nil { - return nil, errors.Wrap(err, "failed to get verbose container info") + return nil, fmt.Errorf("failed to get verbose container info: %w", err) } return &runtime.ContainerStatusResponse{ @@ -156,26 +156,26 @@ func toCRIContainerInfo(ctx context.Context, container containerstore.Container, var err error ci.RuntimeSpec, err = container.Container.Spec(ctx) if err != nil { - return nil, errors.Wrap(err, "failed to get container runtime spec") + return nil, fmt.Errorf("failed to get container runtime spec: %w", err) } ctrInfo, err := container.Container.Info(ctx) if err != nil { - return nil, errors.Wrap(err, "failed to get container info") + return nil, fmt.Errorf("failed to get container info: %w", err) } ci.SnapshotKey = ctrInfo.SnapshotKey ci.Snapshotter = ctrInfo.Snapshotter runtimeOptions, err := getRuntimeOptions(ctrInfo) if err != nil { - return nil, errors.Wrap(err, "failed to get runtime options") + return nil, fmt.Errorf("failed to get runtime options: %w", err) } ci.RuntimeType = ctrInfo.Runtime.Name ci.RuntimeOptions = runtimeOptions infoBytes, err := json.Marshal(ci) if err != nil { - return nil, errors.Wrapf(err, "failed to marshal info %v", ci) + return nil, fmt.Errorf("failed to marshal info %v: %w", ci, err) } return map[string]string{ "info": string(infoBytes), diff --git a/pkg/cri/server/container_stop.go b/pkg/cri/server/container_stop.go index 88460f6065fb3..80854fe8bb643 100644 --- a/pkg/cri/server/container_stop.go +++ b/pkg/cri/server/container_stop.go @@ -17,6 +17,7 @@ package server import ( + "fmt" "sync/atomic" "syscall" "time" @@ -28,7 +29,6 @@ import ( ctrdutil "github.com/containerd/containerd/pkg/cri/util" "github.com/moby/sys/signal" - "github.com/pkg/errors" "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) @@ -39,7 +39,7 @@ func (c *criService) StopContainer(ctx context.Context, r *runtime.StopContainer // Get container config from container store. container, err := c.containerStore.Get(r.GetContainerId()) if err != nil { - return nil, errors.Wrapf(err, "an error occurred when try to find container %q", r.GetContainerId()) + return nil, fmt.Errorf("an error occurred when try to find container %q: %w", r.GetContainerId(), err) } if err := c.stopContainer(ctx, container, time.Duration(r.GetTimeout())*time.Second); err != nil { @@ -48,7 +48,7 @@ func (c *criService) StopContainer(ctx context.Context, r *runtime.StopContainer i, err := container.Container.Info(ctx) if err != nil { - return nil, errors.Wrap(err, "get container info") + return nil, fmt.Errorf("get container info: %w", err) } containerStopTimer.WithValues(i.Runtime.Name).UpdateSince(start) @@ -73,7 +73,7 @@ func (c *criService) stopContainer(ctx context.Context, container containerstore task, err := container.Container.Task(ctx, nil) if err != nil { if !errdefs.IsNotFound(err) { - return errors.Wrapf(err, "failed to get task for container %q", id) + return fmt.Errorf("failed to get task for container %q: %w", id, err) } // Don't return for unknown state, some cleanup needs to be done. if state == runtime.ContainerState_CONTAINER_UNKNOWN { @@ -90,7 +90,7 @@ func (c *criService) stopContainer(ctx context.Context, container containerstore exitCh, err := task.Wait(waitCtx) if err != nil { if !errdefs.IsNotFound(err) { - return errors.Wrapf(err, "failed to wait for task for %q", id) + return fmt.Errorf("failed to wait for task for %q: %w", id, err) } return cleanupUnknownContainer(ctx, id, container) } @@ -124,7 +124,7 @@ func (c *criService) stopContainer(ctx context.Context, container containerstore image, err := c.imageStore.Get(container.ImageRef) if err != nil { if !errdefs.IsNotFound(err) { - return errors.Wrapf(err, "failed to get image %q", container.ImageRef) + return fmt.Errorf("failed to get image %q: %w", container.ImageRef, err) } log.G(ctx).Warningf("Image %q not found, stop container with signal %q", container.ImageRef, stopSignal) } else { @@ -135,7 +135,7 @@ func (c *criService) stopContainer(ctx context.Context, container containerstore } sig, err := signal.ParseSignal(stopSignal) if err != nil { - return errors.Wrapf(err, "failed to parse stop signal %q", stopSignal) + return fmt.Errorf("failed to parse stop signal %q: %w", stopSignal, err) } var sswt bool @@ -149,7 +149,7 @@ func (c *criService) stopContainer(ctx context.Context, container containerstore if sswt { log.G(ctx).Infof("Stop container %q with signal %v", id, sig) if err = task.Kill(ctx, sig); err != nil && !errdefs.IsNotFound(err) { - return errors.Wrapf(err, "failed to stop container %q", id) + return fmt.Errorf("failed to stop container %q: %w", id, err) } } else { log.G(ctx).Infof("Skipping the sending of signal %v to container %q because a prior stop with timeout>0 request already sent the signal", sig, id) @@ -172,13 +172,13 @@ func (c *criService) stopContainer(ctx context.Context, container containerstore log.G(ctx).Infof("Kill container %q", id) if err = task.Kill(ctx, syscall.SIGKILL); err != nil && !errdefs.IsNotFound(err) { - return errors.Wrapf(err, "failed to kill container %q", id) + return fmt.Errorf("failed to kill container %q: %w", id, err) } // Wait for a fixed timeout until container stop is observed by event monitor. err = c.waitContainerStop(ctx, container) if err != nil { - return errors.Wrapf(err, "an error occurs during waiting for container %q to be killed", id) + return fmt.Errorf("an error occurs during waiting for container %q to be killed: %w", id, err) } return nil } @@ -188,7 +188,7 @@ func (c *criService) stopContainer(ctx context.Context, container containerstore func (c *criService) waitContainerStop(ctx context.Context, container containerstore.Container) error { select { case <-ctx.Done(): - return errors.Wrapf(ctx.Err(), "wait container %q", container.ID) + return fmt.Errorf("wait container %q: %w", container.ID, ctx.Err()) case <-container.Stopped(): return nil } diff --git a/pkg/cri/server/container_update_resources.go b/pkg/cri/server/container_update_resources.go index e2b2b6d5b010f..e5f6466a17f79 100644 --- a/pkg/cri/server/container_update_resources.go +++ b/pkg/cri/server/container_update_resources.go @@ -21,6 +21,7 @@ package server import ( gocontext "context" + "fmt" "github.com/containerd/containerd" "github.com/containerd/containerd/containers" @@ -28,7 +29,6 @@ import ( "github.com/containerd/containerd/log" "github.com/containerd/typeurl" runtimespec "github.com/opencontainers/runtime-spec/specs-go" - "github.com/pkg/errors" "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" @@ -40,7 +40,7 @@ import ( func (c *criService) UpdateContainerResources(ctx context.Context, r *runtime.UpdateContainerResourcesRequest) (retRes *runtime.UpdateContainerResourcesResponse, retErr error) { container, err := c.containerStore.Get(r.GetContainerId()) if err != nil { - return nil, errors.Wrap(err, "failed to find container") + return nil, fmt.Errorf("failed to find container: %w", err) } // Update resources in status update transaction, so that: // 1) There won't be race condition with container start. @@ -48,7 +48,7 @@ func (c *criService) UpdateContainerResources(ctx context.Context, r *runtime.Up if err := container.Status.Update(func(status containerstore.Status) (containerstore.Status, error) { return status, c.updateContainerResources(ctx, container, r, status) }); err != nil { - return nil, errors.Wrap(err, "failed to update resources") + return nil, fmt.Errorf("failed to update resources: %w", err) } return &runtime.UpdateContainerResourcesResponse{}, nil } @@ -60,7 +60,7 @@ func (c *criService) updateContainerResources(ctx context.Context, id := cntr.ID // Do not update the container when there is a removal in progress. if status.Removing { - return errors.Errorf("container %q is in removing state", id) + return fmt.Errorf("container %q is in removing state", id) } // Update container spec. If the container is not started yet, updating @@ -69,11 +69,11 @@ func (c *criService) updateContainerResources(ctx context.Context, // the spec will become our source of truth for resource limits. oldSpec, err := cntr.Container.Spec(ctx) if err != nil { - return errors.Wrap(err, "failed to get container spec") + return fmt.Errorf("failed to get container spec: %w", err) } newSpec, err := updateOCIResource(ctx, oldSpec, r, c.config) if err != nil { - return errors.Wrap(err, "failed to update resource in spec") + return fmt.Errorf("failed to update resource in spec: %w", err) } if err := updateContainerSpec(ctx, cntr.Container, newSpec); err != nil { @@ -102,7 +102,7 @@ func (c *criService) updateContainerResources(ctx context.Context, // Task exited already. return nil } - return errors.Wrap(err, "failed to get task") + return fmt.Errorf("failed to get task: %w", err) } // newSpec.Linux / newSpec.Windows won't be nil if err := task.Update(ctx, containerd.WithResources(getResources(newSpec))); err != nil { @@ -110,7 +110,7 @@ func (c *criService) updateContainerResources(ctx context.Context, // Task exited already. return nil } - return errors.Wrap(err, "failed to update resources") + return fmt.Errorf("failed to update resources: %w", err) } return nil } @@ -119,13 +119,13 @@ func (c *criService) updateContainerResources(ctx context.Context, func updateContainerSpec(ctx context.Context, cntr containerd.Container, spec *runtimespec.Spec) error { any, err := typeurl.MarshalAny(spec) if err != nil { - return errors.Wrapf(err, "failed to marshal spec %+v", spec) + return fmt.Errorf("failed to marshal spec %+v: %w", spec, err) } if err := cntr.Update(ctx, func(ctx gocontext.Context, client *containerd.Client, c *containers.Container) error { c.Spec = any return nil }); err != nil { - return errors.Wrap(err, "failed to update container spec") + return fmt.Errorf("failed to update container spec: %w", err) } return nil } diff --git a/pkg/cri/server/container_update_resources_linux.go b/pkg/cri/server/container_update_resources_linux.go index ebe78780cf9cf..a30d194e65f54 100644 --- a/pkg/cri/server/container_update_resources_linux.go +++ b/pkg/cri/server/container_update_resources_linux.go @@ -17,8 +17,9 @@ package server import ( + "fmt" + runtimespec "github.com/opencontainers/runtime-spec/specs-go" - "github.com/pkg/errors" "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" @@ -34,13 +35,13 @@ func updateOCIResource(ctx context.Context, spec *runtimespec.Spec, r *runtime.U // Copy to make sure old spec is not changed. var cloned runtimespec.Spec if err := util.DeepCopy(&cloned, spec); err != nil { - return nil, errors.Wrap(err, "failed to deep copy") + return nil, fmt.Errorf("failed to deep copy: %w", err) } if cloned.Linux == nil { cloned.Linux = &runtimespec.Linux{} } if err := opts.WithResources(r.GetLinux(), config.TolerateMissingHugetlbController, config.DisableHugetlbController)(ctx, nil, nil, &cloned); err != nil { - return nil, errors.Wrap(err, "unable to set linux container resources") + return nil, fmt.Errorf("unable to set linux container resources: %w", err) } return &cloned, nil } diff --git a/pkg/cri/server/container_update_resources_other.go b/pkg/cri/server/container_update_resources_other.go index b8142de23f18a..76000e1f6355b 100644 --- a/pkg/cri/server/container_update_resources_other.go +++ b/pkg/cri/server/container_update_resources_other.go @@ -20,7 +20,8 @@ package server import ( - "github.com/pkg/errors" + "fmt" + "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" @@ -31,7 +32,7 @@ import ( func (c *criService) UpdateContainerResources(ctx context.Context, r *runtime.UpdateContainerResourcesRequest) (retRes *runtime.UpdateContainerResourcesResponse, retErr error) { container, err := c.containerStore.Get(r.GetContainerId()) if err != nil { - return nil, errors.Wrap(err, "failed to find container") + return nil, fmt.Errorf("failed to find container: %w", err) } // Update resources in status update transaction, so that: // 1) There won't be race condition with container start. @@ -39,7 +40,7 @@ func (c *criService) UpdateContainerResources(ctx context.Context, r *runtime.Up if err := container.Status.Update(func(status containerstore.Status) (containerstore.Status, error) { return status, nil }); err != nil { - return nil, errors.Wrap(err, "failed to update resources") + return nil, fmt.Errorf("failed to update resources: %w", err) } return &runtime.UpdateContainerResourcesResponse{}, nil } diff --git a/pkg/cri/server/container_update_resources_windows.go b/pkg/cri/server/container_update_resources_windows.go index fa0fdc183ea4c..74ce4b3e44c47 100644 --- a/pkg/cri/server/container_update_resources_windows.go +++ b/pkg/cri/server/container_update_resources_windows.go @@ -17,8 +17,9 @@ package server import ( + "fmt" + runtimespec "github.com/opencontainers/runtime-spec/specs-go" - "github.com/pkg/errors" "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" @@ -34,13 +35,13 @@ func updateOCIResource(ctx context.Context, spec *runtimespec.Spec, r *runtime.U // Copy to make sure old spec is not changed. var cloned runtimespec.Spec if err := util.DeepCopy(&cloned, spec); err != nil { - return nil, errors.Wrap(err, "failed to deep copy") + return nil, fmt.Errorf("failed to deep copy: %w", err) } if cloned.Windows == nil { cloned.Windows = &runtimespec.Windows{} } if err := opts.WithWindowsResources(r.GetWindows())(ctx, nil, nil, &cloned); err != nil { - return nil, errors.Wrap(err, "unable to set windows container resources") + return nil, fmt.Errorf("unable to set windows container resources: %w", err) } return &cloned, nil } diff --git a/pkg/cri/server/events.go b/pkg/cri/server/events.go index 0b834e12e3545..b98dd1fd30b3e 100644 --- a/pkg/cri/server/events.go +++ b/pkg/cri/server/events.go @@ -17,6 +17,8 @@ package server import ( + "errors" + "fmt" "sync" "time" @@ -30,9 +32,7 @@ import ( sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox" ctrdutil "github.com/containerd/containerd/pkg/cri/util" "github.com/containerd/typeurl" - gogotypes "github.com/gogo/protobuf/types" - "github.com/pkg/errors" "github.com/sirupsen/logrus" "golang.org/x/net/context" "k8s.io/utils/clock" @@ -141,7 +141,7 @@ func (em *eventMonitor) startSandboxExitMonitor(ctx context.Context, id string, } return nil } else if !errdefs.IsNotFound(err) { - return errors.Wrapf(err, "failed to get sandbox %s", e.ID) + return fmt.Errorf("failed to get sandbox %s: %w", e.ID, err) } return nil }() @@ -192,7 +192,7 @@ func (em *eventMonitor) startContainerExitMonitor(ctx context.Context, id string } return nil } else if !errdefs.IsNotFound(err) { - return errors.Wrapf(err, "failed to get container %s", e.ID) + return fmt.Errorf("failed to get container %s: %w", e.ID, err) } return nil }() @@ -211,7 +211,7 @@ func convertEvent(e *gogotypes.Any) (string, interface{}, error) { id := "" evt, err := typeurl.UnmarshalAny(e) if err != nil { - return "", nil, errors.Wrap(err, "failed to unmarshalany") + return "", nil, fmt.Errorf("failed to unmarshalany: %w", err) } switch e := evt.(type) { @@ -314,20 +314,20 @@ func (em *eventMonitor) handleEvent(any interface{}) error { cntr, err := em.c.containerStore.Get(e.ID) if err == nil { if err := handleContainerExit(ctx, e, cntr); err != nil { - return errors.Wrap(err, "failed to handle container TaskExit event") + return fmt.Errorf("failed to handle container TaskExit event: %w", err) } return nil } else if !errdefs.IsNotFound(err) { - return errors.Wrap(err, "can't find container for TaskExit event") + return fmt.Errorf("can't find container for TaskExit event: %w", err) } sb, err := em.c.sandboxStore.Get(e.ID) if err == nil { if err := handleSandboxExit(ctx, e, sb); err != nil { - return errors.Wrap(err, "failed to handle sandbox TaskExit event") + return fmt.Errorf("failed to handle sandbox TaskExit event: %w", err) } return nil } else if !errdefs.IsNotFound(err) { - return errors.Wrap(err, "can't find sandbox for TaskExit event") + return fmt.Errorf("can't find sandbox for TaskExit event: %w", err) } return nil case *eventtypes.TaskOOM: @@ -336,7 +336,7 @@ func (em *eventMonitor) handleEvent(any interface{}) error { cntr, err := em.c.containerStore.Get(e.ContainerID) if err != nil { if !errdefs.IsNotFound(err) { - return errors.Wrap(err, "can't find container for TaskOOM event") + return fmt.Errorf("can't find container for TaskOOM event: %w", err) } return nil } @@ -345,7 +345,7 @@ func (em *eventMonitor) handleEvent(any interface{}) error { return status, nil }) if err != nil { - return errors.Wrap(err, "failed to update container status for TaskOOM event") + return fmt.Errorf("failed to update container status for TaskOOM event: %w", err) } case *eventtypes.ImageCreate: logrus.Infof("ImageCreate event %+v", e) @@ -380,13 +380,13 @@ func handleContainerExit(ctx context.Context, e *eventtypes.TaskExit, cntr conta ) if err != nil { if !errdefs.IsNotFound(err) { - return errors.Wrapf(err, "failed to load task for container") + return fmt.Errorf("failed to load task for container: %w", err) } } else { // TODO(random-liu): [P1] This may block the loop, we may want to spawn a worker if _, err = task.Delete(ctx, WithNRISandboxDelete(cntr.SandboxID), containerd.WithProcessKill); err != nil { if !errdefs.IsNotFound(err) { - return errors.Wrap(err, "failed to stop container") + return fmt.Errorf("failed to stop container: %w", err) } // Move on to make sure container status is updated. } @@ -407,7 +407,7 @@ func handleContainerExit(ctx context.Context, e *eventtypes.TaskExit, cntr conta return status, nil }) if err != nil { - return errors.Wrap(err, "failed to update container state") + return fmt.Errorf("failed to update container state: %w", err) } // Using channel to propagate the information of container stop cntr.Stop() @@ -420,13 +420,13 @@ func handleSandboxExit(ctx context.Context, e *eventtypes.TaskExit, sb sandboxst task, err := sb.Container.Task(ctx, nil) if err != nil { if !errdefs.IsNotFound(err) { - return errors.Wrap(err, "failed to load task for sandbox") + return fmt.Errorf("failed to load task for sandbox: %w", err) } } else { // TODO(random-liu): [P1] This may block the loop, we may want to spawn a worker if _, err = task.Delete(ctx, WithNRISandboxDelete(sb.ID), containerd.WithProcessKill); err != nil { if !errdefs.IsNotFound(err) { - return errors.Wrap(err, "failed to stop sandbox") + return fmt.Errorf("failed to stop sandbox: %w", err) } // Move on to make sure container status is updated. } @@ -437,7 +437,7 @@ func handleSandboxExit(ctx context.Context, e *eventtypes.TaskExit, sb sandboxst return status, nil }) if err != nil { - return errors.Wrap(err, "failed to update sandbox state") + return fmt.Errorf("failed to update sandbox state: %w", err) } // Using channel to propagate the information of sandbox stop sb.Stop() diff --git a/pkg/cri/server/helpers.go b/pkg/cri/server/helpers.go index b2feb13f36ab2..abc66e3891372 100644 --- a/pkg/cri/server/helpers.go +++ b/pkg/cri/server/helpers.go @@ -42,7 +42,6 @@ import ( runhcsoptions "github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options" imagedigest "github.com/opencontainers/go-digest" "github.com/pelletier/go-toml" - "github.com/pkg/errors" "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) @@ -196,7 +195,7 @@ func (c *criService) localResolve(refOrID string) (imagestore.Image, error) { func (c *criService) toContainerdImage(ctx context.Context, image imagestore.Image) (containerd.Image, error) { // image should always have at least one reference. if len(image.References) == 0 { - return nil, errors.Errorf("invalid image with no reference %q", image.ID) + return nil, fmt.Errorf("invalid image with no reference %q", image.ID) } return c.client.GetImage(ctx, image.References[0]) } @@ -225,7 +224,7 @@ func getUserFromImage(user string) (*int64, string) { func (c *criService) ensureImageExists(ctx context.Context, ref string, config *runtime.PodSandboxConfig) (*imagestore.Image, error) { image, err := c.localResolve(ref) if err != nil && !errdefs.IsNotFound(err) { - return nil, errors.Wrapf(err, "failed to get image %q", ref) + return nil, fmt.Errorf("failed to get image %q: %w", ref, err) } if err == nil { return &image, nil @@ -233,13 +232,13 @@ func (c *criService) ensureImageExists(ctx context.Context, ref string, config * // Pull image to ensure the image exists resp, err := c.PullImage(ctx, &runtime.PullImageRequest{Image: &runtime.ImageSpec{Image: ref}, SandboxConfig: config}) if err != nil { - return nil, errors.Wrapf(err, "failed to pull image %q", ref) + return nil, fmt.Errorf("failed to pull image %q: %w", ref, err) } imageID := resp.GetImageRef() newImage, err := c.imageStore.Get(imageID) if err != nil { // It's still possible that someone removed the image right after it is pulled. - return nil, errors.Wrapf(err, "failed to get image %q after pulling", imageID) + return nil, fmt.Errorf("failed to get image %q after pulling: %w", imageID, err) } return &newImage, nil } @@ -251,18 +250,18 @@ func (c *criService) ensureImageExists(ctx context.Context, ref string, config * func (c *criService) validateTargetContainer(sandboxID, targetContainerID string) (containerstore.Container, error) { targetContainer, err := c.containerStore.Get(targetContainerID) if err != nil { - return containerstore.Container{}, errors.Wrapf(err, "container %q does not exist", targetContainerID) + return containerstore.Container{}, fmt.Errorf("container %q does not exist: %w", targetContainerID, err) } targetSandboxID := targetContainer.Metadata.SandboxID if targetSandboxID != sandboxID { return containerstore.Container{}, - errors.Errorf("container %q (sandbox %s) does not belong to sandbox %s", targetContainerID, targetSandboxID, sandboxID) + fmt.Errorf("container %q (sandbox %s) does not belong to sandbox %s", targetContainerID, targetSandboxID, sandboxID) } status := targetContainer.Status.Get() if state := status.State(); state != runtime.ContainerState_CONTAINER_RUNNING { - return containerstore.Container{}, errors.Errorf("container %q is not running - in state %s", targetContainerID, state) + return containerstore.Container{}, fmt.Errorf("container %q is not running - in state %s", targetContainerID, state) } return targetContainer, nil diff --git a/pkg/cri/server/helpers_linux.go b/pkg/cri/server/helpers_linux.go index bc415e871d32f..42b2d99a1c625 100644 --- a/pkg/cri/server/helpers_linux.go +++ b/pkg/cri/server/helpers_linux.go @@ -36,7 +36,6 @@ import ( "github.com/moby/sys/mountinfo" "github.com/opencontainers/runtime-spec/specs-go" "github.com/opencontainers/selinux/go-selinux/label" - "github.com/pkg/errors" "golang.org/x/sys/unix" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) @@ -131,7 +130,7 @@ func checkSelinuxLevel(level string) error { matched, err := regexp.MatchString(`^s\d(-s\d)??(:c\d{1,4}(\.c\d{1,4})?(,c\d{1,4}(\.c\d{1,4})?)*)?$`, level) if err != nil { - return errors.Wrapf(err, "the format of 'level' %q is not correct", level) + return fmt.Errorf("the format of 'level' %q is not correct: %w", level, err) } if !matched { return fmt.Errorf("the format of 'level' %q is not correct", level) @@ -241,7 +240,7 @@ func ensureRemoveAll(ctx context.Context, dir string) error { return err } if e := mount.Unmount(pe.Path, unix.MNT_DETACH); e != nil { - return errors.Wrapf(e, "error while removing %s", dir) + return fmt.Errorf("error while removing %s: %w", dir, e) } if exitOnErr[pe.Path] == maxRetry { @@ -271,7 +270,7 @@ func modifyProcessLabel(runtimeType string, spec *specs.Spec) error { } l, err := seutil.ChangeToKVM(spec.Process.SelinuxLabel) if err != nil { - return errors.Wrap(err, "failed to get selinux kvm label") + return fmt.Errorf("failed to get selinux kvm label: %w", err) } spec.Process.SelinuxLabel = l return nil diff --git a/pkg/cri/server/image_pull.go b/pkg/cri/server/image_pull.go index 0372c31028d9b..9d3e76d8830ea 100644 --- a/pkg/cri/server/image_pull.go +++ b/pkg/cri/server/image_pull.go @@ -40,7 +40,6 @@ import ( "github.com/containerd/imgcrypt" "github.com/containerd/imgcrypt/images/encryption" imagespec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" @@ -93,7 +92,7 @@ func (c *criService) PullImage(ctx context.Context, r *runtime.PullImageRequest) imageRef := r.GetImage().GetImage() namedRef, err := distribution.ParseDockerRef(imageRef) if err != nil { - return nil, errors.Wrapf(err, "failed to parse image reference %q", imageRef) + return nil, fmt.Errorf("failed to parse image reference %q: %w", imageRef, err) } ref := namedRef.String() if ref != imageRef { @@ -138,12 +137,12 @@ func (c *criService) PullImage(ctx context.Context, r *runtime.PullImageRequest) image, err := c.client.Pull(ctx, ref, pullOpts...) if err != nil { - return nil, errors.Wrapf(err, "failed to pull and unpack image %q", ref) + return nil, fmt.Errorf("failed to pull and unpack image %q: %w", ref, err) } configDesc, err := image.Config(ctx) if err != nil { - return nil, errors.Wrap(err, "get image config descriptor") + return nil, fmt.Errorf("get image config descriptor: %w", err) } imageID := configDesc.Digest.String() @@ -153,13 +152,13 @@ func (c *criService) PullImage(ctx context.Context, r *runtime.PullImageRequest) continue } if err := c.createImageReference(ctx, r, image.Target()); err != nil { - return nil, errors.Wrapf(err, "failed to create image reference %q", r) + return nil, fmt.Errorf("failed to create image reference %q: %w", r, err) } // Update image store to reflect the newest state in containerd. // No need to use `updateImage`, because the image reference must // have been managed by the cri plugin. if err := c.imageStore.Update(ctx, r); err != nil { - return nil, errors.Wrapf(err, "failed to update image store %q", r) + return nil, fmt.Errorf("failed to update image store %q: %w", r, err) } } @@ -182,7 +181,7 @@ func ParseAuth(auth *runtime.AuthConfig, host string) (string, string, error) { // Do not return the auth info when server address doesn't match. u, err := url.Parse(auth.ServerAddress) if err != nil { - return "", "", errors.Wrap(err, "parse server address") + return "", "", fmt.Errorf("parse server address: %w", err) } if host != u.Host { return "", "", nil @@ -203,7 +202,7 @@ func ParseAuth(auth *runtime.AuthConfig, host string) (string, string, error) { } fields := strings.SplitN(string(decoded), ":", 2) if len(fields) != 2 { - return "", "", errors.Errorf("invalid decoded auth: %q", decoded) + return "", "", fmt.Errorf("invalid decoded auth: %q", decoded) } user, passwd := fields[0], fields[1] return user, strings.Trim(passwd, "\x00"), nil @@ -243,31 +242,31 @@ func (c *criService) createImageReference(ctx context.Context, name string, desc func (c *criService) updateImage(ctx context.Context, r string) error { img, err := c.client.GetImage(ctx, r) if err != nil && !errdefs.IsNotFound(err) { - return errors.Wrap(err, "get image by reference") + return fmt.Errorf("get image by reference: %w", err) } if err == nil && img.Labels()[imageLabelKey] != imageLabelValue { // Make sure the image has the image id as its unique // identifier that references the image in its lifetime. configDesc, err := img.Config(ctx) if err != nil { - return errors.Wrap(err, "get image id") + return fmt.Errorf("get image id: %w", err) } id := configDesc.Digest.String() if err := c.createImageReference(ctx, id, img.Target()); err != nil { - return errors.Wrapf(err, "create image id reference %q", id) + return fmt.Errorf("create image id reference %q: %w", id, err) } if err := c.imageStore.Update(ctx, id); err != nil { - return errors.Wrapf(err, "update image store for %q", id) + return fmt.Errorf("update image store for %q: %w", id, err) } // The image id is ready, add the label to mark the image as managed. if err := c.createImageReference(ctx, r, img.Target()); err != nil { - return errors.Wrap(err, "create managed label") + return fmt.Errorf("create managed label: %w", err) } } // If the image is not found, we should continue updating the cache, // so that the image can be removed from the cache. if err := c.imageStore.Update(ctx, r); err != nil { - return errors.Wrapf(err, "update image store for %q", r) + return fmt.Errorf("update image store for %q: %w", r, err) } return nil } @@ -280,15 +279,15 @@ func (c *criService) getTLSConfig(registryTLSConfig criconfig.TLSConfig) (*tls.C err error ) if registryTLSConfig.CertFile != "" && registryTLSConfig.KeyFile == "" { - return nil, errors.Errorf("cert file %q was specified, but no corresponding key file was specified", registryTLSConfig.CertFile) + return nil, fmt.Errorf("cert file %q was specified, but no corresponding key file was specified", registryTLSConfig.CertFile) } if registryTLSConfig.CertFile == "" && registryTLSConfig.KeyFile != "" { - return nil, errors.Errorf("key file %q was specified, but no corresponding cert file was specified", registryTLSConfig.KeyFile) + return nil, fmt.Errorf("key file %q was specified, but no corresponding cert file was specified", registryTLSConfig.KeyFile) } if registryTLSConfig.CertFile != "" && registryTLSConfig.KeyFile != "" { cert, err = tls.LoadX509KeyPair(registryTLSConfig.CertFile, registryTLSConfig.KeyFile) if err != nil { - return nil, errors.Wrap(err, "failed to load cert file") + return nil, fmt.Errorf("failed to load cert file: %w", err) } if len(cert.Certificate) != 0 { tlsConfig.Certificates = []tls.Certificate{cert} @@ -299,11 +298,11 @@ func (c *criService) getTLSConfig(registryTLSConfig criconfig.TLSConfig) (*tls.C if registryTLSConfig.CAFile != "" { caCertPool, err := x509.SystemCertPool() if err != nil { - return nil, errors.Wrap(err, "failed to get system cert pool") + return nil, fmt.Errorf("failed to get system cert pool: %w", err) } caCert, err := os.ReadFile(registryTLSConfig.CAFile) if err != nil { - return nil, errors.Wrap(err, "failed to load CA file") + return nil, fmt.Errorf("failed to load CA file: %w", err) } caCertPool.AppendCertsFromPEM(caCert) tlsConfig.RootCAs = caCertPool @@ -354,12 +353,12 @@ func (c *criService) registryHosts(ctx context.Context, auth *runtime.AuthConfig endpoints, err := c.registryEndpoints(host) if err != nil { - return nil, errors.Wrap(err, "get registry endpoints") + return nil, fmt.Errorf("get registry endpoints: %w", err) } for _, e := range endpoints { u, err := url.Parse(e) if err != nil { - return nil, errors.Wrapf(err, "parse registry endpoint %q from mirrors", e) + return nil, fmt.Errorf("parse registry endpoint %q from mirrors: %w", e, err) } var ( @@ -371,7 +370,7 @@ func (c *criService) registryHosts(ctx context.Context, auth *runtime.AuthConfig if config.TLS != nil { transport.TLSClientConfig, err = c.getTLSConfig(*config.TLS) if err != nil { - return nil, errors.Wrapf(err, "get TLSConfig for registry %q", e) + return nil, fmt.Errorf("get TLSConfig for registry %q: %w", e, err) } } else if isLocalHost(host) && u.Scheme == "http" { // Skipping TLS verification for localhost @@ -457,19 +456,19 @@ func (c *criService) registryEndpoints(host string) ([]string, error) { } defaultHost, err := docker.DefaultHost(host) if err != nil { - return nil, errors.Wrap(err, "get default host") + return nil, fmt.Errorf("get default host: %w", err) } for i := range endpoints { en, err := addDefaultScheme(endpoints[i]) if err != nil { - return nil, errors.Wrap(err, "parse endpoint url") + return nil, fmt.Errorf("parse endpoint url: %w", err) } endpoints[i] = en } for _, e := range endpoints { u, err := url.Parse(e) if err != nil { - return nil, errors.Wrap(err, "parse endpoint url") + return nil, fmt.Errorf("parse endpoint url: %w", err) } if u.Host == host { // Do not add default if the endpoint already exists. diff --git a/pkg/cri/server/image_remove.go b/pkg/cri/server/image_remove.go index 90619b1b67766..8821661b2c4b4 100644 --- a/pkg/cri/server/image_remove.go +++ b/pkg/cri/server/image_remove.go @@ -17,10 +17,11 @@ package server import ( + "fmt" + "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" - "github.com/pkg/errors" "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) @@ -38,7 +39,7 @@ func (c *criService) RemoveImage(ctx context.Context, r *runtime.RemoveImageRequ // return empty without error when image not found. return &runtime.RemoveImageResponse{}, nil } - return nil, errors.Wrapf(err, "can not resolve %q locally", r.GetImage().GetImage()) + return nil, fmt.Errorf("can not resolve %q locally: %w", r.GetImage().GetImage(), err) } // Remove all image references. @@ -54,11 +55,11 @@ func (c *criService) RemoveImage(ctx context.Context, r *runtime.RemoveImageRequ if err == nil || errdefs.IsNotFound(err) { // Update image store to reflect the newest state in containerd. if err := c.imageStore.Update(ctx, ref); err != nil { - return nil, errors.Wrapf(err, "failed to update image reference %q for %q", ref, image.ID) + return nil, fmt.Errorf("failed to update image reference %q for %q: %w", ref, image.ID, err) } continue } - return nil, errors.Wrapf(err, "failed to delete image reference %q for %q", ref, image.ID) + return nil, fmt.Errorf("failed to delete image reference %q for %q: %w", ref, image.ID, err) } return &runtime.RemoveImageResponse{}, nil } diff --git a/pkg/cri/server/image_status.go b/pkg/cri/server/image_status.go index f94ef4dc09a3c..5d28837f06208 100644 --- a/pkg/cri/server/image_status.go +++ b/pkg/cri/server/image_status.go @@ -18,13 +18,13 @@ package server import ( "encoding/json" + "fmt" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/log" imagestore "github.com/containerd/containerd/pkg/cri/store/image" imagespec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) @@ -39,7 +39,7 @@ func (c *criService) ImageStatus(ctx context.Context, r *runtime.ImageStatusRequ // return empty without error when image not found. return &runtime.ImageStatusResponse{}, nil } - return nil, errors.Wrapf(err, "can not resolve %q locally", r.GetImage().GetImage()) + return nil, fmt.Errorf("can not resolve %q locally: %w", r.GetImage().GetImage(), err) } // TODO(random-liu): [P0] Make sure corresponding snapshot exists. What if snapshot // doesn't exist? @@ -47,7 +47,7 @@ func (c *criService) ImageStatus(ctx context.Context, r *runtime.ImageStatusRequ runtimeImage := toCRIImage(image) info, err := c.toCRIImageInfo(ctx, &image, r.GetVerbose()) if err != nil { - return nil, errors.Wrap(err, "failed to generate image info") + return nil, fmt.Errorf("failed to generate image info: %w", err) } return &runtime.ImageStatusResponse{ diff --git a/pkg/cri/server/instrumented_service.go b/pkg/cri/server/instrumented_service.go index 00304791c739f..0b85d66f5e194 100644 --- a/pkg/cri/server/instrumented_service.go +++ b/pkg/cri/server/instrumented_service.go @@ -72,7 +72,7 @@ func (in *instrumentedService) RunPodSandbox(ctx context.Context, r *runtime.Run if err := in.checkInitialized(); err != nil { return nil, err } - log.G(ctx).Infof("RunPodsandbox for %+v", r.GetConfig().GetMetadata()) + log.G(ctx).Infof("RunPodSandbox for %+v", r.GetConfig().GetMetadata()) defer func() { if err != nil { log.G(ctx).WithError(err).Errorf("RunPodSandbox for %+v failed, error", r.GetConfig().GetMetadata()) @@ -88,7 +88,7 @@ func (in *instrumentedAlphaService) RunPodSandbox(ctx context.Context, r *runtim if err := in.checkInitialized(); err != nil { return nil, err } - log.G(ctx).Infof("RunPodsandbox for %+v", r.GetConfig().GetMetadata()) + log.G(ctx).Infof("RunPodSandbox for %+v", r.GetConfig().GetMetadata()) defer func() { if err != nil { log.G(ctx).WithError(err).Errorf("RunPodSandbox for %+v failed, error", r.GetConfig().GetMetadata()) diff --git a/pkg/cri/server/rdt_linux.go b/pkg/cri/server/rdt_linux.go index 9885da3145c55..38a9395c57c00 100644 --- a/pkg/cri/server/rdt_linux.go +++ b/pkg/cri/server/rdt_linux.go @@ -1,4 +1,5 @@ //go:build !no_rdt +// +build !no_rdt /* Copyright The containerd Authors. @@ -30,17 +31,21 @@ import ( // container and returns its effective RDT class. func (c *criService) rdtClassFromAnnotations(containerName string, containerAnnotations, podAnnotations map[string]string) (string, error) { cls, err := rdt.ContainerClassFromAnnotations(containerName, containerAnnotations, podAnnotations) - if err != nil { - return "", err + + if err == nil { + // Our internal check that RDT has been enabled + if cls != "" && !tasks.RdtEnabled() { + err = fmt.Errorf("RDT disabled, refusing to set RDT class of container %q to %q", containerName, cls) + } } - if cls != "" && !tasks.RdtEnabled() { - if c.config.ContainerdConfig.IgnoreRdtNotEnabledErrors { - cls = "" + if err != nil { + if !tasks.RdtEnabled() && c.config.ContainerdConfig.IgnoreRdtNotEnabledErrors { logrus.Debugf("continuing create container %s, ignoring rdt not enabled (%v)", containerName, err) - } else { - return "", fmt.Errorf("RDT disabled, refusing to set RDT class of container %q to %q", containerName, cls) + return "", nil } + return "", err } + return cls, nil } diff --git a/pkg/cri/server/rdt_stub_linux.go b/pkg/cri/server/rdt_stub_linux.go index 16d3e606e777b..179493562e993 100644 --- a/pkg/cri/server/rdt_stub_linux.go +++ b/pkg/cri/server/rdt_stub_linux.go @@ -1,4 +1,5 @@ //go:build no_rdt +// +build no_rdt /* Copyright The containerd Authors. diff --git a/pkg/cri/server/restart.go b/pkg/cri/server/restart.go index ffcb5cd1da649..f5f3e5083e2cd 100644 --- a/pkg/cri/server/restart.go +++ b/pkg/cri/server/restart.go @@ -17,6 +17,7 @@ package server import ( + "fmt" "os" "path/filepath" goruntime "runtime" @@ -29,7 +30,6 @@ import ( "github.com/containerd/containerd/log" "github.com/containerd/containerd/platforms" "github.com/containerd/typeurl" - "github.com/pkg/errors" "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" @@ -54,7 +54,7 @@ func (c *criService) recover(ctx context.Context) error { // Recover all sandboxes. sandboxes, err := c.client.Containers(ctx, filterLabel(containerKindLabel, containerKindSandbox)) if err != nil { - return errors.Wrap(err, "failed to list sandbox containers") + return fmt.Errorf("failed to list sandbox containers: %w", err) } for _, sandbox := range sandboxes { sb, err := c.loadSandbox(ctx, sandbox) @@ -64,17 +64,17 @@ func (c *criService) recover(ctx context.Context) error { } log.G(ctx).Debugf("Loaded sandbox %+v", sb) if err := c.sandboxStore.Add(sb); err != nil { - return errors.Wrapf(err, "failed to add sandbox %q to store", sandbox.ID()) + return fmt.Errorf("failed to add sandbox %q to store: %w", sandbox.ID(), err) } if err := c.sandboxNameIndex.Reserve(sb.Name, sb.ID); err != nil { - return errors.Wrapf(err, "failed to reserve sandbox name %q", sb.Name) + return fmt.Errorf("failed to reserve sandbox name %q: %w", sb.Name, err) } } // Recover all containers. containers, err := c.client.Containers(ctx, filterLabel(containerKindLabel, containerKindContainer)) if err != nil { - return errors.Wrap(err, "failed to list containers") + return fmt.Errorf("failed to list containers: %w", err) } for _, container := range containers { cntr, err := c.loadContainer(ctx, container) @@ -84,17 +84,17 @@ func (c *criService) recover(ctx context.Context) error { } log.G(ctx).Debugf("Loaded container %+v", cntr) if err := c.containerStore.Add(cntr); err != nil { - return errors.Wrapf(err, "failed to add container %q to store", container.ID()) + return fmt.Errorf("failed to add container %q to store: %w", container.ID(), err) } if err := c.containerNameIndex.Reserve(cntr.Name, cntr.ID); err != nil { - return errors.Wrapf(err, "failed to reserve container name %q", cntr.Name) + return fmt.Errorf("failed to reserve container name %q: %w", cntr.Name, err) } } // Recover all images. cImages, err := c.client.ListImages(ctx) if err != nil { - return errors.Wrap(err, "failed to list images") + return fmt.Errorf("failed to list images: %w", err) } c.loadImages(ctx, cImages) @@ -130,7 +130,7 @@ func (c *criService) recover(ctx context.Context) error { }, } { if err := cleanupOrphanedIDDirs(ctx, cleanup.cntrs, cleanup.base); err != nil { - return errors.Wrap(err, cleanup.errMsg) + return fmt.Errorf("%s: %w", cleanup.errMsg, err) } } return nil @@ -160,15 +160,15 @@ func (c *criService) loadContainer(ctx context.Context, cntr containerd.Containe // Load container metadata. exts, err := cntr.Extensions(ctx) if err != nil { - return container, errors.Wrap(err, "failed to get container extensions") + return container, fmt.Errorf("failed to get container extensions: %w", err) } ext, ok := exts[containerMetadataExtension] if !ok { - return container, errors.Errorf("metadata extension %q not found", containerMetadataExtension) + return container, fmt.Errorf("metadata extension %q not found", containerMetadataExtension) } data, err := typeurl.UnmarshalAny(&ext) if err != nil { - return container, errors.Wrapf(err, "failed to unmarshal metadata extension %q", ext) + return container, fmt.Errorf("failed to unmarshal metadata extension %q: %w", ext, err) } meta := data.(*containerstore.Metadata) @@ -208,7 +208,7 @@ func (c *criService) loadContainer(ctx context.Context, cntr containerd.Containe return containerIO, nil }) if err != nil && !errdefs.IsNotFound(err) { - return errors.Wrap(err, "failed to load task") + return fmt.Errorf("failed to load task: %w", err) } var s containerd.Status var notFound bool @@ -221,7 +221,7 @@ func (c *criService) loadContainer(ctx context.Context, cntr containerd.Containe if err != nil { // It's still possible that task is deleted during this window. if !errdefs.IsNotFound(err) { - return errors.Wrap(err, "failed to get task status") + return fmt.Errorf("failed to get task status: %w", err) } notFound = true } @@ -238,7 +238,7 @@ func (c *criService) loadContainer(ctx context.Context, cntr containerd.Containe cio.WithNewFIFOs(volatileContainerDir, meta.Config.GetTty(), meta.Config.GetStdin()), ) if err != nil { - return errors.Wrap(err, "failed to create container io") + return fmt.Errorf("failed to create container io: %w", err) } case runtime.ContainerState_CONTAINER_RUNNING: // Container was in running state, but its task has been deleted, @@ -257,17 +257,17 @@ func (c *criService) loadContainer(ctx context.Context, cntr containerd.Containe // gets restarted during container start. // Container must be in `CREATED` state. if _, err := t.Delete(ctx, containerd.WithProcessKill); err != nil && !errdefs.IsNotFound(err) { - return errors.Wrap(err, "failed to delete task") + return fmt.Errorf("failed to delete task: %w", err) } if status.State() != runtime.ContainerState_CONTAINER_CREATED { - return errors.Errorf("unexpected container state for created task: %q", status.State()) + return fmt.Errorf("unexpected container state for created task: %q", status.State()) } case containerd.Running: // Task is running. Container must be in `RUNNING` state, based on our assumption that // "task should not be started when containerd is down". switch status.State() { case runtime.ContainerState_CONTAINER_EXITED: - return errors.Errorf("unexpected container state for running task: %q", status.State()) + return fmt.Errorf("unexpected container state for running task: %q", status.State()) case runtime.ContainerState_CONTAINER_RUNNING: default: // This may happen if containerd gets restarted after task is started, but @@ -280,7 +280,7 @@ func (c *criService) loadContainer(ctx context.Context, cntr containerd.Containe exitCh, err := t.Wait(ctrdutil.NamespacedContext()) if err != nil { if !errdefs.IsNotFound(err) { - return errors.Wrap(err, "failed to wait for task") + return fmt.Errorf("failed to wait for task: %w", err) } // Container was in running state, but its task has been deleted, // set unknown exited state. @@ -294,12 +294,12 @@ func (c *criService) loadContainer(ctx context.Context, cntr containerd.Containe case containerd.Stopped: // Task is stopped. Updata status and delete the task. if _, err := t.Delete(ctx, containerd.WithProcessKill); err != nil && !errdefs.IsNotFound(err) { - return errors.Wrap(err, "failed to delete task") + return fmt.Errorf("failed to delete task: %w", err) } status.FinishedAt = s.ExitTime.UnixNano() status.ExitCode = int32(s.ExitStatus) default: - return errors.Errorf("unexpected task status %q", s.Status) + return fmt.Errorf("unexpected task status %q", s.Status) } } return nil @@ -329,15 +329,15 @@ func (c *criService) loadSandbox(ctx context.Context, cntr containerd.Container) // Load sandbox metadata. exts, err := cntr.Extensions(ctx) if err != nil { - return sandbox, errors.Wrap(err, "failed to get sandbox container extensions") + return sandbox, fmt.Errorf("failed to get sandbox container extensions: %w", err) } ext, ok := exts[sandboxMetadataExtension] if !ok { - return sandbox, errors.Errorf("metadata extension %q not found", sandboxMetadataExtension) + return sandbox, fmt.Errorf("metadata extension %q not found", sandboxMetadataExtension) } data, err := typeurl.UnmarshalAny(&ext) if err != nil { - return sandbox, errors.Wrapf(err, "failed to unmarshal metadata extension %q", ext) + return sandbox, fmt.Errorf("failed to unmarshal metadata extension %q: %w", ext, err) } meta := data.(*sandboxstore.Metadata) @@ -346,14 +346,14 @@ func (c *criService) loadSandbox(ctx context.Context, cntr containerd.Container) // Load sandbox created timestamp. info, err := cntr.Info(ctx) if err != nil { - return status, errors.Wrap(err, "failed to get sandbox container info") + return status, fmt.Errorf("failed to get sandbox container info: %w", err) } status.CreatedAt = info.CreatedAt // Load sandbox state. t, err := cntr.Task(ctx, nil) if err != nil && !errdefs.IsNotFound(err) { - return status, errors.Wrap(err, "failed to load task") + return status, fmt.Errorf("failed to load task: %w", err) } var taskStatus containerd.Status var notFound bool @@ -366,7 +366,7 @@ func (c *criService) loadSandbox(ctx context.Context, cntr containerd.Container) if err != nil { // It's still possible that task is deleted during this window. if !errdefs.IsNotFound(err) { - return status, errors.Wrap(err, "failed to get task status") + return status, fmt.Errorf("failed to get task status: %w", err) } notFound = true } @@ -381,7 +381,7 @@ func (c *criService) loadSandbox(ctx context.Context, cntr containerd.Container) exitCh, err := t.Wait(ctrdutil.NamespacedContext()) if err != nil { if !errdefs.IsNotFound(err) { - return status, errors.Wrap(err, "failed to wait for task") + return status, fmt.Errorf("failed to wait for task: %w", err) } status.State = sandboxstore.StateNotReady } else { @@ -393,7 +393,7 @@ func (c *criService) loadSandbox(ctx context.Context, cntr containerd.Container) } else { // Task is not running. Delete the task and set sandbox state as NOTREADY. if _, err := t.Delete(ctx, containerd.WithProcessKill); err != nil && !errdefs.IsNotFound(err) { - return status, errors.Wrap(err, "failed to delete task") + return status, fmt.Errorf("failed to delete task: %w", err) } status.State = sandboxstore.StateNotReady } @@ -459,7 +459,7 @@ func cleanupOrphanedIDDirs(ctx context.Context, cntrs []containerd.Container, ba // Cleanup orphaned id directories. dirs, err := os.ReadDir(base) if err != nil && !os.IsNotExist(err) { - return errors.Wrap(err, "failed to read base directory") + return fmt.Errorf("failed to read base directory: %w", err) } idsMap := make(map[string]containerd.Container) for _, cntr := range cntrs { diff --git a/pkg/cri/server/sandbox_portforward.go b/pkg/cri/server/sandbox_portforward.go index 91e863f41ee2b..29ffb58c962c3 100644 --- a/pkg/cri/server/sandbox_portforward.go +++ b/pkg/cri/server/sandbox_portforward.go @@ -17,7 +17,9 @@ package server import ( - "github.com/pkg/errors" + "errors" + "fmt" + "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" @@ -28,7 +30,7 @@ import ( func (c *criService) PortForward(ctx context.Context, r *runtime.PortForwardRequest) (retRes *runtime.PortForwardResponse, retErr error) { sandbox, err := c.sandboxStore.Get(r.GetPodSandboxId()) if err != nil { - return nil, errors.Wrapf(err, "failed to find sandbox %q", r.GetPodSandboxId()) + return nil, fmt.Errorf("failed to find sandbox %q: %w", r.GetPodSandboxId(), err) } if sandbox.Status.Get().State != sandboxstore.StateReady { return nil, errors.New("sandbox container is not running") diff --git a/pkg/cri/server/sandbox_portforward_linux.go b/pkg/cri/server/sandbox_portforward_linux.go index 86b0156733c95..9f54daeac4add 100644 --- a/pkg/cri/server/sandbox_portforward_linux.go +++ b/pkg/cri/server/sandbox_portforward_linux.go @@ -24,7 +24,6 @@ import ( "github.com/containerd/containerd/log" "github.com/containernetworking/plugins/pkg/ns" - "github.com/pkg/errors" "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" @@ -35,7 +34,7 @@ import ( func (c *criService) portForward(ctx context.Context, id string, port int32, stream io.ReadWriteCloser) error { s, err := c.sandboxStore.Get(id) if err != nil { - return errors.Wrapf(err, "failed to find sandbox %q in store", id) + return fmt.Errorf("failed to find sandbox %q in store: %w", id, err) } var netNSDo func(func(ns.NetNS) error) error @@ -45,9 +44,9 @@ func (c *criService) portForward(ctx context.Context, id string, port int32, str hostNet := securityContext.GetNamespaceOptions().GetNetwork() == runtime.NamespaceMode_NODE if !hostNet { if closed, err := s.NetNS.Closed(); err != nil { - return errors.Wrapf(err, "failed to check netwok namespace closed for sandbox %q", id) + return fmt.Errorf("failed to check netwok namespace closed for sandbox %q: %w", id, err) } else if closed { - return errors.Errorf("network namespace for sandbox %q is closed", id) + return fmt.Errorf("network namespace for sandbox %q is closed", id) } netNSDo = s.NetNS.Do netNSPath = s.NetNS.GetPath() @@ -130,7 +129,7 @@ func (c *criService) portForward(ctx context.Context, id string, port int32, str }) if err != nil { - return errors.Wrapf(err, "failed to execute portforward in network namespace %q", netNSPath) + return fmt.Errorf("failed to execute portforward in network namespace %q: %w", netNSPath, err) } log.G(ctx).Infof("Finish port forwarding for %q port %d", id, port) diff --git a/pkg/cri/server/sandbox_portforward_other.go b/pkg/cri/server/sandbox_portforward_other.go index e449d607a1e52..aa113405cef64 100644 --- a/pkg/cri/server/sandbox_portforward_other.go +++ b/pkg/cri/server/sandbox_portforward_other.go @@ -20,15 +20,15 @@ package server import ( + "fmt" "io" "github.com/containerd/containerd/errdefs" - "github.com/pkg/errors" "golang.org/x/net/context" ) // portForward uses netns to enter the sandbox namespace, and forwards a stream inside the // the namespace to a specific port. It keeps forwarding until it exits or client disconnect. func (c *criService) portForward(ctx context.Context, id string, port int32, stream io.ReadWriteCloser) error { - return errors.Wrap(errdefs.ErrNotImplemented, "port forward") + return fmt.Errorf("port forward: %w", errdefs.ErrNotImplemented) } diff --git a/pkg/cri/server/sandbox_portforward_windows.go b/pkg/cri/server/sandbox_portforward_windows.go index 3bcd36ee55658..d5bf77660d657 100644 --- a/pkg/cri/server/sandbox_portforward_windows.go +++ b/pkg/cri/server/sandbox_portforward_windows.go @@ -21,7 +21,6 @@ import ( "fmt" "io" - "github.com/pkg/errors" "golang.org/x/net/context" "k8s.io/utils/exec" @@ -38,7 +37,7 @@ func (c *criService) portForward(ctx context.Context, id string, port int32, str cmd := []string{"wincat.exe", "127.0.0.1", fmt.Sprint(port)} err := c.execInSandbox(ctx, id, cmd, stream, stdout, stderr) if err != nil { - return errors.Wrapf(err, "failed to execute port forward in sandbox: %s", stderrBuffer.String()) + return fmt.Errorf("failed to execute port forward in sandbox: %s: %w", stderrBuffer.String(), err) } return nil } @@ -47,13 +46,13 @@ func (c *criService) execInSandbox(ctx context.Context, sandboxID string, cmd [] // Get sandbox from our sandbox store. sb, err := c.sandboxStore.Get(sandboxID) if err != nil { - return errors.Wrapf(err, "failed to find sandbox %q in store", sandboxID) + return fmt.Errorf("failed to find sandbox %q in store: %w", sandboxID, err) } // Check the sandbox state state := sb.Status.Get().State if state != sandboxstore.StateReady { - return errors.Errorf("sandbox is in %s state", fmt.Sprint(state)) + return fmt.Errorf("sandbox is in %s state", fmt.Sprint(state)) } opts := execOptions{ @@ -66,13 +65,13 @@ func (c *criService) execInSandbox(ctx context.Context, sandboxID string, cmd [] } exitCode, err := c.execInternal(ctx, sb.Container, sandboxID, opts) if err != nil { - return errors.Wrap(err, "failed to exec in sandbox") + return fmt.Errorf("failed to exec in sandbox: %w", err) } if *exitCode == 0 { return nil } return &exec.CodeExitError{ - Err: errors.Errorf("error executing command %v, exit code %d", cmd, *exitCode), + Err: fmt.Errorf("error executing command %v, exit code %d", cmd, *exitCode), Code: int(*exitCode), } } diff --git a/pkg/cri/server/sandbox_remove.go b/pkg/cri/server/sandbox_remove.go index 0d4a1344e2f04..4f5a4f78a2108 100644 --- a/pkg/cri/server/sandbox_remove.go +++ b/pkg/cri/server/sandbox_remove.go @@ -17,13 +17,13 @@ package server import ( + "fmt" "time" "github.com/containerd/containerd" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/log" - "github.com/pkg/errors" "github.com/sirupsen/logrus" "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" @@ -36,8 +36,8 @@ func (c *criService) RemovePodSandbox(ctx context.Context, r *runtime.RemovePodS sandbox, err := c.sandboxStore.Get(r.GetPodSandboxId()) if err != nil { if !errdefs.IsNotFound(err) { - return nil, errors.Wrapf(err, "an error occurred when try to find sandbox %q", - r.GetPodSandboxId()) + return nil, fmt.Errorf("an error occurred when try to find sandbox %q: %w", + r.GetPodSandboxId(), err) } // Do not return error if the id doesn't exist. log.G(ctx).Tracef("RemovePodSandbox called for sandbox %q that does not exist", @@ -52,16 +52,16 @@ func (c *criService) RemovePodSandbox(ctx context.Context, r *runtime.RemovePodS // This can happen if the task process associated with the Pod died or it was killed. logrus.Infof("Forcibly stopping sandbox %q", id) if err := c.stopPodSandbox(ctx, sandbox); err != nil { - return nil, errors.Wrapf(err, "failed to forcibly stop sandbox %q", id) + return nil, fmt.Errorf("failed to forcibly stop sandbox %q: %w", id, err) } // Return error if sandbox network namespace is not closed yet. if sandbox.NetNS != nil { nsPath := sandbox.NetNS.GetPath() if closed, err := sandbox.NetNS.Closed(); err != nil { - return nil, errors.Wrapf(err, "failed to check sandbox network namespace %q closed", nsPath) + return nil, fmt.Errorf("failed to check sandbox network namespace %q closed: %w", nsPath, err) } else if !closed { - return nil, errors.Errorf("sandbox network namespace %q is not fully closed", nsPath) + return nil, fmt.Errorf("sandbox network namespace %q is not fully closed", nsPath) } } @@ -77,26 +77,26 @@ func (c *criService) RemovePodSandbox(ctx context.Context, r *runtime.RemovePodS } _, err = c.RemoveContainer(ctx, &runtime.RemoveContainerRequest{ContainerId: cntr.ID}) if err != nil { - return nil, errors.Wrapf(err, "failed to remove container %q", cntr.ID) + return nil, fmt.Errorf("failed to remove container %q: %w", cntr.ID, err) } } // Cleanup the sandbox root directories. sandboxRootDir := c.getSandboxRootDir(id) if err := ensureRemoveAll(ctx, sandboxRootDir); err != nil { - return nil, errors.Wrapf(err, "failed to remove sandbox root directory %q", - sandboxRootDir) + return nil, fmt.Errorf("failed to remove sandbox root directory %q: %w", + sandboxRootDir, err) } volatileSandboxRootDir := c.getVolatileSandboxRootDir(id) if err := ensureRemoveAll(ctx, volatileSandboxRootDir); err != nil { - return nil, errors.Wrapf(err, "failed to remove volatile sandbox root directory %q", - volatileSandboxRootDir) + return nil, fmt.Errorf("failed to remove volatile sandbox root directory %q: %w", + volatileSandboxRootDir, err) } // Delete sandbox container. if err := sandbox.Container.Delete(ctx, containerd.WithSnapshotCleanup); err != nil { if !errdefs.IsNotFound(err) { - return nil, errors.Wrapf(err, "failed to delete sandbox container %q", id) + return nil, fmt.Errorf("failed to delete sandbox container %q: %w", id, err) } log.G(ctx).Tracef("Remove called for sandbox container %q that does not exist", id) } diff --git a/pkg/cri/server/sandbox_run.go b/pkg/cri/server/sandbox_run.go index 891578ce5afd8..646df510a23b1 100644 --- a/pkg/cri/server/sandbox_run.go +++ b/pkg/cri/server/sandbox_run.go @@ -18,6 +18,8 @@ package server import ( "encoding/json" + "errors" + "fmt" "math" "path/filepath" goruntime "runtime" @@ -34,7 +36,6 @@ import ( v1 "github.com/containerd/nri/types/v1" "github.com/containerd/typeurl" "github.com/davecgh/go-spew/spew" - "github.com/pkg/errors" "github.com/sirupsen/logrus" "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" @@ -72,7 +73,7 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox // Reserve the sandbox name to avoid concurrent `RunPodSandbox` request starting the // same sandbox. if err := c.sandboxNameIndex.Reserve(name, id); err != nil { - return nil, errors.Wrapf(err, "failed to reserve sandbox name %q", name) + return nil, fmt.Errorf("failed to reserve sandbox name %q: %w", name, err) } defer func() { // Release the name if the function returns with an error. @@ -97,16 +98,16 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox // Ensure sandbox container image snapshot. image, err := c.ensureImageExists(ctx, c.config.SandboxImage, config) if err != nil { - return nil, errors.Wrapf(err, "failed to get sandbox image %q", c.config.SandboxImage) + return nil, fmt.Errorf("failed to get sandbox image %q: %w", c.config.SandboxImage, err) } containerdImage, err := c.toContainerdImage(ctx, *image) if err != nil { - return nil, errors.Wrapf(err, "failed to get image from containerd %q", image.ID) + return nil, fmt.Errorf("failed to get image from containerd %q: %w", image.ID, err) } ociRuntime, err := c.getSandboxRuntime(config, r.GetRuntimeHandler()) if err != nil { - return nil, errors.Wrap(err, "failed to get sandbox runtime") + return nil, fmt.Errorf("failed to get sandbox runtime: %w", err) } log.G(ctx).WithField("podsandboxid", id).Debugf("use OCI runtime %+v", ociRuntime) @@ -135,7 +136,7 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox } sandbox.NetNS, err = netns.NewNetNS(netnsMountDir) if err != nil { - return nil, errors.Wrapf(err, "failed to create network namespace for sandbox %q", id) + return nil, fmt.Errorf("failed to create network namespace for sandbox %q: %w", id, err) } sandbox.NetNSPath = sandbox.NetNS.GetPath() defer func() { @@ -163,7 +164,7 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox // calls to network namespace of the pod to query the IP of the veth interface on every // SandboxStatus request. if err := c.setupPodNetwork(ctx, &sandbox); err != nil { - return nil, errors.Wrapf(err, "failed to setup network for sandbox %q", id) + return nil, fmt.Errorf("failed to setup network for sandbox %q: %w", id, err) } sandboxCreateNetworkTimer.UpdateSince(netStart) } @@ -175,7 +176,7 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox // it safely. spec, err := c.sandboxContainerSpec(id, config, &image.ImageSpec.Config, sandbox.NetNSPath, ociRuntime.PodAnnotations) if err != nil { - return nil, errors.Wrap(err, "failed to generate sandbox container spec") + return nil, fmt.Errorf("failed to generate sandbox container spec: %w", err) } log.G(ctx).WithField("podsandboxid", id).Debugf("sandbox container spec: %#+v", spew.NewFormatter(spec)) sandbox.ProcessLabel = spec.Process.SelinuxLabel @@ -199,14 +200,14 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox // Generate spec options that will be applied to the spec later. specOpts, err := c.sandboxContainerSpecOpts(config, &image.ImageSpec.Config) if err != nil { - return nil, errors.Wrap(err, "failed to generate sanbdox container spec options") + return nil, fmt.Errorf("failed to generate sanbdox container spec options: %w", err) } sandboxLabels := buildLabels(config.Labels, image.ImageSpec.Config.Labels, containerKindSandbox) runtimeOpts, err := generateRuntimeOptions(ociRuntime, c.config) if err != nil { - return nil, errors.Wrap(err, "failed to generate runtime options") + return nil, fmt.Errorf("failed to generate runtime options: %w", err) } snapshotterOpt := snapshots.WithLabels(snapshots.FilterInheritedLabels(config.Annotations)) opts := []containerd.NewContainerOpts{ @@ -219,7 +220,7 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox container, err := c.client.NewContainer(ctx, id, opts...) if err != nil { - return nil, errors.Wrap(err, "failed to create containerd container") + return nil, fmt.Errorf("failed to create containerd container: %w", err) } defer func() { if retErr != nil { @@ -234,8 +235,8 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox // Create sandbox container root directories. sandboxRootDir := c.getSandboxRootDir(id) if err := c.os.MkdirAll(sandboxRootDir, 0755); err != nil { - return nil, errors.Wrapf(err, "failed to create sandbox root directory %q", - sandboxRootDir) + return nil, fmt.Errorf("failed to create sandbox root directory %q: %w", + sandboxRootDir, err) } defer func() { if retErr != nil { @@ -248,8 +249,8 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox }() volatileSandboxRootDir := c.getVolatileSandboxRootDir(id) if err := c.os.MkdirAll(volatileSandboxRootDir, 0755); err != nil { - return nil, errors.Wrapf(err, "failed to create volatile sandbox root directory %q", - volatileSandboxRootDir) + return nil, fmt.Errorf("failed to create volatile sandbox root directory %q: %w", + volatileSandboxRootDir, err) } defer func() { if retErr != nil { @@ -263,7 +264,7 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox // Setup files required for the sandbox. if err = c.setupSandboxFiles(id, config); err != nil { - return nil, errors.Wrapf(err, "failed to setup sandbox files") + return nil, fmt.Errorf("failed to setup sandbox files: %w", err) } defer func() { if retErr != nil { @@ -277,7 +278,7 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox // Update sandbox created timestamp. info, err := container.Info(ctx) if err != nil { - return nil, errors.Wrap(err, "failed to get sandbox container info") + return nil, fmt.Errorf("failed to get sandbox container info: %w", err) } // Create sandbox task in containerd. @@ -291,7 +292,7 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox // We don't need stdio for sandbox container. task, err := container.NewTask(ctx, containerdio.NullIO, taskOpts...) if err != nil { - return nil, errors.Wrap(err, "failed to create containerd task") + return nil, fmt.Errorf("failed to create containerd task: %w", err) } defer func() { if retErr != nil { @@ -307,12 +308,12 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox // wait is a long running background request, no timeout needed. exitCh, err := task.Wait(ctrdutil.NamespacedContext()) if err != nil { - return nil, errors.Wrap(err, "failed to wait for sandbox container task") + return nil, fmt.Errorf("failed to wait for sandbox container task: %w", err) } nric, err := nri.New() if err != nil { - return nil, errors.Wrap(err, "unable to create nri client") + return nil, fmt.Errorf("unable to create nri client: %w", err) } if nric != nil { nriSB := &nri.Sandbox{ @@ -320,12 +321,12 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox Labels: config.Labels, } if _, err := nric.InvokeWithSandbox(ctx, task, v1.Create, nriSB); err != nil { - return nil, errors.Wrap(err, "nri invoke") + return nil, fmt.Errorf("nri invoke: %w", err) } } if err := task.Start(ctx); err != nil { - return nil, errors.Wrapf(err, "failed to start sandbox container task %q", id) + return nil, fmt.Errorf("failed to start sandbox container task %q: %w", id, err) } if err := sandbox.Status.Update(func(status sandboxstore.Status) (sandboxstore.Status, error) { @@ -335,14 +336,14 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox status.CreatedAt = info.CreatedAt return status, nil }); err != nil { - return nil, errors.Wrap(err, "failed to update sandbox status") + return nil, fmt.Errorf("failed to update sandbox status: %w", err) } // Add sandbox into sandbox store in INIT state. sandbox.Container = container if err := c.sandboxStore.Add(sandbox); err != nil { - return nil, errors.Wrapf(err, "failed to add sandbox %+v into store", sandbox) + return nil, fmt.Errorf("failed to add sandbox %+v into store: %w", sandbox, err) } // start the monitor after adding sandbox into the store, this ensures @@ -386,7 +387,7 @@ func (c *criService) setupPodNetwork(ctx context.Context, sandbox *sandboxstore. opts, err := cniNamespaceOpts(id, config) if err != nil { - return errors.Wrap(err, "get cni namespace options") + return fmt.Errorf("get cni namespace options: %w", err) } log.G(ctx).WithField("podsandboxid", id).Debugf("begin cni setup") result, err := netPlugin.Setup(ctx, id, path, opts...) @@ -400,7 +401,7 @@ func (c *criService) setupPodNetwork(ctx context.Context, sandbox *sandboxstore. sandbox.CNIResult = result return nil } - return errors.Errorf("failed to find network info for sandbox %q", id) + return fmt.Errorf("failed to find network info for sandbox %q", id) } // cniNamespaceOpts get CNI namespace options from sandbox config. @@ -448,7 +449,7 @@ func toCNILabels(id string, config *runtime.PodSandboxConfig) map[string]string func toCNIBandWidth(annotations map[string]string) (*cni.BandWidth, error) { ingress, egress, err := bandwidth.ExtractPodBandwidthResources(annotations) if err != nil { - return nil, errors.Wrap(err, "reading pod bandwidth annotations") + return nil, fmt.Errorf("reading pod bandwidth annotations: %w", err) } if ingress == nil && egress == nil { @@ -590,7 +591,7 @@ func (c *criService) getSandboxRuntime(config *runtime.PodSandboxConfig, runtime handler, ok := c.config.ContainerdConfig.Runtimes[runtimeHandler] if !ok { - return criconfig.Runtime{}, errors.Errorf("no runtime for %q is configured", runtimeHandler) + return criconfig.Runtime{}, fmt.Errorf("no runtime for %q is configured", runtimeHandler) } return handler, nil } diff --git a/pkg/cri/server/sandbox_run_linux.go b/pkg/cri/server/sandbox_run_linux.go index 4a82f1a9ac16f..c4485e2fa04ea 100644 --- a/pkg/cri/server/sandbox_run_linux.go +++ b/pkg/cri/server/sandbox_run_linux.go @@ -28,7 +28,6 @@ import ( imagespec "github.com/opencontainers/image-spec/specs-go/v1" runtimespec "github.com/opencontainers/runtime-spec/specs-go" selinux "github.com/opencontainers/selinux/go-selinux" - "github.com/pkg/errors" "golang.org/x/sys/unix" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" @@ -56,7 +55,7 @@ func (c *criService) sandboxContainerSpec(id string, config *runtime.PodSandboxC if len(imageConfig.Entrypoint) == 0 && len(imageConfig.Cmd) == 0 { // Pause image must have entrypoint or cmd. - return nil, errors.Errorf("invalid empty entrypoint and cmd in image config %+v", imageConfig) + return nil, fmt.Errorf("invalid empty entrypoint and cmd in image config %+v", imageConfig) } specOpts = append(specOpts, oci.WithProcessArgs(append(imageConfig.Entrypoint, imageConfig.Cmd...)...)) @@ -120,7 +119,7 @@ func (c *criService) sandboxContainerSpec(id string, config *runtime.PodSandboxC processLabel, mountLabel, err := initLabelsFromOpt(securityContext.GetSelinuxOptions()) if err != nil { - return nil, errors.Wrapf(err, "failed to init selinux options %+v", securityContext.GetSelinuxOptions()) + return nil, fmt.Errorf("failed to init selinux options %+v: %w", securityContext.GetSelinuxOptions(), err) } defer func() { if retErr != nil { @@ -197,7 +196,7 @@ func (c *criService) sandboxContainerSpecOpts(config *runtime.PodSandboxConfig, securityContext.GetSeccompProfilePath(), //nolint:staticcheck // Deprecated but we don't want to remove yet c.config.UnsetSeccompProfile) if err != nil { - return nil, errors.Wrap(err, "failed to generate seccomp spec opts") + return nil, fmt.Errorf("failed to generate seccomp spec opts: %w", err) } } seccompSpecOpts, err := c.generateSeccompSpecOpts( @@ -205,7 +204,7 @@ func (c *criService) sandboxContainerSpecOpts(config *runtime.PodSandboxConfig, securityContext.GetPrivileged(), c.seccompEnabled()) if err != nil { - return nil, errors.Wrap(err, "failed to generate seccomp spec opts") + return nil, fmt.Errorf("failed to generate seccomp spec opts: %w", err) } if seccompSpecOpts != nil { specOpts = append(specOpts, seccompSpecOpts) @@ -217,7 +216,7 @@ func (c *criService) sandboxContainerSpecOpts(config *runtime.PodSandboxConfig, securityContext.GetRunAsGroup(), ) if err != nil { - return nil, errors.Wrap(err, "failed to generate user string") + return nil, fmt.Errorf("failed to generate user string: %w", err) } if userstr == "" { // Lastly, since no user override was passed via CRI try to set via OCI @@ -239,17 +238,17 @@ func (c *criService) setupSandboxFiles(id string, config *runtime.PodSandboxConf var err error hostname, err = c.os.Hostname() if err != nil { - return errors.Wrap(err, "failed to get hostname") + return fmt.Errorf("failed to get hostname: %w", err) } } if err := c.os.WriteFile(sandboxEtcHostname, []byte(hostname+"\n"), 0644); err != nil { - return errors.Wrapf(err, "failed to write hostname to %q", sandboxEtcHostname) + return fmt.Errorf("failed to write hostname to %q: %w", sandboxEtcHostname, err) } // TODO(random-liu): Consider whether we should maintain /etc/hosts and /etc/resolv.conf in kubelet. sandboxEtcHosts := c.getSandboxHosts(id) if err := c.os.CopyFile(etcHosts, sandboxEtcHosts, 0644); err != nil { - return errors.Wrapf(err, "failed to generate sandbox hosts file %q", sandboxEtcHosts) + return fmt.Errorf("failed to generate sandbox hosts file %q: %w", sandboxEtcHosts, err) } // Set DNS options. Maintain a resolv.conf for the sandbox. @@ -258,7 +257,7 @@ func (c *criService) setupSandboxFiles(id string, config *runtime.PodSandboxConf if dnsConfig := config.GetDnsConfig(); dnsConfig != nil { resolvContent, err = parseDNSOptions(dnsConfig.Servers, dnsConfig.Searches, dnsConfig.Options) if err != nil { - return errors.Wrapf(err, "failed to parse sandbox DNSConfig %+v", dnsConfig) + return fmt.Errorf("failed to parse sandbox DNSConfig %+v: %w", dnsConfig, err) } } resolvPath := c.getResolvPath(id) @@ -266,28 +265,28 @@ func (c *criService) setupSandboxFiles(id string, config *runtime.PodSandboxConf // copy host's resolv.conf to resolvPath err = c.os.CopyFile(resolvConfPath, resolvPath, 0644) if err != nil { - return errors.Wrapf(err, "failed to copy host's resolv.conf to %q", resolvPath) + return fmt.Errorf("failed to copy host's resolv.conf to %q: %w", resolvPath, err) } } else { err = c.os.WriteFile(resolvPath, []byte(resolvContent), 0644) if err != nil { - return errors.Wrapf(err, "failed to write resolv content to %q", resolvPath) + return fmt.Errorf("failed to write resolv content to %q: %w", resolvPath, err) } } // Setup sandbox /dev/shm. if config.GetLinux().GetSecurityContext().GetNamespaceOptions().GetIpc() == runtime.NamespaceMode_NODE { if _, err := c.os.Stat(devShm); err != nil { - return errors.Wrapf(err, "host %q is not available for host ipc", devShm) + return fmt.Errorf("host %q is not available for host ipc: %w", devShm, err) } } else { sandboxDevShm := c.getSandboxDevShm(id) if err := c.os.MkdirAll(sandboxDevShm, 0700); err != nil { - return errors.Wrap(err, "failed to create sandbox shm") + return fmt.Errorf("failed to create sandbox shm: %w", err) } shmproperty := fmt.Sprintf("mode=1777,size=%d", defaultShmSize) if err := c.os.(osinterface.UNIX).Mount("shm", sandboxDevShm, "tmpfs", uintptr(unix.MS_NOEXEC|unix.MS_NOSUID|unix.MS_NODEV), shmproperty); err != nil { - return errors.Wrap(err, "failed to mount sandbox shm") + return fmt.Errorf("failed to mount sandbox shm: %w", err) } } @@ -320,10 +319,10 @@ func (c *criService) cleanupSandboxFiles(id string, config *runtime.PodSandboxCo if config.GetLinux().GetSecurityContext().GetNamespaceOptions().GetIpc() != runtime.NamespaceMode_NODE { path, err := c.os.FollowSymlinkInScope(c.getSandboxDevShm(id), "/") if err != nil { - return errors.Wrap(err, "failed to follow symlink") + return fmt.Errorf("failed to follow symlink: %w", err) } if err := c.os.(osinterface.UNIX).Unmount(path); err != nil && !os.IsNotExist(err) { - return errors.Wrapf(err, "failed to unmount %q", path) + return fmt.Errorf("failed to unmount %q: %w", path, err) } } return nil diff --git a/pkg/cri/server/sandbox_run_windows.go b/pkg/cri/server/sandbox_run_windows.go index 29d70953fac0c..a2e0530eac3b7 100644 --- a/pkg/cri/server/sandbox_run_windows.go +++ b/pkg/cri/server/sandbox_run_windows.go @@ -17,13 +17,13 @@ package server import ( + "fmt" "strconv" "github.com/containerd/containerd" "github.com/containerd/containerd/oci" imagespec "github.com/opencontainers/image-spec/specs-go/v1" runtimespec "github.com/opencontainers/runtime-spec/specs-go" - "github.com/pkg/errors" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" "github.com/containerd/containerd/pkg/cri/annotations" @@ -43,7 +43,7 @@ func (c *criService) sandboxContainerSpec(id string, config *runtime.PodSandboxC if len(imageConfig.Entrypoint) == 0 && len(imageConfig.Cmd) == 0 { // Pause image must have entrypoint or cmd. - return nil, errors.Errorf("invalid empty entrypoint and cmd in image config %+v", imageConfig) + return nil, fmt.Errorf("invalid empty entrypoint and cmd in image config %+v", imageConfig) } specOpts = append(specOpts, oci.WithProcessArgs(append(imageConfig.Entrypoint, imageConfig.Cmd...)...)) diff --git a/pkg/cri/server/sandbox_stats.go b/pkg/cri/server/sandbox_stats.go index f3402c9396d0a..8b47388362610 100644 --- a/pkg/cri/server/sandbox_stats.go +++ b/pkg/cri/server/sandbox_stats.go @@ -17,7 +17,8 @@ package server import ( - "github.com/pkg/errors" + "fmt" + "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) @@ -29,18 +30,18 @@ func (c *criService) PodSandboxStats( sandbox, err := c.sandboxStore.Get(r.GetPodSandboxId()) if err != nil { - return nil, errors.Wrapf(err, "an error occurred when trying to find sandbox %s", r.GetPodSandboxId()) + return nil, fmt.Errorf("an error occurred when trying to find sandbox %s: %w", r.GetPodSandboxId(), err) } metrics, err := metricsForSandbox(sandbox) if err != nil { - return nil, errors.Wrapf(err, "failed getting metrics for sandbox %s", r.GetPodSandboxId()) + return nil, fmt.Errorf("failed getting metrics for sandbox %s: %w", r.GetPodSandboxId(), err) } podSandboxStats, err := c.podSandboxStats(ctx, sandbox, metrics) if err != nil { - return nil, errors.Wrapf(err, "failed to decode pod sandbox metrics %s", r.GetPodSandboxId()) + return nil, fmt.Errorf("failed to decode pod sandbox metrics %s: %w", r.GetPodSandboxId(), err) } return &runtime.PodSandboxStatsResponse{Stats: podSandboxStats}, nil diff --git a/pkg/cri/server/sandbox_stats_linux.go b/pkg/cri/server/sandbox_stats_linux.go index ad4feb59d1a10..bd06cb5a136ed 100644 --- a/pkg/cri/server/sandbox_stats_linux.go +++ b/pkg/cri/server/sandbox_stats_linux.go @@ -17,10 +17,10 @@ package server import ( + "fmt" "time" "github.com/containernetworking/plugins/pkg/ns" - "github.com/pkg/errors" "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" @@ -41,7 +41,7 @@ func (c *criService) podSandboxStats( meta := sandbox.Metadata if sandbox.Status.Get().State != sandboxstore.StateReady { - return nil, errors.Errorf("failed to get pod sandbox stats since sandbox container %q is not in ready state", meta.ID) + return nil, fmt.Errorf("failed to get pod sandbox stats since sandbox container %q is not in ready state", meta.ID) } var podSandboxStats runtime.PodSandboxStats @@ -59,13 +59,13 @@ func (c *criService) podSandboxStats( cpuStats, err := c.cpuContainerStats(meta.ID, true /* isSandbox */, stats, timestamp) if err != nil { - return nil, errors.Wrap(err, "failed to obtain cpu stats") + return nil, fmt.Errorf("failed to obtain cpu stats: %w", err) } podSandboxStats.Linux.Cpu = cpuStats memoryStats, err := c.memoryContainerStats(meta.ID, stats, timestamp) if err != nil { - return nil, errors.Wrap(err, "failed to obtain memory stats") + return nil, fmt.Errorf("failed to obtain memory stats: %w", err) } podSandboxStats.Linux.Memory = memoryStats @@ -113,7 +113,7 @@ func (c *criService) podSandboxStats( listContainerStatsRequest := &runtime.ListContainerStatsRequest{Filter: &runtime.ContainerStatsFilter{PodSandboxId: meta.ID}} resp, err := c.ListContainerStats(ctx, listContainerStatsRequest) if err != nil { - return nil, errors.Wrap(err, "failed to obtain container stats during podSandboxStats call") + return nil, fmt.Errorf("failed to obtain container stats during podSandboxStats call: %w", err) } podSandboxStats.Linux.Containers = resp.GetStats() } @@ -146,29 +146,29 @@ func metricsForSandbox(sandbox sandboxstore.Sandbox) (interface{}, error) { cgroupPath := sandbox.Config.GetLinux().GetCgroupParent() if cgroupPath == "" { - return nil, errors.Errorf("failed to get cgroup metrics for sandbox %v because cgroupPath is empty", sandbox.ID) + return nil, fmt.Errorf("failed to get cgroup metrics for sandbox %v because cgroupPath is empty", sandbox.ID) } var statsx interface{} if cgroups.Mode() == cgroups.Unified { cg, err := cgroupsv2.LoadManager("/sys/fs/cgroup", cgroupPath) if err != nil { - return nil, errors.Wrapf(err, "failed to load sandbox cgroup: %v", cgroupPath) + return nil, fmt.Errorf("failed to load sandbox cgroup: %v: %w", cgroupPath, err) } stats, err := cg.Stat() if err != nil { - return nil, errors.Wrapf(err, "failed to get stats for cgroup: %v", cgroupPath) + return nil, fmt.Errorf("failed to get stats for cgroup: %v: %w", cgroupPath, err) } statsx = stats } else { control, err := cgroups.Load(cgroups.V1, cgroups.StaticPath(cgroupPath)) if err != nil { - return nil, errors.Wrapf(err, "failed to load sandbox cgroup: %v", cgroupPath) + return nil, fmt.Errorf("failed to load sandbox cgroup %v: %w", cgroupPath, err) } stats, err := control.Stat(cgroups.IgnoreNotExist) if err != nil { - return nil, errors.Wrapf(err, "failed to get stats for cgroup %v", cgroupPath) + return nil, fmt.Errorf("failed to get stats for cgroup %v: %w", cgroupPath, err) } statsx = stats } diff --git a/pkg/cri/server/sandbox_stats_list.go b/pkg/cri/server/sandbox_stats_list.go index cefcc43ee4d01..01ded0e3c94b1 100644 --- a/pkg/cri/server/sandbox_stats_list.go +++ b/pkg/cri/server/sandbox_stats_list.go @@ -17,8 +17,9 @@ package server import ( + "fmt" + sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox" - "github.com/pkg/errors" "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) @@ -35,12 +36,12 @@ func (c *criService) ListPodSandboxStats( metrics, err := metricsForSandbox(sandbox) if err != nil { - return nil, errors.Wrapf(err, "failed to obtain metrics for sandbox %q", sandbox.ID) + return nil, fmt.Errorf("failed to obtain metrics for sandbox %q: %w", sandbox.ID, err) } sandboxStats, err := c.podSandboxStats(ctx, sandbox, metrics) if err != nil { - return nil, errors.Wrapf(err, "failed to decode sandbox container metrics for sandbox %q", sandbox.ID) + return nil, fmt.Errorf("failed to decode sandbox container metrics for sandbox %q: %w", sandbox.ID, err) } podSandboxStats.Stats = append(podSandboxStats.Stats, sandboxStats) } diff --git a/pkg/cri/server/sandbox_stats_other.go b/pkg/cri/server/sandbox_stats_other.go index 88c94d182a2ee..f21391eacacbd 100644 --- a/pkg/cri/server/sandbox_stats_other.go +++ b/pkg/cri/server/sandbox_stats_other.go @@ -20,18 +20,19 @@ package server import ( + "fmt" + "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" "github.com/containerd/containerd/errdefs" sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox" - "github.com/pkg/errors" ) func (c *criService) podSandboxStats(ctx context.Context, sandbox sandboxstore.Sandbox, stats interface{}) (*runtime.PodSandboxStats, error) { - return nil, errors.Wrap(errdefs.ErrNotImplemented, "pod sandbox stats not implemented") + return nil, fmt.Errorf("pod sandbox stats not implemented: %w", errdefs.ErrNotImplemented) } func metricsForSandbox(sandbox sandboxstore.Sandbox) (interface{}, error) { - return nil, errors.Wrap(errdefs.ErrNotImplemented, "metrics for sandbox not implemented") + return nil, fmt.Errorf("metrics for sandbox not implemented: %w", errdefs.ErrNotImplemented) } diff --git a/pkg/cri/server/sandbox_stats_windows.go b/pkg/cri/server/sandbox_stats_windows.go index 3798a5e1be66c..d4b23733794fd 100644 --- a/pkg/cri/server/sandbox_stats_windows.go +++ b/pkg/cri/server/sandbox_stats_windows.go @@ -17,18 +17,19 @@ package server import ( + "fmt" + "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" "github.com/containerd/containerd/errdefs" sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox" - "github.com/pkg/errors" ) func (c *criService) podSandboxStats(ctx context.Context, sandbox sandboxstore.Sandbox, stats interface{}) (*runtime.PodSandboxStats, error) { - return nil, errors.Wrap(errdefs.ErrNotImplemented, "pod sandbox stats not implemented on windows") + return nil, fmt.Errorf("pod sandbox stats not implemented on windows: %w", errdefs.ErrNotImplemented) } func metricsForSandbox(sandbox sandboxstore.Sandbox) (interface{}, error) { - return nil, errors.Wrap(errdefs.ErrNotImplemented, "metrics for sandbox not implemented on windows") + return nil, fmt.Errorf("metrics for sandbox not implemented on windows: %w", errdefs.ErrNotImplemented) } diff --git a/pkg/cri/server/sandbox_status.go b/pkg/cri/server/sandbox_status.go index e21e96e3fd351..609b559a88202 100644 --- a/pkg/cri/server/sandbox_status.go +++ b/pkg/cri/server/sandbox_status.go @@ -18,13 +18,13 @@ package server import ( "encoding/json" + "fmt" goruntime "runtime" "github.com/containerd/containerd" "github.com/containerd/containerd/errdefs" cni "github.com/containerd/go-cni" runtimespec "github.com/opencontainers/runtime-spec/specs-go" - "github.com/pkg/errors" "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" @@ -35,19 +35,19 @@ import ( func (c *criService) PodSandboxStatus(ctx context.Context, r *runtime.PodSandboxStatusRequest) (*runtime.PodSandboxStatusResponse, error) { sandbox, err := c.sandboxStore.Get(r.GetPodSandboxId()) if err != nil { - return nil, errors.Wrap(err, "an error occurred when try to find sandbox") + return nil, fmt.Errorf("an error occurred when try to find sandbox: %w", err) } ip, additionalIPs, err := c.getIPs(sandbox) if err != nil { - return nil, errors.Wrap(err, "failed to get sandbox ip") + return nil, fmt.Errorf("failed to get sandbox ip: %w", err) } status := toCRISandboxStatus(sandbox.Metadata, sandbox.Status.Get(), ip, additionalIPs) if status.GetCreatedAt() == 0 { // CRI doesn't allow CreatedAt == 0. info, err := sandbox.Container.Info(ctx) if err != nil { - return nil, errors.Wrapf(err, "failed to get CreatedAt for sandbox container in %q state", status.State) + return nil, fmt.Errorf("failed to get CreatedAt for sandbox container in %q state: %w", status.State, err) } status.CreatedAt = info.CreatedAt.UnixNano() } @@ -58,7 +58,7 @@ func (c *criService) PodSandboxStatus(ctx context.Context, r *runtime.PodSandbox // Generate verbose information. info, err := toCRISandboxInfo(ctx, sandbox) if err != nil { - return nil, errors.Wrap(err, "failed to get verbose sandbox container info") + return nil, fmt.Errorf("failed to get verbose sandbox container info: %w", err) } return &runtime.PodSandboxStatusResponse{ @@ -81,7 +81,7 @@ func (c *criService) getIPs(sandbox sandboxstore.Sandbox) (string, []string, err } if closed, err := sandbox.NetNS.Closed(); err != nil { - return "", nil, errors.Wrap(err, "check network namespace closed") + return "", nil, fmt.Errorf("check network namespace closed: %w", err) } else if closed { return "", nil, nil } @@ -150,14 +150,14 @@ func toCRISandboxInfo(ctx context.Context, sandbox sandboxstore.Sandbox) (map[st container := sandbox.Container task, err := container.Task(ctx, nil) if err != nil && !errdefs.IsNotFound(err) { - return nil, errors.Wrap(err, "failed to get sandbox container task") + return nil, fmt.Errorf("failed to get sandbox container task: %w", err) } var processStatus containerd.ProcessStatus if task != nil { taskStatus, err := task.Status(ctx) if err != nil { - return nil, errors.Wrap(err, "failed to get task status") + return nil, fmt.Errorf("failed to get task status: %w", err) } processStatus = taskStatus.Status @@ -181,20 +181,20 @@ func toCRISandboxInfo(ctx context.Context, sandbox sandboxstore.Sandbox) (map[st // Add network closed information if sandbox is not using host network. closed, err := sandbox.NetNS.Closed() if err != nil { - return nil, errors.Wrap(err, "failed to check network namespace closed") + return nil, fmt.Errorf("failed to check network namespace closed: %w", err) } si.NetNSClosed = closed } spec, err := container.Spec(ctx) if err != nil { - return nil, errors.Wrap(err, "failed to get sandbox container runtime spec") + return nil, fmt.Errorf("failed to get sandbox container runtime spec: %w", err) } si.RuntimeSpec = spec ctrInfo, err := container.Info(ctx) if err != nil { - return nil, errors.Wrap(err, "failed to get sandbox container info") + return nil, fmt.Errorf("failed to get sandbox container info: %w", err) } // Do not use config.SandboxImage because the configuration might // be changed during restart. It may not reflect the actual image @@ -205,14 +205,14 @@ func toCRISandboxInfo(ctx context.Context, sandbox sandboxstore.Sandbox) (map[st runtimeOptions, err := getRuntimeOptions(ctrInfo) if err != nil { - return nil, errors.Wrap(err, "failed to get runtime options") + return nil, fmt.Errorf("failed to get runtime options: %w", err) } si.RuntimeType = ctrInfo.Runtime.Name si.RuntimeOptions = runtimeOptions infoBytes, err := json.Marshal(si) if err != nil { - return nil, errors.Wrapf(err, "failed to marshal info %v", si) + return nil, fmt.Errorf("failed to marshal info %v: %w", si, err) } return map[string]string{ "info": string(infoBytes), diff --git a/pkg/cri/server/sandbox_stop.go b/pkg/cri/server/sandbox_stop.go index c64398e97a146..a3231631070dc 100644 --- a/pkg/cri/server/sandbox_stop.go +++ b/pkg/cri/server/sandbox_stop.go @@ -17,13 +17,14 @@ package server import ( + "errors" + "fmt" "syscall" "time" eventtypes "github.com/containerd/containerd/api/events" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/log" - "github.com/pkg/errors" "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" @@ -36,8 +37,8 @@ import ( func (c *criService) StopPodSandbox(ctx context.Context, r *runtime.StopPodSandboxRequest) (*runtime.StopPodSandboxResponse, error) { sandbox, err := c.sandboxStore.Get(r.GetPodSandboxId()) if err != nil { - return nil, errors.Wrapf(err, "an error occurred when try to find sandbox %q", - r.GetPodSandboxId()) + return nil, fmt.Errorf("an error occurred when try to find sandbox %q: %w", + r.GetPodSandboxId(), err) } if err := c.stopPodSandbox(ctx, sandbox); err != nil { @@ -63,19 +64,19 @@ func (c *criService) stopPodSandbox(ctx context.Context, sandbox sandboxstore.Sa // Forcibly stop the container. Do not use `StopContainer`, because it introduces a race // if a container is removed after list. if err := c.stopContainer(ctx, container, 0); err != nil { - return errors.Wrapf(err, "failed to stop container %q", container.ID) + return fmt.Errorf("failed to stop container %q: %w", container.ID, err) } } if err := c.cleanupSandboxFiles(id, sandbox.Config); err != nil { - return errors.Wrap(err, "failed to cleanup sandbox files") + return fmt.Errorf("failed to cleanup sandbox files: %w", err) } // Only stop sandbox container when it's running or unknown. state := sandbox.Status.Get().State if state == sandboxstore.StateReady || state == sandboxstore.StateUnknown { if err := c.stopSandboxContainer(ctx, sandbox); err != nil { - return errors.Wrapf(err, "failed to stop sandbox container %q in %q state", id, state) + return fmt.Errorf("failed to stop sandbox container %q in %q state: %w", id, state, err) } } sandboxRuntimeStopTimer.WithValues(sandbox.RuntimeHandler).UpdateSince(stop) @@ -86,15 +87,15 @@ func (c *criService) stopPodSandbox(ctx context.Context, sandbox sandboxstore.Sa // Use empty netns path if netns is not available. This is defined in: // https://github.com/containernetworking/cni/blob/v0.7.0-alpha1/SPEC.md if closed, err := sandbox.NetNS.Closed(); err != nil { - return errors.Wrap(err, "failed to check network namespace closed") + return fmt.Errorf("failed to check network namespace closed: %w", err) } else if closed { sandbox.NetNSPath = "" } if err := c.teardownPodNetwork(ctx, sandbox); err != nil { - return errors.Wrapf(err, "failed to destroy network for sandbox %q", id) + return fmt.Errorf("failed to destroy network for sandbox %q: %w", id, err) } if err := sandbox.NetNS.Remove(); err != nil { - return errors.Wrapf(err, "failed to remove network namespace for sandbox %q", id) + return fmt.Errorf("failed to remove network namespace for sandbox %q: %w", id, err) } sandboxDeleteNetwork.UpdateSince(netStop) } @@ -114,7 +115,7 @@ func (c *criService) stopSandboxContainer(ctx context.Context, sandbox sandboxst task, err := container.Task(ctx, nil) if err != nil { if !errdefs.IsNotFound(err) { - return errors.Wrap(err, "failed to get sandbox container") + return fmt.Errorf("failed to get sandbox container: %w", err) } // Don't return for unknown state, some cleanup needs to be done. if state == sandboxstore.StateUnknown { @@ -132,7 +133,7 @@ func (c *criService) stopSandboxContainer(ctx context.Context, sandbox sandboxst exitCh, err := task.Wait(waitCtx) if err != nil { if !errdefs.IsNotFound(err) { - return errors.Wrap(err, "failed to wait for task") + return fmt.Errorf("failed to wait for task: %w", err) } return cleanupUnknownSandbox(ctx, id, sandbox) } @@ -150,7 +151,7 @@ func (c *criService) stopSandboxContainer(ctx context.Context, sandbox sandboxst // Kill the sandbox container. if err = task.Kill(ctx, syscall.SIGKILL); err != nil && !errdefs.IsNotFound(err) { - return errors.Wrap(err, "failed to kill sandbox container") + return fmt.Errorf("failed to kill sandbox container: %w", err) } return c.waitSandboxStop(ctx, sandbox) @@ -161,7 +162,7 @@ func (c *criService) stopSandboxContainer(ctx context.Context, sandbox sandboxst func (c *criService) waitSandboxStop(ctx context.Context, sandbox sandboxstore.Sandbox) error { select { case <-ctx.Done(): - return errors.Wrapf(ctx.Err(), "wait sandbox container %q", sandbox.ID) + return fmt.Errorf("wait sandbox container %q: %w", sandbox.ID, ctx.Err()) case <-sandbox.Stopped(): return nil } @@ -181,7 +182,7 @@ func (c *criService) teardownPodNetwork(ctx context.Context, sandbox sandboxstor ) opts, err := cniNamespaceOpts(id, config) if err != nil { - return errors.Wrap(err, "get cni namespace options") + return fmt.Errorf("get cni namespace options: %w", err) } return netPlugin.Remove(ctx, id, path, opts...) diff --git a/pkg/cri/server/service.go b/pkg/cri/server/service.go index 9de20c11e707b..b15164fea6d13 100644 --- a/pkg/cri/server/service.go +++ b/pkg/cri/server/service.go @@ -31,7 +31,6 @@ import ( "github.com/containerd/containerd/pkg/cri/streaming" "github.com/containerd/containerd/plugin" cni "github.com/containerd/go-cni" - "github.com/pkg/errors" "github.com/sirupsen/logrus" "google.golang.org/grpc" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" @@ -135,20 +134,20 @@ func NewCRIService(config criconfig.Config, client *containerd.Client) (CRIServi } if client.SnapshotService(c.config.ContainerdConfig.Snapshotter) == nil { - return nil, errors.Errorf("failed to find snapshotter %q", c.config.ContainerdConfig.Snapshotter) + return nil, fmt.Errorf("failed to find snapshotter %q", c.config.ContainerdConfig.Snapshotter) } c.imageFSPath = imageFSPath(config.ContainerdRootDir, config.ContainerdConfig.Snapshotter) logrus.Infof("Get image filesystem path %q", c.imageFSPath) if err := c.initPlatform(); err != nil { - return nil, errors.Wrap(err, "initialize platform") + return nil, fmt.Errorf("initialize platform: %w", err) } // prepare streaming server c.streamServer, err = newStreamServer(c, config.StreamServerAddress, config.StreamServerPort, config.StreamIdleTimeout) if err != nil { - return nil, errors.Wrap(err, "failed to create stream server") + return nil, fmt.Errorf("failed to create stream server: %w", err) } c.eventMonitor = newEventMonitor(c) @@ -164,7 +163,7 @@ func NewCRIService(config criconfig.Config, client *containerd.Client) (CRIServi if path != "" { m, err := newCNINetConfSyncer(path, i, c.cniLoadOptions()) if err != nil { - return nil, errors.Wrapf(err, "failed to create cni conf monitor for %s", name) + return nil, fmt.Errorf("failed to create cni conf monitor for %s: %w", name, err) } c.cniNetConfMonitor[name] = m } @@ -201,7 +200,7 @@ func (c *criService) Run() error { logrus.Infof("Start recovering state") if err := c.recover(ctrdutil.NamespacedContext()); err != nil { - return errors.Wrap(err, "failed to recover state") + return fmt.Errorf("failed to recover state: %w", err) } // Start event handler. @@ -255,7 +254,7 @@ func (c *criService) Run() error { case cniNetConfMonitorErr = <-cniNetConfMonitorErrCh: } if err := c.Close(); err != nil { - return errors.Wrap(err, "failed to stop cri service") + return fmt.Errorf("failed to stop cri service: %w", err) } // If the error is set above, err from channel must be nil here, because // the channel is supposed to be closed. Or else, we wait and set it. @@ -282,13 +281,13 @@ func (c *criService) Run() error { logrus.Errorf("Stream server is not stopped in %q", streamServerStopTimeout) } if eventMonitorErr != nil { - return errors.Wrap(eventMonitorErr, "event monitor error") + return fmt.Errorf("event monitor error: %w", eventMonitorErr) } if streamServerErr != nil { - return errors.Wrap(streamServerErr, "stream server error") + return fmt.Errorf("stream server error: %w", streamServerErr) } if cniNetConfMonitorErr != nil { - return errors.Wrap(cniNetConfMonitorErr, "cni network conf monitor error") + return fmt.Errorf("cni network conf monitor error: %w", cniNetConfMonitorErr) } return nil } @@ -304,7 +303,7 @@ func (c *criService) Close() error { } c.eventMonitor.stop() if err := c.streamServer.Stop(); err != nil { - return errors.Wrap(err, "failed to stop stream server") + return fmt.Errorf("failed to stop stream server: %w", err) } return nil } @@ -328,13 +327,13 @@ func imageFSPath(rootDir, snapshotter string) string { func loadOCISpec(filename string) (*oci.Spec, error) { file, err := os.Open(filename) if err != nil { - return nil, errors.Wrapf(err, "failed to open base OCI spec: %s", filename) + return nil, fmt.Errorf("failed to open base OCI spec: %s: %w", filename, err) } defer file.Close() spec := oci.Spec{} if err := json.NewDecoder(file).Decode(&spec); err != nil { - return nil, errors.Wrap(err, "failed to parse base OCI spec file") + return nil, fmt.Errorf("failed to parse base OCI spec file: %w", err) } return &spec, nil @@ -354,7 +353,7 @@ func loadBaseOCISpecs(config *criconfig.Config) (map[string]*oci.Spec, error) { spec, err := loadOCISpec(cfg.BaseRuntimeSpec) if err != nil { - return nil, errors.Wrapf(err, "failed to load base OCI spec from file: %s", cfg.BaseRuntimeSpec) + return nil, fmt.Errorf("failed to load base OCI spec from file: %s: %w", cfg.BaseRuntimeSpec, err) } specs[cfg.BaseRuntimeSpec] = spec diff --git a/pkg/cri/server/service_linux.go b/pkg/cri/server/service_linux.go index c41aa2c068007..020e373977bf8 100644 --- a/pkg/cri/server/service_linux.go +++ b/pkg/cri/server/service_linux.go @@ -17,11 +17,12 @@ package server import ( + "fmt" + "github.com/containerd/containerd/pkg/cap" "github.com/containerd/containerd/pkg/userns" cni "github.com/containerd/go-cni" "github.com/opencontainers/selinux/go-selinux" - "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -74,7 +75,7 @@ func (c *criService) initPlatform() (err error) { cni.WithPluginMaxConfNum(max), cni.WithPluginDir([]string{c.config.NetworkPluginBinDir})) if err != nil { - return errors.Wrap(err, "failed to initialize cni") + return fmt.Errorf("failed to initialize cni: %w", err) } c.netPlugin[name] = i } @@ -82,7 +83,7 @@ func (c *criService) initPlatform() (err error) { if c.allCaps == nil { c.allCaps, err = cap.Current() if err != nil { - return errors.Wrap(err, "failed to get caps") + return fmt.Errorf("failed to get caps: %w", err) } } diff --git a/pkg/cri/server/service_windows.go b/pkg/cri/server/service_windows.go index f335297e747c7..2d660c16f0dfd 100644 --- a/pkg/cri/server/service_windows.go +++ b/pkg/cri/server/service_windows.go @@ -17,8 +17,9 @@ package server import ( + "fmt" + cni "github.com/containerd/go-cni" - "github.com/pkg/errors" ) // windowsNetworkAttachCount is the minimum number of networks the PodSandbox @@ -54,7 +55,7 @@ func (c *criService) initPlatform() error { cni.WithPluginMaxConfNum(max), cni.WithPluginDir([]string{c.config.NetworkPluginBinDir})) if err != nil { - return errors.Wrap(err, "failed to initialize cni") + return fmt.Errorf("failed to initialize cni: %w", err) } c.netPlugin[name] = i } diff --git a/pkg/cri/server/snapshots.go b/pkg/cri/server/snapshots.go index 10dd41b03e2dd..ed672752ff884 100644 --- a/pkg/cri/server/snapshots.go +++ b/pkg/cri/server/snapshots.go @@ -18,11 +18,11 @@ package server import ( "context" + "fmt" "time" "github.com/containerd/containerd/errdefs" snapshot "github.com/containerd/containerd/snapshots" - "github.com/pkg/errors" "github.com/sirupsen/logrus" snapshotstore "github.com/containerd/containerd/pkg/cri/store/snapshot" @@ -80,7 +80,7 @@ func (s *snapshotsSyncer) sync() error { snapshots = append(snapshots, info) return nil }); err != nil { - return errors.Wrap(err, "walk all snapshots failed") + return fmt.Errorf("walk all snapshots failed: %w", err) } for _, info := range snapshots { sn, err := s.store.Get(info.Name) diff --git a/pkg/cri/server/streaming.go b/pkg/cri/server/streaming.go index d195d8d994fc0..6c9cd4b3e7e36 100644 --- a/pkg/cri/server/streaming.go +++ b/pkg/cri/server/streaming.go @@ -19,13 +19,14 @@ package server import ( "context" "crypto/tls" + "errors" + "fmt" "io" "math" "net" "os" "time" - "github.com/pkg/errors" k8snet "k8s.io/apimachinery/pkg/util/net" "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/tools/remotecommand" @@ -70,7 +71,7 @@ func newStreamServer(c *criService, addr, port, streamIdleTimeout string) (strea if addr == "" { a, err := k8snet.ResolveBindAddress(nil) if err != nil { - return nil, errors.Wrap(err, "failed to get stream server address") + return nil, fmt.Errorf("failed to get stream server address: %w", err) } addr = a.String() } @@ -79,20 +80,20 @@ func newStreamServer(c *criService, addr, port, streamIdleTimeout string) (strea var err error config.StreamIdleTimeout, err = time.ParseDuration(streamIdleTimeout) if err != nil { - return nil, errors.Wrap(err, "invalid stream idle timeout") + return nil, fmt.Errorf("invalid stream idle timeout: %w", err) } } config.Addr = net.JoinHostPort(addr, port) run := newStreamRuntime(c) tlsMode, err := getStreamListenerMode(c) if err != nil { - return nil, errors.Wrapf(err, "invalid stream server configuration") + return nil, fmt.Errorf("invalid stream server configuration: %w", err) } switch tlsMode { case x509KeyPairTLS: tlsCert, err := tls.LoadX509KeyPair(c.config.X509KeyPairStreaming.TLSCertFile, c.config.X509KeyPairStreaming.TLSKeyFile) if err != nil { - return nil, errors.Wrap(err, "failed to load x509 key pair for stream server") + return nil, fmt.Errorf("failed to load x509 key pair for stream server: %w", err) } config.TLSConfig = &tls.Config{ Certificates: []tls.Certificate{tlsCert}, @@ -101,7 +102,7 @@ func newStreamServer(c *criService, addr, port, streamIdleTimeout string) (strea case selfSignTLS: tlsCert, err := newTLSCert() if err != nil { - return nil, errors.Wrap(err, "failed to generate tls certificate for stream server") + return nil, fmt.Errorf("failed to generate tls certificate for stream server: %w", err) } config.TLSConfig = &tls.Config{ Certificates: []tls.Certificate{tlsCert}, @@ -136,13 +137,13 @@ func (s *streamRuntime) Exec(containerID string, cmd []string, stdin io.Reader, resize: resize, }) if err != nil { - return errors.Wrap(err, "failed to exec in container") + return fmt.Errorf("failed to exec in container: %w", err) } if *exitCode == 0 { return nil } return &exec.CodeExitError{ - Err: errors.Errorf("error executing command %v, exit code %d", cmd, *exitCode), + Err: fmt.Errorf("error executing command %v, exit code %d", cmd, *exitCode), Code: int(*exitCode), } } @@ -154,7 +155,7 @@ func (s *streamRuntime) Attach(containerID string, in io.Reader, out, err io.Wri func (s *streamRuntime) PortForward(podSandboxID string, port int32, stream io.ReadWriteCloser) error { if port <= 0 || port > math.MaxUint16 { - return errors.Errorf("invalid port %d", port) + return fmt.Errorf("invalid port %d", port) } ctx := ctrdutil.NamespacedContext() return s.c.portForward(ctx, podSandboxID, port, stream) @@ -197,12 +198,12 @@ func newTLSCert() (tls.Certificate, error) { hostName, err := os.Hostname() if err != nil { - return fail(errors.Wrap(err, "failed to get hostname")) + return fail(fmt.Errorf("failed to get hostname: %w", err)) } addrs, err := net.InterfaceAddrs() if err != nil { - return fail(errors.Wrap(err, "failed to get host IP addresses")) + return fail(fmt.Errorf("failed to get host IP addresses: %w", err)) } var alternateIPs []net.IP @@ -226,13 +227,13 @@ func newTLSCert() (tls.Certificate, error) { // Generate a self signed certificate key (CA is self) certPem, keyPem, err := k8scert.GenerateSelfSignedCertKey(hostName, alternateIPs, alternateDNS) if err != nil { - return fail(errors.Wrap(err, "certificate key could not be created")) + return fail(fmt.Errorf("certificate key could not be created: %w", err)) } // Load the tls certificate tlsCert, err := tls.X509KeyPair(certPem, keyPem) if err != nil { - return fail(errors.Wrap(err, "certificate could not be loaded")) + return fail(fmt.Errorf("certificate could not be loaded: %w", err)) } return tlsCert, nil diff --git a/pkg/cri/server/testing/fake_cni_plugin.go b/pkg/cri/server/testing/fake_cni_plugin.go index 15dd4961405e7..d27d753782570 100644 --- a/pkg/cri/server/testing/fake_cni_plugin.go +++ b/pkg/cri/server/testing/fake_cni_plugin.go @@ -43,6 +43,11 @@ func (f *FakeCNIPlugin) Remove(ctx context.Context, id, path string, opts ...cni return nil } +// Check the network of PodSandbox. +func (f *FakeCNIPlugin) Check(ctx context.Context, id, path string, opts ...cni.NamespaceOpts) error { + return nil +} + // Status get the status of the plugin. func (f *FakeCNIPlugin) Status() error { return f.StatusErr diff --git a/pkg/cri/server/update_runtime_config.go b/pkg/cri/server/update_runtime_config.go index ae4d1114ea195..3cf0b5529b678 100644 --- a/pkg/cri/server/update_runtime_config.go +++ b/pkg/cri/server/update_runtime_config.go @@ -17,6 +17,7 @@ package server import ( + "fmt" "net" "os" "path/filepath" @@ -24,7 +25,6 @@ import ( "text/template" "github.com/containerd/containerd/log" - "github.com/pkg/errors" "golang.org/x/net/context" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) @@ -61,7 +61,7 @@ func (c *criService) UpdateRuntimeConfig(ctx context.Context, r *runtime.UpdateR } routes, err := getRoutes(cidrs) if err != nil { - return nil, errors.Wrap(err, "get routes") + return nil, fmt.Errorf("get routes: %w", err) } confTemplate := c.config.NetworkPluginConfTemplate @@ -85,15 +85,15 @@ func (c *criService) UpdateRuntimeConfig(ctx context.Context, r *runtime.UpdateR // generate cni config file from the template with updated pod cidr. t, err := template.ParseFiles(confTemplate) if err != nil { - return nil, errors.Wrapf(err, "failed to parse cni config template %q", confTemplate) + return nil, fmt.Errorf("failed to parse cni config template %q: %w", confTemplate, err) } if err := os.MkdirAll(c.config.NetworkPluginConfDir, 0755); err != nil { - return nil, errors.Wrapf(err, "failed to create cni config directory: %q", c.config.NetworkPluginConfDir) + return nil, fmt.Errorf("failed to create cni config directory: %q: %w", c.config.NetworkPluginConfDir, err) } confFile := filepath.Join(c.config.NetworkPluginConfDir, cniConfigFileName) f, err := os.OpenFile(confFile, os.O_WRONLY|os.O_CREATE, 0644) if err != nil { - return nil, errors.Wrapf(err, "failed to open cni config file %q", confFile) + return nil, fmt.Errorf("failed to open cni config file %q: %w", confFile, err) } defer f.Close() if err := t.Execute(f, cniConfigTemplate{ @@ -101,7 +101,7 @@ func (c *criService) UpdateRuntimeConfig(ctx context.Context, r *runtime.UpdateR PodCIDRRanges: cidrs, Routes: routes, }); err != nil { - return nil, errors.Wrapf(err, "failed to generate cni config file %q", confFile) + return nil, fmt.Errorf("failed to generate cni config file %q: %w", confFile, err) } return &runtime.UpdateRuntimeConfigResponse{}, nil } diff --git a/pkg/cri/server/update_runtime_config_test.go b/pkg/cri/server/update_runtime_config_test.go index 267946ba3a4ed..852926685133c 100644 --- a/pkg/cri/server/update_runtime_config_test.go +++ b/pkg/cri/server/update_runtime_config_test.go @@ -17,11 +17,11 @@ package server import ( + "errors" "os" "path/filepath" "testing" - "github.com/pkg/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "golang.org/x/net/context" diff --git a/pkg/cri/store/container/metadata.go b/pkg/cri/store/container/metadata.go index 629f7162352b9..f21914a2080e3 100644 --- a/pkg/cri/store/container/metadata.go +++ b/pkg/cri/store/container/metadata.go @@ -18,8 +18,8 @@ package container import ( "encoding/json" + "fmt" - "github.com/pkg/errors" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) @@ -85,5 +85,5 @@ func (c *Metadata) UnmarshalJSON(data []byte) error { *c = Metadata(versioned.Metadata) return nil } - return errors.Errorf("unsupported version: %q", versioned.Version) + return fmt.Errorf("unsupported version: %q", versioned.Version) } diff --git a/pkg/cri/store/container/status.go b/pkg/cri/store/container/status.go index ed9d574f4e494..d810963df70a8 100644 --- a/pkg/cri/store/container/status.go +++ b/pkg/cri/store/container/status.go @@ -18,12 +18,13 @@ package container import ( "encoding/json" + "errors" + "fmt" "os" "path/filepath" "sync" "github.com/containerd/continuity" - "github.com/pkg/errors" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) @@ -165,11 +166,11 @@ type StatusStorage interface { func StoreStatus(root, id string, status Status) (StatusStorage, error) { data, err := status.encode() if err != nil { - return nil, errors.Wrap(err, "failed to encode status") + return nil, fmt.Errorf("failed to encode status: %w", err) } path := filepath.Join(root, "status") if err := continuity.AtomicWriteFile(path, data, 0600); err != nil { - return nil, errors.Wrapf(err, "failed to checkpoint status to %q", path) + return nil, fmt.Errorf("failed to checkpoint status to %q: %w", path, err) } return &statusStorage{ path: path, @@ -183,11 +184,11 @@ func LoadStatus(root, id string) (Status, error) { path := filepath.Join(root, "status") data, err := os.ReadFile(path) if err != nil { - return Status{}, errors.Wrapf(err, "failed to read status from %q", path) + return Status{}, fmt.Errorf("failed to read status from %q: %w", path, err) } var status Status if err := status.decode(data); err != nil { - return Status{}, errors.Wrapf(err, "failed to decode status %q", data) + return Status{}, fmt.Errorf("failed to decode status %q: %w", data, err) } return status, nil } @@ -215,10 +216,10 @@ func (s *statusStorage) UpdateSync(u UpdateFunc) error { } data, err := newStatus.encode() if err != nil { - return errors.Wrap(err, "failed to encode status") + return fmt.Errorf("failed to encode status: %w", err) } if err := continuity.AtomicWriteFile(s.path, data, 0600); err != nil { - return errors.Wrapf(err, "failed to checkpoint status to %q", s.path) + return fmt.Errorf("failed to checkpoint status to %q: %w", s.path, err) } s.status = newStatus return nil diff --git a/pkg/cri/store/image/fake_image.go b/pkg/cri/store/image/fake_image.go index e1d6b7cd46f20..4b4636004cc7e 100644 --- a/pkg/cri/store/image/fake_image.go +++ b/pkg/cri/store/image/fake_image.go @@ -16,7 +16,7 @@ package image -import "github.com/pkg/errors" +import "fmt" // NewFakeStore returns an image store with predefined images. // Update is not allowed for this fake store. @@ -27,7 +27,7 @@ func NewFakeStore(images []Image) (*Store, error) { s.refCache[ref] = i.ID } if err := s.store.add(i); err != nil { - return nil, errors.Wrapf(err, "add image %+v", i) + return nil, fmt.Errorf("add image %+v: %w", i, err) } } return s, nil diff --git a/pkg/cri/store/image/image.go b/pkg/cri/store/image/image.go index 7dcd0706d26b2..f9c057086e965 100644 --- a/pkg/cri/store/image/image.go +++ b/pkg/cri/store/image/image.go @@ -19,6 +19,7 @@ package image import ( "context" "encoding/json" + "fmt" "sync" "github.com/containerd/containerd" @@ -30,7 +31,6 @@ import ( "github.com/opencontainers/go-digest/digestset" imageidentity "github.com/opencontainers/image-spec/identity" imagespec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" ) // Image contains all resources associated with the image. All fields @@ -77,13 +77,13 @@ func (s *Store) Update(ctx context.Context, ref string) error { defer s.lock.Unlock() i, err := s.client.GetImage(ctx, ref) if err != nil && !errdefs.IsNotFound(err) { - return errors.Wrap(err, "get image from containerd") + return fmt.Errorf("get image from containerd: %w", err) } var img *Image if err == nil { img, err = getImage(ctx, i) if err != nil { - return errors.Wrap(err, "get image info from containerd") + return fmt.Errorf("get image info from containerd: %w", err) } } return s.update(ref, img) @@ -119,28 +119,28 @@ func getImage(ctx context.Context, i containerd.Image) (*Image, error) { // Get image information. diffIDs, err := i.RootFS(ctx) if err != nil { - return nil, errors.Wrap(err, "get image diffIDs") + return nil, fmt.Errorf("get image diffIDs: %w", err) } chainID := imageidentity.ChainID(diffIDs) size, err := i.Size(ctx) if err != nil { - return nil, errors.Wrap(err, "get image compressed resource size") + return nil, fmt.Errorf("get image compressed resource size: %w", err) } desc, err := i.Config(ctx) if err != nil { - return nil, errors.Wrap(err, "get image config descriptor") + return nil, fmt.Errorf("get image config descriptor: %w", err) } id := desc.Digest.String() rb, err := content.ReadBlob(ctx, i.ContentStore(), desc) if err != nil { - return nil, errors.Wrap(err, "read image config from content store") + return nil, fmt.Errorf("read image config from content store: %w", err) } var ociimage imagespec.Image if err := json.Unmarshal(rb, &ociimage); err != nil { - return nil, errors.Wrapf(err, "unmarshal image config %s", rb) + return nil, fmt.Errorf("unmarshal image config %s: %w", rb, err) } return &Image{ diff --git a/pkg/cri/store/sandbox/metadata.go b/pkg/cri/store/sandbox/metadata.go index 1df4e3deed0a6..80e39c68c2a32 100644 --- a/pkg/cri/store/sandbox/metadata.go +++ b/pkg/cri/store/sandbox/metadata.go @@ -18,9 +18,9 @@ package sandbox import ( "encoding/json" + "fmt" cni "github.com/containerd/go-cni" - "github.com/pkg/errors" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) @@ -85,5 +85,5 @@ func (c *Metadata) UnmarshalJSON(data []byte) error { *c = Metadata(versioned.Metadata) return nil } - return errors.Errorf("unsupported version: %q", versioned.Version) + return fmt.Errorf("unsupported version: %q", versioned.Version) } diff --git a/pkg/cri/util/deep_copy.go b/pkg/cri/util/deep_copy.go index d0e0bf37efacc..cf027eaf8c04c 100644 --- a/pkg/cri/util/deep_copy.go +++ b/pkg/cri/util/deep_copy.go @@ -18,8 +18,8 @@ package util import ( "encoding/json" - - "github.com/pkg/errors" + "errors" + "fmt" ) // DeepCopy makes a deep copy from src into dst. @@ -32,11 +32,11 @@ func DeepCopy(dst interface{}, src interface{}) error { } bytes, err := json.Marshal(src) if err != nil { - return errors.Wrap(err, "unable to marshal src") + return fmt.Errorf("unable to marshal src: %w", err) } err = json.Unmarshal(bytes, dst) if err != nil { - return errors.Wrap(err, "unable to unmarshal into dst") + return fmt.Errorf("unable to unmarshal into dst: %w", err) } return nil } diff --git a/pkg/dialer/dialer.go b/pkg/dialer/dialer.go index aa604baab9217..74c303b944f94 100644 --- a/pkg/dialer/dialer.go +++ b/pkg/dialer/dialer.go @@ -18,10 +18,9 @@ package dialer import ( "context" + "fmt" "net" "time" - - "github.com/pkg/errors" ) type dialResult struct { @@ -74,6 +73,6 @@ func timeoutDialer(address string, timeout time.Duration) (net.Conn, error) { dr.c.Close() } }() - return nil, errors.Errorf("dial %s: timeout", address) + return nil, fmt.Errorf("dial %s: timeout", address) } } diff --git a/pkg/netns/netns_linux.go b/pkg/netns/netns_linux.go index d58f8ab9216cf..71e9a3b632242 100644 --- a/pkg/netns/netns_linux.go +++ b/pkg/netns/netns_linux.go @@ -42,7 +42,6 @@ import ( "github.com/containerd/containerd/mount" cnins "github.com/containernetworking/plugins/pkg/ns" "github.com/moby/sys/symlink" - "github.com/pkg/errors" "golang.org/x/sys/unix" ) @@ -54,7 +53,7 @@ import ( func newNS(baseDir string) (nsPath string, err error) { b := make([]byte, 16) if _, err := rand.Reader.Read(b); err != nil { - return "", errors.Wrap(err, "failed to generate random netns name") + return "", fmt.Errorf("failed to generate random netns name: %w", err) } // Create the directory for mounting network namespaces @@ -113,13 +112,13 @@ func newNS(baseDir string) (nsPath string, err error) { // are no threads in the ns. err = unix.Mount(getCurrentThreadNetNSPath(), nsPath, "none", unix.MS_BIND, "") if err != nil { - err = errors.Wrapf(err, "failed to bind mount ns at %s", nsPath) + err = fmt.Errorf("failed to bind mount ns at %s: %w", nsPath, err) } })() wg.Wait() if err != nil { - return "", errors.Wrap(err, "failed to create namespace") + return "", fmt.Errorf("failed to create namespace: %w", err) } return nsPath, nil @@ -131,17 +130,17 @@ func unmountNS(path string) error { if os.IsNotExist(err) { return nil } - return errors.Wrap(err, "failed to stat netns") + return fmt.Errorf("failed to stat netns: %w", err) } path, err := symlink.FollowSymlinkInScope(path, "/") if err != nil { - return errors.Wrap(err, "failed to follow symlink") + return fmt.Errorf("failed to follow symlink: %w", err) } if err := mount.Unmount(path, unix.MNT_DETACH); err != nil && !os.IsNotExist(err) { - return errors.Wrap(err, "failed to umount netns") + return fmt.Errorf("failed to umount netns: %w", err) } if err := os.RemoveAll(path); err != nil { - return errors.Wrap(err, "failed to remove netns") + return fmt.Errorf("failed to remove netns: %w", err) } return nil } @@ -163,7 +162,7 @@ type NetNS struct { func NewNetNS(baseDir string) (*NetNS, error) { path, err := newNS(baseDir) if err != nil { - return nil, errors.Wrap(err, "failed to setup netns") + return nil, fmt.Errorf("failed to setup netns: %w", err) } return &NetNS{path: path}, nil } @@ -190,14 +189,14 @@ func (n *NetNS) Closed() (bool, error) { if _, ok := err.(cnins.NSPathNotNSErr); ok { // The network namespace is not mounted, remove it. if err := os.RemoveAll(n.path); err != nil { - return false, errors.Wrap(err, "remove netns") + return false, fmt.Errorf("remove netns: %w", err) } return true, nil } - return false, errors.Wrap(err, "get netns fd") + return false, fmt.Errorf("get netns fd: %w", err) } if err := ns.Close(); err != nil { - return false, errors.Wrap(err, "close netns fd") + return false, fmt.Errorf("close netns fd: %w", err) } return false, nil } @@ -211,7 +210,7 @@ func (n *NetNS) GetPath() string { func (n *NetNS) Do(f func(cnins.NetNS) error) error { ns, err := cnins.GetNS(n.path) if err != nil { - return errors.Wrap(err, "get netns fd") + return fmt.Errorf("get netns fd: %w", err) } defer ns.Close() // nolint: errcheck return ns.Do(f) diff --git a/pkg/netns/netns_other.go b/pkg/netns/netns_other.go index 01bad803cf04b..ec8124ceb8ab1 100644 --- a/pkg/netns/netns_other.go +++ b/pkg/netns/netns_other.go @@ -20,7 +20,7 @@ package netns import ( - "github.com/pkg/errors" + "errors" ) var errNotImplementedOnUnix = errors.New("not implemented on unix") diff --git a/pkg/oom/v1/v1.go b/pkg/oom/v1/v1.go index f133efb87f5e0..1e8e670e1cd79 100644 --- a/pkg/oom/v1/v1.go +++ b/pkg/oom/v1/v1.go @@ -21,6 +21,7 @@ package v1 import ( "context" + "fmt" "sync" "github.com/containerd/cgroups" @@ -28,7 +29,6 @@ import ( "github.com/containerd/containerd/pkg/oom" "github.com/containerd/containerd/runtime" "github.com/containerd/containerd/runtime/v2/shim" - "github.com/pkg/errors" "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) @@ -93,7 +93,7 @@ func (e *epoller) Run(ctx context.Context) { func (e *epoller) Add(id string, cgx interface{}) error { cg, ok := cgx.(cgroups.Cgroup) if !ok { - return errors.Errorf("expected cgroups.Cgroup, got: %T", cgx) + return fmt.Errorf("expected cgroups.Cgroup, got: %T", cgx) } e.mu.Lock() defer e.mu.Unlock() diff --git a/pkg/oom/v2/v2.go b/pkg/oom/v2/v2.go index 479300f21f630..49ad3092dd85f 100644 --- a/pkg/oom/v2/v2.go +++ b/pkg/oom/v2/v2.go @@ -21,13 +21,13 @@ package v2 import ( "context" + "fmt" cgroupsv2 "github.com/containerd/cgroups/v2" eventstypes "github.com/containerd/containerd/api/events" "github.com/containerd/containerd/pkg/oom" "github.com/containerd/containerd/runtime" "github.com/containerd/containerd/runtime/v2/shim" - "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -89,7 +89,7 @@ func (w *watcher) Run(ctx context.Context) { func (w *watcher) Add(id string, cgx interface{}) error { cg, ok := cgx.(*cgroupsv2.Manager) if !ok { - return errors.Errorf("expected *cgroupsv2.Manager, got: %T", cgx) + return fmt.Errorf("expected *cgroupsv2.Manager, got: %T", cgx) } // FIXME: cgroupsv2.Manager does not support closing eventCh routine currently. // The routine shuts down when an error happens, mostly when the cgroup is deleted. @@ -102,10 +102,13 @@ func (w *watcher) Add(id string, cgx interface{}) error { i.ev = ev w.itemCh <- i case err := <-errCh: - i.err = err - w.itemCh <- i - // we no longer get any event/err when we got an err - logrus.WithError(err).Warn("error from *cgroupsv2.Manager.EventChan") + // channel is closed when cgroup gets deleted + if err != nil { + i.err = err + w.itemCh <- i + // we no longer get any event/err when we got an err + logrus.WithError(err).Warn("error from *cgroupsv2.Manager.EventChan") + } return } } diff --git a/pkg/process/deleted_state.go b/pkg/process/deleted_state.go index 320b46026739f..4e62b300d08f1 100644 --- a/pkg/process/deleted_state.go +++ b/pkg/process/deleted_state.go @@ -21,11 +21,12 @@ package process import ( "context" + "errors" + "fmt" "github.com/containerd/console" "github.com/containerd/containerd/errdefs" google_protobuf "github.com/gogo/protobuf/types" - "github.com/pkg/errors" ) type deletedState struct { @@ -56,11 +57,11 @@ func (s *deletedState) Start(ctx context.Context) error { } func (s *deletedState) Delete(ctx context.Context) error { - return errors.Wrap(errdefs.ErrNotFound, "cannot delete a deleted process") + return fmt.Errorf("cannot delete a deleted process: %w", errdefs.ErrNotFound) } func (s *deletedState) Kill(ctx context.Context, sig uint32, all bool) error { - return errors.Wrap(errdefs.ErrNotFound, "cannot kill a deleted process") + return fmt.Errorf("cannot kill a deleted process: %w", errdefs.ErrNotFound) } func (s *deletedState) SetExited(status int) { diff --git a/pkg/process/exec.go b/pkg/process/exec.go index db0b3f8c8ddf2..dcd7592e81085 100644 --- a/pkg/process/exec.go +++ b/pkg/process/exec.go @@ -37,7 +37,6 @@ import ( "github.com/containerd/fifo" runc "github.com/containerd/go-runc" specs "github.com/opencontainers/runtime-spec/specs-go" - "github.com/pkg/errors" ) type execProcess struct { @@ -146,12 +145,12 @@ func (e *execProcess) kill(ctx context.Context, sig uint32, _ bool) error { pid := e.pid.get() switch { case pid == 0: - return errors.Wrap(errdefs.ErrFailedPrecondition, "process not created") + return fmt.Errorf("process not created: %w", errdefs.ErrFailedPrecondition) case !e.exited.IsZero(): - return errors.Wrapf(errdefs.ErrNotFound, "process already finished") + return fmt.Errorf("process already finished: %w", errdefs.ErrNotFound) default: if err := unix.Kill(pid, syscall.Signal(sig)); err != nil { - return errors.Wrapf(checkKillError(err), "exec kill error") + return fmt.Errorf("exec kill error: %w", checkKillError(err)) } } return nil @@ -187,12 +186,12 @@ func (e *execProcess) start(ctx context.Context) (err error) { ) if e.stdio.Terminal { if socket, err = runc.NewTempConsoleSocket(); err != nil { - return errors.Wrap(err, "failed to create runc console socket") + return fmt.Errorf("failed to create runc console socket: %w", err) } defer socket.Close() } else { if pio, err = createIO(ctx, e.id, e.parent.IoUID, e.parent.IoGID, e.stdio); err != nil { - return errors.Wrap(err, "failed to create init process I/O") + return fmt.Errorf("failed to create init process I/O: %w", err) } e.io = pio } @@ -220,19 +219,19 @@ func (e *execProcess) start(ctx context.Context) (err error) { if socket != nil { console, err := socket.ReceiveMaster() if err != nil { - return errors.Wrap(err, "failed to retrieve console master") + return fmt.Errorf("failed to retrieve console master: %w", err) } if e.console, err = e.parent.Platform.CopyConsole(ctx, console, e.id, e.stdio.Stdin, e.stdio.Stdout, e.stdio.Stderr, &e.wg); err != nil { - return errors.Wrap(err, "failed to start console copy") + return fmt.Errorf("failed to start console copy: %w", err) } } else { if err := pio.Copy(ctx, &e.wg); err != nil { - return errors.Wrap(err, "failed to start io pipe copy") + return fmt.Errorf("failed to start io pipe copy: %w", err) } } pid, err := pidFile.Read() if err != nil { - return errors.Wrap(err, "failed to retrieve OCI runtime exec pid") + return fmt.Errorf("failed to retrieve OCI runtime exec pi: %wd", err) } e.pid.pid = pid return nil @@ -241,7 +240,7 @@ func (e *execProcess) start(ctx context.Context) (err error) { func (e *execProcess) openStdin(path string) error { sc, err := fifo.OpenFifo(context.Background(), path, syscall.O_WRONLY|syscall.O_NONBLOCK, 0) if err != nil { - return errors.Wrapf(err, "failed to open stdin fifo %s", path) + return fmt.Errorf("failed to open stdin fifo %s: %w", path, err) } e.stdin = sc e.closers = append(e.closers, sc) diff --git a/pkg/process/exec_state.go b/pkg/process/exec_state.go index 6d1e7535a2ff9..4c3dd8fba98c4 100644 --- a/pkg/process/exec_state.go +++ b/pkg/process/exec_state.go @@ -21,9 +21,10 @@ package process import ( "context" + "errors" + "fmt" "github.com/containerd/console" - "github.com/pkg/errors" ) type execState interface { @@ -48,7 +49,7 @@ func (s *execCreatedState) transition(name string) error { case "deleted": s.p.execState = &deletedState{} default: - return errors.Errorf("invalid state transition %q to %q", stateName(s), name) + return fmt.Errorf("invalid state transition %q to %q", stateName(s), name) } return nil } @@ -97,7 +98,7 @@ func (s *execRunningState) transition(name string) error { case "stopped": s.p.execState = &execStoppedState{p: s.p} default: - return errors.Errorf("invalid state transition %q to %q", stateName(s), name) + return fmt.Errorf("invalid state transition %q to %q", stateName(s), name) } return nil } @@ -139,7 +140,7 @@ func (s *execStoppedState) transition(name string) error { case "deleted": s.p.execState = &deletedState{} default: - return errors.Errorf("invalid state transition %q to %q", stateName(s), name) + return fmt.Errorf("invalid state transition %q to %q", stateName(s), name) } return nil } diff --git a/pkg/process/init.go b/pkg/process/init.go index bb6edde3988fe..26aebdcb5a74d 100644 --- a/pkg/process/init.go +++ b/pkg/process/init.go @@ -38,7 +38,6 @@ import ( runc "github.com/containerd/go-runc" google_protobuf "github.com/gogo/protobuf/types" specs "github.com/opencontainers/runtime-spec/specs-go" - "github.com/pkg/errors" "golang.org/x/sys/unix" ) @@ -120,12 +119,12 @@ func (p *Init) Create(ctx context.Context, r *CreateConfig) error { if r.Terminal { if socket, err = runc.NewTempConsoleSocket(); err != nil { - return errors.Wrap(err, "failed to create OCI runtime console socket") + return fmt.Errorf("failed to create OCI runtime console socket: %w", err) } defer socket.Close() } else { if pio, err = createIO(ctx, p.id, p.IoUID, p.IoGID, p.stdio); err != nil { - return errors.Wrap(err, "failed to create init process I/O") + return fmt.Errorf("failed to create init process I/O: %w", err) } p.io = pio } @@ -156,21 +155,21 @@ func (p *Init) Create(ctx context.Context, r *CreateConfig) error { if socket != nil { console, err := socket.ReceiveMaster() if err != nil { - return errors.Wrap(err, "failed to retrieve console master") + return fmt.Errorf("failed to retrieve console master: %w", err) } console, err = p.Platform.CopyConsole(ctx, console, p.id, r.Stdin, r.Stdout, r.Stderr, &p.wg) if err != nil { - return errors.Wrap(err, "failed to start console copy") + return fmt.Errorf("failed to start console copy: %w", err) } p.console = console } else { if err := pio.Copy(ctx, &p.wg); err != nil { - return errors.Wrap(err, "failed to start io pipe copy") + return fmt.Errorf("failed to start io pipe copy: %w", err) } } pid, err := pidFile.Read() if err != nil { - return errors.Wrap(err, "failed to retrieve OCI runtime container pid") + return fmt.Errorf("failed to retrieve OCI runtime container pid: %w", err) } p.pid = pid return nil @@ -179,7 +178,7 @@ func (p *Init) Create(ctx context.Context, r *CreateConfig) error { func (p *Init) openStdin(path string) error { sc, err := fifo.OpenFifo(context.Background(), path, unix.O_WRONLY|unix.O_NONBLOCK, 0) if err != nil { - return errors.Wrapf(err, "failed to open stdin fifo %s", path) + return fmt.Errorf("failed to open stdin fifo %s: %w", path, err) } p.stdin = sc p.closers = append(p.closers, sc) @@ -313,7 +312,7 @@ func (p *Init) delete(ctx context.Context) error { if err2 := mount.UnmountAll(p.Rootfs, 0); err2 != nil { log.G(ctx).WithError(err2).Warn("failed to cleanup rootfs mount") if err == nil { - err = errors.Wrap(err2, "failed rootfs umount") + err = fmt.Errorf("failed rootfs umount: %w", err2) } } return err @@ -482,11 +481,11 @@ func (p *Init) runtimeError(rErr error, msg string) error { rMsg, err := getLastRuntimeError(p.runtime) switch { case err != nil: - return errors.Wrapf(rErr, "%s: %s (%s)", msg, "unable to retrieve OCI runtime error", err.Error()) + return fmt.Errorf("%s: %s (%s): %w", msg, "unable to retrieve OCI runtime error", err.Error(), rErr) case rMsg == "": - return errors.Wrap(rErr, msg) + return fmt.Errorf("%s: %w", msg, rErr) default: - return errors.Errorf("%s: %s", msg, rMsg) + return fmt.Errorf("%s: %s", msg, rMsg) } } diff --git a/pkg/process/init_state.go b/pkg/process/init_state.go index 8ea95bc61c9a5..76c91492e6fc8 100644 --- a/pkg/process/init_state.go +++ b/pkg/process/init_state.go @@ -21,10 +21,11 @@ package process import ( "context" + "errors" + "fmt" runc "github.com/containerd/go-runc" google_protobuf "github.com/gogo/protobuf/types" - "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -54,7 +55,7 @@ func (s *createdState) transition(name string) error { case "deleted": s.p.initState = &deletedState{} default: - return errors.Errorf("invalid state transition %q to %q", stateName(s), name) + return fmt.Errorf("invalid state transition %q to %q", stateName(s), name) } return nil } @@ -123,7 +124,7 @@ func (s *createdCheckpointState) transition(name string) error { case "deleted": s.p.initState = &deletedState{} default: - return errors.Errorf("invalid state transition %q to %q", stateName(s), name) + return fmt.Errorf("invalid state transition %q to %q", stateName(s), name) } return nil } @@ -154,7 +155,7 @@ func (s *createdCheckpointState) Start(ctx context.Context) error { ) if sio.Terminal { if socket, err = runc.NewTempConsoleSocket(); err != nil { - return errors.Wrap(err, "failed to create OCI runtime console socket") + return fmt.Errorf("failed to create OCI runtime console socket: %w", err) } defer socket.Close() s.opts.ConsoleSocket = socket @@ -165,27 +166,27 @@ func (s *createdCheckpointState) Start(ctx context.Context) error { } if sio.Stdin != "" { if err := p.openStdin(sio.Stdin); err != nil { - return errors.Wrapf(err, "failed to open stdin fifo %s", sio.Stdin) + return fmt.Errorf("failed to open stdin fifo %s: %w", sio.Stdin, err) } } if socket != nil { console, err := socket.ReceiveMaster() if err != nil { - return errors.Wrap(err, "failed to retrieve console master") + return fmt.Errorf("failed to retrieve console master: %w", err) } console, err = p.Platform.CopyConsole(ctx, console, p.id, sio.Stdin, sio.Stdout, sio.Stderr, &p.wg) if err != nil { - return errors.Wrap(err, "failed to start console copy") + return fmt.Errorf("failed to start console copy: %w", err) } p.console = console } else { if err := p.io.Copy(ctx, &p.wg); err != nil { - return errors.Wrap(err, "failed to start io pipe copy") + return fmt.Errorf("failed to start io pipe copy: %w", err) } } pid, err := runc.ReadPidFile(s.opts.PidFile) if err != nil { - return errors.Wrap(err, "failed to retrieve OCI runtime container pid") + return fmt.Errorf("failed to retrieve OCI runtime container pid: %w", err) } p.pid = pid return s.transition("running") @@ -229,7 +230,7 @@ func (s *runningState) transition(name string) error { case "paused": s.p.initState = &pausedState{p: s.p} default: - return errors.Errorf("invalid state transition %q to %q", stateName(s), name) + return fmt.Errorf("invalid state transition %q to %q", stateName(s), name) } return nil } @@ -300,7 +301,7 @@ func (s *pausedState) transition(name string) error { case "stopped": s.p.initState = &stoppedState{p: s.p} default: - return errors.Errorf("invalid state transition %q to %q", stateName(s), name) + return fmt.Errorf("invalid state transition %q to %q", stateName(s), name) } return nil } @@ -366,7 +367,7 @@ func (s *stoppedState) transition(name string) error { case "deleted": s.p.initState = &deletedState{} default: - return errors.Errorf("invalid state transition %q to %q", stateName(s), name) + return fmt.Errorf("invalid state transition %q to %q", stateName(s), name) } return nil } diff --git a/pkg/process/io.go b/pkg/process/io.go index 59c82d3d9f3b4..ed9b1da1853a5 100644 --- a/pkg/process/io.go +++ b/pkg/process/io.go @@ -37,7 +37,6 @@ import ( "github.com/containerd/fifo" runc "github.com/containerd/go-runc" "github.com/hashicorp/go-multierror" - "github.com/pkg/errors" exec "golang.org/x/sys/execabs" ) @@ -77,7 +76,7 @@ func (p *processIO) Copy(ctx context.Context, wg *sync.WaitGroup) error { } var cwg sync.WaitGroup if err := copyPipes(ctx, p.IO(), p.stdio.Stdin, p.stdio.Stdout, p.stdio.Stderr, wg, &cwg); err != nil { - return errors.Wrap(err, "unable to copy pipes") + return fmt.Errorf("unable to copy pipes: %w", err) } cwg.Wait() return nil @@ -97,7 +96,7 @@ func createIO(ctx context.Context, id string, ioUID, ioGID int, stdio stdio.Stdi } u, err := url.Parse(stdio.Stdout) if err != nil { - return nil, errors.Wrap(err, "unable to parse stdout uri") + return nil, fmt.Errorf("unable to parse stdout uri: %w", err) } if u.Scheme == "" { u.Scheme = "fifo" @@ -125,7 +124,7 @@ func createIO(ctx context.Context, id string, ioUID, ioGID int, stdio stdio.Stdi pio.copy = true pio.io, err = runc.NewPipeIO(ioUID, ioGID, withConditionalIO(stdio)) default: - return nil, errors.Errorf("unknown STDIO scheme %s", u.Scheme) + return nil, fmt.Errorf("unknown STDIO scheme %s", u.Scheme) } if err != nil { return nil, err @@ -189,10 +188,10 @@ func copyPipes(ctx context.Context, rio runc.IO, stdin, stdout, stderr string, w ) if ok { if fw, err = fifo.OpenFifo(ctx, i.name, syscall.O_WRONLY, 0); err != nil { - return errors.Wrapf(err, "containerd-shim: opening w/o fifo %q failed", i.name) + return fmt.Errorf("containerd-shim: opening w/o fifo %q failed: %w", i.name, err) } if fr, err = fifo.OpenFifo(ctx, i.name, syscall.O_RDONLY, 0); err != nil { - return errors.Wrapf(err, "containerd-shim: opening r/o fifo %q failed", i.name) + return fmt.Errorf("containerd-shim: opening r/o fifo %q failed: %w", i.name, err) } } else { if sameFile != nil { @@ -201,7 +200,7 @@ func copyPipes(ctx context.Context, rio runc.IO, stdin, stdout, stderr string, w continue } if fw, err = os.OpenFile(i.name, syscall.O_WRONLY|syscall.O_APPEND, 0); err != nil { - return errors.Wrapf(err, "containerd-shim: opening file %q failed", i.name) + return fmt.Errorf("containerd-shim: opening file %q failed: %w", i.name, err) } if stdout == stderr { sameFile = &countingWriteCloser{ @@ -266,13 +265,13 @@ func NewBinaryIO(ctx context.Context, id string, uri *url.URL) (_ runc.IO, err e out, err := newPipe() if err != nil { - return nil, errors.Wrap(err, "failed to create stdout pipes") + return nil, fmt.Errorf("failed to create stdout pipes: %w", err) } closers = append(closers, out.Close) serr, err := newPipe() if err != nil { - return nil, errors.Wrap(err, "failed to create stderr pipes") + return nil, fmt.Errorf("failed to create stderr pipes: %w", err) } closers = append(closers, serr.Close) @@ -287,19 +286,19 @@ func NewBinaryIO(ctx context.Context, id string, uri *url.URL) (_ runc.IO, err e // don't need to register this with the reaper or wait when // running inside a shim if err := cmd.Start(); err != nil { - return nil, errors.Wrap(err, "failed to start binary process") + return nil, fmt.Errorf("failed to start binary process: %w", err) } closers = append(closers, func() error { return cmd.Process.Kill() }) // close our side of the pipe after start if err := w.Close(); err != nil { - return nil, errors.Wrap(err, "failed to close write pipe after start") + return nil, fmt.Errorf("failed to close write pipe after start: %w", err) } // wait for the logging binary to be ready b := make([]byte, 1) if _, err := r.Read(b); err != nil && err != io.EOF { - return nil, errors.Wrap(err, "failed to read from logging binary") + return nil, fmt.Errorf("failed to read from logging binary: %w", err) } return &binaryIO{ @@ -357,12 +356,12 @@ func (b *binaryIO) cancel() error { // Send SIGTERM first, so logger process has a chance to flush and exit properly if err := b.cmd.Process.Signal(syscall.SIGTERM); err != nil { - result := multierror.Append(errors.Wrap(err, "failed to send SIGTERM")) + result := multierror.Append(fmt.Errorf("failed to send SIGTERM: %w", err)) log.L.WithError(err).Warn("failed to send SIGTERM signal, killing logging shim") if err := b.cmd.Process.Kill(); err != nil { - result = multierror.Append(result, errors.Wrap(err, "failed to kill process after faulty SIGTERM")) + result = multierror.Append(result, fmt.Errorf("failed to kill process after faulty SIGTERM: %w", err)) } return result.ErrorOrNil() @@ -381,7 +380,7 @@ func (b *binaryIO) cancel() error { err := b.cmd.Process.Kill() if err != nil { - return errors.Wrap(err, "failed to kill shim logger process") + return fmt.Errorf("failed to kill shim logger process: %w", err) } return nil @@ -429,11 +428,11 @@ func (p *pipe) Close() error { var result *multierror.Error if err := p.w.Close(); err != nil { - result = multierror.Append(result, errors.Wrap(err, "failed to close write pipe")) + result = multierror.Append(result, fmt.Errorf("failed to close write pipe: %w", err)) } if err := p.r.Close(); err != nil { - result = multierror.Append(result, errors.Wrap(err, "failed to close read pipe")) + result = multierror.Append(result, fmt.Errorf("failed to close read pipe: %w", err)) } return multierror.Prefix(result.ErrorOrNil(), "pipe:") diff --git a/pkg/process/utils.go b/pkg/process/utils.go index b99bf547b72f3..afada02b7b839 100644 --- a/pkg/process/utils.go +++ b/pkg/process/utils.go @@ -33,7 +33,6 @@ import ( "github.com/containerd/containerd/errdefs" runc "github.com/containerd/go-runc" - "github.com/pkg/errors" "golang.org/x/sys/unix" ) @@ -137,11 +136,11 @@ func checkKillError(err error) error { strings.Contains(err.Error(), "container not running") || strings.Contains(strings.ToLower(err.Error()), "no such process") || err == unix.ESRCH { - return errors.Wrapf(errdefs.ErrNotFound, "process already finished") + return fmt.Errorf("process already finished: %w", errdefs.ErrNotFound) } else if strings.Contains(err.Error(), "does not exist") { - return errors.Wrapf(errdefs.ErrNotFound, "no such container") + return fmt.Errorf("no such container: %w", errdefs.ErrNotFound) } - return errors.Wrapf(err, "unknown error after kill") + return fmt.Errorf("unknown error after kill: %w", err) } func newPidFile(bundle string) *pidFile { @@ -199,5 +198,5 @@ func stateName(v interface{}) string { case *stoppedState: return "stopped" } - panic(errors.Errorf("invalid state %v", v)) + panic(fmt.Errorf("invalid state %v", v)) } diff --git a/pkg/registrar/registrar.go b/pkg/registrar/registrar.go index b83e7ce85013a..d365a57307a68 100644 --- a/pkg/registrar/registrar.go +++ b/pkg/registrar/registrar.go @@ -17,9 +17,8 @@ package registrar import ( + "fmt" "sync" - - "github.com/pkg/errors" ) // Registrar stores one-to-one name<->key mappings. @@ -50,19 +49,19 @@ func (r *Registrar) Reserve(name, key string) error { defer r.lock.Unlock() if name == "" || key == "" { - return errors.Errorf("invalid name %q or key %q", name, key) + return fmt.Errorf("invalid name %q or key %q", name, key) } if k, exists := r.nameToKey[name]; exists { if k != key { - return errors.Errorf("name %q is reserved for %q", name, k) + return fmt.Errorf("name %q is reserved for %q", name, k) } return nil } if n, exists := r.keyToName[key]; exists { if n != name { - return errors.Errorf("key %q is reserved for %q", key, n) + return fmt.Errorf("key %q is reserved for %q", key, n) } return nil } diff --git a/pkg/ttrpcutil/client.go b/pkg/ttrpcutil/client.go index 8b4d925d28edd..f05ab7aa9f9c7 100644 --- a/pkg/ttrpcutil/client.go +++ b/pkg/ttrpcutil/client.go @@ -17,13 +17,14 @@ package ttrpcutil import ( + "errors" + "fmt" "sync" "time" v1 "github.com/containerd/containerd/api/services/ttrpc/events/v1" "github.com/containerd/containerd/pkg/dialer" "github.com/containerd/ttrpc" - "github.com/pkg/errors" ) const ttrpcDialTimeout = 5 * time.Second @@ -43,7 +44,7 @@ func NewClient(address string, opts ...ttrpc.ClientOpts) (*Client, error) { connector := func() (*ttrpc.Client, error) { conn, err := dialer.Dialer(address, ttrpcDialTimeout) if err != nil { - return nil, errors.Wrap(err, "failed to connect") + return nil, fmt.Errorf("failed to connect: %w", err) } client := ttrpc.NewClient(conn, opts...) diff --git a/platforms/compare.go b/platforms/compare.go index c7657e1869bec..3913ef663731a 100644 --- a/platforms/compare.go +++ b/platforms/compare.go @@ -38,12 +38,22 @@ func platformVector(platform specs.Platform) []specs.Platform { switch platform.Architecture { case "amd64": + if amd64Version, err := strconv.Atoi(strings.TrimPrefix(platform.Variant, "v")); err == nil && amd64Version > 1 { + for amd64Version--; amd64Version >= 1; amd64Version-- { + vector = append(vector, specs.Platform{ + Architecture: platform.Architecture, + OS: platform.OS, + OSVersion: platform.OSVersion, + OSFeatures: platform.OSFeatures, + Variant: "v" + strconv.Itoa(amd64Version), + }) + } + } vector = append(vector, specs.Platform{ Architecture: "386", OS: platform.OS, OSVersion: platform.OSVersion, OSFeatures: platform.OSFeatures, - Variant: platform.Variant, }) case "arm": if armVersion, err := strconv.Atoi(strings.TrimPrefix(platform.Variant, "v")); err == nil && armVersion > 5 { diff --git a/platforms/compare_test.go b/platforms/compare_test.go index b734c2afe5b92..cbe90deead3e7 100644 --- a/platforms/compare_test.go +++ b/platforms/compare_test.go @@ -33,6 +33,26 @@ func TestOnly(t *testing.T) { "linux/386", }, false: { + "linux/amd64/v2", + "linux/arm/v7", + "linux/arm64", + "windows/amd64", + "windows/arm", + }, + }, + }, + { + platform: "linux/amd64/v2", + matches: map[bool][]string{ + true: { + "linux/amd64", + "linux/amd64/v1", + "linux/amd64/v2", + "linux/386", + }, + false: { + "linux/amd64/v3", + "linux/amd64/v4", "linux/arm/v7", "linux/arm64", "windows/amd64", diff --git a/platforms/cpuinfo.go b/platforms/cpuinfo.go index 4a7177e313845..046e0356d19db 100644 --- a/platforms/cpuinfo.go +++ b/platforms/cpuinfo.go @@ -18,6 +18,7 @@ package platforms import ( "bufio" + "fmt" "os" "runtime" "strings" @@ -25,7 +26,6 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/log" - "github.com/pkg/errors" ) // Present the ARM instruction set architecture, eg: v7, v8 @@ -48,7 +48,7 @@ func cpuVariant() string { // by ourselves. We can just parse these information from /proc/cpuinfo func getCPUInfo(pattern string) (info string, err error) { if !isLinuxOS(runtime.GOOS) { - return "", errors.Wrapf(errdefs.ErrNotImplemented, "getCPUInfo for OS %s", runtime.GOOS) + return "", fmt.Errorf("getCPUInfo for OS %s: %w", runtime.GOOS, errdefs.ErrNotImplemented) } cpuinfo, err := os.Open("/proc/cpuinfo") @@ -75,7 +75,7 @@ func getCPUInfo(pattern string) (info string, err error) { return "", err } - return "", errors.Wrapf(errdefs.ErrNotFound, "getCPUInfo for pattern: %s", pattern) + return "", fmt.Errorf("getCPUInfo for pattern: %s: %w", pattern, errdefs.ErrNotFound) } func getCPUVariant() string { diff --git a/platforms/database.go b/platforms/database.go index cdf8ceb4cf51c..dbe9957ca9dbd 100644 --- a/platforms/database.go +++ b/platforms/database.go @@ -86,9 +86,11 @@ func normalizeArch(arch, variant string) (string, string) { case "i386": arch = "386" variant = "" - case "x86_64", "x86-64": + case "x86_64", "x86-64", "amd64": arch = "amd64" - variant = "" + if variant == "v1" { + variant = "" + } case "aarch64", "arm64": arch = "arm64" switch variant { diff --git a/platforms/platforms.go b/platforms/platforms.go index 2c1b58ec50650..8f955d036dff9 100644 --- a/platforms/platforms.go +++ b/platforms/platforms.go @@ -107,6 +107,7 @@ package platforms import ( + "fmt" "path" "regexp" "runtime" @@ -115,7 +116,6 @@ import ( "github.com/containerd/containerd/errdefs" specs "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" ) var ( @@ -167,14 +167,14 @@ func (m *matcher) String() string { func Parse(specifier string) (specs.Platform, error) { if strings.Contains(specifier, "*") { // TODO(stevvooe): need to work out exact wildcard handling - return specs.Platform{}, errors.Wrapf(errdefs.ErrInvalidArgument, "%q: wildcards not yet supported", specifier) + return specs.Platform{}, fmt.Errorf("%q: wildcards not yet supported: %w", specifier, errdefs.ErrInvalidArgument) } parts := strings.Split(specifier, "/") for _, part := range parts { if !specifierRe.MatchString(part) { - return specs.Platform{}, errors.Wrapf(errdefs.ErrInvalidArgument, "%q is an invalid component of %q: platform specifier component must match %q", part, specifier, specifierRe.String()) + return specs.Platform{}, fmt.Errorf("%q is an invalid component of %q: platform specifier component must match %q: %w", part, specifier, specifierRe.String(), errdefs.ErrInvalidArgument) } } @@ -206,7 +206,7 @@ func Parse(specifier string) (specs.Platform, error) { return p, nil } - return specs.Platform{}, errors.Wrapf(errdefs.ErrInvalidArgument, "%q: unknown operating system or architecture", specifier) + return specs.Platform{}, fmt.Errorf("%q: unknown operating system or architecture: %w", specifier, errdefs.ErrInvalidArgument) case 2: // In this case, we treat as a regular os/arch pair. We don't care // about whether or not we know of the platform. @@ -228,7 +228,7 @@ func Parse(specifier string) (specs.Platform, error) { return p, nil } - return specs.Platform{}, errors.Wrapf(errdefs.ErrInvalidArgument, "%q: cannot parse platform specifier", specifier) + return specs.Platform{}, fmt.Errorf("%q: cannot parse platform specifier: %w", specifier, errdefs.ErrInvalidArgument) } // MustParse is like Parses but panics if the specifier cannot be parsed. @@ -257,10 +257,5 @@ func Format(platform specs.Platform) string { func Normalize(platform specs.Platform) specs.Platform { platform.OS = normalizeOS(platform.OS) platform.Architecture, platform.Variant = normalizeArch(platform.Architecture, platform.Variant) - - // these fields are deprecated, remove them - platform.OSFeatures = nil - platform.OSVersion = "" - return platform } diff --git a/platforms/platforms_test.go b/platforms/platforms_test.go index c070ddae1cc97..fb24eab776703 100644 --- a/platforms/platforms_test.go +++ b/platforms/platforms_test.go @@ -23,6 +23,7 @@ import ( "testing" specs "github.com/opencontainers/image-spec/specs-go/v1" + "github.com/stretchr/testify/require" ) func TestParseSelector(t *testing.T) { @@ -364,3 +365,7 @@ func TestParseSelectorInvalid(t *testing.T) { }) } } + +func TestNormalize(t *testing.T) { + require.Equal(t, DefaultSpec(), Normalize(DefaultSpec())) +} diff --git a/plugin/context.go b/plugin/context.go index 3ee43c3ddd4a8..dcb533c8a7454 100644 --- a/plugin/context.go +++ b/plugin/context.go @@ -18,12 +18,12 @@ package plugin import ( "context" + "fmt" "path/filepath" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/events/exchange" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" ) // InitContext is used for plugin initialization @@ -117,7 +117,7 @@ func (ps *Set) Add(p *Plugin) error { } else if _, idok := byID[p.Registration.ID]; !idok { byID[p.Registration.ID] = p } else { - return errors.Wrapf(errdefs.ErrAlreadyExists, "plugin %v already initialized", p.Registration.URI()) + return fmt.Errorf("plugin %v already initialized: %w", p.Registration.URI(), errdefs.ErrAlreadyExists) } ps.ordered = append(ps.ordered, p) @@ -129,12 +129,22 @@ func (ps *Set) Get(t Type) (interface{}, error) { for _, v := range ps.byTypeAndID[t] { return v.Instance() } - return nil, errors.Wrapf(errdefs.ErrNotFound, "no plugins registered for %s", t) + return nil, fmt.Errorf("no plugins registered for %s: %w", t, errdefs.ErrNotFound) +} + +// GetAll returns all initialized plugins +func (ps *Set) GetAll() []*Plugin { + return ps.ordered +} + +// Plugins returns plugin set +func (i *InitContext) Plugins() *Set { + return i.plugins } // GetAll plugins in the set func (i *InitContext) GetAll() []*Plugin { - return i.plugins.ordered + return i.plugins.GetAll() } // GetByID returns the plugin of the given type and ID @@ -145,7 +155,7 @@ func (i *InitContext) GetByID(t Type, id string) (interface{}, error) { } p, ok := ps[id] if !ok { - return nil, errors.Wrapf(errdefs.ErrNotFound, "no %s plugins with id %s", t, id) + return nil, fmt.Errorf("no %s plugins with id %s: %w", t, id, errdefs.ErrNotFound) } return p.Instance() } @@ -154,7 +164,7 @@ func (i *InitContext) GetByID(t Type, id string) (interface{}, error) { func (i *InitContext) GetByType(t Type) (map[string]*Plugin, error) { p, ok := i.plugins.byTypeAndID[t] if !ok { - return nil, errors.Wrapf(errdefs.ErrNotFound, "no plugins registered for %s", t) + return nil, fmt.Errorf("no plugins registered for %s: %w", t, errdefs.ErrNotFound) } return p, nil diff --git a/plugin/plugin.go b/plugin/plugin.go index f24a3c77b29ec..eb38c127157fd 100644 --- a/plugin/plugin.go +++ b/plugin/plugin.go @@ -17,10 +17,9 @@ package plugin import ( + "errors" "fmt" "sync" - - "github.com/pkg/errors" ) var ( @@ -172,7 +171,7 @@ func Register(r *Registration) { func checkUnique(r *Registration) error { for _, registered := range register.r { if r.URI() == registered.URI() { - return errors.Wrap(ErrIDRegistered, r.URI()) + return fmt.Errorf("%s: %w", r.URI(), ErrIDRegistered) } } return nil diff --git a/process.go b/process.go index fb17a48c01e12..42d0da60e1e2d 100644 --- a/process.go +++ b/process.go @@ -18,6 +18,7 @@ package containerd import ( "context" + "fmt" "strings" "syscall" "time" @@ -25,7 +26,6 @@ import ( "github.com/containerd/containerd/api/services/tasks/v1" "github.com/containerd/containerd/cio" "github.com/containerd/containerd/errdefs" - "github.com/pkg/errors" ) // Process represents a system process @@ -210,7 +210,7 @@ func (p *process) Delete(ctx context.Context, opts ...ProcessDeleteOpts) (*ExitS } switch status.Status { case Running, Paused, Pausing: - return nil, errors.Wrapf(errdefs.ErrFailedPrecondition, "current process state: %s, process must be stopped before deletion", status.Status) + return nil, fmt.Errorf("current process state: %s, process must be stopped before deletion: %w", status.Status, errdefs.ErrFailedPrecondition) } r, err := p.task.client.TaskService().DeleteProcess(ctx, &tasks.DeleteProcessRequest{ ContainerID: p.task.id, diff --git a/pull.go b/pull.go index 36365513f69bf..92f7719b1f7f5 100644 --- a/pull.go +++ b/pull.go @@ -18,6 +18,8 @@ package containerd import ( "context" + "errors" + "fmt" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" @@ -26,7 +28,6 @@ import ( "github.com/containerd/containerd/remotes/docker" "github.com/containerd/containerd/remotes/docker/schema1" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" "golang.org/x/sync/errgroup" "golang.org/x/sync/semaphore" ) @@ -49,7 +50,7 @@ func (c *Client) Pull(ctx context.Context, ref string, opts ...RemoteOpt) (_ Ima } else { p, err := platforms.Parse(pullCtx.Platforms[0]) if err != nil { - return nil, errors.Wrapf(err, "invalid platform %s", pullCtx.Platforms[0]) + return nil, fmt.Errorf("invalid platform %s: %w", pullCtx.Platforms[0], err) } pullCtx.PlatformMatcher = platforms.Only(p) @@ -70,13 +71,13 @@ func (c *Client) Pull(ctx context.Context, ref string, opts ...RemoteOpt) (_ Ima // unpacker only supports schema 2 image, for schema 1 this is noop. u, err := c.newUnpacker(ctx, pullCtx) if err != nil { - return nil, errors.Wrap(err, "create unpacker") + return nil, fmt.Errorf("create unpacker: %w", err) } unpackWrapper, unpackEg = u.handlerWrapper(ctx, pullCtx, &unpacks) defer func() { if err := unpackEg.Wait(); err != nil { if retErr == nil { - retErr = errors.Wrap(err, "unpack") + retErr = fmt.Errorf("unpack: %w", err) } } }() @@ -117,7 +118,7 @@ func (c *Client) Pull(ctx context.Context, ref string, opts ...RemoteOpt) (_ Ima // Try to unpack is none is done previously. // This is at least required for schema 1 image. if err := i.Unpack(ctx, pullCtx.Snapshotter, pullCtx.UnpackOpts...); err != nil { - return nil, errors.Wrapf(err, "failed to unpack image on snapshotter %s", pullCtx.Snapshotter) + return nil, fmt.Errorf("failed to unpack image on snapshotter %s: %w", pullCtx.Snapshotter, err) } } } @@ -129,12 +130,12 @@ func (c *Client) fetch(ctx context.Context, rCtx *RemoteContext, ref string, lim store := c.ContentStore() name, desc, err := rCtx.Resolver.Resolve(ctx, ref) if err != nil { - return images.Image{}, errors.Wrapf(err, "failed to resolve reference %q", ref) + return images.Image{}, fmt.Errorf("failed to resolve reference %q: %w", ref, err) } fetcher, err := rCtx.Resolver.Fetcher(ctx, name) if err != nil { - return images.Image{}, errors.Wrapf(err, "failed to get fetcher for %q", name) + return images.Image{}, fmt.Errorf("failed to get fetcher for %q: %w", name, err) } var ( diff --git a/releases/v1.6.0-beta.toml b/releases/v1.6.0.toml similarity index 75% rename from releases/v1.6.0-beta.toml rename to releases/v1.6.0.toml index 2060a19b72344..3761ea3f431e5 100644 --- a/releases/v1.6.0-beta.toml +++ b/releases/v1.6.0.toml @@ -21,10 +21,12 @@ support to increase overall compatibility and stability. * **Add runtime label to metrics** ([#5744](https://github.com/containerd/containerd/pull/5744)) * **Cleanup task delete logic in v2 shim** ([#5813](https://github.com/containerd/containerd/pull/5813)) * **Add support for shim plugins** ([#5817](https://github.com/containerd/containerd/pull/5817)) +* **Handle sigint and sigterm in shimv2** ([#5828](https://github.com/containerd/containerd/pull/5828)) * **Decouple shim and task manager** ([#5918](https://github.com/containerd/containerd/pull/5918)) * **Add runc shim support for core scheduling** ([#6011](https://github.com/containerd/containerd/pull/6011)) * **Update shim client connect attempt to fail fast when shim errors** ([#6031](https://github.com/containerd/containerd/pull/6031)) * **Add support for absolute path to shim binaries** ([#6206](https://github.com/containerd/containerd/pull/6206)) +* **Update runc to v1.1.0** ([#6375](https://github.com/containerd/containerd/pull/6375)) #### Windows @@ -46,16 +48,31 @@ support to increase overall compatibility and stability. #### Other -* **Add a shared namespace label for cross-namespace content sharing** ([#5043](https://github.com/containerd/containerd/pull/5043)) * **Add support for client TLS Auth for grpc** ([#5606](https://github.com/containerd/containerd/pull/5606)) * **Add xfs support for devicemapper snapshotter** ([#5610](https://github.com/containerd/containerd/pull/5610)) * **Add metric exposing build version and revision** ([#5965](https://github.com/containerd/containerd/pull/5965)) -* **Add OpenTelemetry trace injection to grpc client** ([#5992](https://github.com/containerd/containerd/pull/5992)) * **Add support for custom fs options in devmapper snapshotter** ([#6122](https://github.com/containerd/containerd/pull/6122)) +* **Update introspection service to show GRPC plugins** ([#6432](https://github.com/containerd/containerd/pull/6432)) #### Client * **Allow WithServices to use custom implementations** ([#5709](https://github.com/containerd/containerd/pull/5709)) * **Support custom compressor for walking differ** ([#5735](https://github.com/containerd/containerd/pull/5735)) +### Release Updates + +#### containerd/CNI/runc/critools tar bundle + +The tar bundles released as `cri-containerd-*.tar.gz` contain a build of runc +linked with a newer version of libseccomp. This dynamically-linked build of runc +was built on Ubuntu 18.04 and will not work on some other distributions, such as +RHEL 7 and Debian 10. Users of such distributions may get a statically-linked +runc binary from https://github.com/opencontainers/runc/releases or build runc +for their own environment. + +> **_Deprecation_** These tar bundles are now deprecated and will be removed or +> replaced in containerd 2.0. Projects relying on these tar bundles should use +> the `containerd-*.tar.gz` bundles or work with the containerd community on a +> suitable replacement in containerd 2.0. + See the changelog for complete list of changes""" diff --git a/remotes/docker/auth/fetch.go b/remotes/docker/auth/fetch.go index 3a9c261845f2f..c259873d2a2ea 100644 --- a/remotes/docker/auth/fetch.go +++ b/remotes/docker/auth/fetch.go @@ -19,6 +19,8 @@ package auth import ( "context" "encoding/json" + "errors" + "fmt" "net/http" "net/url" "strings" @@ -27,7 +29,6 @@ import ( "github.com/containerd/containerd/log" remoteserrors "github.com/containerd/containerd/remotes/errors" "github.com/containerd/containerd/version" - "github.com/pkg/errors" "golang.org/x/net/context/ctxhttp" ) @@ -46,7 +47,7 @@ func GenerateTokenOptions(ctx context.Context, host, username, secret string, c realmURL, err := url.Parse(realm) if err != nil { - return TokenOptions{}, errors.Wrap(err, "invalid token auth challenge realm") + return TokenOptions{}, fmt.Errorf("invalid token auth challenge realm: %w", err) } to := TokenOptions{ @@ -133,18 +134,18 @@ func FetchTokenWithOAuth(ctx context.Context, client *http.Client, headers http. defer resp.Body.Close() if resp.StatusCode < 200 || resp.StatusCode >= 400 { - return nil, errors.WithStack(remoteserrors.NewUnexpectedStatusErr(resp)) + return nil, remoteserrors.NewUnexpectedStatusErr(resp) } decoder := json.NewDecoder(resp.Body) var tr OAuthTokenResponse if err = decoder.Decode(&tr); err != nil { - return nil, errors.Wrap(err, "unable to decode token response") + return nil, fmt.Errorf("unable to decode token response: %w", err) } if tr.AccessToken == "" { - return nil, errors.WithStack(ErrNoToken) + return nil, ErrNoToken } return &tr, nil @@ -200,14 +201,14 @@ func FetchToken(ctx context.Context, client *http.Client, headers http.Header, t defer resp.Body.Close() if resp.StatusCode < 200 || resp.StatusCode >= 400 { - return nil, errors.WithStack(remoteserrors.NewUnexpectedStatusErr(resp)) + return nil, remoteserrors.NewUnexpectedStatusErr(resp) } decoder := json.NewDecoder(resp.Body) var tr FetchTokenResponse if err = decoder.Decode(&tr); err != nil { - return nil, errors.Wrap(err, "unable to decode token response") + return nil, fmt.Errorf("unable to decode token response: %w", err) } // `access_token` is equivalent to `token` and if both are specified @@ -218,7 +219,7 @@ func FetchToken(ctx context.Context, client *http.Client, headers http.Header, t } if tr.Token == "" { - return nil, errors.WithStack(ErrNoToken) + return nil, ErrNoToken } return &tr, nil diff --git a/remotes/docker/authorizer.go b/remotes/docker/authorizer.go index bcb6296f3fb3b..eaa0e5dbdbcd5 100644 --- a/remotes/docker/authorizer.go +++ b/remotes/docker/authorizer.go @@ -19,6 +19,7 @@ package docker import ( "context" "encoding/base64" + "errors" "fmt" "net/http" "strings" @@ -28,7 +29,6 @@ import ( "github.com/containerd/containerd/log" "github.com/containerd/containerd/remotes/docker/auth" remoteerrors "github.com/containerd/containerd/remotes/errors" - "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -205,7 +205,7 @@ func (a *dockerAuthorizer) AddResponses(ctx context.Context, responses []*http.R } } } - return errors.Wrap(errdefs.ErrNotImplemented, "failed to find supported auth scheme") + return fmt.Errorf("failed to find supported auth scheme: %w", errdefs.ErrNotImplemented) } // authResult is used to control limit rate. @@ -252,7 +252,7 @@ func (ah *authHandler) authorize(ctx context.Context) (string, string, error) { case auth.BearerAuth: return ah.doBearerAuth(ctx) default: - return "", "", errors.Wrapf(errdefs.ErrNotImplemented, "failed to find supported auth scheme: %s", string(ah.scheme)) + return "", "", fmt.Errorf("failed to find supported auth scheme: %s: %w", string(ah.scheme), errdefs.ErrNotImplemented) } } @@ -298,7 +298,9 @@ func (ah *authHandler) doBearerAuth(ctx context.Context) (token, refreshToken st // fetch token for the resource scope if to.Secret != "" { defer func() { - err = errors.Wrap(err, "failed to fetch oauth token") + if err != nil { + err = fmt.Errorf("failed to fetch oauth token: %w", err) + } }() // credential information is provided, use oauth POST endpoint // TODO: Allow setting client_id @@ -309,7 +311,8 @@ func (ah *authHandler) doBearerAuth(ctx context.Context) (token, refreshToken st // Registries without support for POST may return 404 for POST /v2/token. // As of September 2017, GCR is known to return 404. // As of February 2018, JFrog Artifactory is known to return 401. - if (errStatus.StatusCode == 405 && to.Username != "") || errStatus.StatusCode == 404 || errStatus.StatusCode == 401 { + // As of January 2022, ACR is known to return 400. + if (errStatus.StatusCode == 405 && to.Username != "") || errStatus.StatusCode == 404 || errStatus.StatusCode == 401 || errStatus.StatusCode == 400 { resp, err := auth.FetchToken(ctx, ah.client, ah.header, to) if err != nil { return "", "", err @@ -328,7 +331,7 @@ func (ah *authHandler) doBearerAuth(ctx context.Context) (token, refreshToken st // do request anonymously resp, err := auth.FetchToken(ctx, ah.client, ah.header, to) if err != nil { - return "", "", errors.Wrap(err, "failed to fetch anonymous token") + return "", "", fmt.Errorf("failed to fetch anonymous token: %w", err) } return resp.Token, resp.RefreshToken, nil } @@ -344,7 +347,7 @@ func invalidAuthorization(c auth.Challenge, responses []*http.Response) error { return nil } - return errors.Wrapf(ErrInvalidAuthorization, "server message: %s", errStr) + return fmt.Errorf("server message: %s: %w", errStr, ErrInvalidAuthorization) } func sameRequest(r1, r2 *http.Request) bool { diff --git a/remotes/docker/config/hosts.go b/remotes/docker/config/hosts.go index f47e4ec062f76..daccb1efbc36c 100644 --- a/remotes/docker/config/hosts.go +++ b/remotes/docker/config/hosts.go @@ -20,6 +20,8 @@ package config import ( "context" "crypto/tls" + "errors" + "fmt" "net" "net/http" "net/url" @@ -34,7 +36,6 @@ import ( "github.com/containerd/containerd/log" "github.com/containerd/containerd/remotes/docker" "github.com/pelletier/go-toml" - "github.com/pkg/errors" ) // UpdateClientFunc is a function that lets you to amend http Client behavior used by registry clients. @@ -166,17 +167,17 @@ func ConfigureHosts(ctx context.Context, options HostOptions) docker.RegistryHos if tlsConfig.RootCAs == nil { rootPool, err := rootSystemPool() if err != nil { - return nil, errors.Wrap(err, "unable to initialize cert pool") + return nil, fmt.Errorf("unable to initialize cert pool: %w", err) } tlsConfig.RootCAs = rootPool } for _, f := range host.caCerts { data, err := os.ReadFile(f) if err != nil { - return nil, errors.Wrapf(err, "unable to read CA cert %q", f) + return nil, fmt.Errorf("unable to read CA cert %q: %w", f, err) } if !tlsConfig.RootCAs.AppendCertsFromPEM(data) { - return nil, errors.Errorf("unable to load CA cert %q", f) + return nil, fmt.Errorf("unable to load CA cert %q", f) } } } @@ -185,13 +186,13 @@ func ConfigureHosts(ctx context.Context, options HostOptions) docker.RegistryHos for _, pair := range host.clientPairs { certPEMBlock, err := os.ReadFile(pair[0]) if err != nil { - return nil, errors.Wrapf(err, "unable to read CERT file %q", pair[0]) + return nil, fmt.Errorf("unable to read CERT file %q: %w", pair[0], err) } var keyPEMBlock []byte if pair[1] != "" { keyPEMBlock, err = os.ReadFile(pair[1]) if err != nil { - return nil, errors.Wrapf(err, "unable to read CERT file %q", pair[1]) + return nil, fmt.Errorf("unable to read CERT file %q: %w", pair[1], err) } } else { // Load key block from same PEM file @@ -199,7 +200,7 @@ func ConfigureHosts(ctx context.Context, options HostOptions) docker.RegistryHos } cert, err := tls.X509KeyPair(certPEMBlock, keyPEMBlock) if err != nil { - return nil, errors.Wrap(err, "failed to load X509 key pair") + return nil, fmt.Errorf("failed to load X509 key pair: %w", err) } tlsConfig.Certificates = append(tlsConfig.Certificates, cert) @@ -315,7 +316,7 @@ type hostFileConfig struct { func parseHostsFile(baseDir string, b []byte) ([]hostConfig, error) { tree, err := toml.LoadBytes(b) if err != nil { - return nil, errors.Wrap(err, "failed to parse TOML") + return nil, fmt.Errorf("failed to parse TOML: %w", err) } // HACK: we want to keep toml parsing structures private in this package, however go-toml ignores private embedded types. @@ -377,7 +378,7 @@ func parseHostConfig(server string, baseDir string, config hostFileConfig) (host } u, err := url.Parse(server) if err != nil { - return hostConfig{}, errors.Wrapf(err, "unable to parse server %v", server) + return hostConfig{}, fmt.Errorf("unable to parse server %v: %w", server, err) } result.scheme = u.Scheme result.host = u.Host @@ -404,7 +405,7 @@ func parseHostConfig(server string, baseDir string, config hostFileConfig) (host case "push": result.capabilities |= docker.HostCapabilityPush default: - return hostConfig{}, errors.Errorf("unknown capability %v", c) + return hostConfig{}, fmt.Errorf("unknown capability %v", c) } } } else { @@ -423,7 +424,7 @@ func parseHostConfig(server string, baseDir string, config hostFileConfig) (host return hostConfig{}, err } default: - return hostConfig{}, errors.Errorf("invalid type %v for \"ca\"", cert) + return hostConfig{}, fmt.Errorf("invalid type %v for \"ca\"", cert) } } @@ -445,18 +446,18 @@ func parseHostConfig(server string, baseDir string, config hostFileConfig) (host return hostConfig{}, err } if len(slice) != 2 { - return hostConfig{}, errors.Errorf("invalid pair %v for \"client\"", p) + return hostConfig{}, fmt.Errorf("invalid pair %v for \"client\"", p) } var pair [2]string copy(pair[:], slice) result.clientPairs = append(result.clientPairs, pair) default: - return hostConfig{}, errors.Errorf("invalid type %T for \"client\"", p) + return hostConfig{}, fmt.Errorf("invalid type %T for \"client\"", p) } } default: - return hostConfig{}, errors.Errorf("invalid type %v for \"client\"", client) + return hostConfig{}, fmt.Errorf("invalid type %v for \"client\"", client) } } @@ -472,7 +473,7 @@ func parseHostConfig(server string, baseDir string, config hostFileConfig) (host return hostConfig{}, err } default: - return hostConfig{}, errors.Errorf("invalid type %v for header %q", ty, key) + return hostConfig{}, fmt.Errorf("invalid type %v for header %q", ty, key) } } result.header = header @@ -508,7 +509,7 @@ func makeStringSlice(slice []interface{}, cb func(string) string) ([]string, err for i, value := range slice { str, ok := value.(string) if !ok { - return nil, errors.Errorf("unable to cast %v to string", value) + return nil, fmt.Errorf("unable to cast %v to string", value) } if cb != nil { diff --git a/remotes/docker/converter.go b/remotes/docker/converter.go index 43e6b372c12bb..d7dca0d364302 100644 --- a/remotes/docker/converter.go +++ b/remotes/docker/converter.go @@ -28,7 +28,6 @@ import ( "github.com/containerd/containerd/remotes" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" ) // LegacyConfigMediaType should be replaced by OCI image spec. @@ -52,12 +51,12 @@ func ConvertManifest(ctx context.Context, store content.Store, desc ocispec.Desc // read manifest data mb, err := content.ReadBlob(ctx, store, desc) if err != nil { - return ocispec.Descriptor{}, errors.Wrap(err, "failed to read index data") + return ocispec.Descriptor{}, fmt.Errorf("failed to read index data: %w", err) } var manifest ocispec.Manifest if err := json.Unmarshal(mb, &manifest); err != nil { - return ocispec.Descriptor{}, errors.Wrap(err, "failed to unmarshal data into manifest") + return ocispec.Descriptor{}, fmt.Errorf("failed to unmarshal data into manifest: %w", err) } // check config media type @@ -68,7 +67,7 @@ func ConvertManifest(ctx context.Context, store content.Store, desc ocispec.Desc manifest.Config.MediaType = images.MediaTypeDockerSchema2Config data, err := json.MarshalIndent(manifest, "", " ") if err != nil { - return ocispec.Descriptor{}, errors.Wrap(err, "failed to marshal manifest") + return ocispec.Descriptor{}, fmt.Errorf("failed to marshal manifest: %w", err) } // update manifest with gc labels @@ -82,7 +81,7 @@ func ConvertManifest(ctx context.Context, store content.Store, desc ocispec.Desc ref := remotes.MakeRefKey(ctx, desc) if err := content.WriteBlob(ctx, store, ref, bytes.NewReader(data), desc, content.WithLabels(labels)); err != nil { - return ocispec.Descriptor{}, errors.Wrap(err, "failed to update content") + return ocispec.Descriptor{}, fmt.Errorf("failed to update content: %w", err) } return desc, nil } diff --git a/remotes/docker/fetcher.go b/remotes/docker/fetcher.go index 31928463fb32b..11a75356e804e 100644 --- a/remotes/docker/fetcher.go +++ b/remotes/docker/fetcher.go @@ -19,6 +19,7 @@ package docker import ( "context" "encoding/json" + "errors" "fmt" "io" "net/http" @@ -29,7 +30,6 @@ import ( "github.com/containerd/containerd/images" "github.com/containerd/containerd/log" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" ) type dockerFetcher struct { @@ -41,7 +41,7 @@ func (r dockerFetcher) Fetch(ctx context.Context, desc ocispec.Descriptor) (io.R hosts := r.filterHosts(HostCapabilityPull) if len(hosts) == 0 { - return nil, errors.Wrap(errdefs.ErrNotFound, "no pull hosts") + return nil, fmt.Errorf("no pull hosts: %w", errdefs.ErrNotFound) } ctx, err := ContextWithRepositoryScope(ctx, r.refspec, false) @@ -141,9 +141,9 @@ func (r dockerFetcher) Fetch(ctx context.Context, desc ocispec.Descriptor) (io.R } if errdefs.IsNotFound(firstErr) { - firstErr = errors.Wrapf(errdefs.ErrNotFound, - "could not fetch content descriptor %v (%v) from remote", - desc.Digest, desc.MediaType) + firstErr = fmt.Errorf("could not fetch content descriptor %v (%v) from remote: %w", + desc.Digest, desc.MediaType, errdefs.ErrNotFound, + ) } return nil, firstErr @@ -178,19 +178,19 @@ func (r dockerFetcher) open(ctx context.Context, req *request, mediatype string, // implementation. if resp.StatusCode == http.StatusNotFound { - return nil, errors.Wrapf(errdefs.ErrNotFound, "content at %v not found", req.String()) + return nil, fmt.Errorf("content at %v not found: %w", req.String(), errdefs.ErrNotFound) } var registryErr Errors if err := json.NewDecoder(resp.Body).Decode(®istryErr); err != nil || registryErr.Len() < 1 { - return nil, errors.Errorf("unexpected status code %v: %v", req.String(), resp.Status) + return nil, fmt.Errorf("unexpected status code %v: %v", req.String(), resp.Status) } - return nil, errors.Errorf("unexpected status code %v: %s - Server message: %s", req.String(), resp.Status, registryErr.Error()) + return nil, fmt.Errorf("unexpected status code %v: %s - Server message: %s", req.String(), resp.Status, registryErr.Error()) } if offset > 0 { cr := resp.Header.Get("content-range") if cr != "" { if !strings.HasPrefix(cr, fmt.Sprintf("bytes %d-", offset)) { - return nil, errors.Errorf("unhandled content range in response: %v", cr) + return nil, fmt.Errorf("unhandled content range in response: %v", cr) } } else { @@ -202,7 +202,7 @@ func (r dockerFetcher) open(ctx context.Context, req *request, mediatype string, // Could use buffer pool here but this case should be rare n, err := io.Copy(io.Discard, io.LimitReader(resp.Body, offset)) if err != nil { - return nil, errors.Wrap(err, "failed to discard to offset") + return nil, fmt.Errorf("failed to discard to offset: %w", err) } if n != offset { return nil, errors.New("unable to discard to offset") diff --git a/remotes/docker/fetcher_test.go b/remotes/docker/fetcher_test.go index 3805b5f682401..47cbb6fb3479a 100644 --- a/remotes/docker/fetcher_test.go +++ b/remotes/docker/fetcher_test.go @@ -27,7 +27,6 @@ import ( "net/url" "testing" - "github.com/pkg/errors" "gotest.tools/v3/assert" ) @@ -200,9 +199,9 @@ func TestDockerFetcherOpen(t *testing.T) { if tt.wantErr { var expectedError error if tt.wantServerMessageError { - expectedError = errors.Errorf("unexpected status code %v/ns: %v %s - Server message: %s", s.URL, tt.mockedStatus, http.StatusText(tt.mockedStatus), tt.mockedErr.Error()) + expectedError = fmt.Errorf("unexpected status code %v/ns: %v %s - Server message: %s", s.URL, tt.mockedStatus, http.StatusText(tt.mockedStatus), tt.mockedErr.Error()) } else if tt.wantPlainError { - expectedError = errors.Errorf("unexpected status code %v/ns: %v %s", s.URL, tt.mockedStatus, http.StatusText(tt.mockedStatus)) + expectedError = fmt.Errorf("unexpected status code %v/ns: %v %s", s.URL, tt.mockedStatus, http.StatusText(tt.mockedStatus)) } assert.Equal(t, expectedError.Error(), err.Error()) diff --git a/remotes/docker/httpreadseeker.go b/remotes/docker/httpreadseeker.go index ecb66836c564a..9a827ef04c254 100644 --- a/remotes/docker/httpreadseeker.go +++ b/remotes/docker/httpreadseeker.go @@ -18,11 +18,11 @@ package docker import ( "bytes" + "fmt" "io" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/log" - "github.com/pkg/errors" ) const maxRetry = 3 @@ -94,7 +94,7 @@ func (hrs *httpReadSeeker) Close() error { func (hrs *httpReadSeeker) Seek(offset int64, whence int) (int64, error) { if hrs.closed { - return 0, errors.Wrap(errdefs.ErrUnavailable, "Fetcher.Seek: closed") + return 0, fmt.Errorf("Fetcher.Seek: closed: %w", errdefs.ErrUnavailable) } abs := hrs.offset @@ -105,15 +105,15 @@ func (hrs *httpReadSeeker) Seek(offset int64, whence int) (int64, error) { abs += offset case io.SeekEnd: if hrs.size == -1 { - return 0, errors.Wrap(errdefs.ErrUnavailable, "Fetcher.Seek: unknown size, cannot seek from end") + return 0, fmt.Errorf("Fetcher.Seek: unknown size, cannot seek from end: %w", errdefs.ErrUnavailable) } abs = hrs.size + offset default: - return 0, errors.Wrap(errdefs.ErrInvalidArgument, "Fetcher.Seek: invalid whence") + return 0, fmt.Errorf("Fetcher.Seek: invalid whence: %w", errdefs.ErrInvalidArgument) } if abs < 0 { - return 0, errors.Wrapf(errdefs.ErrInvalidArgument, "Fetcher.Seek: negative offset") + return 0, fmt.Errorf("Fetcher.Seek: negative offset: %w", errdefs.ErrInvalidArgument) } if abs != hrs.offset { @@ -140,12 +140,12 @@ func (hrs *httpReadSeeker) reader() (io.Reader, error) { // only try to reopen the body request if we are seeking to a value // less than the actual size. if hrs.open == nil { - return nil, errors.Wrapf(errdefs.ErrNotImplemented, "cannot open") + return nil, fmt.Errorf("cannot open: %w", errdefs.ErrNotImplemented) } rc, err := hrs.open(hrs.offset) if err != nil { - return nil, errors.Wrapf(err, "httpReadSeeker: failed open") + return nil, fmt.Errorf("httpReadSeeker: failed open: %w", err) } if hrs.rc != nil { diff --git a/remotes/docker/pusher.go b/remotes/docker/pusher.go index 593aa5d933fa8..c786ad2158986 100644 --- a/remotes/docker/pusher.go +++ b/remotes/docker/pusher.go @@ -18,6 +18,8 @@ package docker import ( "context" + "errors" + "fmt" "io" "net/http" "net/url" @@ -32,7 +34,6 @@ import ( remoteserrors "github.com/containerd/containerd/remotes/errors" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" ) type dockerPusher struct { @@ -55,7 +56,7 @@ func (p dockerPusher) Writer(ctx context.Context, opts ...content.WriterOpt) (co } } if wOpts.Ref == "" { - return nil, errors.Wrap(errdefs.ErrInvalidArgument, "ref must not be empty") + return nil, fmt.Errorf("ref must not be empty: %w", errdefs.ErrInvalidArgument) } return p.push(ctx, wOpts.Desc, wOpts.Ref, true) } @@ -76,22 +77,22 @@ func (p dockerPusher) push(ctx context.Context, desc ocispec.Descriptor, ref str status, err := p.tracker.GetStatus(ref) if err == nil { if status.Committed && status.Offset == status.Total { - return nil, errors.Wrapf(errdefs.ErrAlreadyExists, "ref %v", ref) + return nil, fmt.Errorf("ref %v: %w", ref, errdefs.ErrAlreadyExists) } - if unavailableOnFail { + if unavailableOnFail && status.ErrClosed == nil { // Another push of this ref is happening elsewhere. The rest of function // will continue only when `errdefs.IsNotFound(err) == true` (i.e. there // is no actively-tracked ref already). - return nil, errors.Wrap(errdefs.ErrUnavailable, "push is on-going") + return nil, fmt.Errorf("push is on-going: %w", errdefs.ErrUnavailable) } // TODO: Handle incomplete status } else if !errdefs.IsNotFound(err) { - return nil, errors.Wrap(err, "failed to get status") + return nil, fmt.Errorf("failed to get status: %w", err) } hosts := p.filterHosts(HostCapabilityPush) if len(hosts) == 0 { - return nil, errors.Wrap(errdefs.ErrNotFound, "no push hosts") + return nil, fmt.Errorf("no push hosts: %w", errdefs.ErrNotFound) } var ( @@ -143,7 +144,7 @@ func (p dockerPusher) push(ctx context.Context, desc ocispec.Descriptor, ref str }, }) resp.Body.Close() - return nil, errors.Wrapf(errdefs.ErrAlreadyExists, "content %v on remote", desc.Digest) + return nil, fmt.Errorf("content %v on remote: %w", desc.Digest, errdefs.ErrAlreadyExists) } } else if resp.StatusCode != http.StatusNotFound { err := remoteserrors.NewUnexpectedStatusErr(resp) @@ -205,7 +206,7 @@ func (p dockerPusher) push(ctx context.Context, desc ocispec.Descriptor, ref str Offset: desc.Size, }, }) - return nil, errors.Wrapf(errdefs.ErrAlreadyExists, "content %v on remote", desc.Digest) + return nil, fmt.Errorf("content %v on remote: %w", desc.Digest, errdefs.ErrAlreadyExists) default: err := remoteserrors.NewUnexpectedStatusErr(resp) log.G(ctx).WithField("resp", resp).WithField("body", string(err.(remoteserrors.ErrUnexpectedStatus).Body)).Debug("unexpected response") @@ -221,7 +222,7 @@ func (p dockerPusher) push(ctx context.Context, desc ocispec.Descriptor, ref str if strings.HasPrefix(location, "/") { lurl, err = url.Parse(lhost.Scheme + "://" + lhost.Host + location) if err != nil { - return nil, errors.Wrapf(err, "unable to parse location %v", location) + return nil, fmt.Errorf("unable to parse location %v: %w", location, err) } } else { if !strings.Contains(location, "://") { @@ -229,7 +230,7 @@ func (p dockerPusher) push(ctx context.Context, desc ocispec.Descriptor, ref str } lurl, err = url.Parse(location) if err != nil { - return nil, errors.Wrapf(err, "unable to parse location %v", location) + return nil, fmt.Errorf("unable to parse location %v: %w", location, err) } if lurl.Host != lhost.Host || lhost.Scheme != lurl.Scheme { @@ -354,6 +355,12 @@ func (pw *pushWriter) Write(p []byte) (n int, err error) { } func (pw *pushWriter) Close() error { + status, err := pw.tracker.GetStatus(pw.ref) + if err == nil && !status.Committed { + // Closing an incomplete writer. Record this as an error so that following write can retry it. + status.ErrClosed = errors.New("closed incomplete writer") + pw.tracker.SetStatus(pw.ref, status) + } return pw.pipe.Close() } @@ -374,7 +381,7 @@ func (pw *pushWriter) Digest() digest.Digest { func (pw *pushWriter) Commit(ctx context.Context, size int64, expected digest.Digest, opts ...content.Opt) error { // Check whether read has already thrown an error if _, err := pw.pipe.Write([]byte{}); err != nil && err != io.ErrClosedPipe { - return errors.Wrap(err, "pipe error before commit") + return fmt.Errorf("pipe error before commit: %w", err) } if err := pw.pipe.Close(); err != nil { @@ -397,11 +404,11 @@ func (pw *pushWriter) Commit(ctx context.Context, size int64, expected digest.Di status, err := pw.tracker.GetStatus(pw.ref) if err != nil { - return errors.Wrap(err, "failed to get status") + return fmt.Errorf("failed to get status: %w", err) } if size > 0 && size != status.Offset { - return errors.Errorf("unexpected size %d, expected %d", status.Offset, size) + return fmt.Errorf("unexpected size %d, expected %d", status.Offset, size) } if expected == "" { @@ -410,11 +417,11 @@ func (pw *pushWriter) Commit(ctx context.Context, size int64, expected digest.Di actual, err := digest.Parse(resp.Header.Get("Docker-Content-Digest")) if err != nil { - return errors.Wrap(err, "invalid content digest in response") + return fmt.Errorf("invalid content digest in response: %w", err) } if actual != expected { - return errors.Errorf("got digest %s, expected %s", actual, expected) + return fmt.Errorf("got digest %s, expected %s", actual, expected) } status.Committed = true diff --git a/remotes/docker/pusher_test.go b/remotes/docker/pusher_test.go index 8b81eb3b235be..2dfe9a8d4731b 100644 --- a/remotes/docker/pusher_test.go +++ b/remotes/docker/pusher_test.go @@ -17,10 +17,20 @@ package docker import ( + "context" + "fmt" + "io" + "net/http" + "net/http/httptest" + "net/url" "reflect" + "regexp" + "strings" "testing" + "github.com/containerd/containerd/content" digest "github.com/opencontainers/go-digest" + ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) func TestGetManifestPath(t *testing.T) { @@ -50,3 +60,104 @@ func TestGetManifestPath(t *testing.T) { } } } + +// TestPusherErrClosedRetry tests if retrying work when error occurred on close. +func TestPusherErrClosedRetry(t *testing.T) { + ctx := context.Background() + + p, reg, done := samplePusher(t) + defer done() + + layerContent := []byte("test") + reg.uploadable = false + if err := tryUpload(ctx, t, p, layerContent); err == nil { + t.Errorf("upload should fail but succeeded") + } + + // retry + reg.uploadable = true + if err := tryUpload(ctx, t, p, layerContent); err != nil { + t.Errorf("upload should succeed but got %v", err) + } +} + +func tryUpload(ctx context.Context, t *testing.T, p dockerPusher, layerContent []byte) error { + desc := ocispec.Descriptor{ + MediaType: ocispec.MediaTypeImageLayerGzip, + Digest: digest.FromBytes(layerContent), + Size: int64(len(layerContent)), + } + cw, err := p.Writer(ctx, content.WithRef("test-1"), content.WithDescriptor(desc)) + if err != nil { + return err + } + defer cw.Close() + if _, err := cw.Write(layerContent); err != nil { + return err + } + return cw.Commit(ctx, 0, "") +} + +func samplePusher(t *testing.T) (dockerPusher, *uploadableMockRegistry, func()) { + reg := &uploadableMockRegistry{} + s := httptest.NewServer(reg) + u, err := url.Parse(s.URL) + if err != nil { + t.Fatal(err) + } + return dockerPusher{ + dockerBase: &dockerBase{ + repository: "sample", + hosts: []RegistryHost{ + { + Client: s.Client(), + Host: u.Host, + Scheme: u.Scheme, + Path: u.Path, + Capabilities: HostCapabilityPush | HostCapabilityResolve, + }, + }, + }, + object: "sample", + tracker: NewInMemoryTracker(), + }, reg, s.Close +} + +var manifestRegexp = regexp.MustCompile(`/([a-z0-9]+)/manifests/(.*)`) +var blobUploadRegexp = regexp.MustCompile(`/([a-z0-9]+)/blobs/uploads/`) + +// uploadableMockRegistry provides minimal registry APIs which are enough to serve requests from dockerPusher. +type uploadableMockRegistry struct { + uploadable bool +} + +func (u *uploadableMockRegistry) ServeHTTP(w http.ResponseWriter, r *http.Request) { + if r.Method == "POST" { + if matches := blobUploadRegexp.FindStringSubmatch(r.URL.Path); len(matches) != 0 { + if u.uploadable { + w.Header().Set("Location", "/upload") + } else { + w.Header().Set("Location", "/cannotupload") + } + w.WriteHeader(202) + return + } + } else if r.Method == "PUT" { + mfstMatches := manifestRegexp.FindStringSubmatch(r.URL.Path) + if len(mfstMatches) != 0 || strings.HasPrefix(r.URL.Path, "/upload") { + dgstr := digest.Canonical.Digester() + if _, err := io.Copy(dgstr.Hash(), r.Body); err != nil { + w.WriteHeader(500) + return + } + w.Header().Set("Docker-Content-Digest", dgstr.Digest().String()) + w.WriteHeader(201) + return + } else if r.URL.Path == "/cannotupload" { + w.WriteHeader(500) + return + } + } + fmt.Println(r) + w.WriteHeader(404) +} diff --git a/remotes/docker/registry.go b/remotes/docker/registry.go index 1e77d4c86cd3d..98cafcd069e6f 100644 --- a/remotes/docker/registry.go +++ b/remotes/docker/registry.go @@ -17,10 +17,9 @@ package docker import ( + "errors" "net" "net/http" - - "github.com/pkg/errors" ) // HostCapabilities represent the capabilities of the registry diff --git a/remotes/docker/resolver.go b/remotes/docker/resolver.go index 4af1d19db8295..9bbbc262220b7 100644 --- a/remotes/docker/resolver.go +++ b/remotes/docker/resolver.go @@ -18,6 +18,7 @@ package docker import ( "context" + "errors" "fmt" "io" "net/http" @@ -34,7 +35,6 @@ import ( "github.com/containerd/containerd/version" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" "github.com/sirupsen/logrus" "golang.org/x/net/context/ctxhttp" ) @@ -254,7 +254,7 @@ func (r *dockerResolver) Resolve(ctx context.Context, ref string) (string, ocisp hosts := base.filterHosts(caps) if len(hosts) == 0 { - return "", ocispec.Descriptor{}, errors.Wrap(errdefs.ErrNotFound, "no resolve hosts") + return "", ocispec.Descriptor{}, fmt.Errorf("no resolve hosts: %w", errdefs.ErrNotFound) } ctx, err = ContextWithRepositoryScope(ctx, refspec, false) @@ -279,7 +279,7 @@ func (r *dockerResolver) Resolve(ctx context.Context, ref string) (string, ocisp resp, err := req.doWithRetries(ctx, nil) if err != nil { if errors.Is(err, ErrInvalidAuthorization) { - err = errors.Wrapf(err, "pull access denied, repository does not exist or may require authorization") + err = fmt.Errorf("pull access denied, repository does not exist or may require authorization: %w", err) } // Store the error for referencing later if firstErr == nil { @@ -298,11 +298,11 @@ func (r *dockerResolver) Resolve(ctx context.Context, ref string) (string, ocisp if resp.StatusCode > 399 { // Set firstErr when encountering the first non-404 status code. if firstErr == nil { - firstErr = errors.Errorf("pulling from host %s failed with status code %v: %v", host.Host, u, resp.Status) + firstErr = fmt.Errorf("pulling from host %s failed with status code %v: %v", host.Host, u, resp.Status) } continue // try another host } - return "", ocispec.Descriptor{}, errors.Errorf("pulling from host %s failed with unexpected status code %v: %v", host.Host, u, resp.Status) + return "", ocispec.Descriptor{}, fmt.Errorf("pulling from host %s failed with unexpected status code %v: %v", host.Host, u, resp.Status) } size := resp.ContentLength contentType := getManifestMediaType(resp) @@ -318,7 +318,7 @@ func (r *dockerResolver) Resolve(ctx context.Context, ref string) (string, ocisp if dgstHeader != "" && size != -1 { if err := dgstHeader.Validate(); err != nil { - return "", ocispec.Descriptor{}, errors.Wrapf(err, "%q in header not a valid digest", dgstHeader) + return "", ocispec.Descriptor{}, fmt.Errorf("%q in header not a valid digest: %w", dgstHeader, err) } dgst = dgstHeader } @@ -366,7 +366,7 @@ func (r *dockerResolver) Resolve(ctx context.Context, ref string) (string, ocisp // Prevent resolving to excessively large manifests if size > MaxManifestSize { if firstErr == nil { - firstErr = errors.Wrapf(errdefs.ErrNotFound, "rejecting %d byte manifest for %s", size, ref) + firstErr = fmt.Errorf("rejecting %d byte manifest for %s: %w", size, ref, errdefs.ErrNotFound) } continue } @@ -387,7 +387,7 @@ func (r *dockerResolver) Resolve(ctx context.Context, ref string) (string, ocisp // means that either no registries were given or each registry returned 404. if firstErr == nil { - firstErr = errors.Wrap(errdefs.ErrNotFound, ref) + firstErr = fmt.Errorf("%s: %w", ref, errdefs.ErrNotFound) } return "", ocispec.Descriptor{}, firstErr @@ -547,7 +547,7 @@ func (r *request) do(ctx context.Context) (*http.Response, error) { ctx = log.WithLogger(ctx, log.G(ctx).WithField("url", u)) log.G(ctx).WithFields(requestFields(req)).Debug("do request") if err := r.authorize(ctx, req); err != nil { - return nil, errors.Wrap(err, "failed to authorize") + return nil, fmt.Errorf("failed to authorize: %w", err) } var client = &http.Client{} @@ -559,13 +559,16 @@ func (r *request) do(ctx context.Context) (*http.Response, error) { if len(via) >= 10 { return errors.New("stopped after 10 redirects") } - return errors.Wrap(r.authorize(ctx, req), "failed to authorize redirect") + if err := r.authorize(ctx, req); err != nil { + return fmt.Errorf("failed to authorize redirect: %w", err) + } + return nil } } resp, err := ctxhttp.Do(ctx, client, req) if err != nil { - return nil, errors.Wrap(err, "failed to do request") + return nil, fmt.Errorf("failed to do request: %w", err) } log.G(ctx).WithFields(responseFields(resp)).Debug("fetch response received") return resp, nil diff --git a/remotes/docker/resolver_test.go b/remotes/docker/resolver_test.go index e73ba73b1897a..131c5072f0a62 100644 --- a/remotes/docker/resolver_test.go +++ b/remotes/docker/resolver_test.go @@ -21,6 +21,7 @@ import ( "crypto/tls" "crypto/x509" "encoding/json" + "errors" "fmt" "io" "net/http" @@ -35,7 +36,6 @@ import ( 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" ) func TestHTTPResolver(t *testing.T) { @@ -588,7 +588,7 @@ func testFetch(ctx context.Context, f remotes.Fetcher, desc ocispec.Descriptor) dgstr := desc.Digest.Algorithm().Digester() io.Copy(dgstr.Hash(), r) if dgstr.Digest() != desc.Digest { - return errors.Errorf("content mismatch: %s != %s", dgstr.Digest(), desc.Digest) + return fmt.Errorf("content mismatch: %s != %s", dgstr.Digest(), desc.Digest) } return nil @@ -597,14 +597,14 @@ func testFetch(ctx context.Context, f remotes.Fetcher, desc ocispec.Descriptor) func testocimanifest(ctx context.Context, f remotes.Fetcher, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { r, err := f.Fetch(ctx, desc) if err != nil { - return nil, errors.Wrapf(err, "failed to fetch %s", desc.Digest) + return nil, fmt.Errorf("failed to fetch %s: %w", desc.Digest, err) } p, err := io.ReadAll(r) if err != nil { return nil, err } if dgst := desc.Digest.Algorithm().FromBytes(p); dgst != desc.Digest { - return nil, errors.Errorf("digest mismatch: %s != %s", dgst, desc.Digest) + return nil, fmt.Errorf("digest mismatch: %s != %s", dgst, desc.Digest) } var manifest ocispec.Manifest diff --git a/remotes/docker/schema1/converter.go b/remotes/docker/schema1/converter.go index e72e6a88d6559..efa4e8d6eeb3f 100644 --- a/remotes/docker/schema1/converter.go +++ b/remotes/docker/schema1/converter.go @@ -21,6 +21,7 @@ import ( "context" "encoding/base64" "encoding/json" + "errors" "fmt" "io" "strconv" @@ -28,8 +29,6 @@ import ( "sync" "time" - "golang.org/x/sync/errgroup" - "github.com/containerd/containerd/archive/compression" "github.com/containerd/containerd/content" "github.com/containerd/containerd/errdefs" @@ -39,7 +38,7 @@ import ( 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" + "golang.org/x/sync/errgroup" ) const ( @@ -158,12 +157,12 @@ func (c *Converter) Convert(ctx context.Context, opts ...ConvertOpt) (ocispec.De history, diffIDs, err := c.schema1ManifestHistory() if err != nil { - return ocispec.Descriptor{}, errors.Wrap(err, "schema 1 conversion failed") + return ocispec.Descriptor{}, fmt.Errorf("schema 1 conversion failed: %w", err) } var img ocispec.Image if err := json.Unmarshal([]byte(c.pulledManifest.History[0].V1Compatibility), &img); err != nil { - return ocispec.Descriptor{}, errors.Wrap(err, "failed to unmarshal image from schema 1 history") + return ocispec.Descriptor{}, fmt.Errorf("failed to unmarshal image from schema 1 history: %w", err) } img.History = history @@ -174,7 +173,7 @@ func (c *Converter) Convert(ctx context.Context, opts ...ConvertOpt) (ocispec.De b, err := json.MarshalIndent(img, "", " ") if err != nil { - return ocispec.Descriptor{}, errors.Wrap(err, "failed to marshal image") + return ocispec.Descriptor{}, fmt.Errorf("failed to marshal image: %w", err) } config := ocispec.Descriptor{ @@ -198,7 +197,7 @@ func (c *Converter) Convert(ctx context.Context, opts ...ConvertOpt) (ocispec.De mb, err := json.MarshalIndent(manifest, "", " ") if err != nil { - return ocispec.Descriptor{}, errors.Wrap(err, "failed to marshal image") + return ocispec.Descriptor{}, fmt.Errorf("failed to marshal image: %w", err) } desc := ocispec.Descriptor{ @@ -215,12 +214,12 @@ func (c *Converter) Convert(ctx context.Context, opts ...ConvertOpt) (ocispec.De ref := remotes.MakeRefKey(ctx, desc) if err := content.WriteBlob(ctx, c.contentStore, ref, bytes.NewReader(mb), desc, content.WithLabels(labels)); err != nil { - return ocispec.Descriptor{}, errors.Wrap(err, "failed to write image manifest") + return ocispec.Descriptor{}, fmt.Errorf("failed to write image manifest: %w", err) } ref = remotes.MakeRefKey(ctx, config) if err := content.WriteBlob(ctx, c.contentStore, ref, bytes.NewReader(b), config); err != nil { - return ocispec.Descriptor{}, errors.Wrap(err, "failed to write image config") + return ocispec.Descriptor{}, fmt.Errorf("failed to write image config: %w", err) } return desc, nil @@ -349,7 +348,7 @@ func (c *Converter) fetchBlob(ctx context.Context, desc ocispec.Descriptor) erro if desc.Size == -1 { info, err := c.contentStore.Info(ctx, desc.Digest) if err != nil { - return errors.Wrap(err, "failed to get blob info") + return fmt.Errorf("failed to get blob info: %w", err) } desc.Size = info.Size } @@ -370,7 +369,7 @@ func (c *Converter) fetchBlob(ctx context.Context, desc ocispec.Descriptor) erro } if _, err := c.contentStore.Update(ctx, cinfo, "labels.containerd.io/uncompressed", fmt.Sprintf("labels.%s", labelDockerSchema1EmptyLayer)); err != nil { - return errors.Wrap(err, "failed to update uncompressed label") + return fmt.Errorf("failed to update uncompressed label: %w", err) } c.mu.Lock() @@ -384,7 +383,7 @@ func (c *Converter) fetchBlob(ctx context.Context, desc ocispec.Descriptor) erro func (c *Converter) reuseLabelBlobState(ctx context.Context, desc ocispec.Descriptor) (bool, error) { cinfo, err := c.contentStore.Info(ctx, desc.Digest) if err != nil { - return false, errors.Wrap(err, "failed to get blob info") + return false, fmt.Errorf("failed to get blob info: %w", err) } desc.Size = cinfo.Size @@ -441,7 +440,7 @@ func (c *Converter) schema1ManifestHistory() ([]ocispec.History, []digest.Digest for i := range m.History { var h v1History if err := json.Unmarshal([]byte(m.History[i].V1Compatibility), &h); err != nil { - return nil, nil, errors.Wrap(err, "failed to unmarshal history") + return nil, nil, fmt.Errorf("failed to unmarshal history: %w", err) } blobSum := m.FSLayers[i].BlobSum @@ -553,7 +552,7 @@ func stripSignature(b []byte) ([]byte, error) { } pb, err := joseBase64UrlDecode(sig.Signatures[0].Protected) if err != nil { - return nil, errors.Wrapf(err, "could not decode %s", sig.Signatures[0].Protected) + return nil, fmt.Errorf("could not decode %s: %w", sig.Signatures[0].Protected, err) } var protected protectedBlock @@ -567,7 +566,7 @@ func stripSignature(b []byte) ([]byte, error) { tail, err := joseBase64UrlDecode(protected.Tail) if err != nil { - return nil, errors.Wrap(err, "invalid tail base 64 value") + return nil, fmt.Errorf("invalid tail base 64 value: %w", err) } return append(b[:protected.Length], tail...), nil diff --git a/remotes/docker/scope.go b/remotes/docker/scope.go index fe57f023d35a6..95b4810ab93e5 100644 --- a/remotes/docker/scope.go +++ b/remotes/docker/scope.go @@ -74,7 +74,7 @@ func ContextWithAppendPullRepositoryScope(ctx context.Context, repo string) cont // GetTokenScopes returns deduplicated and sorted scopes from ctx.Value(tokenScopesKey{}) and common scopes. func GetTokenScopes(ctx context.Context, common []string) []string { - var scopes []string + scopes := []string{} if x := ctx.Value(tokenScopesKey{}); x != nil { scopes = append(scopes, x.([]string)...) } @@ -82,6 +82,10 @@ func GetTokenScopes(ctx context.Context, common []string) []string { scopes = append(scopes, common...) sort.Strings(scopes) + if len(scopes) == 0 { + return scopes + } + l := 0 for idx := 1; idx < len(scopes); idx++ { // Note: this comparison is unaware of the scope grammar (https://docs.docker.com/registry/spec/auth/scope/) diff --git a/remotes/docker/scope_test.go b/remotes/docker/scope_test.go index a1229787eda0a..42e9f7c13c6a2 100644 --- a/remotes/docker/scope_test.go +++ b/remotes/docker/scope_test.go @@ -63,6 +63,11 @@ func TestGetTokenScopes(t *testing.T) { commonScopes []string expected []string }{ + { + scopesInCtx: []string{}, + commonScopes: []string{}, + expected: []string{}, + }, { scopesInCtx: []string{}, commonScopes: []string{"repository:foo/bar:pull"}, diff --git a/remotes/docker/status.go b/remotes/docker/status.go index 9751edac7f99e..1f7b278aefe3d 100644 --- a/remotes/docker/status.go +++ b/remotes/docker/status.go @@ -17,12 +17,12 @@ package docker import ( + "fmt" "sync" "github.com/containerd/containerd/content" "github.com/containerd/containerd/errdefs" "github.com/moby/locker" - "github.com/pkg/errors" ) // Status of a content operation @@ -31,6 +31,9 @@ type Status struct { Committed bool + // ErrClosed contains error encountered on close. + ErrClosed error + // UploadUUID is used by the Docker registry to reference blob uploads UploadUUID string } @@ -67,7 +70,7 @@ func (t *memoryStatusTracker) GetStatus(ref string) (Status, error) { defer t.m.Unlock() status, ok := t.statuses[ref] if !ok { - return Status{}, errors.Wrapf(errdefs.ErrNotFound, "status for ref %v", ref) + return Status{}, fmt.Errorf("status for ref %v: %w", ref, errdefs.ErrNotFound) } return status, nil } diff --git a/remotes/handlers.go b/remotes/handlers.go index 8f79c608e68ce..8bcafb22a078a 100644 --- a/remotes/handlers.go +++ b/remotes/handlers.go @@ -18,6 +18,7 @@ package remotes import ( "context" + "errors" "fmt" "io" "strings" @@ -29,7 +30,6 @@ import ( "github.com/containerd/containerd/log" "github.com/containerd/containerd/platforms" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" "github.com/sirupsen/logrus" "golang.org/x/sync/semaphore" ) @@ -127,13 +127,13 @@ func fetch(ctx context.Context, ingester content.Ingester, fetcher Fetcher, desc // most likely a poorly configured registry/web front end which responded with no // Content-Length header; unable (not to mention useless) to commit a 0-length entry // into the content store. Error out here otherwise the error sent back is confusing - return errors.Wrapf(errdefs.ErrInvalidArgument, "unable to fetch descriptor (%s) which reports content size of zero", desc.Digest) + return fmt.Errorf("unable to fetch descriptor (%s) which reports content size of zero: %w", desc.Digest, errdefs.ErrInvalidArgument) } if ws.Offset == desc.Size { // If writer is already complete, commit and return err := cw.Commit(ctx, desc.Size, desc.Digest) if err != nil && !errdefs.IsAlreadyExists(err) { - return errors.Wrapf(err, "failed commit on ref %q", ws.Ref) + return fmt.Errorf("failed commit on ref %q: %w", ws.Ref, err) } return nil } @@ -243,8 +243,8 @@ func PushContent(ctx context.Context, pusher Pusher, desc ocispec.Descriptor, st // as a marker for this problem if (manifestStack[i].MediaType == ocispec.MediaTypeImageIndex || manifestStack[i].MediaType == images.MediaTypeDockerSchema2ManifestList) && - errors.Cause(err) != nil && strings.Contains(errors.Cause(err).Error(), "400 Bad Request") { - return errors.Wrap(err, "manifest list/index references to blobs and/or manifests are missing in your target registry") + errors.Unwrap(err) != nil && strings.Contains(errors.Unwrap(err).Error(), "400 Bad Request") { + return fmt.Errorf("manifest list/index references to blobs and/or manifests are missing in your target registry: %w", err) } return err } @@ -253,6 +253,43 @@ func PushContent(ctx context.Context, pusher Pusher, desc ocispec.Descriptor, st return nil } +// SkipNonDistributableBlobs returns a handler that skips blobs that have a media type that is "non-distributeable". +// An example of this kind of content would be a Windows base layer, which is not supposed to be redistributed. +// +// This is based on the media type of the content: +// - application/vnd.oci.image.layer.nondistributable +// - application/vnd.docker.image.rootfs.foreign +func SkipNonDistributableBlobs(f images.HandlerFunc) images.HandlerFunc { + return func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { + if images.IsNonDistributable(desc.MediaType) { + log.G(ctx).WithField("digest", desc.Digest).WithField("mediatype", desc.MediaType).Debug("Skipping non-distributable blob") + return nil, images.ErrSkipDesc + } + + if images.IsLayerType(desc.MediaType) { + return nil, nil + } + + children, err := f(ctx, desc) + if err != nil { + return nil, err + } + if len(children) == 0 { + return nil, nil + } + + out := make([]ocispec.Descriptor, 0, len(children)) + for _, child := range children { + if !images.IsNonDistributable(child.MediaType) { + out = append(out, child) + } else { + log.G(ctx).WithField("digest", child.Digest).WithField("mediatype", child.MediaType).Debug("Skipping non-distributable blob") + } + } + return out, nil + } +} + // FilterManifestByPlatformHandler allows Handler to handle non-target // platform's manifest and configuration data. func FilterManifestByPlatformHandler(f images.HandlerFunc, m platforms.Matcher) images.HandlerFunc { diff --git a/remotes/handlers_test.go b/remotes/handlers_test.go index 56db9837e8da7..c0446e1a52e6b 100644 --- a/remotes/handlers_test.go +++ b/remotes/handlers_test.go @@ -18,9 +18,15 @@ package remotes import ( "context" + _ "crypto/sha256" + "encoding/json" + "sync" "testing" + "github.com/containerd/containerd/content" + "github.com/containerd/containerd/content/local" "github.com/containerd/containerd/images" + "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) @@ -71,3 +77,141 @@ func TestContextCustomKeyPrefix(t *testing.T) { } }) } + +func TestSkipNonDistributableBlobs(t *testing.T) { + ctx := context.Background() + + out, err := SkipNonDistributableBlobs(images.HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { + return []ocispec.Descriptor{ + {MediaType: images.MediaTypeDockerSchema2Layer, Digest: "test:1"}, + {MediaType: images.MediaTypeDockerSchema2LayerForeign, Digest: "test:2"}, + {MediaType: images.MediaTypeDockerSchema2LayerForeignGzip, Digest: "test:3"}, + {MediaType: ocispec.MediaTypeImageLayerNonDistributable, Digest: "test:4"}, + {MediaType: ocispec.MediaTypeImageLayerNonDistributableGzip, Digest: "test:5"}, + {MediaType: ocispec.MediaTypeImageLayerNonDistributableZstd, Digest: "test:6"}, + }, nil + }))(ctx, ocispec.Descriptor{MediaType: images.MediaTypeDockerSchema2Manifest}) + if err != nil { + t.Fatal(err) + } + + if len(out) != 1 { + t.Fatalf("unexpected number of descriptors returned: %d", len(out)) + } + if out[0].Digest != "test:1" { + t.Fatalf("unexpected digest returned: %s", out[0].Digest) + } + + dir := t.TempDir() + cs, err := local.NewLabeledStore(dir, newMemoryLabelStore()) + if err != nil { + t.Fatal(err) + } + + write := func(i interface{}, ref string) digest.Digest { + t.Helper() + + data, err := json.Marshal(i) + if err != nil { + t.Fatal(err) + } + + w, err := cs.Writer(ctx, content.WithRef(ref)) + if err != nil { + t.Fatal(err) + } + defer w.Close() + + dgst := digest.SHA256.FromBytes(data) + + n, err := w.Write(data) + if err != nil { + t.Fatal(err) + } + + if err := w.Commit(ctx, int64(n), dgst); err != nil { + t.Fatal(err) + } + + return dgst + } + + configDigest := write(ocispec.ImageConfig{}, "config") + + manifest := ocispec.Manifest{ + Config: ocispec.Descriptor{Digest: configDigest, MediaType: ocispec.MediaTypeImageConfig}, + MediaType: ocispec.MediaTypeImageManifest, + Layers: []ocispec.Descriptor{ + {MediaType: images.MediaTypeDockerSchema2Layer, Digest: "test:1"}, + {MediaType: images.MediaTypeDockerSchema2LayerForeign, Digest: "test:2"}, + {MediaType: images.MediaTypeDockerSchema2LayerForeignGzip, Digest: "test:3"}, + {MediaType: ocispec.MediaTypeImageLayerNonDistributable, Digest: "test:4"}, + {MediaType: ocispec.MediaTypeImageLayerNonDistributableGzip, Digest: "test:5"}, + {MediaType: ocispec.MediaTypeImageLayerNonDistributableZstd, Digest: "test:6"}, + }, + } + + manifestDigest := write(manifest, "manifest") + + out, err = SkipNonDistributableBlobs(images.ChildrenHandler(cs))(ctx, ocispec.Descriptor{MediaType: manifest.MediaType, Digest: manifestDigest}) + if err != nil { + t.Fatal(err) + } + + if len(out) != 2 { + t.Fatalf("unexpected number of descriptors returned: %v", out) + } + + if out[0].Digest != configDigest { + t.Fatalf("unexpected digest returned: %v", out[0]) + } + if out[1].Digest != manifest.Layers[0].Digest { + t.Fatalf("unexpected digest returned: %v", out[1]) + } +} + +type memoryLabelStore struct { + l sync.Mutex + labels map[digest.Digest]map[string]string +} + +func newMemoryLabelStore() local.LabelStore { + return &memoryLabelStore{ + labels: map[digest.Digest]map[string]string{}, + } +} + +func (mls *memoryLabelStore) Get(d digest.Digest) (map[string]string, error) { + mls.l.Lock() + labels := mls.labels[d] + mls.l.Unlock() + + return labels, nil +} + +func (mls *memoryLabelStore) Set(d digest.Digest, labels map[string]string) error { + mls.l.Lock() + mls.labels[d] = labels + mls.l.Unlock() + + return nil +} + +func (mls *memoryLabelStore) Update(d digest.Digest, update map[string]string) (map[string]string, error) { + mls.l.Lock() + labels, ok := mls.labels[d] + if !ok { + labels = map[string]string{} + } + for k, v := range update { + if v == "" { + delete(labels, k) + } else { + labels[k] = v + } + } + mls.labels[d] = labels + mls.l.Unlock() + + return labels, nil +} diff --git a/rootfs/apply.go b/rootfs/apply.go index f1ca624bf98fc..b3f388e64126a 100644 --- a/rootfs/apply.go +++ b/rootfs/apply.go @@ -31,7 +31,6 @@ import ( "github.com/opencontainers/go-digest" "github.com/opencontainers/image-spec/identity" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" ) // Layer represents the descriptors for a layer diff. These descriptions @@ -68,7 +67,7 @@ func ApplyLayersWithOpts(ctx context.Context, layers []Layer, sn snapshots.Snaps _, err := sn.Stat(ctx, chainID.String()) if err != nil { if !errdefs.IsNotFound(err) { - return "", errors.Wrapf(err, "failed to stat snapshot %s", chainID) + return "", fmt.Errorf("failed to stat snapshot %s: %w", chainID, err) } if err := applyLayers(ctx, layers, chain, sn, a, nil, applyOpts); err != nil && !errdefs.IsAlreadyExists(err) { @@ -96,7 +95,7 @@ func ApplyLayerWithOpts(ctx context.Context, layer Layer, chain []digest.Digest, ) if _, err := sn.Stat(ctx, chainID); err != nil { if !errdefs.IsNotFound(err) { - return false, errors.Wrapf(err, "failed to stat snapshot %s", chainID) + return false, fmt.Errorf("failed to stat snapshot %s: %w", chainID, err) } if err := applyLayers(ctx, []Layer{layer}, append(chain, layer.Diff.Digest), sn, a, opts, applyOpts); err != nil { @@ -143,7 +142,7 @@ func applyLayers(ctx context.Context, layers []Layer, chain []digest.Digest, sn } // Already exists should have the caller retry - return errors.Wrapf(err, "failed to prepare extraction snapshot %q", key) + return fmt.Errorf("failed to prepare extraction snapshot %q: %w", key, err) } break @@ -162,16 +161,16 @@ func applyLayers(ctx context.Context, layers []Layer, chain []digest.Digest, sn diff, err = a.Apply(ctx, layer.Blob, mounts, applyOpts...) if err != nil { - err = errors.Wrapf(err, "failed to extract layer %s", layer.Diff.Digest) + err = fmt.Errorf("failed to extract layer %s: %w", layer.Diff.Digest, err) return err } if diff.Digest != layer.Diff.Digest { - err = errors.Errorf("wrong diff id calculated on extraction %q", diff.Digest) + err = fmt.Errorf("wrong diff id calculated on extraction %q", diff.Digest) return err } if err = sn.Commit(ctx, chainID.String(), key, opts...); err != nil { - err = errors.Wrapf(err, "failed to commit snapshot %s", key) + err = fmt.Errorf("failed to commit snapshot %s: %w", key, err) return err } diff --git a/rootfs/init.go b/rootfs/init.go index 92908fa1cc7f7..02d13bfc3675d 100644 --- a/rootfs/init.go +++ b/rootfs/init.go @@ -18,6 +18,7 @@ package rootfs import ( "context" + "errors" "fmt" "os" @@ -25,7 +26,6 @@ import ( "github.com/containerd/containerd/mount" "github.com/containerd/containerd/snapshots" digest "github.com/opencontainers/go-digest" - "github.com/pkg/errors" ) var ( diff --git a/runtime/restart/monitor/change.go b/runtime/restart/monitor/change.go index 7de6f67c3161e..a74b3dcd1a336 100644 --- a/runtime/restart/monitor/change.go +++ b/runtime/restart/monitor/change.go @@ -18,12 +18,12 @@ package monitor import ( "context" + "fmt" "net/url" "syscall" "github.com/containerd/containerd" "github.com/containerd/containerd/cio" - "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -49,7 +49,7 @@ func (s *startChange) apply(ctx context.Context, client *containerd.Client) erro if s.logURI != "" { uri, err := url.Parse(s.logURI) if err != nil { - return errors.Wrapf(err, "failed to parse %v into url", s.logURI) + return fmt.Errorf("failed to parse %v into url: %w", s.logURI, err) } log = cio.LogURI(uri) } else if s.logPath != "" { diff --git a/runtime/restart/monitor/monitor.go b/runtime/restart/monitor/monitor.go index 623fc6f2acd42..a504ad9f4bf7a 100644 --- a/runtime/restart/monitor/monitor.go +++ b/runtime/restart/monitor/monitor.go @@ -35,7 +35,6 @@ import ( "github.com/containerd/containerd/runtime/restart" "github.com/containerd/containerd/services" "github.com/containerd/containerd/snapshots" - "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -94,12 +93,12 @@ func init() { func getServicesOpts(ic *plugin.InitContext) ([]containerd.ServicesOpt, error) { plugins, err := ic.GetByType(plugin.ServicePlugin) if err != nil { - return nil, errors.Wrap(err, "failed to get service plugin") + return nil, fmt.Errorf("failed to get service plugin: %w", err) } ep, err := ic.Get(plugin.EventPlugin) if err != nil { - return nil, errors.Wrap(err, "failed to get event plugin") + return nil, fmt.Errorf("failed to get event plugin: %w", err) } opts := []containerd.ServicesOpt{ @@ -133,14 +132,14 @@ func getServicesOpts(ic *plugin.InitContext) ([]containerd.ServicesOpt, error) { } { p := plugins[s] if p == nil { - return nil, errors.Errorf("service %q not found", s) + return nil, fmt.Errorf("service %q not found", s) } i, err := p.Instance() if err != nil { - return nil, errors.Wrapf(err, "failed to get instance of service %q", s) + return nil, fmt.Errorf("failed to get instance of service %q: %w", s, err) } if i == nil { - return nil, errors.Errorf("instance of service %q not found", s) + return nil, fmt.Errorf("instance of service %q not found", s) } opts = append(opts, fn(i)) } diff --git a/runtime/task_list.go b/runtime/task_list.go index 5b969e5a58ac9..f24d689f114b7 100644 --- a/runtime/task_list.go +++ b/runtime/task_list.go @@ -18,10 +18,11 @@ package runtime import ( "context" + "errors" + "fmt" "sync" "github.com/containerd/containerd/namespaces" - "github.com/pkg/errors" ) var ( @@ -109,7 +110,7 @@ func (l *TaskList) AddWithNamespace(namespace string, t Task) error { l.tasks[namespace] = make(map[string]Task) } if _, ok := l.tasks[namespace][id]; ok { - return errors.Wrap(ErrTaskAlreadyExists, id) + return fmt.Errorf("%s: %w", id, ErrTaskAlreadyExists) } l.tasks[namespace][id] = t return nil diff --git a/runtime/v1/linux/bundle.go b/runtime/v1/linux/bundle.go index 9885d950121bb..b1830d00496e0 100644 --- a/runtime/v1/linux/bundle.go +++ b/runtime/v1/linux/bundle.go @@ -32,7 +32,6 @@ import ( "github.com/containerd/containerd/runtime/v1/shim" "github.com/containerd/containerd/runtime/v1/shim/client" "github.com/opencontainers/runtime-spec/specs-go" - "github.com/pkg/errors" ) // loadBundle loads an existing bundle from disk @@ -185,7 +184,7 @@ func (b *bundle) Delete() error { if err2 == nil { return err } - return errors.Wrapf(err, "Failed to remove both bundle and workdir locations: %v", err2) + return fmt.Errorf("Failed to remove both bundle and workdir locations: %v: %w", err2, err) } func (b *bundle) legacyShimAddress(namespace string) string { diff --git a/runtime/v1/linux/process.go b/runtime/v1/linux/process.go index cf01abe89244d..b7f9e0dc53b4e 100644 --- a/runtime/v1/linux/process.go +++ b/runtime/v1/linux/process.go @@ -21,6 +21,7 @@ package linux import ( "context" + "errors" eventstypes "github.com/containerd/containerd/api/events" "github.com/containerd/containerd/api/types/task" @@ -28,7 +29,6 @@ import ( "github.com/containerd/containerd/runtime" shim "github.com/containerd/containerd/runtime/v1/shim/v1" "github.com/containerd/ttrpc" - "github.com/pkg/errors" ) // Process implements a linux process diff --git a/runtime/v1/linux/runtime.go b/runtime/v1/linux/runtime.go index 4734fcdd8d142..b6d53820a859f 100644 --- a/runtime/v1/linux/runtime.go +++ b/runtime/v1/linux/runtime.go @@ -21,6 +21,7 @@ package linux import ( "context" + "errors" "fmt" "io" "os" @@ -48,7 +49,6 @@ import ( "github.com/containerd/typeurl" ptypes "github.com/gogo/protobuf/types" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) @@ -167,7 +167,7 @@ func (r *Runtime) Create(ctx context.Context, id string, opts runtime.CreateOpts } if err := identifiers.Validate(id); err != nil { - return nil, errors.Wrapf(err, "invalid task id") + return nil, fmt.Errorf("invalid task id: %w", err) } ropts, err := r.getRuncOptions(ctx, id) @@ -450,7 +450,7 @@ func (r *Runtime) cleanupAfterDeadShim(ctx context.Context, bundle *bundle, ns, ctx = namespaces.WithNamespace(ctx, ns) if err := r.terminate(ctx, bundle, ns, id); err != nil { if r.config.ShimDebug { - return errors.Wrap(err, "failed to terminate task, leaving bundle for debugging") + return fmt.Errorf("failed to terminate task, leaving bundle for debugging: %w", err) } log.G(ctx).WithError(err).Warn("failed to terminate task") } diff --git a/runtime/v1/linux/task.go b/runtime/v1/linux/task.go index 72dca64cacf77..3ac7839ff02b4 100644 --- a/runtime/v1/linux/task.go +++ b/runtime/v1/linux/task.go @@ -21,6 +21,8 @@ package linux import ( "context" + "errors" + "fmt" "sync" "github.com/containerd/cgroups" @@ -36,7 +38,6 @@ import ( "github.com/containerd/ttrpc" "github.com/containerd/typeurl" "github.com/gogo/protobuf/types" - "github.com/pkg/errors" ) // Task on a linux based system @@ -229,7 +230,7 @@ func (t *Task) Kill(ctx context.Context, signal uint32, all bool) error { // Exec creates a new process inside the task func (t *Task) Exec(ctx context.Context, id string, opts runtime.ExecOpts) (runtime.ExecProcess, error) { if err := identifiers.Validate(id); err != nil { - return nil, errors.Wrapf(err, "invalid exec id") + return nil, fmt.Errorf("invalid exec id: %w", err) } request := &shim.ExecProcessRequest{ ID: id, @@ -333,7 +334,7 @@ func (t *Task) Stats(ctx context.Context) (*types.Any, error) { t.mu.Lock() defer t.mu.Unlock() if t.cg == nil { - return nil, errors.Wrap(errdefs.ErrNotFound, "cgroup does not exist") + return nil, fmt.Errorf("cgroup does not exist: %w", errdefs.ErrNotFound) } stats, err := t.cg.Stat(cgroups.IgnoreNotExist) if err != nil { @@ -347,7 +348,7 @@ func (t *Task) Cgroup() (cgroups.Cgroup, error) { t.mu.Lock() defer t.mu.Unlock() if t.cg == nil { - return nil, errors.Wrap(errdefs.ErrNotFound, "cgroup does not exist") + return nil, fmt.Errorf("cgroup does not exist: %w", errdefs.ErrNotFound) } return t.cg, nil } diff --git a/runtime/v1/shim/client/client.go b/runtime/v1/shim/client/client.go index ac38c33fe996b..6e5eae5223816 100644 --- a/runtime/v1/shim/client/client.go +++ b/runtime/v1/shim/client/client.go @@ -21,6 +21,7 @@ package client import ( "context" + "errors" "fmt" "io" "net" @@ -40,7 +41,6 @@ import ( "github.com/containerd/containerd/sys" "github.com/containerd/ttrpc" ptypes "github.com/gogo/protobuf/types" - "github.com/pkg/errors" "github.com/sirupsen/logrus" exec "golang.org/x/sys/execabs" "golang.org/x/sys/unix" @@ -60,7 +60,7 @@ func WithStart(binary, address, daemonAddress, cgroup string, debug bool, exitHa return nil, nil, err } if err := RemoveSocket(address); err != nil { - return nil, nil, errors.Wrap(err, "remove already used socket") + return nil, nil, fmt.Errorf("remove already used socket: %w", err) } if socket, err = newSocket(address); err != nil { return nil, nil, err @@ -69,7 +69,7 @@ func WithStart(binary, address, daemonAddress, cgroup string, debug bool, exitHa f, err := socket.File() if err != nil { - return nil, nil, errors.Wrapf(err, "failed to get fd for socket %s", address) + return nil, nil, fmt.Errorf("failed to get fd for socket %s: %w", address, err) } defer f.Close() @@ -77,12 +77,12 @@ func WithStart(binary, address, daemonAddress, cgroup string, debug bool, exitHa stderrCopy := io.Discard stdoutLog, err := v1.OpenShimStdoutLog(ctx, config.WorkDir) if err != nil { - return nil, nil, errors.Wrapf(err, "failed to create stdout log") + return nil, nil, fmt.Errorf("failed to create stdout log: %w", err) } stderrLog, err := v1.OpenShimStderrLog(ctx, config.WorkDir) if err != nil { - return nil, nil, errors.Wrapf(err, "failed to create stderr log") + return nil, nil, fmt.Errorf("failed to create stderr log: %w", err) } if debug { stdoutCopy = os.Stdout @@ -97,7 +97,7 @@ func WithStart(binary, address, daemonAddress, cgroup string, debug bool, exitHa return nil, nil, err } if err := cmd.Start(); err != nil { - return nil, nil, errors.Wrapf(err, "failed to start shim") + return nil, nil, fmt.Errorf("failed to start shim: %w", err) } defer func() { if err != nil { @@ -143,14 +143,14 @@ func WithStart(binary, address, daemonAddress, cgroup string, debug bool, exitHa } c, clo, err := WithConnect(address, func() {})(ctx, config) if err != nil { - return nil, nil, errors.Wrap(err, "failed to connect") + return nil, nil, fmt.Errorf("failed to connect: %w", err) } return c, clo, nil } } func eaddrinuse(err error) bool { - cause := errors.Cause(err) + cause := errors.Unwrap(err) netErr, ok := cause.(*net.OpError) if !ok { return false @@ -176,11 +176,11 @@ func setupOOMScore(shimPid int) error { pid := os.Getpid() score, err := sys.GetOOMScoreAdj(pid) if err != nil { - return errors.Wrap(err, "get daemon OOM score") + return fmt.Errorf("get daemon OOM score: %w", err) } shimScore := score + 1 if err := sys.AdjustOOMScore(shimPid, shimScore); err != nil { - return errors.Wrap(err, "set shim OOM score") + return fmt.Errorf("set shim OOM score: %w", err) } return nil } @@ -264,7 +264,7 @@ func (s socket) path() string { func newSocket(address string) (*net.UnixListener, error) { if len(address) > socketPathLimit { - return nil, errors.Errorf("%q: unix socket path too long (> %d)", address, socketPathLimit) + return nil, fmt.Errorf("%q: unix socket path too long (> %d)", address, socketPathLimit) } var ( sock = socket(address) @@ -272,12 +272,12 @@ func newSocket(address string) (*net.UnixListener, error) { ) if !sock.isAbstract() { if err := os.MkdirAll(filepath.Dir(path), 0600); err != nil { - return nil, errors.Wrapf(err, "%s", path) + return nil, fmt.Errorf("%s: %w", path, err) } } l, err := net.Listen("unix", path) if err != nil { - return nil, errors.Wrapf(err, "failed to listen to unix socket %q (abstract: %t)", address, sock.isAbstract()) + return nil, fmt.Errorf("failed to listen to unix socket %q (abstract: %t): %w", address, sock.isAbstract(), err) } if err := os.Chmod(path, 0600); err != nil { l.Close() diff --git a/runtime/v1/shim/client/client_linux.go b/runtime/v1/shim/client/client_linux.go index f8e40846a06e3..15cf505652169 100644 --- a/runtime/v1/shim/client/client_linux.go +++ b/runtime/v1/shim/client/client_linux.go @@ -17,10 +17,10 @@ package client import ( + "fmt" "syscall" "github.com/containerd/cgroups" - "github.com/pkg/errors" exec "golang.org/x/sys/execabs" ) @@ -33,12 +33,12 @@ func getSysProcAttr() *syscall.SysProcAttr { func setCgroup(cgroupPath string, cmd *exec.Cmd) error { cg, err := cgroups.Load(cgroups.V1, cgroups.StaticPath(cgroupPath)) if err != nil { - return errors.Wrapf(err, "failed to load cgroup %s", cgroupPath) + return fmt.Errorf("failed to load cgroup %s: %w", cgroupPath, err) } if err := cg.Add(cgroups.Process{ Pid: cmd.Process.Pid, }); err != nil { - return errors.Wrapf(err, "failed to join cgroup %s", cgroupPath) + return fmt.Errorf("failed to join cgroup %s: %w", cgroupPath, err) } return nil } diff --git a/runtime/v1/shim/service.go b/runtime/v1/shim/service.go index c0b32dcca8442..a08757d0a7b9d 100644 --- a/runtime/v1/shim/service.go +++ b/runtime/v1/shim/service.go @@ -45,7 +45,6 @@ import ( "github.com/containerd/typeurl" ptypes "github.com/gogo/protobuf/types" specs "github.com/opencontainers/runtime-spec/specs-go" - "github.com/pkg/errors" "github.com/sirupsen/logrus" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -91,7 +90,7 @@ func NewService(config Config, publisher events.Publisher) (*Service, error) { } go s.processExits() if err := s.initPlatform(); err != nil { - return nil, errors.Wrap(err, "failed to initialized platform behavior") + return nil, fmt.Errorf("failed to initialized platform behavior: %w", err) } go s.forward(publisher) return s, nil @@ -160,7 +159,7 @@ func (s *Service) Create(ctx context.Context, r *shimapi.CreateTaskRequest) (_ * Options: rm.Options, } if err := m.Mount(rootfs); err != nil { - return nil, errors.Wrapf(err, "failed to mount rootfs component %v", m) + return nil, fmt.Errorf("failed to mount rootfs component %v: %w", m, err) } } @@ -297,7 +296,7 @@ func (s *Service) ResizePty(ctx context.Context, r *shimapi.ResizePtyRequest) (* p := s.processes[r.ID] s.mu.Unlock() if p == nil { - return nil, errors.Errorf("process does not exist %s", r.ID) + return nil, fmt.Errorf("process does not exist %s", r.ID) } if err := p.Resize(ws); err != nil { return nil, errdefs.ToGRPC(err) @@ -411,7 +410,7 @@ func (s *Service) ListPids(ctx context.Context, r *shimapi.ListPidsRequest) (*sh } a, err := typeurl.MarshalAny(d) if err != nil { - return nil, errors.Wrapf(err, "failed to marshal process %d info", pid) + return nil, fmt.Errorf("failed to marshal process %d info: %w", pid, err) } pInfo.Info = a break @@ -432,7 +431,7 @@ func (s *Service) CloseIO(ctx context.Context, r *shimapi.CloseIORequest) (*ptyp } if stdin := p.Stdin(); stdin != nil { if err := stdin.Close(); err != nil { - return nil, errors.Wrap(err, "close stdin") + return nil, fmt.Errorf("close stdin: %w", err) } } return empty, nil diff --git a/runtime/v1/shim/service_linux.go b/runtime/v1/shim/service_linux.go index c0950049d6060..4994906011929 100644 --- a/runtime/v1/shim/service_linux.go +++ b/runtime/v1/shim/service_linux.go @@ -18,6 +18,8 @@ package shim import ( "context" + "errors" + "fmt" "io" "net/url" "os" @@ -28,7 +30,6 @@ import ( "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/pkg/process" "github.com/containerd/fifo" - "github.com/pkg/errors" ) type linuxPlatform struct { @@ -65,7 +66,7 @@ func (p *linuxPlatform) CopyConsole(ctx context.Context, console console.Console uri, err := url.Parse(stdout) if err != nil { - return nil, errors.Wrap(err, "unable to parse stdout uri") + return nil, fmt.Errorf("unable to parse stdout uri: %w", err) } switch uri.Scheme { @@ -89,14 +90,14 @@ func (p *linuxPlatform) CopyConsole(ctx context.Context, console console.Console // Create pipe to be used by logging binary for Stdout outR, outW, err := os.Pipe() if err != nil { - return nil, errors.Wrap(err, "failed to create stdout pipes") + return nil, fmt.Errorf("failed to create stdout pipes: %w", err) } filesToClose = append(filesToClose, outR) // Stderr is created for logging binary but unused when terminal is true serrR, _, err := os.Pipe() if err != nil { - return nil, errors.Wrap(err, "failed to create stderr pipes") + return nil, fmt.Errorf("failed to create stderr pipes: %w", err) } filesToClose = append(filesToClose, serrR) @@ -118,18 +119,18 @@ func (p *linuxPlatform) CopyConsole(ctx context.Context, console console.Console }() if err := cmd.Start(); err != nil { - return nil, errors.Wrap(err, "failed to start logging binary process") + return nil, fmt.Errorf("failed to start logging binary process: %w", err) } // Close our side of the pipe after start if err := w.Close(); err != nil { - return nil, errors.Wrap(err, "failed to close write pipe after start") + return nil, fmt.Errorf("failed to close write pipe after start: %w", err) } // Wait for the logging binary to be ready b := make([]byte, 1) if _, err := r.Read(b); err != nil && err != io.EOF { - return nil, errors.Wrap(err, "failed to read from logging binary") + return nil, fmt.Errorf("failed to read from logging binary: %w", err) } cwg.Wait() @@ -164,7 +165,7 @@ func (p *linuxPlatform) ShutdownConsole(ctx context.Context, cons console.Consol } epollConsole, ok := cons.(*console.EpollConsole) if !ok { - return errors.Errorf("expected EpollConsole, got %#v", cons) + return fmt.Errorf("expected EpollConsole, got %#v", cons) } return epollConsole.Shutdown(p.epoller.CloseConsole) } @@ -181,7 +182,7 @@ func (s *Service) initPlatform() error { } epoller, err := console.NewEpoller() if err != nil { - return errors.Wrap(err, "failed to initialize epoller") + return fmt.Errorf("failed to initialize epoller: %w", err) } s.platform = &linuxPlatform{ epoller: epoller, diff --git a/runtime/v1/shim/service_unix.go b/runtime/v1/shim/service_unix.go index 95f90ea2d6ad7..2e6bfb2f01238 100644 --- a/runtime/v1/shim/service_unix.go +++ b/runtime/v1/shim/service_unix.go @@ -21,6 +21,7 @@ package shim import ( "context" + "fmt" "io" "net/url" "os" @@ -31,7 +32,6 @@ import ( "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/pkg/process" "github.com/containerd/fifo" - "github.com/pkg/errors" ) type unixPlatform struct { @@ -55,7 +55,7 @@ func (p *unixPlatform) CopyConsole(ctx context.Context, console console.Console, } uri, err := url.Parse(stdout) if err != nil { - return nil, errors.Wrap(err, "unable to parse stdout uri") + return nil, fmt.Errorf("unable to parse stdout uri: %w", err) } switch uri.Scheme { @@ -78,14 +78,14 @@ func (p *unixPlatform) CopyConsole(ctx context.Context, console console.Console, // Create pipe to be used by logging binary for Stdout outR, outW, err := os.Pipe() if err != nil { - return nil, errors.Wrap(err, "failed to create stdout pipes") + return nil, fmt.Errorf("failed to create stdout pipes: %w", err) } filesToClose = append(filesToClose, outR) // Stderr is created for logging binary but unused when terminal is true serrR, _, err := os.Pipe() if err != nil { - return nil, errors.Wrap(err, "failed to create stderr pipes") + return nil, fmt.Errorf("failed to create stderr pipes: %w", err) } filesToClose = append(filesToClose, serrR) @@ -107,18 +107,18 @@ func (p *unixPlatform) CopyConsole(ctx context.Context, console console.Console, }() if err := cmd.Start(); err != nil { - return nil, errors.Wrap(err, "failed to start logging binary process") + return nil, fmt.Errorf("failed to start logging binary process: %w", err) } // Close our side of the pipe after start if err := w.Close(); err != nil { - return nil, errors.Wrap(err, "failed to close write pipe after start") + return nil, fmt.Errorf("failed to close write pipe after start: %w", err) } // Wait for the logging binary to be ready b := make([]byte, 1) if _, err := r.Read(b); err != nil && err != io.EOF { - return nil, errors.Wrap(err, "failed to read from logging binary") + return nil, fmt.Errorf("failed to read from logging binary: %w", err) } cwg.Wait() diff --git a/runtime/v2/binary.go b/runtime/v2/binary.go index b679076c4c91c..9a65513aa9eca 100644 --- a/runtime/v2/binary.go +++ b/runtime/v2/binary.go @@ -19,6 +19,7 @@ package v2 import ( "bytes" "context" + "fmt" "io" "os" "path/filepath" @@ -33,7 +34,6 @@ import ( "github.com/containerd/containerd/runtime/v2/task" "github.com/containerd/ttrpc" "github.com/gogo/protobuf/types" - "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -94,7 +94,7 @@ func (b *binary) Start(ctx context.Context, opts *types.Any, onClose func()) (_ }() f, err := openShimLog(shimCtx, b.bundle, client.AnonDialer) if err != nil { - return nil, errors.Wrap(err, "open shim log pipe") + return nil, fmt.Errorf("open shim log pipe: %w", err) } defer func() { if err != nil { @@ -117,7 +117,7 @@ func (b *binary) Start(ctx context.Context, opts *types.Any, onClose func()) (_ }() out, err := cmd.CombinedOutput() if err != nil { - return nil, errors.Wrapf(err, "%s", out) + return nil, fmt.Errorf("%s: %w", out, err) } address := strings.TrimSpace(string(out)) conn, err := client.Connect(address, client.AnonDialer) @@ -130,7 +130,7 @@ func (b *binary) Start(ctx context.Context, opts *types.Any, onClose func()) (_ f.Close() } // Save runtime binary path for restore. - if err := os.WriteFile(filepath.Join(b.bundle.Path, "runtime"), []byte(b.runtime), 0600); err != nil { + if err := os.WriteFile(filepath.Join(b.bundle.Path, "shim-binary-path"), []byte(b.runtime), 0600); err != nil { return nil, err } client := ttrpc.NewClient(conn, ttrpc.WithOnClose(onCloseWithShimLog), ttrpc.WithUnaryClientInterceptor(octtrpc.ClientInterceptor())) @@ -178,7 +178,7 @@ func (b *binary) Delete(ctx context.Context) (*runtime.Exit, error) { cmd.Stderr = errb if err := cmd.Run(); err != nil { log.G(ctx).WithField("cmd", cmd).WithError(err).Error("failed to delete") - return nil, errors.Wrapf(err, "%s", errb.String()) + return nil, fmt.Errorf("%s: %w", errb.String(), err) } s := errb.String() if s != "" { diff --git a/runtime/v2/bundle.go b/runtime/v2/bundle.go index f2f745b1a5671..9a2d88a5b953e 100644 --- a/runtime/v2/bundle.go +++ b/runtime/v2/bundle.go @@ -48,7 +48,7 @@ func LoadBundle(ctx context.Context, root, id string) (*Bundle, error) { // NewBundle returns a new bundle on disk func NewBundle(ctx context.Context, root, state, id string, spec []byte) (b *Bundle, err error) { if err := identifiers.Validate(id); err != nil { - return nil, errors.Wrapf(err, "invalid task id %s", id) + return nil, fmt.Errorf("invalid task id %s: %w", id, err) } ns, err := namespaces.NamespaceRequired(ctx) @@ -139,10 +139,10 @@ func (b *Bundle) Delete(ctx context.Context) error { } if err := mount.UnmountAll(rootfs, 0); err != nil { - return errors.Wrapf(err, "unmount rootfs %s", rootfs) + return fmt.Errorf("unmount rootfs %s: %w", rootfs, err) } if err := os.Remove(rootfs); err != nil && !os.IsNotExist(err) { - return errors.Wrap(err, "failed to remove bundle rootfs") + return fmt.Errorf("failed to remove bundle rootfs: %w", err) } err = atomicDelete(b.Path) if err == nil { @@ -159,7 +159,7 @@ func (b *Bundle) Delete(ctx context.Context) error { return err } } - return errors.Wrapf(err, "failed to remove both bundle and workdir locations: %v", err2) + return fmt.Errorf("failed to remove both bundle and workdir locations: %v: %w", err2, err) } // atomicDelete renames the path to a hidden file before removal diff --git a/runtime/v2/logging/logging_windows.go b/runtime/v2/logging/logging_windows.go index 47b9032d82833..67cebaf2f7d93 100644 --- a/runtime/v2/logging/logging_windows.go +++ b/runtime/v2/logging/logging_windows.go @@ -18,6 +18,7 @@ package logging import ( "context" + "errors" "fmt" "net" "os" @@ -25,7 +26,6 @@ import ( "syscall" "github.com/Microsoft/go-winio" - "github.com/pkg/errors" ) // Run the logging driver @@ -53,19 +53,19 @@ func runInternal(fn LoggerFunc) error { return errors.New("'CONTAINER_STDOUT' environment variable missing") } if sout, err = winio.DialPipeContext(ctx, soutPipe); err != nil { - return errors.Wrap(err, "unable to dial stdout pipe") + return fmt.Errorf("unable to dial stdout pipe: %w", err) } if serrPipe, ok = os.LookupEnv("CONTAINER_STDERR"); !ok { return errors.New("'CONTAINER_STDERR' environment variable missing") } if serr, err = winio.DialPipeContext(ctx, serrPipe); err != nil { - return errors.Wrap(err, "unable to dial stderr pipe") + return fmt.Errorf("unable to dial stderr pipe: %w", err) } waitPipe = os.Getenv("CONTAINER_WAIT") if wait, err = winio.DialPipeContext(ctx, waitPipe); err != nil { - return errors.Wrap(err, "unable to dial wait pipe") + return fmt.Errorf("unable to dial wait pipe: %w", err) } config := &Config{ diff --git a/runtime/v2/manager.go b/runtime/v2/manager.go index 2e7ea280506b3..e00d5cfa28a22 100644 --- a/runtime/v2/manager.go +++ b/runtime/v2/manager.go @@ -37,7 +37,6 @@ import ( shimbinary "github.com/containerd/containerd/runtime/v2/shim" "github.com/containerd/containerd/runtime/v2/task" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" ) // Config for the v2 runtime @@ -185,7 +184,7 @@ func (m *ShimManager) Start(ctx context.Context, id string, opts runtime.CreateO } if err := m.shims.Add(ctx, shimTask); err != nil { - return nil, errors.Wrap(err, "failed to add task") + return nil, fmt.Errorf("failed to add task: %w", err) } return shimTask, nil @@ -224,7 +223,7 @@ func (m *ShimManager) startShim(ctx context.Context, bundle *Bundle, id string, m.shims.Delete(ctx, id) }) if err != nil { - return nil, errors.Wrap(err, "start failed") + return nil, fmt.Errorf("start failed: %w", err) } return shim, nil @@ -283,7 +282,7 @@ func (m *ShimManager) resolveRuntimePath(runtime string) (string, error) { cmdPath = testPath } if cmdPath == "" { - return "", errors.Wrapf(os.ErrNotExist, "runtime %q binary not installed %q", runtime, name) + return "", fmt.Errorf("runtime %q binary not installed %q: %w", runtime, name, os.ErrNotExist) } } } @@ -368,7 +367,7 @@ func (m *TaskManager) ID() string { func (m *TaskManager) Create(ctx context.Context, taskID string, opts runtime.CreateOpts) (runtime.Task, error) { process, err := m.manager.Start(ctx, taskID, opts) if err != nil { - return nil, errors.Wrap(err, "failed to start shim") + return nil, fmt.Errorf("failed to start shim: %w", err) } // Cast to shim task and call task service to create a new container task instance. @@ -376,13 +375,13 @@ func (m *TaskManager) Create(ctx context.Context, taskID string, opts runtime.Cr shim := process.(*shimTask) t, err := shim.Create(ctx, opts) if err != nil { + // NOTE: ctx contains required namespace information. + m.manager.shims.Delete(ctx, taskID) + dctx, cancel := timeout.WithContext(context.Background(), cleanupTimeout) defer cancel() - _, errShim := shim.delete(dctx, func(ctx context.Context, id string) { - m.manager.shims.Delete(ctx, id) - }) - + _, errShim := shim.delete(dctx, func(context.Context, string) {}) if errShim != nil { if errdefs.IsDeadlineExceeded(errShim) { dctx, cancel = timeout.WithContext(context.Background(), cleanupTimeout) @@ -393,7 +392,7 @@ func (m *TaskManager) Create(ctx context.Context, taskID string, opts runtime.Cr shim.Close() } - return nil, errors.Wrap(err, "failed to create shim task") + return nil, fmt.Errorf("failed to create shim task: %w", err) } return t, nil diff --git a/runtime/v2/process.go b/runtime/v2/process.go index 497219ae5052b..84c90c74a5798 100644 --- a/runtime/v2/process.go +++ b/runtime/v2/process.go @@ -18,13 +18,13 @@ package v2 import ( "context" + "errors" tasktypes "github.com/containerd/containerd/api/types/task" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/runtime" "github.com/containerd/containerd/runtime/v2/task" "github.com/containerd/ttrpc" - "github.com/pkg/errors" ) type process struct { diff --git a/runtime/v2/runc/container.go b/runtime/v2/runc/container.go index 11798f16849e0..4da91d6919624 100644 --- a/runtime/v2/runc/container.go +++ b/runtime/v2/runc/container.go @@ -22,6 +22,7 @@ package runc import ( "context" "encoding/json" + "fmt" "os" "path/filepath" "sync" @@ -37,7 +38,6 @@ import ( "github.com/containerd/containerd/runtime/v2/runc/options" "github.com/containerd/containerd/runtime/v2/task" "github.com/containerd/typeurl" - "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -45,7 +45,7 @@ import ( func NewContainer(ctx context.Context, platform stdio.Platform, r *task.CreateTaskRequest) (_ *Container, retErr error) { ns, err := namespaces.NamespaceRequired(ctx) if err != nil { - return nil, errors.Wrap(err, "create namespace") + return nil, fmt.Errorf("create namespace: %w", err) } var opts options.Options @@ -110,7 +110,7 @@ func NewContainer(ctx context.Context, platform stdio.Platform, r *task.CreateTa Options: rm.Options, } if err := m.Mount(rootfs); err != nil { - return nil, errors.Wrapf(err, "failed to mount rootfs component %v", m) + return nil, fmt.Errorf("failed to mount rootfs component %v: %w", m, err) } } @@ -300,13 +300,13 @@ func (c *Container) Process(id string) (process.Process, error) { defer c.mu.Unlock() if id == "" { if c.process == nil { - return nil, errors.Wrapf(errdefs.ErrFailedPrecondition, "container must be created") + return nil, fmt.Errorf("container must be created: %w", errdefs.ErrFailedPrecondition) } return c.process, nil } p, ok := c.processes[id] if !ok { - return nil, errors.Wrapf(errdefs.ErrNotFound, "process does not exist %s", id) + return nil, fmt.Errorf("process does not exist %s: %w", id, errdefs.ErrNotFound) } return p, nil } @@ -453,7 +453,7 @@ func (c *Container) CloseIO(ctx context.Context, r *task.CloseIORequest) error { } if stdin := p.Stdin(); stdin != nil { if err := stdin.Close(); err != nil { - return errors.Wrap(err, "close stdin") + return fmt.Errorf("close stdin: %w", err) } } return nil diff --git a/runtime/v2/runc/manager/manager_linux.go b/runtime/v2/runc/manager/manager_linux.go index ba574beb05bd5..a8ac45bfcdf09 100644 --- a/runtime/v2/runc/manager/manager_linux.go +++ b/runtime/v2/runc/manager/manager_linux.go @@ -19,7 +19,8 @@ package manager import ( "context" "encoding/json" - "io/ioutil" + "fmt" + "io" "os" "path/filepath" goruntime "runtime" @@ -40,7 +41,6 @@ import ( "github.com/containerd/typeurl" "github.com/gogo/protobuf/proto" ptypes "github.com/gogo/protobuf/types" - "github.com/pkg/errors" exec "golang.org/x/sys/execabs" "golang.org/x/sys/unix" ) @@ -141,19 +141,19 @@ func (manager) Start(ctx context.Context, id string, opts shim.StartOpts) (_ str // grouping functionality where the new process should be run with the same // shim as an existing container if !shim.SocketEaddrinuse(err) { - return "", errors.Wrap(err, "create new shim socket") + return "", fmt.Errorf("create new shim socket: %w", err) } if shim.CanConnect(address) { if err := shim.WriteAddress("address", address); err != nil { - return "", errors.Wrap(err, "write existing socket for shim") + return "", fmt.Errorf("write existing socket for shim: %w", err) } return address, nil } if err := shim.RemoveSocket(address); err != nil { - return "", errors.Wrap(err, "remove pre-existing socket") + return "", fmt.Errorf("remove pre-existing socket: %w", err) } if socket, err = shim.NewSocket(address); err != nil { - return "", errors.Wrap(err, "try create new shim socket 2x") + return "", fmt.Errorf("try create new shim socket 2x: %w", err) } } defer func() { @@ -178,7 +178,7 @@ func (manager) Start(ctx context.Context, id string, opts shim.StartOpts) (_ str goruntime.LockOSThread() if os.Getenv("SCHED_CORE") != "" { if err := schedcore.Create(schedcore.ProcessGroup); err != nil { - return "", errors.Wrap(err, "enable sched core support") + return "", fmt.Errorf("enable sched core support: %w", err) } } @@ -196,7 +196,7 @@ func (manager) Start(ctx context.Context, id string, opts shim.StartOpts) (_ str }() // make sure to wait after start go cmd.Wait() - if data, err := ioutil.ReadAll(os.Stdin); err == nil { + if data, err := io.ReadAll(os.Stdin); err == nil { if len(data) > 0 { var any ptypes.Any if err := proto.Unmarshal(data, &any); err != nil { @@ -211,20 +211,20 @@ func (manager) Start(ctx context.Context, id string, opts shim.StartOpts) (_ str if cgroups.Mode() == cgroups.Unified { cg, err := cgroupsv2.LoadManager("/sys/fs/cgroup", opts.ShimCgroup) if err != nil { - return "", errors.Wrapf(err, "failed to load cgroup %s", opts.ShimCgroup) + return "", fmt.Errorf("failed to load cgroup %s: %w", opts.ShimCgroup, err) } if err := cg.AddProc(uint64(cmd.Process.Pid)); err != nil { - return "", errors.Wrapf(err, "failed to join cgroup %s", opts.ShimCgroup) + return "", fmt.Errorf("failed to join cgroup %s: %w", opts.ShimCgroup, err) } } else { cg, err := cgroups.Load(cgroups.V1, cgroups.StaticPath(opts.ShimCgroup)) if err != nil { - return "", errors.Wrapf(err, "failed to load cgroup %s", opts.ShimCgroup) + return "", fmt.Errorf("failed to load cgroup %s: %w", opts.ShimCgroup, err) } if err := cg.Add(cgroups.Process{ Pid: cmd.Process.Pid, }); err != nil { - return "", errors.Wrapf(err, "failed to join cgroup %s", opts.ShimCgroup) + return "", fmt.Errorf("failed to join cgroup %s: %w", opts.ShimCgroup, err) } } } @@ -232,7 +232,7 @@ func (manager) Start(ctx context.Context, id string, opts shim.StartOpts) (_ str } } if err := shim.AdjustOOMScore(cmd.Process.Pid); err != nil { - return "", errors.Wrap(err, "failed to adjust OOM score for shim") + return "", fmt.Errorf("failed to adjust OOM score for shim: %w", err) } return address, nil } diff --git a/runtime/v2/runc/platform.go b/runtime/v2/runc/platform.go index 77d050a58e594..c08d32912ab01 100644 --- a/runtime/v2/runc/platform.go +++ b/runtime/v2/runc/platform.go @@ -21,6 +21,8 @@ package runc import ( "context" + "errors" + "fmt" "io" "net/url" "os" @@ -32,7 +34,6 @@ import ( "github.com/containerd/containerd/pkg/process" "github.com/containerd/containerd/pkg/stdio" "github.com/containerd/fifo" - "github.com/pkg/errors" ) var bufPool = sync.Pool{ @@ -48,7 +49,7 @@ var bufPool = sync.Pool{ func NewPlatform() (stdio.Platform, error) { epoller, err := console.NewEpoller() if err != nil { - return nil, errors.Wrap(err, "failed to initialize epoller") + return nil, fmt.Errorf("failed to initialize epoller: %w", err) } go epoller.Wait() return &linuxPlatform{ @@ -90,7 +91,7 @@ func (p *linuxPlatform) CopyConsole(ctx context.Context, console console.Console uri, err := url.Parse(stdout) if err != nil { - return nil, errors.Wrap(err, "unable to parse stdout uri") + return nil, fmt.Errorf("unable to parse stdout uri: %w", err) } switch uri.Scheme { @@ -114,14 +115,14 @@ func (p *linuxPlatform) CopyConsole(ctx context.Context, console console.Console // Create pipe to be used by logging binary for Stdout outR, outW, err := os.Pipe() if err != nil { - return nil, errors.Wrap(err, "failed to create stdout pipes") + return nil, fmt.Errorf("failed to create stdout pipes: %w", err) } filesToClose = append(filesToClose, outR) // Stderr is created for logging binary but unused when terminal is true serrR, _, err := os.Pipe() if err != nil { - return nil, errors.Wrap(err, "failed to create stderr pipes") + return nil, fmt.Errorf("failed to create stderr pipes: %w", err) } filesToClose = append(filesToClose, serrR) @@ -143,18 +144,18 @@ func (p *linuxPlatform) CopyConsole(ctx context.Context, console console.Console }() if err := cmd.Start(); err != nil { - return nil, errors.Wrap(err, "failed to start logging binary process") + return nil, fmt.Errorf("failed to start logging binary process: %w", err) } // Close our side of the pipe after start if err := w.Close(); err != nil { - return nil, errors.Wrap(err, "failed to close write pipe after start") + return nil, fmt.Errorf("failed to close write pipe after start: %w", err) } // Wait for the logging binary to be ready b := make([]byte, 1) if _, err := r.Read(b); err != nil && err != io.EOF { - return nil, errors.Wrap(err, "failed to read from logging binary") + return nil, fmt.Errorf("failed to read from logging binary: %w", err) } cwg.Wait() @@ -191,7 +192,7 @@ func (p *linuxPlatform) ShutdownConsole(ctx context.Context, cons console.Consol } epollConsole, ok := cons.(*console.EpollConsole) if !ok { - return errors.Errorf("expected EpollConsole, got %#v", cons) + return fmt.Errorf("expected EpollConsole, got %#v", cons) } return epollConsole.Shutdown(p.epoller.CloseConsole) } diff --git a/runtime/v2/runc/task/service.go b/runtime/v2/runc/task/service.go index a1b1c468aaed9..4ad70dad32324 100644 --- a/runtime/v2/runc/task/service.go +++ b/runtime/v2/runc/task/service.go @@ -21,6 +21,7 @@ package task import ( "context" + "fmt" "os" "sync" @@ -47,7 +48,6 @@ import ( "github.com/containerd/ttrpc" "github.com/containerd/typeurl" ptypes "github.com/gogo/protobuf/types" - "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -82,7 +82,7 @@ func NewTaskService(ctx context.Context, publisher shim.Publisher, sd shutdown.S go s.processExits() runcC.Monitor = reaper.Default if err := s.initPlatform(); err != nil { - return nil, errors.Wrap(err, "failed to initialized platform behavior") + return nil, fmt.Errorf("failed to initialized platform behavior: %w", err) } go s.forward(ctx, publisher) sd.RegisterCallback(func(context.Context) error { @@ -377,7 +377,7 @@ func (s *service) Pids(ctx context.Context, r *taskAPI.PidsRequest) (*taskAPI.Pi } a, err := typeurl.MarshalAny(d) if err != nil { - return nil, errors.Wrapf(err, "failed to marshal process %d info", pid) + return nil, fmt.Errorf("failed to marshal process %d info: %w", pid, err) } pInfo.Info = a break diff --git a/runtime/v2/runc/v1/service.go b/runtime/v2/runc/v1/service.go index 3609adac7a030..b630711db9f69 100644 --- a/runtime/v2/runc/v1/service.go +++ b/runtime/v2/runc/v1/service.go @@ -21,6 +21,7 @@ package v1 import ( "context" + "fmt" "io" "os" "path/filepath" @@ -49,7 +50,6 @@ import ( "github.com/containerd/typeurl" "github.com/gogo/protobuf/proto" ptypes "github.com/gogo/protobuf/types" - "github.com/pkg/errors" "github.com/sirupsen/logrus" exec "golang.org/x/sys/execabs" "golang.org/x/sys/unix" @@ -79,7 +79,7 @@ func New(ctx context.Context, id string, publisher shim.Publisher, shutdown func runcC.Monitor = reaper.Default if err := s.initPlatform(); err != nil { shutdown() - return nil, errors.Wrap(err, "failed to initialized platform behavior") + return nil, fmt.Errorf("failed to initialized platform behavior: %w", err) } go s.forward(ctx, publisher) return s, nil @@ -144,7 +144,7 @@ func (s *service) StartShim(ctx context.Context, opts shim.StartOpts) (_ string, return "", err } if err := shim.RemoveSocket(address); err != nil { - return "", errors.Wrap(err, "remove already used socket") + return "", fmt.Errorf("remove already used socket: %w", err) } if socket, err = shim.NewSocket(address); err != nil { return "", err @@ -171,7 +171,7 @@ func (s *service) StartShim(ctx context.Context, opts shim.StartOpts) (_ string, goruntime.LockOSThread() if os.Getenv("SCHED_CORE") != "" { if err := schedcore.Create(schedcore.ProcessGroup); err != nil { - return "", errors.Wrap(err, "enable sched core support") + return "", fmt.Errorf("enable sched core support: %w", err) } } @@ -205,19 +205,19 @@ func (s *service) StartShim(ctx context.Context, opts shim.StartOpts) (_ string, if opts.ShimCgroup != "" { cg, err := cgroups.Load(cgroups.V1, cgroups.StaticPath(opts.ShimCgroup)) if err != nil { - return "", errors.Wrapf(err, "failed to load cgroup %s", opts.ShimCgroup) + return "", fmt.Errorf("failed to load cgroup %s: %w", opts.ShimCgroup, err) } if err := cg.Add(cgroups.Process{ Pid: cmd.Process.Pid, }); err != nil { - return "", errors.Wrapf(err, "failed to join cgroup %s", opts.ShimCgroup) + return "", fmt.Errorf("failed to join cgroup %s: %w", opts.ShimCgroup, err) } } } } } if err := shim.AdjustOOMScore(cmd.Process.Pid); err != nil { - return "", errors.Wrap(err, "failed to adjust OOM score for shim") + return "", fmt.Errorf("failed to adjust OOM score for shim: %w", err) } return address, nil } @@ -502,7 +502,7 @@ func (s *service) Pids(ctx context.Context, r *taskAPI.PidsRequest) (*taskAPI.Pi } a, err := typeurl.MarshalAny(d) if err != nil { - return nil, errors.Wrapf(err, "failed to marshal process %d info", pid) + return nil, fmt.Errorf("failed to marshal process %d info: %w", pid, err) } pInfo.Info = a break diff --git a/runtime/v2/shim.go b/runtime/v2/shim.go index aa884ac7b7b33..3ca4022564687 100644 --- a/runtime/v2/shim.go +++ b/runtime/v2/shim.go @@ -18,6 +18,7 @@ package v2 import ( "context" + "errors" "fmt" "io" "os" @@ -39,7 +40,6 @@ import ( "github.com/containerd/ttrpc" ptypes "github.com/gogo/protobuf/types" "github.com/hashicorp/go-multierror" - "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -85,7 +85,7 @@ func loadShim(ctx context.Context, bundle *Bundle, onClose func()) (_ *shimTask, }() f, err := openShimLog(shimCtx, bundle, client.AnonReconnectDialer) if err != nil { - return nil, errors.Wrap(err, "open shim log pipe when reload") + return nil, fmt.Errorf("open shim log pipe when reload: %w", err) } defer func() { if err != nil { @@ -394,7 +394,7 @@ func (s *shimTask) Kill(ctx context.Context, signal uint32, all bool) error { func (s *shimTask) Exec(ctx context.Context, id string, opts runtime.ExecOpts) (runtime.ExecProcess, error) { if err := identifiers.Validate(id); err != nil { - return nil, errors.Wrapf(err, "invalid exec id %s", id) + return nil, fmt.Errorf("invalid exec id %s: %w", id, err) } request := &task.ExecProcessRequest{ ID: s.ID(), diff --git a/runtime/v2/shim/shim.go b/runtime/v2/shim/shim.go index e25626cf337bc..59e522cede4ee 100644 --- a/runtime/v2/shim/shim.go +++ b/runtime/v2/shim/shim.go @@ -18,6 +18,7 @@ package shim import ( "context" + "errors" "flag" "fmt" "io" @@ -36,7 +37,6 @@ import ( "github.com/containerd/containerd/version" "github.com/containerd/ttrpc" "github.com/gogo/protobuf/proto" - "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -305,7 +305,7 @@ func run(ctx context.Context, manager Manager, initFunc Init, name string, confi "pid": os.Getpid(), "namespace": namespaceFlag, }) - go handleSignals(ctx, logger, signals) + go reap(ctx, logger, signals) ss, err := manager.Stop(ctx, id) if err != nil { return err @@ -398,7 +398,7 @@ func run(ctx context.Context, manager Manager, initFunc Init, name string, confi result := p.Init(initContext) if err := initialized.Add(result); err != nil { - return errors.Wrapf(err, "could not add plugin result to plugin set") + return fmt.Errorf("could not add plugin result to plugin set: %w", err) } instance, err := result.Instance() @@ -419,16 +419,16 @@ func run(ctx context.Context, manager Manager, initFunc Init, name string, confi server, err := newServer() if err != nil { - return errors.Wrap(err, "failed creating server") + return fmt.Errorf("failed creating server: %w", err) } for _, srv := range ttrpcServices { if err := srv.RegisterTTRPC(server); err != nil { - return errors.Wrap(err, "failed to register service") + return fmt.Errorf("failed to register service: %w", err) } } - if err := serve(ctx, server, signals); err != nil { + if err := serve(ctx, server, signals, sd.Shutdown); err != nil { if err != shutdown.ErrShutdown { return err } @@ -450,7 +450,7 @@ func run(ctx context.Context, manager Manager, initFunc Init, name string, confi // serve serves the ttrpc API over a unix socket in the current working directory // and blocks until the context is canceled -func serve(ctx context.Context, server *ttrpc.Server, signals chan os.Signal) error { +func serve(ctx context.Context, server *ttrpc.Server, signals chan os.Signal, shutdown func()) error { dump := make(chan os.Signal, 32) setupDumpStacks(dump) @@ -480,7 +480,9 @@ func serve(ctx context.Context, server *ttrpc.Server, signals chan os.Signal) er dumpStacks(logger) } }() - return handleSignals(ctx, logger, signals) + + go handleExitSignals(ctx, logger, shutdown) + return reap(ctx, logger, signals) } func dumpStacks(logger *logrus.Entry) { diff --git a/runtime/v2/shim/shim_unix.go b/runtime/v2/shim/shim_unix.go index cbab4f9297ac3..e2dab0931ea6a 100644 --- a/runtime/v2/shim/shim_unix.go +++ b/runtime/v2/shim/shim_unix.go @@ -21,6 +21,7 @@ package shim import ( "context" + "fmt" "io" "net" "os" @@ -29,7 +30,6 @@ import ( "github.com/containerd/containerd/sys/reaper" "github.com/containerd/fifo" - "github.com/pkg/errors" "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) @@ -60,7 +60,7 @@ func serveListener(path string) (net.Listener, error) { path = "[inherited from parent]" } else { if len(path) > socketPathLimit { - return nil, errors.Errorf("%q: unix socket path too long (> %d)", path, socketPathLimit) + return nil, fmt.Errorf("%q: unix socket path too long (> %d)", path, socketPathLimit) } l, err = net.Listen("unix", path) } @@ -71,7 +71,7 @@ func serveListener(path string) (net.Listener, error) { return l, nil } -func handleSignals(ctx context.Context, logger *logrus.Entry, signals chan os.Signal) error { +func reap(ctx context.Context, logger *logrus.Entry, signals chan os.Signal) error { logger.Info("starting signal loop") for { @@ -79,6 +79,8 @@ func handleSignals(ctx context.Context, logger *logrus.Entry, signals chan os.Si case <-ctx.Done(): return ctx.Err() case s := <-signals: + // Exit signals are handled separately from this loop + // They get registered with this channel so that we can ignore such signals for short-running actions (e.g. `delete`) switch s { case unix.SIGCHLD: if err := reaper.Reap(); err != nil { @@ -90,6 +92,22 @@ func handleSignals(ctx context.Context, logger *logrus.Entry, signals chan os.Si } } +func handleExitSignals(ctx context.Context, logger *logrus.Entry, cancel context.CancelFunc) { + ch := make(chan os.Signal, 32) + signal.Notify(ch, syscall.SIGINT, syscall.SIGTERM) + + for { + select { + case s := <-ch: + logger.WithField("signal", s).Debugf("Caught exit signal") + cancel() + return + case <-ctx.Done(): + return + } + } +} + func openLog(ctx context.Context, _ string) (io.Writer, error) { return fifo.OpenFifoDup2(ctx, "log", unix.O_WRONLY, 0700, int(os.Stderr.Fd())) } diff --git a/runtime/v2/shim/shim_windows.go b/runtime/v2/shim/shim_windows.go index 1ce56d29fe81c..4b098ab16304c 100644 --- a/runtime/v2/shim/shim_windows.go +++ b/runtime/v2/shim/shim_windows.go @@ -18,12 +18,12 @@ package shim import ( "context" + "errors" "io" "net" "os" "github.com/containerd/ttrpc" - "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -46,10 +46,13 @@ func serveListener(path string) (net.Listener, error) { return nil, errors.New("not supported") } -func handleSignals(ctx context.Context, logger *logrus.Entry, signals chan os.Signal) error { +func reap(ctx context.Context, logger *logrus.Entry, signals chan os.Signal) error { return errors.New("not supported") } +func handleExitSignals(ctx context.Context, logger *logrus.Entry, cancel context.CancelFunc) { +} + func openLog(ctx context.Context, _ string) (io.Writer, error) { return nil, errors.New("not supported") } diff --git a/runtime/v2/shim/util.go b/runtime/v2/shim/util.go index 0db7df5f58c47..28ac9d1e79931 100644 --- a/runtime/v2/shim/util.go +++ b/runtime/v2/shim/util.go @@ -19,6 +19,7 @@ package shim import ( "bytes" "context" + "errors" "fmt" "net" "os" @@ -29,7 +30,6 @@ import ( "github.com/containerd/containerd/namespaces" "github.com/gogo/protobuf/proto" "github.com/gogo/protobuf/types" - "github.com/pkg/errors" exec "golang.org/x/sys/execabs" ) diff --git a/runtime/v2/shim/util_unix.go b/runtime/v2/shim/util_unix.go index cc33d300de4b6..4e2309a806950 100644 --- a/runtime/v2/shim/util_unix.go +++ b/runtime/v2/shim/util_unix.go @@ -33,7 +33,6 @@ import ( "github.com/containerd/containerd/defaults" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/sys" - "github.com/pkg/errors" ) const ( @@ -54,11 +53,11 @@ func AdjustOOMScore(pid int) error { parent := os.Getppid() score, err := sys.GetOOMScoreAdj(parent) if err != nil { - return errors.Wrap(err, "get parent OOM score") + return fmt.Errorf("get parent OOM score: %w", err) } shimScore := score + 1 if err := sys.AdjustOOMScore(pid, shimScore); err != nil { - return errors.Wrap(err, "set shim OOM score") + return fmt.Errorf("set shim OOM score: %w", err) } return nil } @@ -96,7 +95,7 @@ func NewSocket(address string) (*net.UnixListener, error) { if !isAbstract { if err := os.MkdirAll(filepath.Dir(path), 0600); err != nil { - return nil, errors.Wrapf(err, "%s", path) + return nil, fmt.Errorf("%s: %w", path, err) } } l, err := net.Listen("unix", path) diff --git a/runtime/v2/shim/util_windows.go b/runtime/v2/shim/util_windows.go index 325c290043f1a..b9042841b1a31 100644 --- a/runtime/v2/shim/util_windows.go +++ b/runtime/v2/shim/util_windows.go @@ -18,13 +18,13 @@ package shim import ( "context" + "fmt" "net" "os" "syscall" "time" winio "github.com/Microsoft/go-winio" - "github.com/pkg/errors" ) const shimBinaryFormat = "containerd-shim-%s-%s.exe" @@ -40,9 +40,9 @@ func AnonReconnectDialer(address string, timeout time.Duration) (net.Conn, error c, err := winio.DialPipeContext(ctx, address) if os.IsNotExist(err) { - return nil, errors.Wrap(os.ErrNotExist, "npipe not found on reconnect") + return nil, fmt.Errorf("npipe not found on reconnect: %w", os.ErrNotExist) } else if err == context.DeadlineExceeded { - return nil, errors.Wrapf(err, "timed out waiting for npipe %s", address) + return nil, fmt.Errorf("timed out waiting for npipe %s: %w", address, err) } else if err != nil { return nil, err } @@ -65,14 +65,14 @@ func AnonDialer(address string, timeout time.Duration) (net.Conn, error) { if os.IsNotExist(err) { select { case <-serveTimer.C: - return nil, errors.Wrap(os.ErrNotExist, "pipe not found before timeout") + return nil, fmt.Errorf("pipe not found before timeout: %w", os.ErrNotExist) default: // Wait 10ms for the shim to serve and try again. time.Sleep(10 * time.Millisecond) continue } } else if err == context.DeadlineExceeded { - return nil, errors.Wrapf(err, "timed out waiting for npipe %s", address) + return nil, fmt.Errorf("timed out waiting for npipe %s: %w", address, err) } return nil, err } diff --git a/runtime/v2/shim_load.go b/runtime/v2/shim_load.go index cde5ceb117794..2252ed8a2b296 100644 --- a/runtime/v2/shim_load.go +++ b/runtime/v2/shim_load.go @@ -93,8 +93,8 @@ func (m *ShimManager) loadShims(ctx context.Context) error { runtime string ) - // If we're on 1.6+ and specified custom path to the runtime binary, path will be saved in 'runtime' file. - if data, err := os.ReadFile(filepath.Join(bundle.Path, "runtime")); err == nil { + // If we're on 1.6+ and specified custom path to the runtime binary, path will be saved in 'shim-binary-path' file. + if data, err := os.ReadFile(filepath.Join(bundle.Path, "shim-binary-path")); err == nil { runtime = string(data) } else if err != nil && !os.IsNotExist(err) { log.G(ctx).WithError(err).Error("failed to read `runtime` path from bundle") diff --git a/runtime/v2/shim_unix.go b/runtime/v2/shim_unix.go index ba49dfb1bd179..9ebfb27c80bec 100644 --- a/runtime/v2/shim_unix.go +++ b/runtime/v2/shim_unix.go @@ -21,6 +21,7 @@ package v2 import ( "context" + "errors" "io" "net" "os" @@ -28,7 +29,6 @@ import ( "time" "github.com/containerd/fifo" - "github.com/pkg/errors" "golang.org/x/sys/unix" ) diff --git a/runtime/v2/shim_windows.go b/runtime/v2/shim_windows.go index dc007c349ca85..913e5b483dcbb 100644 --- a/runtime/v2/shim_windows.go +++ b/runtime/v2/shim_windows.go @@ -18,6 +18,7 @@ package v2 import ( "context" + "errors" "fmt" "io" "net" @@ -26,7 +27,6 @@ import ( "time" "github.com/containerd/containerd/namespaces" - "github.com/pkg/errors" ) type deferredPipeConnection struct { @@ -78,7 +78,7 @@ func openShimLog(ctx context.Context, bundle *Bundle, dialer func(string, time.D time.Second*10, ) if conerr != nil { - dpc.conerr = errors.Wrap(conerr, "failed to connect to shim log") + dpc.conerr = fmt.Errorf("failed to connect to shim log: %w", conerr) } dpc.c = c dpc.wg.Done() diff --git a/runtime/v2/shim_windows_test.go b/runtime/v2/shim_windows_test.go index d7660d5979c50..b496c30f06712 100644 --- a/runtime/v2/shim_windows_test.go +++ b/runtime/v2/shim_windows_test.go @@ -18,10 +18,9 @@ package v2 import ( "context" + "errors" "os" "testing" - - "github.com/pkg/errors" ) func TestCheckCopyShimLogError(t *testing.T) { diff --git a/script/setup/prepare_env_windows.ps1 b/script/setup/prepare_env_windows.ps1 index 1aad0b828c938..e157f02da9a24 100644 --- a/script/setup/prepare_env_windows.ps1 +++ b/script/setup/prepare_env_windows.ps1 @@ -1,6 +1,6 @@ # Prepare windows environment for building and running containerd tests -$PACKAGES= @{ mingw = "10.2.0"; git = ""; golang = "1.17.5"; make = ""; nssm = "" } +$PACKAGES= @{ mingw = "10.2.0"; git = ""; golang = "1.17.7"; make = ""; nssm = "" } Write-Host "Downloading chocolatey package" curl.exe -L "https://packages.chocolatey.org/chocolatey.0.10.15.nupkg" -o 'c:\choco.zip' diff --git a/script/setup/runc-version b/script/setup/runc-version index e946d6bb7143f..795460fcec881 100644 --- a/script/setup/runc-version +++ b/script/setup/runc-version @@ -1 +1 @@ -v1.0.3 +v1.1.0 diff --git a/services/containers/service.go b/services/containers/service.go index 77e844908f0f0..a8bfd96a6c044 100644 --- a/services/containers/service.go +++ b/services/containers/service.go @@ -18,13 +18,13 @@ package containers import ( "context" + "errors" "io" api "github.com/containerd/containerd/api/services/containers/v1" "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/services" ptypes "github.com/gogo/protobuf/types" - "github.com/pkg/errors" "google.golang.org/grpc" ) diff --git a/services/content/contentserver/contentserver.go b/services/content/contentserver/contentserver.go index 44b9e4a764b27..eb5855a476c49 100644 --- a/services/content/contentserver/contentserver.go +++ b/services/content/contentserver/contentserver.go @@ -18,6 +18,7 @@ package contentserver import ( "context" + "fmt" "io" "sync" @@ -28,7 +29,6 @@ import ( ptypes "github.com/gogo/protobuf/types" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" "github.com/sirupsen/logrus" "google.golang.org/grpc" "google.golang.org/grpc/codes" @@ -383,7 +383,7 @@ func (s *service) Write(session api.Content_WriteServer) (err error) { if req.Offset == 0 && ws.Offset > 0 { if err := wr.Truncate(req.Offset); err != nil { - return errors.Wrapf(err, "truncate failed") + return fmt.Errorf("truncate failed: %w", err) } msg.Offset = req.Offset } diff --git a/services/content/service.go b/services/content/service.go index 43320d54d0527..4717e62ebb742 100644 --- a/services/content/service.go +++ b/services/content/service.go @@ -17,11 +17,12 @@ package content import ( + "errors" + "github.com/containerd/containerd/content" "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/services" "github.com/containerd/containerd/services/content/contentserver" - "github.com/pkg/errors" ) func init() { diff --git a/services/diff/local.go b/services/diff/local.go index f05b222dba266..7d0f071672fba 100644 --- a/services/diff/local.go +++ b/services/diff/local.go @@ -18,6 +18,7 @@ package diff import ( "context" + "fmt" diffapi "github.com/containerd/containerd/api/services/diff/v1" "github.com/containerd/containerd/api/types" @@ -27,7 +28,6 @@ import ( "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/services" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" "google.golang.org/grpc" ) @@ -65,16 +65,16 @@ func init() { for i, n := range orderedNames { differp, ok := differs[n] if !ok { - return nil, errors.Errorf("needed differ not loaded: %s", n) + return nil, fmt.Errorf("needed differ not loaded: %s", n) } d, err := differp.Instance() if err != nil { - return nil, errors.Wrapf(err, "could not load required differ due plugin init error: %s", n) + return nil, fmt.Errorf("could not load required differ due plugin init error: %s: %w", n, err) } ordered[i], ok = d.(differ) if !ok { - return nil, errors.Errorf("differ does not implement Comparer and Applier interface: %s", n) + return nil, fmt.Errorf("differ does not implement Comparer and Applier interface: %s", n) } } diff --git a/services/diff/service.go b/services/diff/service.go index 369e8f84dfa06..4ac780976266a 100644 --- a/services/diff/service.go +++ b/services/diff/service.go @@ -18,11 +18,11 @@ package diff import ( "context" + "errors" diffapi "github.com/containerd/containerd/api/services/diff/v1" "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/services" - "github.com/pkg/errors" "google.golang.org/grpc" ) diff --git a/services/events/service.go b/services/events/service.go index ef647582a7c3a..3b5f811382b7a 100644 --- a/services/events/service.go +++ b/services/events/service.go @@ -18,6 +18,7 @@ package events import ( "context" + "fmt" api "github.com/containerd/containerd/api/services/events/v1" apittrpc "github.com/containerd/containerd/api/services/ttrpc/events/v1" @@ -27,7 +28,6 @@ import ( "github.com/containerd/containerd/plugin" "github.com/containerd/ttrpc" ptypes "github.com/gogo/protobuf/types" - "github.com/pkg/errors" "google.golang.org/grpc" ) @@ -98,11 +98,11 @@ func (s *service) Subscribe(req *api.SubscribeRequest, srv api.Events_SubscribeS select { case ev := <-eventq: if err := srv.Send(toProto(ev)); err != nil { - return errors.Wrapf(err, "failed sending event to subscriber") + return fmt.Errorf("failed sending event to subscriber: %w", err) } case err := <-errq: if err != nil { - return errors.Wrapf(err, "subscription error") + return fmt.Errorf("subscription error: %w", err) } return nil diff --git a/services/images/service.go b/services/images/service.go index 83d802140d54d..fbfa7495336b1 100644 --- a/services/images/service.go +++ b/services/images/service.go @@ -18,12 +18,12 @@ package images import ( "context" + "errors" imagesapi "github.com/containerd/containerd/api/services/images/v1" "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/services" ptypes "github.com/gogo/protobuf/types" - "github.com/pkg/errors" "google.golang.org/grpc" ) diff --git a/services/introspection/local.go b/services/introspection/local.go index a409e1cacc53a..47388e4371c03 100644 --- a/services/introspection/local.go +++ b/services/introspection/local.go @@ -41,12 +41,9 @@ func init() { ID: services.IntrospectionService, Requires: []plugin.Type{}, InitFn: func(ic *plugin.InitContext) (interface{}, error) { - // this service works by using the plugin context up till the point - // this service is initialized. Since we require this service last, - // it should provide the full set of plugins. - pluginsPB := pluginsToPB(ic.GetAll()) + // this service fetches all plugins through the plugin set of the plugin context return &Local{ - plugins: pluginsPB, + plugins: ic.Plugins(), root: ic.Root, }, nil }, @@ -55,19 +52,19 @@ func init() { // Local is a local implementation of the introspection service type Local struct { - mu sync.Mutex - plugins []api.Plugin - root string + mu sync.Mutex + root string + plugins *plugin.Set + pluginCache []api.Plugin } var _ = (api.IntrospectionClient)(&Local{}) // UpdateLocal updates the local introspection service -func (l *Local) UpdateLocal(root string, plugins []api.Plugin) { +func (l *Local) UpdateLocal(root string) { l.mu.Lock() defer l.mu.Unlock() l.root = root - l.plugins = plugins } // Plugins returns the locally defined plugins @@ -95,7 +92,11 @@ func (l *Local) Plugins(ctx context.Context, req *api.PluginsRequest, _ ...grpc. func (l *Local) getPlugins() []api.Plugin { l.mu.Lock() defer l.mu.Unlock() - return l.plugins + plugins := l.plugins.GetAll() + if l.pluginCache == nil || len(plugins) != len(l.pluginCache) { + l.pluginCache = pluginsToPB(plugins) + } + return l.pluginCache } // Server returns the local server information diff --git a/services/introspection/service.go b/services/introspection/service.go index ecabaa9132999..c11b8dc1ce3e0 100644 --- a/services/introspection/service.go +++ b/services/introspection/service.go @@ -18,12 +18,12 @@ package introspection import ( context "context" + "errors" api "github.com/containerd/containerd/api/services/introspection/v1" "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/services" ptypes "github.com/gogo/protobuf/types" - "github.com/pkg/errors" "google.golang.org/grpc" ) @@ -31,11 +31,8 @@ func init() { plugin.Register(&plugin.Registration{ Type: plugin.GRPCPlugin, ID: "introspection", - Requires: []plugin.Type{"*"}, + Requires: []plugin.Type{plugin.ServicePlugin}, InitFn: func(ic *plugin.InitContext) (interface{}, error) { - // this service works by using the plugin context up till the point - // this service is initialized. Since we require this service last, - // it should provide the full set of plugins. plugins, err := ic.GetByType(plugin.ServicePlugin) if err != nil { return nil, err @@ -50,13 +47,11 @@ func init() { return nil, err } - allPluginsPB := pluginsToPB(ic.GetAll()) - localClient, ok := i.(*Local) if !ok { return nil, errors.New("Could not create a local client for introspection service") } - localClient.UpdateLocal(ic.Root, allPluginsPB) + localClient.UpdateLocal(ic.Root) return &server{ local: localClient, diff --git a/services/leases/service.go b/services/leases/service.go index 8dcc9f746e9ba..75afa4f158049 100644 --- a/services/leases/service.go +++ b/services/leases/service.go @@ -18,8 +18,7 @@ package leases import ( "context" - - "google.golang.org/grpc" + "errors" api "github.com/containerd/containerd/api/services/leases/v1" "github.com/containerd/containerd/errdefs" @@ -27,7 +26,7 @@ import ( "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/services" ptypes "github.com/gogo/protobuf/types" - "github.com/pkg/errors" + "google.golang.org/grpc" ) func init() { diff --git a/services/namespaces/service.go b/services/namespaces/service.go index d3c74a2cb641c..27d977531a8ee 100644 --- a/services/namespaces/service.go +++ b/services/namespaces/service.go @@ -18,12 +18,12 @@ package namespaces import ( "context" + "errors" api "github.com/containerd/containerd/api/services/namespaces/v1" "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/services" ptypes "github.com/gogo/protobuf/types" - "github.com/pkg/errors" "google.golang.org/grpc" ) diff --git a/services/opt/service.go b/services/opt/service.go index 5ac7665f125d0..76280ba620fd0 100644 --- a/services/opt/service.go +++ b/services/opt/service.go @@ -22,7 +22,6 @@ import ( "path/filepath" "github.com/containerd/containerd/plugin" - "github.com/pkg/errors" ) // Config for the opt manager @@ -46,7 +45,7 @@ func init() { return nil, err } if err := os.Setenv("PATH", fmt.Sprintf("%s%c%s", bin, os.PathListSeparator, os.Getenv("PATH"))); err != nil { - return nil, errors.Wrapf(err, "set binary image directory in path %s", bin) + return nil, fmt.Errorf("set binary image directory in path %s: %w", bin, err) } lib := filepath.Join(path, "lib") @@ -54,7 +53,7 @@ func init() { return nil, err } if err := os.Setenv("LD_LIBRARY_PATH", fmt.Sprintf("%s%c%s", lib, os.PathListSeparator, os.Getenv("LD_LIBRARY_PATH"))); err != nil { - return nil, errors.Wrapf(err, "set binary lib directory in path %s", lib) + return nil, fmt.Errorf("set binary lib directory in path %s: %w", lib, err) } return &manager{}, nil }, diff --git a/services/server/config/config.go b/services/server/config/config.go index f6d759803192f..49175c9a0b2ce 100644 --- a/services/server/config/config.go +++ b/services/server/config/config.go @@ -17,12 +17,12 @@ package config import ( + "fmt" "path/filepath" "strings" "github.com/imdario/mergo" "github.com/pelletier/go-toml" - "github.com/pkg/errors" "github.com/sirupsen/logrus" "github.com/containerd/containerd/errdefs" @@ -104,17 +104,17 @@ func (c *Config) ValidateV2() error { } for _, p := range c.DisabledPlugins { if len(strings.Split(p, ".")) < 4 { - return errors.Errorf("invalid disabled plugin URI %q expect io.containerd.x.vx", p) + return fmt.Errorf("invalid disabled plugin URI %q expect io.containerd.x.vx", p) } } for _, p := range c.RequiredPlugins { if len(strings.Split(p, ".")) < 4 { - return errors.Errorf("invalid required plugin URI %q expect io.containerd.x.vx", p) + return fmt.Errorf("invalid required plugin URI %q expect io.containerd.x.vx", p) } } for p := range c.Plugins { if len(strings.Split(p, ".")) < 4 { - return errors.Errorf("invalid plugin key URI %q expect io.containerd.x.vx", p) + return fmt.Errorf("invalid plugin key URI %q expect io.containerd.x.vx", p) } } return nil @@ -201,7 +201,7 @@ func (bc *BoltConfig) Validate() error { case SharingPolicyShared, SharingPolicyIsolated: return nil default: - return errors.Wrapf(errdefs.ErrInvalidArgument, "unknown policy: %s", bc.ContentSharingPolicy) + return fmt.Errorf("unknown policy: %s: %w", bc.ContentSharingPolicy, errdefs.ErrInvalidArgument) } } @@ -224,7 +224,7 @@ func (c *Config) Decode(p *plugin.Registration) (interface{}, error) { // LoadConfig loads the containerd server config from the provided path func LoadConfig(path string, out *Config) error { if out == nil { - return errors.Wrapf(errdefs.ErrInvalidArgument, "argument out must not be nil") + return fmt.Errorf("argument out must not be nil: %w", errdefs.ErrInvalidArgument) } var ( @@ -266,7 +266,7 @@ func LoadConfig(path string, out *Config) error { err := out.ValidateV2() if err != nil { - return errors.Wrapf(err, "failed to load TOML from %s", path) + return fmt.Errorf("failed to load TOML from %s: %w", path, err) } return nil } @@ -277,11 +277,11 @@ func loadConfigFile(path string) (*Config, error) { file, err := toml.LoadFile(path) if err != nil { - return nil, errors.Wrapf(err, "failed to load TOML: %s", path) + return nil, fmt.Errorf("failed to load TOML: %s: %w", path, err) } if err := file.Unmarshal(config); err != nil { - return nil, errors.Wrap(err, "failed to unmarshal TOML") + return nil, fmt.Errorf("failed to unmarshal TOML: %w", err) } return config, nil diff --git a/services/server/server.go b/services/server/server.go index d56c41764e14a..857cc9c76466a 100644 --- a/services/server/server.go +++ b/services/server/server.go @@ -20,7 +20,9 @@ import ( "context" "crypto/tls" "crypto/x509" + "errors" "expvar" + "fmt" "io" "net" "net/http" @@ -53,7 +55,6 @@ import ( metrics "github.com/docker/go-metrics" grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware" grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus" - "github.com/pkg/errors" bolt "go.etcd.io/bbolt" "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" "google.golang.org/grpc" @@ -117,7 +118,7 @@ func New(ctx context.Context, config *srvconfig.Config) (*Server, error) { for key, sec := range config.Timeouts { d, err := time.ParseDuration(sec) if err != nil { - return nil, errors.Errorf("unable to parse %s into a time duration", sec) + return nil, fmt.Errorf("unable to parse %s into a time duration", sec) } timeout.Set(key, d) } @@ -165,7 +166,7 @@ func New(ctx context.Context, config *srvconfig.Config) (*Server, error) { caCertPool := x509.NewCertPool() caCert, err := os.ReadFile(config.GRPC.TCPTLSCA) if err != nil { - return nil, errors.Wrap(err, "failed to load CA file") + return nil, fmt.Errorf("failed to load CA file: %w", err) } caCertPool.AppendCertsFromPEM(caCert) tlsConfig.ClientCAs = caCertPool @@ -241,7 +242,7 @@ func New(ctx context.Context, config *srvconfig.Config) (*Server, error) { } result := p.Init(initContext) if err := initialized.Add(result); err != nil { - return nil, errors.Wrapf(err, "could not add plugin result to plugin set") + return nil, fmt.Errorf("could not add plugin result to plugin set: %w", err) } instance, err := result.Instance() @@ -252,7 +253,7 @@ func New(ctx context.Context, config *srvconfig.Config) (*Server, error) { log.G(ctx).WithError(err).Warnf("failed to load plugin %s", id) } if _, ok := required[reqID]; ok { - return nil, errors.Wrapf(err, "load required plugin %s", id) + return nil, fmt.Errorf("load required plugin %s: %w", id, err) } continue } @@ -276,7 +277,7 @@ func New(ctx context.Context, config *srvconfig.Config) (*Server, error) { for id := range required { missing = append(missing, id) } - return nil, errors.Errorf("required plugin %s not included", missing) + return nil, fmt.Errorf("required plugin %s not included", missing) } // register services after all plugins have been initialized @@ -560,7 +561,7 @@ func (pc *proxyClients) getClient(address string) (*grpc.ClientConn, error) { conn, err := grpc.Dial(dialer.DialAddress(address), gopts...) if err != nil { - return nil, errors.Wrapf(err, "failed to dial %q", address) + return nil, fmt.Errorf("failed to dial %q: %w", address, err) } pc.clients[address] = conn diff --git a/services/snapshots/service.go b/services/snapshots/service.go index 1b58ac02c96db..c6d711cc2a5eb 100644 --- a/services/snapshots/service.go +++ b/services/snapshots/service.go @@ -18,6 +18,7 @@ package snapshots import ( "context" + "errors" snapshotsapi "github.com/containerd/containerd/api/services/snapshots/v1" "github.com/containerd/containerd/api/types" @@ -28,7 +29,6 @@ import ( "github.com/containerd/containerd/services" "github.com/containerd/containerd/snapshots" ptypes "github.com/gogo/protobuf/types" - "github.com/pkg/errors" "google.golang.org/grpc" ) diff --git a/services/tasks/local.go b/services/tasks/local.go index 8d327356c0f73..96ed36ca4a344 100644 --- a/services/tasks/local.go +++ b/services/tasks/local.go @@ -48,7 +48,6 @@ import ( "github.com/containerd/typeurl" ptypes "github.com/gogo/protobuf/types" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -232,11 +231,11 @@ func (l *local) Create(ctx context.Context, r *api.CreateTaskRequest, _ ...grpc. } labels := map[string]string{"runtime": container.Runtime.Name} if err := l.monitor.Monitor(c, labels); err != nil { - return nil, errors.Wrap(err, "monitor task") + return nil, fmt.Errorf("monitor task: %w", err) } pid, err := c.PID(ctx) if err != nil { - return nil, errors.Wrap(err, "failed to get task pid") + return nil, fmt.Errorf("failed to get task pid: %w", err) } return &api.CreateTaskResponse{ ContainerID: r.ContainerID, @@ -464,7 +463,7 @@ func (l *local) ListPids(ctx context.Context, r *api.ListPidsRequest, _ ...grpc. if p.Info != nil { a, err := typeurl.MarshalAny(p.Info) if err != nil { - return nil, errors.Wrapf(err, "failed to marshal process %d info", p.Pid) + return nil, fmt.Errorf("failed to marshal process %d info: %w", p.Pid, err) } pInfo.Info = a } diff --git a/services/tasks/local_unix.go b/services/tasks/local_unix.go index 50a29f6128893..df381a892a89b 100644 --- a/services/tasks/local_unix.go +++ b/services/tasks/local_unix.go @@ -20,10 +20,11 @@ package tasks import ( + "errors" + "github.com/containerd/containerd/log" "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/runtime" - "github.com/pkg/errors" ) var tasksServiceRequires = []plugin.Type{ diff --git a/services/tasks/rdt_linux.go b/services/tasks/rdt_linux.go index ff798368c740e..78f0d69792d34 100644 --- a/services/tasks/rdt_linux.go +++ b/services/tasks/rdt_linux.go @@ -20,10 +20,11 @@ package tasks import ( + "fmt" + "github.com/containerd/containerd/log" "github.com/intel/goresctrl/pkg/rdt" - "github.com/pkg/errors" ) const ( @@ -44,7 +45,7 @@ func initRdt(configFilePath string) error { } if err := rdt.Initialize(ResctrlPrefix); err != nil { - return errors.Wrap(err, "RDT not enabled") + return fmt.Errorf("RDT not enabled: %w", err) } if err := rdt.SetConfigFromFile(configFilePath, true); err != nil { diff --git a/services/tasks/service.go b/services/tasks/service.go index a92a9a07e30aa..f73ffb415714c 100644 --- a/services/tasks/service.go +++ b/services/tasks/service.go @@ -18,12 +18,12 @@ package tasks import ( "context" + "errors" api "github.com/containerd/containerd/api/services/tasks/v1" "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/services" ptypes "github.com/gogo/protobuf/types" - "github.com/pkg/errors" "google.golang.org/grpc" ) diff --git a/snapshots/benchsuite/benchmark_test.go b/snapshots/benchsuite/benchmark_test.go index 27a3ac7c46cdf..1bc4cc6e91624 100644 --- a/snapshots/benchsuite/benchmark_test.go +++ b/snapshots/benchsuite/benchmark_test.go @@ -31,7 +31,6 @@ import ( "time" "github.com/containerd/continuity/fs/fstest" - "github.com/pkg/errors" "github.com/sirupsen/logrus" "gotest.tools/v3/assert" @@ -287,7 +286,7 @@ func updateFile(name string) applierFn { path := filepath.Join(root, name) file, err := os.OpenFile(path, os.O_WRONLY, 0600) if err != nil { - return errors.Wrapf(err, "failed to open %q", path) + return fmt.Errorf("failed to open %q: %w", path, err) } info, err := file.Stat() @@ -305,7 +304,7 @@ func updateFile(name string) applierFn { } if _, err := file.WriteAt(buf, offset); err != nil { - return errors.Wrapf(err, "failed to write %q at offset %d", path, offset) + return fmt.Errorf("failed to write %q at offset %d: %w", path, offset, err) } return file.Close() diff --git a/snapshots/btrfs/btrfs.go b/snapshots/btrfs/btrfs.go index c289b32d46d0f..0c4ba593bd59d 100644 --- a/snapshots/btrfs/btrfs.go +++ b/snapshots/btrfs/btrfs.go @@ -35,7 +35,6 @@ import ( "github.com/containerd/containerd/snapshots" "github.com/containerd/containerd/snapshots/storage" - "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -69,7 +68,7 @@ func NewSnapshotter(root string) (snapshots.Snapshotter, error) { return nil, err } if mnt.FSType != "btrfs" { - return nil, errors.Wrapf(plugin.ErrSkipPlugin, "path %s (%s) must be a btrfs filesystem to be used with the btrfs snapshotter", root, mnt.FSType) + return nil, fmt.Errorf("path %s (%s) must be a btrfs filesystem to be used with the btrfs snapshotter: %w", root, mnt.FSType, plugin.ErrSkipPlugin) } var ( active = filepath.Join(root, "active") @@ -275,7 +274,7 @@ func (b *snapshotter) mounts(dir string, s storage.Snapshot) ([]mount.Mount, err func (b *snapshotter) Commit(ctx context.Context, name, key string, opts ...snapshots.Opt) (err error) { usage, err := b.usage(ctx, key) if err != nil { - return errors.Wrap(err, "failed to compute usage") + return fmt.Errorf("failed to compute usage: %w", err) } ctx, t, err := b.ms.TransactionContext(ctx, true) @@ -292,7 +291,7 @@ func (b *snapshotter) Commit(ctx context.Context, name, key string, opts ...snap id, err := storage.CommitActive(ctx, key, name, usage, opts...) // TODO(stevvooe): Resolve a usage value for btrfs if err != nil { - return errors.Wrap(err, "failed to commit") + return fmt.Errorf("failed to commit: %w", err) } source := filepath.Join(b.root, "active", id) @@ -331,7 +330,7 @@ func (b *snapshotter) Mounts(ctx context.Context, key string) ([]mount.Mount, er s, err := storage.GetSnapshot(ctx, key) t.Rollback() if err != nil { - return nil, errors.Wrap(err, "failed to get active snapshot") + return nil, fmt.Errorf("failed to get active snapshot: %w", err) } dir := filepath.Join(b.root, strings.ToLower(s.Kind.String()), s.ID) @@ -366,7 +365,7 @@ func (b *snapshotter) Remove(ctx context.Context, key string) (err error) { id, k, err := storage.Remove(ctx, key) if err != nil { - return errors.Wrap(err, "failed to remove snapshot") + return fmt.Errorf("failed to remove snapshot: %w", err) } switch k { @@ -389,7 +388,7 @@ func (b *snapshotter) Remove(ctx context.Context, key string) (err error) { } if err := btrfs.SubvolDelete(source); err != nil { - return errors.Wrapf(err, "failed to remove snapshot %v", source) + return fmt.Errorf("failed to remove snapshot %v: %w", source, err) } err = t.Commit() diff --git a/snapshots/btrfs/btrfs_test.go b/snapshots/btrfs/btrfs_test.go index 6f0c82b1cdbff..e7dde3c509913 100644 --- a/snapshots/btrfs/btrfs_test.go +++ b/snapshots/btrfs/btrfs_test.go @@ -22,6 +22,8 @@ package btrfs import ( "bytes" "context" + "errors" + "fmt" "os" "path/filepath" "strings" @@ -34,7 +36,6 @@ import ( "github.com/containerd/containerd/snapshots" "github.com/containerd/containerd/snapshots/testsuite" "github.com/containerd/continuity/testutil/loopback" - "github.com/pkg/errors" exec "golang.org/x/sys/execabs" "golang.org/x/sys/unix" ) @@ -66,7 +67,7 @@ func boltSnapshotter(t *testing.T) func(context.Context, string) (snapshots.Snap if out, err := exec.Command(mkbtrfs, loop.Device).CombinedOutput(); err != nil { loop.Close() - return nil, nil, errors.Wrapf(err, "failed to make btrfs filesystem (out: %q)", out) + return nil, nil, fmt.Errorf("failed to make btrfs filesystem (out: %q): %w", out, err) } // sync after a mkfs on the loopback before trying to mount the device unix.Sync() @@ -75,7 +76,7 @@ func boltSnapshotter(t *testing.T) func(context.Context, string) (snapshots.Snap for i := 0; i < 5; i++ { if out, err := exec.Command("mount", loop.Device, root).CombinedOutput(); err != nil { loop.Close() - return nil, nil, errors.Wrapf(err, "failed to mount device %s (out: %q)", loop.Device, out) + return nil, nil, fmt.Errorf("failed to mount device %s (out: %q): %w", loop.Device, out, err) } if i > 0 { @@ -95,7 +96,7 @@ func boltSnapshotter(t *testing.T) func(context.Context, string) (snapshots.Snap unix.Unmount(root, 0) } if snapshotter == nil { - return nil, nil, errors.Wrap(err, "failed to successfully create snapshotter after 5 attempts") + return nil, nil, fmt.Errorf("failed to successfully create snapshotter after 5 attempts: %w", err) } return snapshotter, func() error { @@ -104,7 +105,7 @@ func boltSnapshotter(t *testing.T) func(context.Context, string) (snapshots.Snap } err := mount.UnmountAll(root, unix.MNT_DETACH) if cerr := loop.Close(); cerr != nil { - err = errors.Wrap(cerr, "device cleanup failed") + err = fmt.Errorf("device cleanup failed: %w", cerr) } return err }, nil diff --git a/snapshots/devmapper/README.md b/snapshots/devmapper/README.md index 6279db4664119..93f1836e43bca 100644 --- a/snapshots/devmapper/README.md +++ b/snapshots/devmapper/README.md @@ -27,6 +27,8 @@ The following configuration flags are supported: * `base_image_size` - defines how much space to allocate when creating the base device * `async_remove` - flag to async remove device using snapshot GC's cleanup callback * `discard_blocks` - whether to discard blocks when removing a device. This is especially useful for returning disk space to the filesystem when using loopback devices. +* `fs_type` - defines the file system to use for snapshot device mount. Valid values are `ext4` and `xfs`. Defaults to `ext4` if unspecified. +* `fs_options` - optionally defines the file system options. This is currently only applicable to `ext4` file system. Pool name and base image size are required snapshotter parameters. diff --git a/snapshots/devmapper/config.go b/snapshots/devmapper/config.go index 9e5ed7d849b21..335832985391b 100644 --- a/snapshots/devmapper/config.go +++ b/snapshots/devmapper/config.go @@ -26,7 +26,6 @@ import ( "github.com/docker/go-units" "github.com/hashicorp/go-multierror" "github.com/pelletier/go-toml" - "github.com/pkg/errors" ) // Config represents device mapper configuration loaded from file. @@ -68,11 +67,11 @@ func LoadConfig(path string) (*Config, error) { config := Config{} file, err := toml.LoadFile(path) if err != nil { - return nil, errors.Wrapf(err, "failed to open devmapepr TOML: %s", path) + return nil, fmt.Errorf("failed to open devmapepr TOML: %s: %w", path, err) } if err := file.Unmarshal(&config); err != nil { - return nil, errors.Wrap(err, "failed to unmarshal devmapper TOML") + return nil, fmt.Errorf("failed to unmarshal devmapper TOML: %w", err) } if err := config.parse(); err != nil { @@ -89,7 +88,7 @@ func LoadConfig(path string) (*Config, error) { func (c *Config) parse() error { baseImageSize, err := units.RAMInBytes(c.BaseImageSize) if err != nil { - return errors.Wrapf(err, "failed to parse base image size: '%s'", c.BaseImageSize) + return fmt.Errorf("failed to parse base image size: '%s': %w", c.BaseImageSize, err) } if c.FileSystemType == "" { diff --git a/snapshots/devmapper/dmsetup/dmsetup.go b/snapshots/devmapper/dmsetup/dmsetup.go index 7526984da6f0a..7391783137e89 100644 --- a/snapshots/devmapper/dmsetup/dmsetup.go +++ b/snapshots/devmapper/dmsetup/dmsetup.go @@ -22,6 +22,7 @@ package dmsetup import ( + "errors" "fmt" "io" "os" @@ -29,7 +30,6 @@ import ( "strings" blkdiscard "github.com/containerd/containerd/snapshots/devmapper/blkdiscard" - "github.com/pkg/errors" exec "golang.org/x/sys/execabs" "golang.org/x/sys/unix" ) @@ -101,7 +101,7 @@ const ( func makeThinPoolMapping(dataFile, metaFile string, blockSizeSectors uint32) (string, error) { dataDeviceSizeBytes, err := BlockDeviceSize(dataFile) if err != nil { - return "", errors.Wrapf(err, "failed to get block device size: %s", dataFile) + return "", fmt.Errorf("failed to get block device size: %s: %w", dataFile, err) } // Thin-pool mapping target has the following format: @@ -259,7 +259,7 @@ func Info(deviceName string) ([]*DeviceInfo, error) { &info.EventNumber) if err != nil { - return nil, errors.Wrapf(err, "failed to parse line %q", line) + return nil, fmt.Errorf("failed to parse line %q: %w", line, err) } // Parse attributes (see "man 8 dmsetup" for details) @@ -309,17 +309,17 @@ func Status(deviceName string) (*DeviceStatus, error) { const MinParseCount = 4 parts := strings.Split(output, " ") if len(parts) < MinParseCount { - return nil, errors.Errorf("failed to parse output: %q", output) + return nil, fmt.Errorf("failed to parse output: %q", output) } status.Offset, err = strconv.ParseInt(parts[0], 10, 64) if err != nil { - return nil, errors.Wrapf(err, "failed to parse offset: %q", parts[0]) + return nil, fmt.Errorf("failed to parse offset: %q: %w", parts[0], err) } status.Length, err = strconv.ParseInt(parts[1], 10, 64) if err != nil { - return nil, errors.Wrapf(err, "failed to parse length: %q", parts[1]) + return nil, fmt.Errorf("failed to parse length: %q: %w", parts[1], err) } status.Target = parts[2] @@ -347,7 +347,7 @@ func BlockDeviceSize(path string) (int64, error) { size, err := f.Seek(0, io.SeekEnd) if err != nil { - return 0, errors.Wrapf(err, "failed to seek on %q", path) + return 0, fmt.Errorf("failed to seek on %q: %w", path, err) } return size, nil } @@ -379,7 +379,7 @@ func dmsetup(args ...string) (string, error) { return "", errno } - return "", errors.Wrapf(err, "dmsetup %s\nerror: %s\n", strings.Join(args, " "), output) + return "", fmt.Errorf("dmsetup %s\nerror: %s\n: %w", strings.Join(args, " "), output, err) } output = strings.TrimSuffix(output, "\n") diff --git a/snapshots/devmapper/metadata.go b/snapshots/devmapper/metadata.go index 730187e2fe20a..6aab53a2429d2 100644 --- a/snapshots/devmapper/metadata.go +++ b/snapshots/devmapper/metadata.go @@ -22,10 +22,10 @@ package devmapper import ( "context" "encoding/json" + "errors" "fmt" "strconv" - "github.com/pkg/errors" bolt "go.etcd.io/bbolt" ) @@ -70,7 +70,7 @@ func NewPoolMetadata(dbfile string) (*PoolMetadata, error) { metadata := &PoolMetadata{db: db} if err := metadata.ensureDatabaseInitialized(); err != nil { - return nil, errors.Wrap(err, "failed to initialize database") + return nil, fmt.Errorf("failed to initialize database: %w", err) } return metadata, nil @@ -102,7 +102,7 @@ func (m *PoolMetadata) AddDevice(ctx context.Context, info *DeviceInfo) error { // See https://github.com/containerd/containerd/pull/3436 for more context. var existing DeviceInfo if err := getObject(devicesBucket, info.Name, &existing); err == nil && existing.State != Faulty { - return errors.Wrapf(ErrAlreadyExists, "device %q is already there %+v", info.Name, existing) + return fmt.Errorf("device %q is already there %+v: %w", info.Name, existing, ErrAlreadyExists) } // Find next available device ID @@ -117,7 +117,7 @@ func (m *PoolMetadata) AddDevice(ctx context.Context, info *DeviceInfo) error { }) if err != nil { - return errors.Wrapf(err, "failed to save metadata for device %q (parent: %q)", info.Name, info.ParentName) + return fmt.Errorf("failed to save metadata for device %q (parent: %q): %w", info.Name, info.ParentName, err) } return nil @@ -213,7 +213,7 @@ func markDeviceID(tx *bolt.Tx, deviceID uint32, state deviceIDState) error { ) if err := bucket.Put([]byte(key), value); err != nil { - return errors.Wrapf(err, "failed to free device id %q", key) + return fmt.Errorf("failed to free device id %q: %w", key, err) } return nil @@ -282,7 +282,7 @@ func (m *PoolMetadata) RemoveDevice(ctx context.Context, name string) error { } if err := bucket.Delete([]byte(name)); err != nil { - return errors.Wrapf(err, "failed to delete device info for %q", name) + return fmt.Errorf("failed to delete device info for %q: %w", name, err) } return markDeviceID(tx, device.DeviceID, deviceFree) @@ -297,7 +297,7 @@ func (m *PoolMetadata) WalkDevices(ctx context.Context, cb func(info *DeviceInfo return bucket.ForEach(func(key, value []byte) error { device := &DeviceInfo{} if err := json.Unmarshal(value, device); err != nil { - return errors.Wrapf(err, "failed to unmarshal %s", key) + return fmt.Errorf("failed to unmarshal %s: %w", key, err) } return cb(device) @@ -340,16 +340,16 @@ func putObject(bucket *bolt.Bucket, key string, obj interface{}, overwrite bool) keyBytes := []byte(key) if !overwrite && bucket.Get(keyBytes) != nil { - return errors.Errorf("object with key %q already exists", key) + return fmt.Errorf("object with key %q already exists", key) } data, err := json.Marshal(obj) if err != nil { - return errors.Wrapf(err, "failed to marshal object with key %q", key) + return fmt.Errorf("failed to marshal object with key %q: %w", key, err) } if err := bucket.Put(keyBytes, data); err != nil { - return errors.Wrapf(err, "failed to insert object with key %q", key) + return fmt.Errorf("failed to insert object with key %q: %w", key, err) } return nil @@ -363,7 +363,7 @@ func getObject(bucket *bolt.Bucket, key string, obj interface{}) error { if obj != nil { if err := json.Unmarshal(data, obj); err != nil { - return errors.Wrapf(err, "failed to unmarshal object with key %q", key) + return fmt.Errorf("failed to unmarshal object with key %q: %w", key, err) } } diff --git a/snapshots/devmapper/metadata_test.go b/snapshots/devmapper/metadata_test.go index 17b2bb2d35bad..f482fd45c0c5e 100644 --- a/snapshots/devmapper/metadata_test.go +++ b/snapshots/devmapper/metadata_test.go @@ -21,12 +21,12 @@ package devmapper import ( "context" + "errors" "os" "path/filepath" "strconv" "testing" - "github.com/pkg/errors" "go.etcd.io/bbolt" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/snapshots/devmapper/plugin/plugin.go b/snapshots/devmapper/plugin/plugin.go index ad74e1fe1737b..403fd69d20650 100644 --- a/snapshots/devmapper/plugin/plugin.go +++ b/snapshots/devmapper/plugin/plugin.go @@ -20,10 +20,11 @@ package plugin import ( + "errors" + "github.com/containerd/containerd/platforms" "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/snapshots/devmapper" - "github.com/pkg/errors" ) func init() { diff --git a/snapshots/devmapper/pool_device.go b/snapshots/devmapper/pool_device.go index 8a297d0f0dd31..3af80d338d0ad 100644 --- a/snapshots/devmapper/pool_device.go +++ b/snapshots/devmapper/pool_device.go @@ -21,12 +21,13 @@ package devmapper import ( "context" + "errors" + "fmt" "path/filepath" "strconv" "time" "github.com/hashicorp/go-multierror" - "github.com/pkg/errors" "golang.org/x/sys/unix" "github.com/containerd/containerd/log" @@ -72,7 +73,7 @@ func NewPoolDevice(ctx context.Context, config *Config) (*PoolDevice, error) { // Make sure pool exists and available poolPath := dmsetup.GetFullDevicePath(config.PoolName) if _, err := dmsetup.Info(poolPath); err != nil { - return nil, errors.Wrapf(err, "failed to query pool %q", poolPath) + return nil, fmt.Errorf("failed to query pool %q: %w", poolPath, err) } poolDevice := &PoolDevice{ @@ -82,7 +83,7 @@ func NewPoolDevice(ctx context.Context, config *Config) (*PoolDevice, error) { } if err := poolDevice.ensureDeviceStates(ctx); err != nil { - return nil, errors.Wrap(err, "failed to check devices state") + return nil, fmt.Errorf("failed to check devices state: %w", err) } return poolDevice, nil @@ -134,7 +135,7 @@ func (p *PoolDevice) ensureDeviceStates(ctx context.Context) error { } return nil }); err != nil { - return errors.Wrap(err, "failed to query devices from metastore") + return fmt.Errorf("failed to query devices from metastore: %w", err) } var result *multierror.Error @@ -175,7 +176,7 @@ func (p *PoolDevice) transition(ctx context.Context, deviceName string, tryingSt }) if uerr != nil { - return errors.Wrapf(uerr, "failed to set device %q state to %q", deviceName, tryingState) + return fmt.Errorf("failed to set device %q state to %q: %w", deviceName, tryingState, uerr) } var result *multierror.Error @@ -293,7 +294,7 @@ func (p *PoolDevice) createDevice(ctx context.Context, info *DeviceInfo) error { if err := p.transition(ctx, info.Name, Creating, Created, func() error { return dmsetup.CreateDevice(p.poolName, info.DeviceID) }); err != nil { - return errors.Wrapf(err, "failed to create new thin device %q (dev: %d)", info.Name, info.DeviceID) + return fmt.Errorf("failed to create new thin device %q (dev: %d): %w", info.Name, info.DeviceID, err) } return nil @@ -304,7 +305,7 @@ func (p *PoolDevice) activateDevice(ctx context.Context, info *DeviceInfo) error if err := p.transition(ctx, info.Name, Activating, Activated, func() error { return dmsetup.ActivateDevice(p.poolName, info.Name, info.DeviceID, info.Size, "") }); err != nil { - return errors.Wrapf(err, "failed to activate new thin device %q (dev: %d)", info.Name, info.DeviceID) + return fmt.Errorf("failed to activate new thin device %q (dev: %d): %w", info.Name, info.DeviceID, err) } return nil @@ -314,7 +315,7 @@ func (p *PoolDevice) activateDevice(ctx context.Context, info *DeviceInfo) error func (p *PoolDevice) CreateSnapshotDevice(ctx context.Context, deviceName string, snapshotName string, virtualSizeBytes uint64) (retErr error) { baseInfo, err := p.metadata.GetDevice(ctx, deviceName) if err != nil { - return errors.Wrapf(err, "failed to query device metadata for %q", deviceName) + return fmt.Errorf("failed to query device metadata for %q: %w", deviceName, err) } snapInfo := &DeviceInfo{ @@ -386,12 +387,13 @@ func (p *PoolDevice) createSnapshot(ctx context.Context, baseInfo, snapInfo *Dev if err := p.transition(ctx, snapInfo.Name, Creating, Created, func() error { return dmsetup.CreateSnapshot(p.poolName, snapInfo.DeviceID, baseInfo.DeviceID) }); err != nil { - return errors.Wrapf(err, - "failed to create snapshot %q (dev: %d) from %q (dev: %d)", + return fmt.Errorf( + "failed to create snapshot %q (dev: %d) from %q (dev: %d): %w", snapInfo.Name, snapInfo.DeviceID, baseInfo.Name, - baseInfo.DeviceID) + baseInfo.DeviceID, err, + ) } return nil @@ -402,7 +404,7 @@ func (p *PoolDevice) SuspendDevice(ctx context.Context, deviceName string) error if err := p.transition(ctx, deviceName, Suspending, Suspended, func() error { return dmsetup.SuspendDevice(deviceName) }); err != nil { - return errors.Wrapf(err, "failed to suspend device %q", deviceName) + return fmt.Errorf("failed to suspend device %q: %w", deviceName, err) } return nil @@ -413,7 +415,7 @@ func (p *PoolDevice) ResumeDevice(ctx context.Context, deviceName string) error if err := p.transition(ctx, deviceName, Resuming, Resumed, func() error { return dmsetup.ResumeDevice(deviceName) }); err != nil { - return errors.Wrapf(err, "failed to resume device %q", deviceName) + return fmt.Errorf("failed to resume device %q: %w", deviceName, err) } return nil @@ -446,13 +448,13 @@ func (p *PoolDevice) DeactivateDevice(ctx context.Context, deviceName string, de } } if err := dmsetup.RemoveDevice(deviceName, opts...); err != nil { - return errors.Wrap(err, "failed to deactivate device") + return fmt.Errorf("failed to deactivate device: %w", err) } return nil }) }); err != nil { - return errors.Wrapf(err, "failed to deactivate device %q", deviceName) + return fmt.Errorf("failed to deactivate device %q: %w", deviceName, err) } return nil @@ -487,7 +489,7 @@ func (p *PoolDevice) IsLoaded(deviceName string) bool { func (p *PoolDevice) GetUsage(deviceName string) (int64, error) { status, err := dmsetup.Status(deviceName) if err != nil { - return 0, errors.Wrapf(err, "can't get status for device %q", deviceName) + return 0, fmt.Errorf("can't get status for device %q: %w", deviceName, err) } if len(status.Params) == 0 { @@ -496,7 +498,7 @@ func (p *PoolDevice) GetUsage(deviceName string) (int64, error) { count, err := strconv.ParseInt(status.Params[0], 10, 64) if err != nil { - return 0, errors.Wrapf(err, "failed to parse status params: %q", status.Params[0]) + return 0, fmt.Errorf("failed to parse status params: %q: %w", status.Params[0], err) } return count * dmsetup.SectorSize, nil @@ -506,7 +508,7 @@ func (p *PoolDevice) GetUsage(deviceName string) (int64, error) { func (p *PoolDevice) RemoveDevice(ctx context.Context, deviceName string) error { info, err := p.metadata.GetDevice(ctx, deviceName) if err != nil { - return errors.Wrapf(err, "can't query metadata for device %q", deviceName) + return fmt.Errorf("can't query metadata for device %q: %w", deviceName, err) } if err := p.DeactivateDevice(ctx, deviceName, false, true); err != nil { @@ -519,7 +521,7 @@ func (p *PoolDevice) RemoveDevice(ctx context.Context, deviceName string) error // Remove record from meta store and free device ID if err := p.metadata.RemoveDevice(ctx, deviceName); err != nil { - return errors.Wrapf(err, "can't remove device %q metadata from store after removal", deviceName) + return fmt.Errorf("can't remove device %q metadata from store after removal: %w", deviceName, err) } return nil @@ -537,7 +539,7 @@ func (p *PoolDevice) deleteDevice(ctx context.Context, info *DeviceInfo) error { return nil }) }); err != nil { - return errors.Wrapf(err, "failed to delete device %q (dev id: %d)", info.Name, info.DeviceID) + return fmt.Errorf("failed to delete device %q (dev id: %d): %w", info.Name, info.DeviceID, err) } return nil @@ -547,7 +549,7 @@ func (p *PoolDevice) deleteDevice(ctx context.Context, info *DeviceInfo) error { func (p *PoolDevice) RemovePool(ctx context.Context) error { deviceNames, err := p.metadata.GetDeviceNames(ctx) if err != nil { - return errors.Wrap(err, "can't query device names") + return fmt.Errorf("can't query device names: %w", err) } var result *multierror.Error @@ -555,12 +557,12 @@ func (p *PoolDevice) RemovePool(ctx context.Context) error { // Deactivate devices if any for _, name := range deviceNames { if err := p.DeactivateDevice(ctx, name, true, true); err != nil { - result = multierror.Append(result, errors.Wrapf(err, "failed to remove %q", name)) + result = multierror.Append(result, fmt.Errorf("failed to remove %q: %w", name, err)) } } if err := dmsetup.RemoveDevice(p.poolName, dmsetup.RemoveWithForce, dmsetup.RemoveWithRetries, dmsetup.RemoveDeferred); err != nil { - result = multierror.Append(result, errors.Wrapf(err, "failed to remove pool %q", p.poolName)) + result = multierror.Append(result, fmt.Errorf("failed to remove pool %q: %w", p.poolName, err)) } return result.ErrorOrNil() diff --git a/snapshots/devmapper/snapshotter.go b/snapshots/devmapper/snapshotter.go index 4a504ac7c4596..ca9867f491c35 100644 --- a/snapshots/devmapper/snapshotter.go +++ b/snapshots/devmapper/snapshotter.go @@ -21,6 +21,7 @@ package devmapper import ( "context" + "errors" "fmt" "os" "path/filepath" @@ -34,7 +35,6 @@ import ( "github.com/containerd/containerd/snapshots/devmapper/dmsetup" "github.com/containerd/containerd/snapshots/storage" "github.com/hashicorp/go-multierror" - "github.com/pkg/errors" "github.com/sirupsen/logrus" exec "golang.org/x/sys/execabs" ) @@ -76,12 +76,12 @@ func NewSnapshotter(ctx context.Context, config *Config) (*Snapshotter, error) { var cleanupFn []closeFunc if err := os.MkdirAll(config.RootPath, 0750); err != nil && !os.IsExist(err) { - return nil, errors.Wrapf(err, "failed to create root directory: %s", config.RootPath) + return nil, fmt.Errorf("failed to create root directory: %s: %w", config.RootPath, err) } store, err := storage.NewMetaStore(filepath.Join(config.RootPath, metadataFileName)) if err != nil { - return nil, errors.Wrap(err, "failed to create metastore") + return nil, fmt.Errorf("failed to create metastore: %w", err) } cleanupFn = append(cleanupFn, store.Close) @@ -481,7 +481,7 @@ func mkfs(ctx context.Context, fs fsType, fsOptions string, path string) error { b, err := exec.Command(mkfsCommand, args...).CombinedOutput() out := string(b) if err != nil { - return errors.Wrapf(err, "%s couldn't initialize %q: %s", mkfsCommand, path, out) + return fmt.Errorf("%s couldn't initialize %q: %s: %w", mkfsCommand, path, out, err) } log.G(ctx).Debugf("mkfs:\n%s", out) @@ -539,12 +539,12 @@ func (s *Snapshotter) withTransaction(ctx context.Context, writable bool, fn fun if err != nil || !writable { if terr := trans.Rollback(); terr != nil { log.G(ctx).WithError(terr).Error("failed to rollback transaction") - result = multierror.Append(result, errors.Wrap(terr, "rollback failed")) + result = multierror.Append(result, fmt.Errorf("rollback failed: %w", terr)) } } else { if terr := trans.Commit(); terr != nil { log.G(ctx).WithError(terr).Error("failed to commit transaction") - result = multierror.Append(result, errors.Wrap(terr, "commit failed")) + result = multierror.Append(result, fmt.Errorf("commit failed: %w", terr)) } } diff --git a/snapshots/native/native.go b/snapshots/native/native.go index f3d33afa02bcd..33578fd146399 100644 --- a/snapshots/native/native.go +++ b/snapshots/native/native.go @@ -18,6 +18,7 @@ package native import ( "context" + "fmt" "os" "path/filepath" @@ -27,7 +28,6 @@ import ( "github.com/containerd/containerd/snapshots/storage" "github.com/containerd/continuity/fs" - "github.com/pkg/errors" ) type snapshotter struct { @@ -137,7 +137,7 @@ func (o *snapshotter) Mounts(ctx context.Context, key string) ([]mount.Mount, er s, err := storage.GetSnapshot(ctx, key) t.Rollback() if err != nil { - return nil, errors.Wrap(err, "failed to get snapshot mount") + return nil, fmt.Errorf("failed to get snapshot mount: %w", err) } return o.mounts(s), nil } @@ -162,7 +162,7 @@ func (o *snapshotter) Commit(ctx context.Context, name, key string, opts ...snap if rerr := t.Rollback(); rerr != nil { log.G(ctx).WithError(rerr).Warn("failed to rollback transaction") } - return errors.Wrap(err, "failed to commit snapshot") + return fmt.Errorf("failed to commit snapshot: %w", err) } return t.Commit() } @@ -184,14 +184,14 @@ func (o *snapshotter) Remove(ctx context.Context, key string) (err error) { id, _, err := storage.Remove(ctx, key) if err != nil { - return errors.Wrap(err, "failed to remove") + return fmt.Errorf("failed to remove: %w", err) } path := o.getSnapshotDir(id) renamed := filepath.Join(o.root, "snapshots", "rm-"+id) if err := os.Rename(path, renamed); err != nil { if !os.IsNotExist(err) { - return errors.Wrap(err, "failed to rename") + return fmt.Errorf("failed to rename: %w", err) } renamed = "" } @@ -205,7 +205,7 @@ func (o *snapshotter) Remove(ctx context.Context, key string) (err error) { log.G(ctx).WithError(err1).WithField("path", renamed).Error("failed to rename after failed commit") } } - return errors.Wrap(err, "failed to commit") + return fmt.Errorf("failed to commit: %w", err) } if renamed != "" { if err := os.RemoveAll(renamed); err != nil { @@ -235,21 +235,21 @@ func (o *snapshotter) createSnapshot(ctx context.Context, kind snapshots.Kind, k if kind == snapshots.KindActive || parent == "" { td, err = os.MkdirTemp(filepath.Join(o.root, "snapshots"), "new-") if err != nil { - return nil, errors.Wrap(err, "failed to create temp dir") + return nil, fmt.Errorf("failed to create temp dir: %w", err) } if err := os.Chmod(td, 0755); err != nil { - return nil, errors.Wrapf(err, "failed to chmod %s to 0755", td) + return nil, fmt.Errorf("failed to chmod %s to 0755: %w", td, err) } defer func() { if err != nil { if td != "" { if err1 := os.RemoveAll(td); err1 != nil { - err = errors.Wrapf(err, "remove failed: %v", err1) + err = fmt.Errorf("remove failed: %v: %w", err1, err) } } if path != "" { if err1 := os.RemoveAll(path); err1 != nil { - err = errors.Wrapf(err, "failed to remove path: %v", err1) + err = fmt.Errorf("failed to remove path: %v: %w", err1, err) } } } @@ -266,7 +266,7 @@ func (o *snapshotter) createSnapshot(ctx context.Context, kind snapshots.Kind, k if rerr := t.Rollback(); rerr != nil { log.G(ctx).WithError(rerr).Warn("failed to rollback transaction") } - return nil, errors.Wrap(err, "failed to create snapshot") + return nil, fmt.Errorf("failed to create snapshot: %w", err) } if td != "" { @@ -281,7 +281,7 @@ func (o *snapshotter) createSnapshot(ctx context.Context, kind snapshots.Kind, k fs.WithXAttrErrorHandler(xattrErrorHandler), } if err := fs.CopyDir(td, parent, copyDirOpts...); err != nil { - return nil, errors.Wrap(err, "copying of parent failed") + return nil, fmt.Errorf("copying of parent failed: %w", err) } } @@ -290,13 +290,13 @@ func (o *snapshotter) createSnapshot(ctx context.Context, kind snapshots.Kind, k if rerr := t.Rollback(); rerr != nil { log.G(ctx).WithError(rerr).Warn("failed to rollback transaction") } - return nil, errors.Wrap(err, "failed to rename") + return nil, fmt.Errorf("failed to rename: %w", err) } td = "" } if err := t.Commit(); err != nil { - return nil, errors.Wrap(err, "commit failed") + return nil, fmt.Errorf("commit failed: %w", err) } return o.mounts(s), nil diff --git a/snapshots/overlay/overlay.go b/snapshots/overlay/overlay.go index b9073724c3c5a..26ee5c5684472 100644 --- a/snapshots/overlay/overlay.go +++ b/snapshots/overlay/overlay.go @@ -33,7 +33,6 @@ import ( "github.com/containerd/containerd/snapshots/overlay/overlayutils" "github.com/containerd/containerd/snapshots/storage" "github.com/containerd/continuity/fs" - "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -231,7 +230,7 @@ func (o *snapshotter) Mounts(ctx context.Context, key string) ([]mount.Mount, er s, err := storage.GetSnapshot(ctx, key) t.Rollback() if err != nil { - return nil, errors.Wrap(err, "failed to get active mount") + return nil, fmt.Errorf("failed to get active mount: %w", err) } return o.mounts(s), nil } @@ -262,7 +261,7 @@ func (o *snapshotter) Commit(ctx context.Context, name, key string, opts ...snap } if _, err = storage.CommitActive(ctx, key, name, snapshots.Usage(usage), opts...); err != nil { - return errors.Wrap(err, "failed to commit snapshot") + return fmt.Errorf("failed to commit snapshot: %w", err) } return t.Commit() } @@ -285,14 +284,14 @@ func (o *snapshotter) Remove(ctx context.Context, key string) (err error) { _, _, err = storage.Remove(ctx, key) if err != nil { - return errors.Wrap(err, "failed to remove") + return fmt.Errorf("failed to remove: %w", err) } if !o.asyncRemove { var removals []string removals, err = o.getCleanupDirectories(ctx, t) if err != nil { - return errors.Wrap(err, "unable to get directories for removal") + return fmt.Errorf("unable to get directories for removal: %w", err) } // Remove directories after the transaction is closed, failures must not @@ -411,7 +410,7 @@ func (o *snapshotter) createSnapshot(ctx context.Context, kind snapshots.Kind, k if path != "" { if err1 := os.RemoveAll(path); err1 != nil { log.G(ctx).WithError(err1).WithField("path", path).Error("failed to reclaim snapshot directory, directory may need removal") - err = errors.Wrapf(err, "failed to remove path: %v", err1) + err = fmt.Errorf("failed to remove path: %v: %w", err1, err) } } } @@ -423,7 +422,7 @@ func (o *snapshotter) createSnapshot(ctx context.Context, kind snapshots.Kind, k if rerr := t.Rollback(); rerr != nil { log.G(ctx).WithError(rerr).Warn("failed to rollback transaction") } - return nil, errors.Wrap(err, "failed to create prepare snapshot dir") + return nil, fmt.Errorf("failed to create prepare snapshot dir: %w", err) } rollback := true defer func() { @@ -436,13 +435,13 @@ func (o *snapshotter) createSnapshot(ctx context.Context, kind snapshots.Kind, k s, err := storage.CreateSnapshot(ctx, kind, key, parent, opts...) if err != nil { - return nil, errors.Wrap(err, "failed to create snapshot") + return nil, fmt.Errorf("failed to create snapshot: %w", err) } if len(s.ParentIDs) > 0 { st, err := os.Stat(o.upperPath(s.ParentIDs[0])) if err != nil { - return nil, errors.Wrap(err, "failed to stat parent") + return nil, fmt.Errorf("failed to stat parent: %w", err) } stat := st.Sys().(*syscall.Stat_t) @@ -451,19 +450,19 @@ func (o *snapshotter) createSnapshot(ctx context.Context, kind snapshots.Kind, k if rerr := t.Rollback(); rerr != nil { log.G(ctx).WithError(rerr).Warn("failed to rollback transaction") } - return nil, errors.Wrap(err, "failed to chown") + return nil, fmt.Errorf("failed to chown: %w", err) } } path = filepath.Join(snapshotDir, s.ID) if err = os.Rename(td, path); err != nil { - return nil, errors.Wrap(err, "failed to rename") + return nil, fmt.Errorf("failed to rename: %w", err) } td = "" rollback = false if err = t.Commit(); err != nil { - return nil, errors.Wrap(err, "commit failed") + return nil, fmt.Errorf("commit failed: %w", err) } return o.mounts(s), nil @@ -472,7 +471,7 @@ func (o *snapshotter) createSnapshot(ctx context.Context, kind snapshots.Kind, k func (o *snapshotter) prepareDirectory(ctx context.Context, snapshotDir string, kind snapshots.Kind) (string, error) { td, err := os.MkdirTemp(snapshotDir, "new-") if err != nil { - return "", errors.Wrap(err, "failed to create temp dir") + return "", fmt.Errorf("failed to create temp dir: %w", err) } if err := os.Mkdir(filepath.Join(td, "fs"), 0755); err != nil { diff --git a/snapshots/overlay/overlayutils/check.go b/snapshots/overlay/overlayutils/check.go index 27bd305cbcef8..c5b93fc576798 100644 --- a/snapshots/overlay/overlayutils/check.go +++ b/snapshots/overlay/overlayutils/check.go @@ -28,7 +28,6 @@ import ( "github.com/containerd/containerd/mount" "github.com/containerd/containerd/pkg/userns" "github.com/containerd/continuity/fs" - "github.com/pkg/errors" ) // SupportsMultipleLowerDir checks if the system supports multiple lowerdirs, @@ -63,7 +62,7 @@ func SupportsMultipleLowerDir(d string) error { } dest := filepath.Join(td, "merged") if err := m.Mount(dest); err != nil { - return errors.Wrap(err, "failed to mount overlay") + return fmt.Errorf("failed to mount overlay: %w", err) } if err := mount.UnmountAll(dest, 0); err != nil { log.L.WithError(err).Warnf("Failed to unmount check directory %v", dest) diff --git a/snapshots/storage/bolt.go b/snapshots/storage/bolt.go index 712c71f72e82f..894ac2e022fc5 100644 --- a/snapshots/storage/bolt.go +++ b/snapshots/storage/bolt.go @@ -19,6 +19,7 @@ package storage import ( "context" "encoding/binary" + "errors" "fmt" "strings" "time" @@ -27,7 +28,6 @@ import ( "github.com/containerd/containerd/filters" "github.com/containerd/containerd/metadata/boltutil" "github.com/containerd/containerd/snapshots" - "github.com/pkg/errors" bolt "go.etcd.io/bbolt" ) @@ -100,7 +100,7 @@ func UpdateInfo(ctx context.Context, info snapshots.Info, fieldpaths ...string) err := withBucket(ctx, func(ctx context.Context, bkt, pbkt *bolt.Bucket) error { sbkt := bkt.Bucket([]byte(info.Name)) if sbkt == nil { - return errors.Wrap(errdefs.ErrNotFound, "snapshot does not exist") + return fmt.Errorf("snapshot does not exist: %w", errdefs.ErrNotFound) } if err := readSnapshot(sbkt, nil, &updated); err != nil { return err @@ -122,7 +122,7 @@ func UpdateInfo(ctx context.Context, info snapshots.Info, fieldpaths ...string) case "labels": updated.Labels = info.Labels default: - return errors.Wrapf(errdefs.ErrInvalidArgument, "cannot update %q field on snapshot %q", path, info.Name) + return fmt.Errorf("cannot update %q field on snapshot %q: %w", path, info.Name, errdefs.ErrInvalidArgument) } } } else { @@ -181,25 +181,25 @@ func GetSnapshot(ctx context.Context, key string) (s Snapshot, err error) { err = withBucket(ctx, func(ctx context.Context, bkt, pbkt *bolt.Bucket) error { sbkt := bkt.Bucket([]byte(key)) if sbkt == nil { - return errors.Wrap(errdefs.ErrNotFound, "snapshot does not exist") + return fmt.Errorf("snapshot does not exist: %w", errdefs.ErrNotFound) } s.ID = fmt.Sprintf("%d", readID(sbkt)) s.Kind = readKind(sbkt) if s.Kind != snapshots.KindActive && s.Kind != snapshots.KindView { - return errors.Wrapf(errdefs.ErrFailedPrecondition, "requested snapshot %v not active or view", key) + return fmt.Errorf("requested snapshot %v not active or view: %w", key, errdefs.ErrFailedPrecondition) } if parentKey := sbkt.Get(bucketKeyParent); len(parentKey) > 0 { spbkt := bkt.Bucket(parentKey) if spbkt == nil { - return errors.Wrap(errdefs.ErrNotFound, "parent does not exist") + return fmt.Errorf("parent does not exist: %w", errdefs.ErrNotFound) } s.ParentIDs, err = parents(bkt, spbkt, readID(spbkt)) if err != nil { - return errors.Wrap(err, "failed to get parent chain") + return fmt.Errorf("failed to get parent chain: %w", err) } } return nil @@ -216,7 +216,7 @@ func CreateSnapshot(ctx context.Context, kind snapshots.Kind, key, parent string switch kind { case snapshots.KindActive, snapshots.KindView: default: - return Snapshot{}, errors.Wrapf(errdefs.ErrInvalidArgument, "snapshot type %v invalid; only snapshots of type Active or View can be created", kind) + return Snapshot{}, fmt.Errorf("snapshot type %v invalid; only snapshots of type Active or View can be created: %w", kind, errdefs.ErrInvalidArgument) } var base snapshots.Info for _, opt := range opts { @@ -232,24 +232,24 @@ func CreateSnapshot(ctx context.Context, kind snapshots.Kind, key, parent string if parent != "" { spbkt = bkt.Bucket([]byte(parent)) if spbkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "missing parent %q bucket", parent) + return fmt.Errorf("missing parent %q bucket: %w", parent, errdefs.ErrNotFound) } if readKind(spbkt) != snapshots.KindCommitted { - return errors.Wrapf(errdefs.ErrInvalidArgument, "parent %q is not committed snapshot", parent) + return fmt.Errorf("parent %q is not committed snapshot: %w", parent, errdefs.ErrInvalidArgument) } } sbkt, err := bkt.CreateBucket([]byte(key)) if err != nil { if err == bolt.ErrBucketExists { - err = errors.Wrapf(errdefs.ErrAlreadyExists, "snapshot %v", key) + err = fmt.Errorf("snapshot %v: %w", key, errdefs.ErrAlreadyExists) } return err } id, err := bkt.NextSequence() if err != nil { - return errors.Wrapf(err, "unable to get identifier for snapshot %q", key) + return fmt.Errorf("unable to get identifier for snapshot %q: %w", key, err) } t := time.Now().UTC() @@ -270,12 +270,12 @@ func CreateSnapshot(ctx context.Context, kind snapshots.Kind, key, parent string // Store a backlink from the key to the parent. Store the snapshot name // as the value to allow following the backlink to the snapshot value. if err := pbkt.Put(parentKey(pid, id), []byte(key)); err != nil { - return errors.Wrapf(err, "failed to write parent link for snapshot %q", key) + return fmt.Errorf("failed to write parent link for snapshot %q: %w", key, err) } s.ParentIDs, err = parents(bkt, spbkt, pid) if err != nil { - return errors.Wrapf(err, "failed to get parent chain for snapshot %q", key) + return fmt.Errorf("failed to get parent chain for snapshot %q: %w", key, err) } } @@ -302,33 +302,33 @@ func Remove(ctx context.Context, key string) (string, snapshots.Kind, error) { if err := withBucket(ctx, func(ctx context.Context, bkt, pbkt *bolt.Bucket) error { sbkt := bkt.Bucket([]byte(key)) if sbkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "snapshot %v", key) + return fmt.Errorf("snapshot %v: %w", key, errdefs.ErrNotFound) } if err := readSnapshot(sbkt, &id, &si); err != nil { - return errors.Wrapf(err, "failed to read snapshot %s", key) + return fmt.Errorf("failed to read snapshot %s: %w", key, err) } if pbkt != nil { k, _ := pbkt.Cursor().Seek(parentPrefixKey(id)) if getParentPrefix(k) == id { - return errors.Wrap(errdefs.ErrFailedPrecondition, "cannot remove snapshot with child") + return fmt.Errorf("cannot remove snapshot with child: %w", errdefs.ErrFailedPrecondition) } if si.Parent != "" { spbkt := bkt.Bucket([]byte(si.Parent)) if spbkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "snapshot %v", key) + return fmt.Errorf("snapshot %v: %w", key, errdefs.ErrNotFound) } if err := pbkt.Delete(parentKey(readID(spbkt), id)); err != nil { - return errors.Wrap(err, "failed to delete parent link") + return fmt.Errorf("failed to delete parent link: %w", err) } } } if err := bkt.DeleteBucket([]byte(key)); err != nil { - return errors.Wrap(err, "failed to delete snapshot") + return fmt.Errorf("failed to delete snapshot: %w", err) } return nil @@ -362,20 +362,20 @@ func CommitActive(ctx context.Context, key, name string, usage snapshots.Usage, if err == bolt.ErrBucketExists { err = errdefs.ErrAlreadyExists } - return errors.Wrapf(err, "committed snapshot %v", name) + return fmt.Errorf("committed snapshot %v: %w", name, err) } sbkt := bkt.Bucket([]byte(key)) if sbkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "failed to get active snapshot %q", key) + return fmt.Errorf("failed to get active snapshot %q: %w", key, errdefs.ErrNotFound) } var si snapshots.Info if err := readSnapshot(sbkt, &id, &si); err != nil { - return errors.Wrapf(err, "failed to read active snapshot %q", key) + return fmt.Errorf("failed to read active snapshot %q: %w", key, err) } if si.Kind != snapshots.KindActive { - return errors.Wrapf(errdefs.ErrFailedPrecondition, "snapshot %q is not active", key) + return fmt.Errorf("snapshot %q is not active: %w", key, errdefs.ErrFailedPrecondition) } si.Kind = snapshots.KindCommitted si.Created = time.Now().UTC() @@ -391,18 +391,18 @@ func CommitActive(ctx context.Context, key, name string, usage snapshots.Usage, return err } if err := bkt.DeleteBucket([]byte(key)); err != nil { - return errors.Wrapf(err, "failed to delete active snapshot %q", key) + return fmt.Errorf("failed to delete active snapshot %q: %w", key, err) } if si.Parent != "" { spbkt := bkt.Bucket([]byte(si.Parent)) if spbkt == nil { - return errors.Wrapf(errdefs.ErrNotFound, "missing parent %q of snapshot %q", si.Parent, key) + return fmt.Errorf("missing parent %q of snapshot %q: %w", si.Parent, key, errdefs.ErrNotFound) } pid := readID(spbkt) // Updates parent back link to use new key if err := pbkt.Put(parentKey(pid, id), []byte(name)); err != nil { - return errors.Wrapf(err, "failed to update parent link %q from %q to %q", pid, key, name) + return fmt.Errorf("failed to update parent link %q from %q to %q: %w", pid, key, name, err) } } @@ -441,15 +441,15 @@ func withSnapshotBucket(ctx context.Context, key string, fn func(context.Context } vbkt := tx.Bucket(bucketKeyStorageVersion) if vbkt == nil { - return errors.Wrap(errdefs.ErrNotFound, "bucket does not exist") + return fmt.Errorf("bucket does not exist: %w", errdefs.ErrNotFound) } bkt := vbkt.Bucket(bucketKeySnapshot) if bkt == nil { - return errors.Wrap(errdefs.ErrNotFound, "snapshots bucket does not exist") + return fmt.Errorf("snapshots bucket does not exist: %w", errdefs.ErrNotFound) } bkt = bkt.Bucket([]byte(key)) if bkt == nil { - return errors.Wrap(errdefs.ErrNotFound, "snapshot does not exist") + return fmt.Errorf("snapshot does not exist: %w", errdefs.ErrNotFound) } return fn(ctx, bkt, vbkt.Bucket(bucketKeyParents)) @@ -462,7 +462,7 @@ func withBucket(ctx context.Context, fn func(context.Context, *bolt.Bucket, *bol } bkt := tx.Bucket(bucketKeyStorageVersion) if bkt == nil { - return errors.Wrap(errdefs.ErrNotFound, "bucket does not exist") + return fmt.Errorf("bucket does not exist: %w", errdefs.ErrNotFound) } return fn(ctx, bkt.Bucket(bucketKeySnapshot), bkt.Bucket(bucketKeyParents)) } @@ -475,15 +475,15 @@ func createBucketIfNotExists(ctx context.Context, fn func(context.Context, *bolt bkt, err := tx.CreateBucketIfNotExists(bucketKeyStorageVersion) if err != nil { - return errors.Wrap(err, "failed to create version bucket") + return fmt.Errorf("failed to create version bucket: %w", err) } sbkt, err := bkt.CreateBucketIfNotExists(bucketKeySnapshot) if err != nil { - return errors.Wrap(err, "failed to create snapshots bucket") + return fmt.Errorf("failed to create snapshots bucket: %w", err) } pbkt, err := bkt.CreateBucketIfNotExists(bucketKeyParents) if err != nil { - return errors.Wrap(err, "failed to create parents bucket") + return fmt.Errorf("failed to create parents bucket: %w", err) } return fn(ctx, sbkt, pbkt) } @@ -498,7 +498,7 @@ func parents(bkt, pbkt *bolt.Bucket, parent uint64) (parents []string, err error } pbkt = bkt.Bucket(parentKey) if pbkt == nil { - return nil, errors.Wrap(errdefs.ErrNotFound, "missing parent") + return nil, fmt.Errorf("missing parent: %w", errdefs.ErrNotFound) } parent = readID(pbkt) diff --git a/snapshots/storage/metastore.go b/snapshots/storage/metastore.go index 69ba3ea96bbc1..6ba2f15bf2aea 100644 --- a/snapshots/storage/metastore.go +++ b/snapshots/storage/metastore.go @@ -23,10 +23,10 @@ package storage import ( "context" + "fmt" "sync" "github.com/containerd/containerd/snapshots" - "github.com/pkg/errors" bolt "go.etcd.io/bbolt" ) @@ -88,7 +88,7 @@ func (ms *MetaStore) TransactionContext(ctx context.Context, writable bool) (con db, err := bolt.Open(ms.dbfile, 0600, nil) if err != nil { ms.dbL.Unlock() - return ctx, nil, errors.Wrap(err, "failed to open database file") + return ctx, nil, fmt.Errorf("failed to open database file: %w", err) } ms.db = db } @@ -96,7 +96,7 @@ func (ms *MetaStore) TransactionContext(ctx context.Context, writable bool) (con tx, err := ms.db.Begin(writable) if err != nil { - return ctx, nil, errors.Wrap(err, "failed to start transaction") + return ctx, nil, fmt.Errorf("failed to start transaction: %w", err) } ctx = context.WithValue(ctx, transactionKey{}, tx) diff --git a/snapshots/storage/metastore_test.go b/snapshots/storage/metastore_test.go index 8f1af68f0ad60..b3355e863ed82 100644 --- a/snapshots/storage/metastore_test.go +++ b/snapshots/storage/metastore_test.go @@ -18,6 +18,7 @@ package storage import ( "context" + "errors" "fmt" "os" "testing" @@ -26,7 +27,6 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/snapshots" "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) @@ -147,31 +147,31 @@ func inWriteTransaction(fn testFunc) testFunc { // - "active-5": readonly active with parent "committed-2" func basePopulate(ctx context.Context, ms *MetaStore) error { if _, err := CreateSnapshot(ctx, snapshots.KindActive, "committed-tmp-1", ""); err != nil { - return errors.Wrap(err, "failed to create active") + return fmt.Errorf("failed to create active: %w", err) } if _, err := CommitActive(ctx, "committed-tmp-1", "committed-1", snapshots.Usage{Size: 1}); err != nil { - return errors.Wrap(err, "failed to create active") + return fmt.Errorf("failed to create active: %w", err) } if _, err := CreateSnapshot(ctx, snapshots.KindActive, "committed-tmp-2", "committed-1"); err != nil { - return errors.Wrap(err, "failed to create active") + return fmt.Errorf("failed to create active: %w", err) } if _, err := CommitActive(ctx, "committed-tmp-2", "committed-2", snapshots.Usage{Size: 2}); err != nil { - return errors.Wrap(err, "failed to create active") + return fmt.Errorf("failed to create active: %w", err) } if _, err := CreateSnapshot(ctx, snapshots.KindActive, "active-1", ""); err != nil { - return errors.Wrap(err, "failed to create active") + return fmt.Errorf("failed to create active: %w", err) } if _, err := CreateSnapshot(ctx, snapshots.KindActive, "active-2", "committed-1"); err != nil { - return errors.Wrap(err, "failed to create active") + return fmt.Errorf("failed to create active: %w", err) } if _, err := CreateSnapshot(ctx, snapshots.KindActive, "active-3", "committed-2"); err != nil { - return errors.Wrap(err, "failed to create active") + return fmt.Errorf("failed to create active: %w", err) } if _, err := CreateSnapshot(ctx, snapshots.KindView, "view-1", ""); err != nil { - return errors.Wrap(err, "failed to create active") + return fmt.Errorf("failed to create active: %w", err) } if _, err := CreateSnapshot(ctx, snapshots.KindView, "view-2", "committed-2"); err != nil { - return errors.Wrap(err, "failed to create active") + return fmt.Errorf("failed to create active: %w", err) } return nil } @@ -286,10 +286,10 @@ func testGetSnapshot(ctx context.Context, t *testing.T, ms *MetaStore) { snapshotMap := map[string]Snapshot{} populate := func(ctx context.Context, ms *MetaStore) error { if _, err := CreateSnapshot(ctx, snapshots.KindActive, "committed-tmp-1", ""); err != nil { - return errors.Wrap(err, "failed to create active") + return fmt.Errorf("failed to create active: %w", err) } if _, err := CommitActive(ctx, "committed-tmp-1", "committed-1", snapshots.Usage{}); err != nil { - return errors.Wrap(err, "failed to create active") + return fmt.Errorf("failed to create active: %w", err) } for _, opts := range []struct { @@ -318,7 +318,7 @@ func testGetSnapshot(ctx context.Context, t *testing.T, ms *MetaStore) { } { active, err := CreateSnapshot(ctx, opts.Kind, opts.Name, opts.Parent) if err != nil { - return errors.Wrap(err, "failed to create active") + return fmt.Errorf("failed to create active: %w", err) } snapshotMap[opts.Name] = active } diff --git a/snapshots/testsuite/helpers.go b/snapshots/testsuite/helpers.go index eeed9d2fbee80..bc3db2c55d796 100644 --- a/snapshots/testsuite/helpers.go +++ b/snapshots/testsuite/helpers.go @@ -25,22 +25,21 @@ import ( "github.com/containerd/containerd/mount" "github.com/containerd/containerd/snapshots" "github.com/containerd/continuity/fs/fstest" - "github.com/pkg/errors" ) func applyToMounts(m []mount.Mount, work string, a fstest.Applier) (err error) { td, err := os.MkdirTemp(work, "prepare") if err != nil { - return errors.Wrap(err, "failed to create temp dir") + return fmt.Errorf("failed to create temp dir: %w", err) } defer os.RemoveAll(td) if err := mount.All(m, td); err != nil { - return errors.Wrap(err, "failed to mount") + return fmt.Errorf("failed to mount: %w", err) } defer func() { - if err1 := mount.UnmountAll(td, umountflags); err == nil { - err = errors.Wrap(err1, "failed to unmount") + if err1 := mount.UnmountAll(td, umountflags); err1 != nil && err == nil { + err = fmt.Errorf("failed to unmount: %w", err1) } }() @@ -55,15 +54,15 @@ func createSnapshot(ctx context.Context, sn snapshots.Snapshotter, parent, work m, err := sn.Prepare(ctx, prepare, parent, opt) if err != nil { - return "", errors.Wrap(err, "failed to prepare snapshot") + return "", fmt.Errorf("failed to prepare snapshot: %w", err) } if err := applyToMounts(m, work, a); err != nil { - return "", errors.Wrap(err, "failed to apply") + return "", fmt.Errorf("failed to apply: %w", err) } if err := sn.Commit(ctx, n, prepare, opt); err != nil { - return "", errors.Wrap(err, "failed to commit") + return "", fmt.Errorf("failed to commit: %w", err) } return n, nil @@ -72,36 +71,36 @@ func createSnapshot(ctx context.Context, sn snapshots.Snapshotter, parent, work func checkSnapshot(ctx context.Context, sn snapshots.Snapshotter, work, name, check string) (err error) { td, err := os.MkdirTemp(work, "check") if err != nil { - return errors.Wrap(err, "failed to create temp dir") + return fmt.Errorf("failed to create temp dir: %w", err) } defer func() { - if err1 := os.RemoveAll(td); err == nil { - err = errors.Wrapf(err1, "failed to remove temporary directory %s", td) + if err1 := os.RemoveAll(td); err1 != nil && err == nil { + err = fmt.Errorf("failed to remove temporary directory %s: %w", td, err1) } }() view := fmt.Sprintf("%s-view", name) m, err := sn.View(ctx, view, name, opt) if err != nil { - return errors.Wrap(err, "failed to create view") + return fmt.Errorf("failed to create view: %w", err) } defer func() { - if err1 := sn.Remove(ctx, view); err == nil { - err = errors.Wrap(err1, "failed to remove view") + if err1 := sn.Remove(ctx, view); err1 != nil && err == nil { + err = fmt.Errorf("failed to remove view: %w", err1) } }() if err := mount.All(m, td); err != nil { - return errors.Wrap(err, "failed to mount") + return fmt.Errorf("failed to mount: %w", err) } defer func() { - if err1 := mount.UnmountAll(td, umountflags); err == nil { - err = errors.Wrap(err1, "failed to unmount view") + if err1 := mount.UnmountAll(td, umountflags); err1 != nil && err == nil { + err = fmt.Errorf("failed to unmount view: %w", err1) } }() if err := fstest.CheckDirectoryEqual(check, td); err != nil { - return errors.Wrap(err, "check directory failed") + return fmt.Errorf("check directory failed: %w", err) } return nil @@ -113,7 +112,7 @@ func checkSnapshot(ctx context.Context, sn snapshots.Snapshotter, work, name, ch func checkSnapshots(ctx context.Context, sn snapshots.Snapshotter, work string, as ...fstest.Applier) error { td, err := os.MkdirTemp(work, "flat") if err != nil { - return errors.Wrap(err, "failed to create temp dir") + return fmt.Errorf("failed to create temp dir: %w", err) } defer os.RemoveAll(td) @@ -121,15 +120,15 @@ func checkSnapshots(ctx context.Context, sn snapshots.Snapshotter, work string, for i, a := range as { s, err := createSnapshot(ctx, sn, parentID, work, a) if err != nil { - return errors.Wrapf(err, "failed to create snapshot %d", i+1) + return fmt.Errorf("failed to create snapshot %d: %w", i+1, err) } if err := a.Apply(td); err != nil { - return errors.Wrapf(err, "failed to apply to check directory on %d", i+1) + return fmt.Errorf("failed to apply to check directory on %d: %w", i+1, err) } if err := checkSnapshot(ctx, sn, work, s, td); err != nil { - return errors.Wrapf(err, "snapshot check failed on snapshot %d", i+1) + return fmt.Errorf("snapshot check failed on snapshot %d: %w", i+1, err) } parentID = s @@ -141,28 +140,28 @@ func checkSnapshots(ctx context.Context, sn snapshots.Snapshotter, work string, // checkInfo checks that the infos are the same func checkInfo(si1, si2 snapshots.Info) error { if si1.Kind != si2.Kind { - return errors.Errorf("Expected kind %v, got %v", si1.Kind, si2.Kind) + return fmt.Errorf("Expected kind %v, got %v", si1.Kind, si2.Kind) } if si1.Name != si2.Name { - return errors.Errorf("Expected name %v, got %v", si1.Name, si2.Name) + return fmt.Errorf("Expected name %v, got %v", si1.Name, si2.Name) } if si1.Parent != si2.Parent { - return errors.Errorf("Expected Parent %v, got %v", si1.Parent, si2.Parent) + return fmt.Errorf("Expected Parent %v, got %v", si1.Parent, si2.Parent) } if len(si1.Labels) != len(si2.Labels) { - return errors.Errorf("Expected %d labels, got %d", len(si1.Labels), len(si2.Labels)) + return fmt.Errorf("Expected %d labels, got %d", len(si1.Labels), len(si2.Labels)) } for k, l1 := range si1.Labels { l2 := si2.Labels[k] if l1 != l2 { - return errors.Errorf("Expected label %v, got %v", l1, l2) + return fmt.Errorf("Expected label %v, got %v", l1, l2) } } if si1.Created != si2.Created { - return errors.Errorf("Expected Created %v, got %v", si1.Created, si2.Created) + return fmt.Errorf("Expected Created %v, got %v", si1.Created, si2.Created) } if si1.Updated != si2.Updated { - return errors.Errorf("Expected Updated %v, got %v", si1.Updated, si2.Updated) + return fmt.Errorf("Expected Updated %v, got %v", si1.Updated, si2.Updated) } return nil diff --git a/sys/filesys_windows.go b/sys/filesys_windows.go index 1c3cc40ac92b2..87ebacc200680 100644 --- a/sys/filesys_windows.go +++ b/sys/filesys_windows.go @@ -17,6 +17,7 @@ package sys import ( + "fmt" "os" "path/filepath" "regexp" @@ -27,7 +28,6 @@ import ( "unsafe" "github.com/Microsoft/hcsshim" - "github.com/pkg/errors" "golang.org/x/sys/windows" ) @@ -268,7 +268,7 @@ func ForceRemoveAll(path string) error { snapshotDir := filepath.Join(path, snapshotPlugin, "snapshots") if stat, err := os.Stat(snapshotDir); err == nil && stat.IsDir() { if err := cleanupWCOWLayers(snapshotDir); err != nil { - return errors.Wrapf(err, "failed to cleanup WCOW layers in %s", snapshotDir) + return fmt.Errorf("failed to cleanup WCOW layers in %s: %w", snapshotDir, err) } } @@ -329,16 +329,16 @@ func cleanupWCOWLayer(layerPath string) error { // ERROR_FLT_INSTANCE_NOT_FOUND is returned if the layer is currently activated but not prepared. if err := hcsshim.UnprepareLayer(info, filepath.Base(layerPath)); err != nil { if hcserror, ok := err.(*hcsshim.HcsError); !ok || (hcserror.Err != windows.ERROR_DEV_NOT_EXIST && hcserror.Err != syscall.Errno(windows.ERROR_FLT_INSTANCE_NOT_FOUND)) { - return errors.Wrapf(err, "failed to unprepare %s", layerPath) + return fmt.Errorf("failed to unprepare %s: %w", layerPath, err) } } if err := hcsshim.DeactivateLayer(info, filepath.Base(layerPath)); err != nil { - return errors.Wrapf(err, "failed to deactivate %s", layerPath) + return fmt.Errorf("failed to deactivate %s: %w", layerPath, err) } if err := hcsshim.DestroyLayer(info, filepath.Base(layerPath)); err != nil { - return errors.Wrapf(err, "failed to destroy %s", layerPath) + return fmt.Errorf("failed to destroy %s: %w", layerPath, err) } return nil diff --git a/sys/reaper/reaper_unix.go b/sys/reaper/reaper_unix.go index a402326069081..6c4f13b9088e9 100644 --- a/sys/reaper/reaper_unix.go +++ b/sys/reaper/reaper_unix.go @@ -20,12 +20,13 @@ package reaper import ( + "errors" + "fmt" "sync" "syscall" "time" runc "github.com/containerd/go-runc" - "github.com/pkg/errors" exec "golang.org/x/sys/execabs" "golang.org/x/sys/unix" ) @@ -143,7 +144,7 @@ func (m *Monitor) WaitTimeout(c *exec.Cmd, ec chan runc.Exit, timeout time.Durat select { case <-timer.C: syscall.Kill(c.Process.Pid, syscall.SIGKILL) - return 0, errors.Errorf("timeout %v for cmd(pid=%d): %s, %s", timeout, c.Process.Pid, c.Path, c.Args) + return 0, fmt.Errorf("timeout %v for cmd(pid=%d): %s, %s", timeout, c.Process.Pid, c.Path, c.Args) case res := <-waitCh: return res.status, res.err } diff --git a/sys/socket_unix.go b/sys/socket_unix.go index eb803503e2e24..367e19cad8454 100644 --- a/sys/socket_unix.go +++ b/sys/socket_unix.go @@ -20,11 +20,11 @@ package sys import ( + "fmt" "net" "os" "path/filepath" - "github.com/pkg/errors" "golang.org/x/sys/unix" ) @@ -32,7 +32,7 @@ import ( func CreateUnixSocket(path string) (net.Listener, error) { // BSDs have a 104 limit if len(path) > 104 { - return nil, errors.Errorf("%q: unix socket path too long (> 104)", path) + return nil, fmt.Errorf("%q: unix socket path too long (> 104)", path) } if err := os.MkdirAll(filepath.Dir(path), 0660); err != nil { return nil, err diff --git a/task.go b/task.go index 4e23fb8616bab..692d92c1d27cc 100644 --- a/task.go +++ b/task.go @@ -20,6 +20,7 @@ import ( "bytes" "context" "encoding/json" + "errors" "fmt" "io" goruntime "runtime" @@ -46,7 +47,6 @@ import ( is "github.com/opencontainers/image-spec/specs-go" v1 "github.com/opencontainers/image-spec/specs-go/v1" specs "github.com/opencontainers/runtime-spec/specs-go" - "github.com/pkg/errors" ) // UnknownExitStatus is returned when containerd is unable to @@ -312,7 +312,7 @@ func (t *task) Delete(ctx context.Context, opts ...ProcessDeleteOpts) (*ExitStat } fallthrough default: - return nil, errors.Wrapf(errdefs.ErrFailedPrecondition, "task must be stopped before deletion: %s", status.Status) + return nil, fmt.Errorf("task must be stopped before deletion: %s: %w", status.Status, errdefs.ErrFailedPrecondition) } if t.io != nil { t.io.Close() @@ -334,7 +334,7 @@ func (t *task) Delete(ctx context.Context, opts ...ProcessDeleteOpts) (*ExitStat func (t *task) Exec(ctx context.Context, id string, spec *specs.Process, ioCreate cio.Creator) (_ Process, err error) { if id == "" { - return nil, errors.Wrapf(errdefs.ErrInvalidArgument, "exec id must not be empty") + return nil, fmt.Errorf("exec id must not be empty: %w", errdefs.ErrInvalidArgument) } i, err := ioCreate(id) if err != nil { @@ -555,7 +555,7 @@ func (t *task) LoadProcess(ctx context.Context, id string, ioAttach cio.Attach) if err != nil { err = errdefs.FromGRPC(err) if errdefs.IsNotFound(err) { - return nil, errors.Wrapf(err, "no running process found") + return nil, fmt.Errorf("no running process found: %w", err) } return nil, err } diff --git a/task_opts.go b/task_opts.go index c2e8437c69703..56f3cbad60dcc 100644 --- a/task_opts.go +++ b/task_opts.go @@ -19,6 +19,7 @@ package containerd import ( "context" "encoding/json" + "errors" "fmt" "syscall" @@ -31,7 +32,6 @@ import ( "github.com/containerd/containerd/runtime/v2/runc/options" imagespec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/opencontainers/runtime-spec/specs-go" - "github.com/pkg/errors" ) // NewTaskOpts allows the caller to set options on a new task diff --git a/task_opts_unix.go b/task_opts_unix.go index 639fb7c53f86d..1d5983b6294f7 100644 --- a/task_opts_unix.go +++ b/task_opts_unix.go @@ -21,10 +21,10 @@ package containerd import ( "context" + "errors" "github.com/containerd/containerd/runtime/linux/runctypes" "github.com/containerd/containerd/runtime/v2/runc/options" - "github.com/pkg/errors" ) // WithNoNewKeyring causes tasks not to be created with a new keyring for secret storage. diff --git a/test/e2e_node/gci-init.sh b/test/e2e_node/gci-init.sh index c24be53b73f2c..83da28194dc2c 100755 --- a/test/e2e_node/gci-init.sh +++ b/test/e2e_node/gci-init.sh @@ -30,7 +30,7 @@ if [ "${CONTAINERD_CGROUPV2:-"false"}" == "true" ]; then OS_ID="$(. /etc/os-release && echo "$ID")" fi if [ "${OS_ID}" = "cos" ]; then - if ! grep -q 'systemd.unified_cgroup_hierarchy=true' /proc/cmdline; then + if ! grep -q 'systemd.unified_cgroup_hierarchy=true' /proc/cmdline && [ "$(stat -fc %T /sys/fs/cgroup/)" != "cgroup2fs" ]; then echo "Setting up cgroupv2" mount_path="/tmp/esp" diff --git a/tracing/plugin/otlp.go b/tracing/plugin/otlp.go index e95a78b6b54ba..a2aabd465f857 100644 --- a/tracing/plugin/otlp.go +++ b/tracing/plugin/otlp.go @@ -17,19 +17,22 @@ package plugin import ( + "context" + "fmt" "io" + "net/url" + "time" "github.com/containerd/containerd/log" "github.com/containerd/containerd/plugin" - "github.com/pkg/errors" "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/exporters/otlp/otlptrace" "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc" + "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp" "go.opentelemetry.io/otel/propagation" "go.opentelemetry.io/otel/sdk/resource" sdktrace "go.opentelemetry.io/otel/sdk/trace" semconv "go.opentelemetry.io/otel/semconv/v1.4.0" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials/insecure" ) const exporterPlugin = "otlp" @@ -42,28 +45,16 @@ func init() { InitFn: func(ic *plugin.InitContext) (interface{}, error) { cfg := ic.Config.(*OTLPConfig) if cfg.Endpoint == "" { - return nil, errors.Wrap(plugin.ErrSkipPlugin, "otlp endpoint not set") + return nil, fmt.Errorf("no OpenTelemetry endpoint: %w", plugin.ErrSkipPlugin) } - dialOpts := []grpc.DialOption{grpc.WithBlock()} - if cfg.Insecure { - dialOpts = append(dialOpts, grpc.WithTransportCredentials(insecure.NewCredentials())) - } - - exp, err := otlptracegrpc.New(ic.Context, - otlptracegrpc.WithEndpoint(cfg.Endpoint), - otlptracegrpc.WithDialOption(dialOpts...), - ) - if err != nil { - return nil, errors.Wrap(err, "failed to create otlp exporter") - } - return sdktrace.NewBatchSpanProcessor(exp), nil + return newExporter(ic.Context, cfg) }, }) plugin.Register(&plugin.Registration{ ID: "tracing", Type: plugin.InternalPlugin, Requires: []plugin.Type{plugin.TracingProcessorPlugin}, - Config: &TraceConfig{ServiceName: "containerd"}, + Config: &TraceConfig{ServiceName: "containerd", TraceSamplingRatio: 1.0}, InitFn: func(ic *plugin.InitContext) (interface{}, error) { return newTracer(ic) }, @@ -73,6 +64,7 @@ func init() { // OTLPConfig holds the configurations for the built-in otlp span processor type OTLPConfig struct { Endpoint string `toml:"endpoint"` + Protocol string `toml:"protocol"` Insecure bool `toml:"insecure"` } @@ -90,8 +82,46 @@ func (c *closer) Close() error { return c.close() } -// InitOpenTelemetry reads config and initializes otel middleware, sets the exporter -// propagator and global tracer provider +// newExporter creates an exporter based on the given configuration. +// +// The default protocol is http/protobuf since it is recommended by +// https://github.com/open-telemetry/opentelemetry-specification/blob/v1.8.0/specification/protocol/exporter.md#specify-protocol. +func newExporter(ctx context.Context, cfg *OTLPConfig) (*otlptrace.Exporter, error) { + const timeout = 5 * time.Second + + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + + if cfg.Protocol == "http/protobuf" || cfg.Protocol == "" { + u, err := url.Parse(cfg.Endpoint) + if err != nil { + return nil, fmt.Errorf("OpenTelemetry endpoint %q is invalid: %w", cfg.Endpoint, err) + } + opts := []otlptracehttp.Option{ + otlptracehttp.WithEndpoint(u.Host), + } + if u.Scheme == "http" { + opts = append(opts, otlptracehttp.WithInsecure()) + } + return otlptracehttp.New(ctx, opts...) + } else if cfg.Protocol == "grpc" { + opts := []otlptracegrpc.Option{ + otlptracegrpc.WithEndpoint(cfg.Endpoint), + } + if cfg.Insecure { + opts = append(opts, otlptracegrpc.WithInsecure()) + } + return otlptracegrpc.New(ctx, opts...) + } else { + // Other protocols such as "http/json" are not supported. + return nil, fmt.Errorf("OpenTelemetry protocol %q is not supported", cfg.Protocol) + } +} + +// newTracer configures protocol-agonostic tracing settings such as +// its sampling ratio and returns io.Closer. +// +// Note that this function sets process-wide tracing configuration. func newTracer(ic *plugin.InitContext) (io.Closer, error) { ctx := ic.Context config := ic.Config.(*TraceConfig) @@ -103,7 +133,7 @@ func newTracer(ic *plugin.InitContext) (io.Closer, error) { ), ) if err != nil { - return nil, errors.Wrap(err, "failed to create resource") + return nil, fmt.Errorf("failed to create resource: %w", err) } opts := []sdktrace.TracerProviderOption{ @@ -113,14 +143,14 @@ func newTracer(ic *plugin.InitContext) (io.Closer, error) { ls, err := ic.GetByType(plugin.TracingProcessorPlugin) if err != nil { - return nil, errors.Wrap(err, "failed to get tracing processors") + return nil, fmt.Errorf("failed to get tracing processors: %w", err) } procs := make([]sdktrace.SpanProcessor, 0, len(ls)) for id, pctx := range ls { p, err := pctx.Instance() if err != nil { - log.G(ctx).WithError(err).Errorf("Failed to init tracing processor %q", id) + log.G(ctx).WithError(err).Errorf("failed to initialize a tracing processor %q", id) continue } proc := p.(sdktrace.SpanProcessor) diff --git a/tracing/tracing.go b/tracing/tracing.go index 433739aa6a4e6..d3ecfb5f9bdbe 100644 --- a/tracing/tracing.go +++ b/tracing/tracing.go @@ -24,13 +24,11 @@ import ( ) // StartSpan starts child span in a context. -func StartSpan(ctx context.Context, opName string, opts ...trace.SpanStartOption) (trace.Span, context.Context) { +func StartSpan(ctx context.Context, opName string, opts ...trace.SpanStartOption) (context.Context, trace.Span) { if parent := trace.SpanFromContext(ctx); parent != nil && parent.SpanContext().IsValid() { - ctx, span := parent.TracerProvider().Tracer("").Start(ctx, opName, opts...) - return span, ctx + return parent.TracerProvider().Tracer("").Start(ctx, opName, opts...) } - ctx, span := otel.Tracer("").Start(ctx, opName, opts...) - return span, ctx + return otel.Tracer("").Start(ctx, opName, opts...) } // StopSpan ends the span specified diff --git a/unpacker.go b/unpacker.go index d9e120dce97fa..719345a1c22ce 100644 --- a/unpacker.go +++ b/unpacker.go @@ -20,6 +20,7 @@ import ( "context" "encoding/base64" "encoding/json" + "errors" "fmt" "math/rand" "sync" @@ -36,7 +37,6 @@ import ( "github.com/opencontainers/go-digest" "github.com/opencontainers/image-spec/identity" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" "github.com/sirupsen/logrus" "golang.org/x/sync/errgroup" "golang.org/x/sync/semaphore" @@ -92,18 +92,18 @@ func (u *unpacker) unpack( var i ocispec.Image if err := json.Unmarshal(p, &i); err != nil { - return errors.Wrap(err, "unmarshal image config") + return fmt.Errorf("unmarshal image config: %w", err) } diffIDs := i.RootFS.DiffIDs if len(layers) != len(diffIDs) { - return errors.Errorf("number of layers and diffIDs don't match: %d != %d", len(layers), len(diffIDs)) + return fmt.Errorf("number of layers and diffIDs don't match: %d != %d", len(layers), len(diffIDs)) } if u.config.CheckPlatformSupported { imgPlatform := platforms.Normalize(ocispec.Platform{OS: i.OS, Architecture: i.Architecture}) snapshotterPlatformMatcher, err := u.c.GetSnapshotterSupportedPlatforms(ctx, u.snapshotter) if err != nil { - return errors.Wrapf(err, "failed to find supported platforms for snapshotter %s", u.snapshotter) + return fmt.Errorf("failed to find supported platforms for snapshotter %s: %w", u.snapshotter, err) } if !snapshotterPlatformMatcher.Match(imgPlatform) { return fmt.Errorf("snapshotter %s does not support platform %s for image %s", u.snapshotter, imgPlatform, config.Digest) @@ -137,7 +137,7 @@ EachLayer: // no need to handle continue } else if !errdefs.IsNotFound(err) { - return errors.Wrapf(err, "failed to stat snapshot %s", chainID) + return fmt.Errorf("failed to stat snapshot %s: %w", chainID, err) } // inherits annotations which are provided as snapshot labels. @@ -161,7 +161,7 @@ EachLayer: if errdefs.IsAlreadyExists(err) { if _, err := sn.Stat(ctx, chainID); err != nil { if !errdefs.IsNotFound(err) { - return errors.Wrapf(err, "failed to stat snapshot %s", chainID) + return fmt.Errorf("failed to stat snapshot %s: %w", chainID, err) } // Try again, this should be rare, log it log.G(ctx).WithField("key", key).WithField("chainid", chainID).Debug("extraction snapshot already exists, chain id not found") @@ -170,14 +170,14 @@ EachLayer: continue EachLayer } } else { - return errors.Wrapf(err, "failed to prepare extraction snapshot %q", key) + return fmt.Errorf("failed to prepare extraction snapshot %q: %w", key, err) } } else { break } } if err != nil { - return errors.Wrap(err, "unable to prepare extraction snapshot") + return fmt.Errorf("unable to prepare extraction snapshot: %w", err) } // Abort the snapshot if commit does not happen @@ -217,11 +217,11 @@ EachLayer: diff, err := a.Apply(ctx, desc, mounts, u.config.ApplyOpts...) if err != nil { abort() - return errors.Wrapf(err, "failed to extract layer %s", diffIDs[i]) + return fmt.Errorf("failed to extract layer %s: %w", diffIDs[i], err) } if diff.Digest != diffIDs[i] { abort() - return errors.Errorf("wrong diff id calculated on extraction %q", diffIDs[i]) + return fmt.Errorf("wrong diff id calculated on extraction %q", diffIDs[i]) } if err = sn.Commit(ctx, chainID, key, opts...); err != nil { @@ -229,7 +229,7 @@ EachLayer: if errdefs.IsAlreadyExists(err) { continue } - return errors.Wrapf(err, "failed to commit snapshot %s", key) + return fmt.Errorf("failed to commit snapshot %s: %w", key, err) } // Set the uncompressed label after the uncompressed diff --git a/vendor/github.com/Microsoft/hcsshim/.golangci.yml b/vendor/github.com/Microsoft/hcsshim/.golangci.yml index 16b25be554537..2400e7f1e02de 100644 --- a/vendor/github.com/Microsoft/hcsshim/.golangci.yml +++ b/vendor/github.com/Microsoft/hcsshim/.golangci.yml @@ -1,3 +1,6 @@ +run: + timeout: 8m + linters: enable: - stylecheck diff --git a/vendor/github.com/Microsoft/hcsshim/go.mod b/vendor/github.com/Microsoft/hcsshim/go.mod index 7c9747667bafd..9c60dd3025110 100644 --- a/vendor/github.com/Microsoft/hcsshim/go.mod +++ b/vendor/github.com/Microsoft/hcsshim/go.mod @@ -29,7 +29,7 @@ require ( go.opencensus.io v0.22.3 golang.org/x/net v0.0.0-20210825183410-e898025ed96a // indirect golang.org/x/sync v0.0.0-20210220032951-036812b2e83c - golang.org/x/sys v0.0.0-20210510120138-977fb7262007 + golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e google.golang.org/grpc v1.40.0 ) diff --git a/vendor/github.com/Microsoft/hcsshim/go.sum b/vendor/github.com/Microsoft/hcsshim/go.sum index 7c383806dcc24..93c37657f3cfc 100644 --- a/vendor/github.com/Microsoft/hcsshim/go.sum +++ b/vendor/github.com/Microsoft/hcsshim/go.sum @@ -812,8 +812,9 @@ golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/errors.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/errors.go index 644f0ab711f1b..e21354ffd66a6 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/hcs/errors.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/hcs/errors.go @@ -78,6 +78,13 @@ var ( // ErrNotSupported is an error encountered when hcs doesn't support the request ErrPlatformNotSupported = errors.New("unsupported platform request") + + // ErrProcessAlreadyStopped is returned by hcs if the process we're trying to kill has already been stopped. + ErrProcessAlreadyStopped = syscall.Errno(0x8037011f) + + // ErrInvalidHandle is an error that can be encountrered when querying the properties of a compute system when the handle to that + // compute system has already been closed. + ErrInvalidHandle = syscall.Errno(0x6) ) type ErrorEvent struct { @@ -249,6 +256,14 @@ func IsNotExist(err error) bool { err == ErrElementNotFound } +// IsErrorInvalidHandle checks whether the error is the result of an operation carried +// out on a handle that is invalid/closed. This error popped up while trying to query +// stats on a container in the process of being stopped. +func IsErrorInvalidHandle(err error) bool { + err = getInnerError(err) + return err == ErrInvalidHandle +} + // 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 { @@ -281,6 +296,7 @@ func IsTimeout(err error) bool { func IsAlreadyStopped(err error) bool { err = getInnerError(err) return err == ErrVmcomputeAlreadyStopped || + err == ErrProcessAlreadyStopped || err == ErrElementNotFound } diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/process.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/process.go index 8f203466887ab..f4605922ab4ab 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/hcs/process.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/hcs/process.go @@ -3,7 +3,9 @@ package hcs import ( "context" "encoding/json" + "errors" "io" + "os" "sync" "syscall" "time" @@ -16,16 +18,17 @@ import ( // 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 + 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 + killSignalDelivered bool closedWaitOnce sync.Once waitBlock chan struct{} @@ -149,12 +152,45 @@ func (process *Process) Kill(ctx context.Context) (bool, error) { return false, makeProcessError(process, operation, ErrAlreadyClosed, nil) } + if process.killSignalDelivered { + // A kill signal has already been sent to this process. Sending a second + // one offers no real benefit, as processes cannot stop themselves from + // being terminated, once a TerminateProcess has been issued. Sending a + // second kill may result in a number of errors (two of which detailed bellow) + // and which we can avoid handling. + return true, nil + } + resultJSON, err := vmcompute.HcsTerminateProcess(ctx, process.handle) + if err != nil { + // We still need to check these two cases, as processes may still be killed by an + // external actor (human operator, OOM, random script etc). + if errors.Is(err, os.ErrPermission) || IsAlreadyStopped(err) { + // There are two cases where it should be safe to ignore an error returned + // by HcsTerminateProcess. The first one is cause by the fact that + // HcsTerminateProcess ends up calling TerminateProcess in the context + // of a container. According to the TerminateProcess documentation: + // https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-terminateprocess#remarks + // After a process has terminated, call to TerminateProcess with open + // handles to the process fails with ERROR_ACCESS_DENIED (5) error code. + // It's safe to ignore this error here. HCS should always have permissions + // to kill processes inside any container. So an ERROR_ACCESS_DENIED + // is unlikely to be anything else than what the ending remarks in the + // documentation states. + // + // The second case is generated by hcs itself, if for any reason HcsTerminateProcess + // is called twice in a very short amount of time. In such cases, hcs may return + // HCS_E_PROCESS_ALREADY_STOPPED. + return true, nil + } + } events := processHcsResult(ctx, resultJSON) delivered, err := process.processSignalResult(ctx, err) if err != nil { err = makeProcessError(process, operation, err, events) } + + process.killSignalDelivered = delivered return delivered, err } diff --git a/vendor/github.com/Microsoft/hcsshim/internal/winapi/console.go b/vendor/github.com/Microsoft/hcsshim/internal/winapi/console.go new file mode 100644 index 0000000000000..def9525417e9e --- /dev/null +++ b/vendor/github.com/Microsoft/hcsshim/internal/winapi/console.go @@ -0,0 +1,44 @@ +package winapi + +import ( + "unsafe" + + "golang.org/x/sys/windows" +) + +const PSEUDOCONSOLE_INHERIT_CURSOR = 0x1 + +// CreatePseudoConsole creates a windows pseudo console. +func CreatePseudoConsole(size windows.Coord, hInput windows.Handle, hOutput windows.Handle, dwFlags uint32, hpcon *windows.Handle) error { + // We need this wrapper as the function takes a COORD struct and not a pointer to one, so we need to cast to something beforehand. + return createPseudoConsole(*((*uint32)(unsafe.Pointer(&size))), hInput, hOutput, 0, hpcon) +} + +// ResizePseudoConsole resizes the internal buffers of the pseudo console to the width and height specified in `size`. +func ResizePseudoConsole(hpcon windows.Handle, size windows.Coord) error { + // We need this wrapper as the function takes a COORD struct and not a pointer to one, so we need to cast to something beforehand. + return resizePseudoConsole(hpcon, *((*uint32)(unsafe.Pointer(&size)))) +} + +// HRESULT WINAPI CreatePseudoConsole( +// _In_ COORD size, +// _In_ HANDLE hInput, +// _In_ HANDLE hOutput, +// _In_ DWORD dwFlags, +// _Out_ HPCON* phPC +// ); +// +//sys createPseudoConsole(size uint32, hInput windows.Handle, hOutput windows.Handle, dwFlags uint32, hpcon *windows.Handle) (hr error) = kernel32.CreatePseudoConsole + +// void WINAPI ClosePseudoConsole( +// _In_ HPCON hPC +// ); +// +//sys ClosePseudoConsole(hpc windows.Handle) = kernel32.ClosePseudoConsole + +// HRESULT WINAPI ResizePseudoConsole( +// _In_ HPCON hPC , +// _In_ COORD size +// ); +// +//sys resizePseudoConsole(hPc windows.Handle, size uint32) (hr error) = kernel32.ResizePseudoConsole diff --git a/vendor/github.com/Microsoft/hcsshim/internal/winapi/process.go b/vendor/github.com/Microsoft/hcsshim/internal/winapi/process.go index b87068327ccde..37839435b9399 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/winapi/process.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/winapi/process.go @@ -2,9 +2,7 @@ package winapi const PROCESS_ALL_ACCESS uint32 = 2097151 -// DWORD GetProcessImageFileNameW( -// HANDLE hProcess, -// LPWSTR lpImageFileName, -// DWORD nSize -// ); -//sys GetProcessImageFileName(hProcess windows.Handle, imageFileName *uint16, nSize uint32) (size uint32, err error) = kernel32.GetProcessImageFileNameW +const ( + PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE = 0x20016 + PROC_THREAD_ATTRIBUTE_JOB_LIST = 0x2000D +) diff --git a/vendor/github.com/Microsoft/hcsshim/internal/winapi/winapi.go b/vendor/github.com/Microsoft/hcsshim/internal/winapi/winapi.go index ec88c0d2128b6..1d4ba3c4f8edc 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/winapi/winapi.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/winapi/winapi.go @@ -2,4 +2,4 @@ // be thought of as an extension to golang.org/x/sys/windows. package winapi -//go:generate go run ..\..\mksyscall_windows.go -output zsyscall_windows.go system.go net.go path.go thread.go iocp.go jobobject.go logon.go memory.go process.go processor.go devices.go filesystem.go errors.go +//go:generate go run ..\..\mksyscall_windows.go -output zsyscall_windows.go console.go system.go net.go path.go thread.go iocp.go jobobject.go logon.go memory.go process.go processor.go devices.go filesystem.go errors.go diff --git a/vendor/github.com/Microsoft/hcsshim/internal/winapi/zsyscall_windows.go b/vendor/github.com/Microsoft/hcsshim/internal/winapi/zsyscall_windows.go index 59ddee274e3a0..4eb64b4c0c463 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/winapi/zsyscall_windows.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/winapi/zsyscall_windows.go @@ -37,12 +37,15 @@ func errnoErr(e syscall.Errno) error { } var ( + modkernel32 = windows.NewLazySystemDLL("kernel32.dll") modntdll = windows.NewLazySystemDLL("ntdll.dll") modiphlpapi = windows.NewLazySystemDLL("iphlpapi.dll") - modkernel32 = windows.NewLazySystemDLL("kernel32.dll") modadvapi32 = windows.NewLazySystemDLL("advapi32.dll") modcfgmgr32 = windows.NewLazySystemDLL("cfgmgr32.dll") + procCreatePseudoConsole = modkernel32.NewProc("CreatePseudoConsole") + procClosePseudoConsole = modkernel32.NewProc("ClosePseudoConsole") + procResizePseudoConsole = modkernel32.NewProc("ResizePseudoConsole") procNtQuerySystemInformation = modntdll.NewProc("NtQuerySystemInformation") procSetJobCompartmentId = modiphlpapi.NewProc("SetJobCompartmentId") procSearchPathW = modkernel32.NewProc("SearchPathW") @@ -58,7 +61,6 @@ var ( procLogonUserW = modadvapi32.NewProc("LogonUserW") procLocalAlloc = modkernel32.NewProc("LocalAlloc") procLocalFree = modkernel32.NewProc("LocalFree") - procGetProcessImageFileNameW = modkernel32.NewProc("GetProcessImageFileNameW") procGetActiveProcessorCount = modkernel32.NewProc("GetActiveProcessorCount") procCM_Get_Device_ID_List_SizeA = modcfgmgr32.NewProc("CM_Get_Device_ID_List_SizeA") procCM_Get_Device_ID_ListA = modcfgmgr32.NewProc("CM_Get_Device_ID_ListA") @@ -71,6 +73,33 @@ var ( procRtlNtStatusToDosError = modntdll.NewProc("RtlNtStatusToDosError") ) +func createPseudoConsole(size uint32, hInput windows.Handle, hOutput windows.Handle, dwFlags uint32, hpcon *windows.Handle) (hr error) { + r0, _, _ := syscall.Syscall6(procCreatePseudoConsole.Addr(), 5, uintptr(size), uintptr(hInput), uintptr(hOutput), uintptr(dwFlags), uintptr(unsafe.Pointer(hpcon)), 0) + if int32(r0) < 0 { + if r0&0x1fff0000 == 0x00070000 { + r0 &= 0xffff + } + hr = syscall.Errno(r0) + } + return +} + +func ClosePseudoConsole(hpc windows.Handle) { + syscall.Syscall(procClosePseudoConsole.Addr(), 1, uintptr(hpc), 0, 0) + return +} + +func resizePseudoConsole(hPc windows.Handle, size uint32) (hr error) { + r0, _, _ := syscall.Syscall(procResizePseudoConsole.Addr(), 2, uintptr(hPc), uintptr(size), 0) + if int32(r0) < 0 { + if r0&0x1fff0000 == 0x00070000 { + r0 &= 0xffff + } + hr = syscall.Errno(r0) + } + return +} + func NtQuerySystemInformation(systemInfoClass int, systemInformation uintptr, systemInfoLength uint32, returnLength *uint32) (status uint32) { r0, _, _ := syscall.Syscall6(procNtQuerySystemInformation.Addr(), 4, uintptr(systemInfoClass), uintptr(systemInformation), uintptr(systemInfoLength), uintptr(unsafe.Pointer(returnLength)), 0, 0) status = uint32(r0) @@ -227,19 +256,6 @@ func LocalFree(ptr uintptr) { return } -func GetProcessImageFileName(hProcess windows.Handle, imageFileName *uint16, nSize uint32) (size uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetProcessImageFileNameW.Addr(), 3, uintptr(hProcess), uintptr(unsafe.Pointer(imageFileName)), uintptr(nSize)) - size = uint32(r0) - if size == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - func GetActiveProcessorCount(groupNumber uint16) (amount uint32) { r0, _, _ := syscall.Syscall(procGetActiveProcessorCount.Addr(), 1, uintptr(groupNumber), 0, 0) amount = uint32(r0) diff --git a/vendor/github.com/Microsoft/hcsshim/osversion/windowsbuilds.go b/vendor/github.com/Microsoft/hcsshim/osversion/windowsbuilds.go index 49fb740cd1309..75dce5d821d19 100644 --- a/vendor/github.com/Microsoft/hcsshim/osversion/windowsbuilds.go +++ b/vendor/github.com/Microsoft/hcsshim/osversion/windowsbuilds.go @@ -38,4 +38,13 @@ const ( // V21H1 corresponds to Windows Server 21H1 (semi-annual channel). V21H1 = 19043 + + // V21H2Win10 corresponds to Windows 10 (November 2021 Update). + V21H2Win10 = 19044 + + // V21H2Server corresponds to Windows Server 2022 (ltsc2022). + V21H2Server = 20348 + + // V21H2Win11 corresponds to Windows 11 (original release). + V21H2Win11 = 22000 ) diff --git a/vendor/github.com/bits-and-blooms/bitset/.gitignore b/vendor/github.com/bits-and-blooms/bitset/.gitignore deleted file mode 100644 index 5c204d28b0e36..0000000000000 --- a/vendor/github.com/bits-and-blooms/bitset/.gitignore +++ /dev/null @@ -1,26 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof - -target diff --git a/vendor/github.com/bits-and-blooms/bitset/.travis.yml b/vendor/github.com/bits-and-blooms/bitset/.travis.yml deleted file mode 100644 index 094aa5ce070cc..0000000000000 --- a/vendor/github.com/bits-and-blooms/bitset/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -language: go - -sudo: false - -branches: - except: - - release - -branches: - only: - - master - - travis - -go: - - "1.11.x" - - tip - -matrix: - allow_failures: - - go: tip - -before_install: - - if [ -n "$GH_USER" ]; then git config --global github.user ${GH_USER}; fi; - - if [ -n "$GH_TOKEN" ]; then git config --global github.token ${GH_TOKEN}; fi; - - go get github.com/mattn/goveralls - -before_script: - - make deps - -script: - - make qa - -after_failure: - - cat ./target/test/report.xml - -after_success: - - if [ "$TRAVIS_GO_VERSION" = "1.11.1" ]; then $HOME/gopath/bin/goveralls -covermode=count -coverprofile=target/report/coverage.out -service=travis-ci; fi; diff --git a/vendor/github.com/bits-and-blooms/bitset/README.md b/vendor/github.com/bits-and-blooms/bitset/README.md deleted file mode 100644 index 97e83071e41a1..0000000000000 --- a/vendor/github.com/bits-and-blooms/bitset/README.md +++ /dev/null @@ -1,93 +0,0 @@ -# bitset - -*Go language library to map between non-negative integers and boolean values* - -[![Test](https://github.com/bits-and-blooms/bitset/workflows/Test/badge.svg)](https://github.com/willf/bitset/actions?query=workflow%3ATest) -[![Go Report Card](https://goreportcard.com/badge/github.com/willf/bitset)](https://goreportcard.com/report/github.com/willf/bitset) -[![PkgGoDev](https://pkg.go.dev/badge/github.com/bits-and-blooms/bitset?tab=doc)](https://pkg.go.dev/github.com/bits-and-blooms/bitset?tab=doc) - - -## Description - -Package bitset implements bitsets, a mapping between non-negative integers and boolean values. -It should be more efficient than map[uint] bool. - -It provides methods for setting, clearing, flipping, and testing individual integers. - -But it also provides set intersection, union, difference, complement, and symmetric operations, as well as tests to check whether any, all, or no bits are set, and querying a bitset's current length and number of positive bits. - -BitSets are expanded to the size of the largest set bit; the memory allocation is approximately Max bits, where Max is the largest set bit. BitSets are never shrunk. On creation, a hint can be given for the number of bits that will be used. - -Many of the methods, including Set, Clear, and Flip, return a BitSet pointer, which allows for chaining. - -### Example use: - -```go -package main - -import ( - "fmt" - "math/rand" - - "github.com/bits-and-blooms/bitset" -) - -func main() { - fmt.Printf("Hello from BitSet!\n") - var b bitset.BitSet - // play some Go Fish - for i := 0; i < 100; i++ { - card1 := uint(rand.Intn(52)) - card2 := uint(rand.Intn(52)) - b.Set(card1) - if b.Test(card2) { - fmt.Println("Go Fish!") - } - b.Clear(card1) - } - - // Chaining - b.Set(10).Set(11) - - for i, e := b.NextSet(0); e; i, e = b.NextSet(i + 1) { - fmt.Println("The following bit is set:", i) - } - if b.Intersection(bitset.New(100).Set(10)).Count() == 1 { - fmt.Println("Intersection works.") - } else { - fmt.Println("Intersection doesn't work???") - } -} -``` - -As an alternative to BitSets, one should check out the 'big' package, which provides a (less set-theoretical) view of bitsets. - -Package documentation is at: https://pkg.go.dev/github.com/bits-and-blooms/bitset?tab=doc - -## Memory Usage - -The memory usage of a bitset using N bits is at least N/8 bytes. The number of bits in a bitset is at least as large as one plus the greatest bit index you have accessed. Thus it is possible to run out of memory while using a bitset. If you have lots of bits, you might prefer compressed bitsets, like the [Roaring bitmaps](http://roaringbitmap.org) and its [Go implementation](https://github.com/RoaringBitmap/roaring). - -## Implementation Note - -Go 1.9 introduced a native `math/bits` library. We provide backward compatibility to Go 1.7, which might be removed. - -It is possible that a later version will match the `math/bits` return signature for counts (which is `int`, rather than our library's `unit64`). If so, the version will be bumped. - -## Installation - -```bash -go get github.com/bits-and-blooms/bitset -``` - -## Contributing - -If you wish to contribute to this project, please branch and issue a pull request against master ("[GitHub Flow](https://guides.github.com/introduction/flow/)") - -## Running all tests - -Before committing the code, please check if it passes tests, has adequate coverage, etc. -```bash -go test -go test -cover -``` diff --git a/vendor/github.com/bits-and-blooms/bitset/azure-pipelines.yml b/vendor/github.com/bits-and-blooms/bitset/azure-pipelines.yml deleted file mode 100644 index f9b295918404f..0000000000000 --- a/vendor/github.com/bits-and-blooms/bitset/azure-pipelines.yml +++ /dev/null @@ -1,39 +0,0 @@ -# Go -# Build your Go project. -# Add steps that test, save build artifacts, deploy, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/go - -trigger: -- master - -pool: - vmImage: 'Ubuntu-16.04' - -variables: - GOBIN: '$(GOPATH)/bin' # Go binaries path - GOROOT: '/usr/local/go1.11' # Go installation path - GOPATH: '$(system.defaultWorkingDirectory)/gopath' # Go workspace path - modulePath: '$(GOPATH)/src/github.com/$(build.repository.name)' # Path to the module's code - -steps: -- script: | - mkdir -p '$(GOBIN)' - mkdir -p '$(GOPATH)/pkg' - mkdir -p '$(modulePath)' - shopt -s extglob - shopt -s dotglob - mv !(gopath) '$(modulePath)' - echo '##vso[task.prependpath]$(GOBIN)' - echo '##vso[task.prependpath]$(GOROOT)/bin' - displayName: 'Set up the Go workspace' - -- script: | - go version - go get -v -t -d ./... - if [ -f Gopkg.toml ]; then - curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh - dep ensure - fi - go build -v . - workingDirectory: '$(modulePath)' - displayName: 'Get dependencies, then build' diff --git a/vendor/github.com/bits-and-blooms/bitset/bitset.go b/vendor/github.com/bits-and-blooms/bitset/bitset.go deleted file mode 100644 index d688806a54b89..0000000000000 --- a/vendor/github.com/bits-and-blooms/bitset/bitset.go +++ /dev/null @@ -1,952 +0,0 @@ -/* -Package bitset implements bitsets, a mapping -between non-negative integers and boolean values. It should be more -efficient than map[uint] bool. - -It provides methods for setting, clearing, flipping, and testing -individual integers. - -But it also provides set intersection, union, difference, -complement, and symmetric operations, as well as tests to -check whether any, all, or no bits are set, and querying a -bitset's current length and number of positive bits. - -BitSets are expanded to the size of the largest set bit; the -memory allocation is approximately Max bits, where Max is -the largest set bit. BitSets are never shrunk. On creation, -a hint can be given for the number of bits that will be used. - -Many of the methods, including Set,Clear, and Flip, return -a BitSet pointer, which allows for chaining. - -Example use: - - import "bitset" - var b BitSet - b.Set(10).Set(11) - if b.Test(1000) { - b.Clear(1000) - } - if B.Intersection(bitset.New(100).Set(10)).Count() > 1 { - fmt.Println("Intersection works.") - } - -As an alternative to BitSets, one should check out the 'big' package, -which provides a (less set-theoretical) view of bitsets. - -*/ -package bitset - -import ( - "bufio" - "bytes" - "encoding/base64" - "encoding/binary" - "encoding/json" - "errors" - "fmt" - "io" - "strconv" -) - -// the wordSize of a bit set -const wordSize = uint(64) - -// log2WordSize is lg(wordSize) -const log2WordSize = uint(6) - -// allBits has every bit set -const allBits uint64 = 0xffffffffffffffff - -// default binary BigEndian -var binaryOrder binary.ByteOrder = binary.BigEndian - -// default json encoding base64.URLEncoding -var base64Encoding = base64.URLEncoding - -// Base64StdEncoding Marshal/Unmarshal BitSet with base64.StdEncoding(Default: base64.URLEncoding) -func Base64StdEncoding() { base64Encoding = base64.StdEncoding } - -// LittleEndian Marshal/Unmarshal Binary as Little Endian(Default: binary.BigEndian) -func LittleEndian() { binaryOrder = binary.LittleEndian } - -// A BitSet is a set of bits. The zero value of a BitSet is an empty set of length 0. -type BitSet struct { - length uint - set []uint64 -} - -// Error is used to distinguish errors (panics) generated in this package. -type Error string - -// safeSet will fixup b.set to be non-nil and return the field value -func (b *BitSet) safeSet() []uint64 { - if b.set == nil { - b.set = make([]uint64, wordsNeeded(0)) - } - return b.set -} - -// From is a constructor used to create a BitSet from an array of integers -func From(buf []uint64) *BitSet { - return &BitSet{uint(len(buf)) * 64, buf} -} - -// Bytes returns the bitset as array of integers -func (b *BitSet) Bytes() []uint64 { - return b.set -} - -// wordsNeeded calculates the number of words needed for i bits -func wordsNeeded(i uint) int { - if i > (Cap() - wordSize + 1) { - return int(Cap() >> log2WordSize) - } - return int((i + (wordSize - 1)) >> log2WordSize) -} - -// New creates a new BitSet with a hint that length bits will be required -func New(length uint) (bset *BitSet) { - defer func() { - if r := recover(); r != nil { - bset = &BitSet{ - 0, - make([]uint64, 0), - } - } - }() - - bset = &BitSet{ - length, - make([]uint64, wordsNeeded(length)), - } - - return bset -} - -// Cap returns the total possible capacity, or number of bits -func Cap() uint { - return ^uint(0) -} - -// Len returns the number of bits in the BitSet. -// Note the difference to method Count, see example. -func (b *BitSet) Len() uint { - return b.length -} - -// extendSetMaybe adds additional words to incorporate new bits if needed -func (b *BitSet) extendSetMaybe(i uint) { - if i >= b.length { // if we need more bits, make 'em - if i >= Cap() { - panic("You are exceeding the capacity") - } - nsize := wordsNeeded(i + 1) - if b.set == nil { - b.set = make([]uint64, nsize) - } else if cap(b.set) >= nsize { - b.set = b.set[:nsize] // fast resize - } else if len(b.set) < nsize { - newset := make([]uint64, nsize, 2*nsize) // increase capacity 2x - copy(newset, b.set) - b.set = newset - } - b.length = i + 1 - } -} - -// Test whether bit i is set. -func (b *BitSet) Test(i uint) bool { - if i >= b.length { - return false - } - return b.set[i>>log2WordSize]&(1<<(i&(wordSize-1))) != 0 -} - -// Set bit i to 1, the capacity of the bitset is automatically -// increased accordingly. -// If i>= Cap(), this function will panic. -// Warning: using a very large value for 'i' -// may lead to a memory shortage and a panic: the caller is responsible -// for providing sensible parameters in line with their memory capacity. -func (b *BitSet) Set(i uint) *BitSet { - b.extendSetMaybe(i) - b.set[i>>log2WordSize] |= 1 << (i & (wordSize - 1)) - return b -} - -// Clear bit i to 0 -func (b *BitSet) Clear(i uint) *BitSet { - if i >= b.length { - return b - } - b.set[i>>log2WordSize] &^= 1 << (i & (wordSize - 1)) - return b -} - -// SetTo sets bit i to value. -// If i>= Cap(), this function will panic. -// Warning: using a very large value for 'i' -// may lead to a memory shortage and a panic: the caller is responsible -// for providing sensible parameters in line with their memory capacity. -func (b *BitSet) SetTo(i uint, value bool) *BitSet { - if value { - return b.Set(i) - } - return b.Clear(i) -} - -// Flip bit at i. -// If i>= Cap(), this function will panic. -// Warning: using a very large value for 'i' -// may lead to a memory shortage and a panic: the caller is responsible -// for providing sensible parameters in line with their memory capacity. -func (b *BitSet) Flip(i uint) *BitSet { - if i >= b.length { - return b.Set(i) - } - b.set[i>>log2WordSize] ^= 1 << (i & (wordSize - 1)) - return b -} - -// FlipRange bit in [start, end). -// If end>= Cap(), this function will panic. -// Warning: using a very large value for 'end' -// may lead to a memory shortage and a panic: the caller is responsible -// for providing sensible parameters in line with their memory capacity. -func (b *BitSet) FlipRange(start, end uint) *BitSet { - if start >= end { - return b - } - - b.extendSetMaybe(end - 1) - var startWord uint = start >> log2WordSize - var endWord uint = end >> log2WordSize - b.set[startWord] ^= ^(^uint64(0) << (start & (wordSize - 1))) - for i := startWord; i < endWord; i++ { - b.set[i] = ^b.set[i] - } - b.set[endWord] ^= ^uint64(0) >> (-end & (wordSize - 1)) - return b -} - -// Shrink shrinks BitSet so that the provided value is the last possible -// set value. It clears all bits > the provided index and reduces the size -// and length of the set. -// -// Note that the parameter value is not the new length in bits: it is the -// maximal value that can be stored in the bitset after the function call. -// The new length in bits is the parameter value + 1. Thus it is not possible -// to use this function to set the length to 0, the minimal value of the length -// after this function call is 1. -// -// A new slice is allocated to store the new bits, so you may see an increase in -// memory usage until the GC runs. Normally this should not be a problem, but if you -// have an extremely large BitSet its important to understand that the old BitSet will -// remain in memory until the GC frees it. -func (b *BitSet) Shrink(lastbitindex uint) *BitSet { - length := lastbitindex + 1 - idx := wordsNeeded(length) - if idx > len(b.set) { - return b - } - shrunk := make([]uint64, idx) - copy(shrunk, b.set[:idx]) - b.set = shrunk - b.length = length - b.set[idx-1] &= (allBits >> (uint64(64) - uint64(length&(wordSize-1)))) - return b -} - -// Compact shrinks BitSet to so that we preserve all set bits, while minimizing -// memory usage. Compact calls Shrink. -func (b *BitSet) Compact() *BitSet { - idx := len(b.set) - 1 - for ; idx >= 0 && b.set[idx] == 0; idx-- { - } - newlength := uint((idx + 1) << log2WordSize) - if newlength >= b.length { - return b // nothing to do - } - if newlength > 0 { - return b.Shrink(newlength - 1) - } - // We preserve one word - return b.Shrink(63) -} - -// InsertAt takes an index which indicates where a bit should be -// inserted. Then it shifts all the bits in the set to the left by 1, starting -// from the given index position, and sets the index position to 0. -// -// Depending on the size of your BitSet, and where you are inserting the new entry, -// this method could be extremely slow and in some cases might cause the entire BitSet -// to be recopied. -func (b *BitSet) InsertAt(idx uint) *BitSet { - insertAtElement := (idx >> log2WordSize) - - // if length of set is a multiple of wordSize we need to allocate more space first - if b.isLenExactMultiple() { - b.set = append(b.set, uint64(0)) - } - - var i uint - for i = uint(len(b.set) - 1); i > insertAtElement; i-- { - // all elements above the position where we want to insert can simply by shifted - b.set[i] <<= 1 - - // we take the most significant bit of the previous element and set it as - // the least significant bit of the current element - b.set[i] |= (b.set[i-1] & 0x8000000000000000) >> 63 - } - - // generate a mask to extract the data that we need to shift left - // within the element where we insert a bit - dataMask := ^(uint64(1)< 0x40000 { - buffer.WriteString("...") - break - } - buffer.WriteString(strconv.FormatInt(int64(i), 10)) - i, e = b.NextSet(i + 1) - if e { - buffer.WriteString(",") - } - } - buffer.WriteString("}") - return buffer.String() -} - -// DeleteAt deletes the bit at the given index position from -// within the bitset -// All the bits residing on the left of the deleted bit get -// shifted right by 1 -// The running time of this operation may potentially be -// relatively slow, O(length) -func (b *BitSet) DeleteAt(i uint) *BitSet { - // the index of the slice element where we'll delete a bit - deleteAtElement := i >> log2WordSize - - // generate a mask for the data that needs to be shifted right - // within that slice element that gets modified - dataMask := ^((uint64(1) << (i & (wordSize - 1))) - 1) - - // extract the data that we'll shift right from the slice element - data := b.set[deleteAtElement] & dataMask - - // set the masked area to 0 while leaving the rest as it is - b.set[deleteAtElement] &= ^dataMask - - // shift the previously extracted data to the right and then - // set it in the previously masked area - b.set[deleteAtElement] |= (data >> 1) & dataMask - - // loop over all the consecutive slice elements to copy each - // lowest bit into the highest position of the previous element, - // then shift the entire content to the right by 1 - for i := int(deleteAtElement) + 1; i < len(b.set); i++ { - b.set[i-1] |= (b.set[i] & 1) << 63 - b.set[i] >>= 1 - } - - b.length = b.length - 1 - - return b -} - -// NextSet returns the next bit set from the specified index, -// including possibly the current index -// along with an error code (true = valid, false = no set bit found) -// for i,e := v.NextSet(0); e; i,e = v.NextSet(i + 1) {...} -// -// Users concerned with performance may want to use NextSetMany to -// retrieve several values at once. -func (b *BitSet) NextSet(i uint) (uint, bool) { - x := int(i >> log2WordSize) - if x >= len(b.set) { - return 0, false - } - w := b.set[x] - w = w >> (i & (wordSize - 1)) - if w != 0 { - return i + trailingZeroes64(w), true - } - x = x + 1 - for x < len(b.set) { - if b.set[x] != 0 { - return uint(x)*wordSize + trailingZeroes64(b.set[x]), true - } - x = x + 1 - - } - return 0, false -} - -// NextSetMany returns many next bit sets from the specified index, -// including possibly the current index and up to cap(buffer). -// If the returned slice has len zero, then no more set bits were found -// -// buffer := make([]uint, 256) // this should be reused -// j := uint(0) -// j, buffer = bitmap.NextSetMany(j, buffer) -// for ; len(buffer) > 0; j, buffer = bitmap.NextSetMany(j,buffer) { -// for k := range buffer { -// do something with buffer[k] -// } -// j += 1 -// } -// -// -// It is possible to retrieve all set bits as follow: -// -// indices := make([]uint, bitmap.Count()) -// bitmap.NextSetMany(0, indices) -// -// However if bitmap.Count() is large, it might be preferable to -// use several calls to NextSetMany, for performance reasons. -func (b *BitSet) NextSetMany(i uint, buffer []uint) (uint, []uint) { - myanswer := buffer - capacity := cap(buffer) - x := int(i >> log2WordSize) - if x >= len(b.set) || capacity == 0 { - return 0, myanswer[:0] - } - skip := i & (wordSize - 1) - word := b.set[x] >> skip - myanswer = myanswer[:capacity] - size := int(0) - for word != 0 { - r := trailingZeroes64(word) - t := word & ((^word) + 1) - myanswer[size] = r + i - size++ - if size == capacity { - goto End - } - word = word ^ t - } - x++ - for idx, word := range b.set[x:] { - for word != 0 { - r := trailingZeroes64(word) - t := word & ((^word) + 1) - myanswer[size] = r + (uint(x+idx) << 6) - size++ - if size == capacity { - goto End - } - word = word ^ t - } - } -End: - if size > 0 { - return myanswer[size-1], myanswer[:size] - } - return 0, myanswer[:0] -} - -// NextClear returns the next clear bit from the specified index, -// including possibly the current index -// along with an error code (true = valid, false = no bit found i.e. all bits are set) -func (b *BitSet) NextClear(i uint) (uint, bool) { - x := int(i >> log2WordSize) - if x >= len(b.set) { - return 0, false - } - w := b.set[x] - w = w >> (i & (wordSize - 1)) - wA := allBits >> (i & (wordSize - 1)) - index := i + trailingZeroes64(^w) - if w != wA && index < b.length { - return index, true - } - x++ - for x < len(b.set) { - index = uint(x)*wordSize + trailingZeroes64(^b.set[x]) - if b.set[x] != allBits && index < b.length { - return index, true - } - x++ - } - return 0, false -} - -// ClearAll clears the entire BitSet -func (b *BitSet) ClearAll() *BitSet { - if b != nil && b.set != nil { - for i := range b.set { - b.set[i] = 0 - } - } - return b -} - -// wordCount returns the number of words used in a bit set -func (b *BitSet) wordCount() int { - return len(b.set) -} - -// Clone this BitSet -func (b *BitSet) Clone() *BitSet { - c := New(b.length) - if b.set != nil { // Clone should not modify current object - copy(c.set, b.set) - } - return c -} - -// Copy into a destination BitSet -// Returning the size of the destination BitSet -// like array copy -func (b *BitSet) Copy(c *BitSet) (count uint) { - if c == nil { - return - } - if b.set != nil { // Copy should not modify current object - copy(c.set, b.set) - } - count = c.length - if b.length < c.length { - count = b.length - } - return -} - -// Count (number of set bits). -// Also known as "popcount" or "population count". -func (b *BitSet) Count() uint { - if b != nil && b.set != nil { - return uint(popcntSlice(b.set)) - } - return 0 -} - -// Equal tests the equivalence of two BitSets. -// False if they are of different sizes, otherwise true -// only if all the same bits are set -func (b *BitSet) Equal(c *BitSet) bool { - if c == nil || b == nil { - return c == b - } - if b.length != c.length { - return false - } - if b.length == 0 { // if they have both length == 0, then could have nil set - return true - } - // testing for equality shoud not transform the bitset (no call to safeSet) - - for p, v := range b.set { - if c.set[p] != v { - return false - } - } - return true -} - -func panicIfNull(b *BitSet) { - if b == nil { - panic(Error("BitSet must not be null")) - } -} - -// Difference of base set and other set -// This is the BitSet equivalent of &^ (and not) -func (b *BitSet) Difference(compare *BitSet) (result *BitSet) { - panicIfNull(b) - panicIfNull(compare) - result = b.Clone() // clone b (in case b is bigger than compare) - l := int(compare.wordCount()) - if l > int(b.wordCount()) { - l = int(b.wordCount()) - } - for i := 0; i < l; i++ { - result.set[i] = b.set[i] &^ compare.set[i] - } - return -} - -// DifferenceCardinality computes the cardinality of the differnce -func (b *BitSet) DifferenceCardinality(compare *BitSet) uint { - panicIfNull(b) - panicIfNull(compare) - l := int(compare.wordCount()) - if l > int(b.wordCount()) { - l = int(b.wordCount()) - } - cnt := uint64(0) - cnt += popcntMaskSlice(b.set[:l], compare.set[:l]) - cnt += popcntSlice(b.set[l:]) - return uint(cnt) -} - -// InPlaceDifference computes the difference of base set and other set -// This is the BitSet equivalent of &^ (and not) -func (b *BitSet) InPlaceDifference(compare *BitSet) { - panicIfNull(b) - panicIfNull(compare) - l := int(compare.wordCount()) - if l > int(b.wordCount()) { - l = int(b.wordCount()) - } - for i := 0; i < l; i++ { - b.set[i] &^= compare.set[i] - } -} - -// Convenience function: return two bitsets ordered by -// increasing length. Note: neither can be nil -func sortByLength(a *BitSet, b *BitSet) (ap *BitSet, bp *BitSet) { - if a.length <= b.length { - ap, bp = a, b - } else { - ap, bp = b, a - } - return -} - -// Intersection of base set and other set -// This is the BitSet equivalent of & (and) -func (b *BitSet) Intersection(compare *BitSet) (result *BitSet) { - panicIfNull(b) - panicIfNull(compare) - b, compare = sortByLength(b, compare) - result = New(b.length) - for i, word := range b.set { - result.set[i] = word & compare.set[i] - } - return -} - -// IntersectionCardinality computes the cardinality of the union -func (b *BitSet) IntersectionCardinality(compare *BitSet) uint { - panicIfNull(b) - panicIfNull(compare) - b, compare = sortByLength(b, compare) - cnt := popcntAndSlice(b.set, compare.set) - return uint(cnt) -} - -// InPlaceIntersection destructively computes the intersection of -// base set and the compare set. -// This is the BitSet equivalent of & (and) -func (b *BitSet) InPlaceIntersection(compare *BitSet) { - panicIfNull(b) - panicIfNull(compare) - l := int(compare.wordCount()) - if l > int(b.wordCount()) { - l = int(b.wordCount()) - } - for i := 0; i < l; i++ { - b.set[i] &= compare.set[i] - } - for i := l; i < len(b.set); i++ { - b.set[i] = 0 - } - if compare.length > 0 { - b.extendSetMaybe(compare.length - 1) - } -} - -// Union of base set and other set -// This is the BitSet equivalent of | (or) -func (b *BitSet) Union(compare *BitSet) (result *BitSet) { - panicIfNull(b) - panicIfNull(compare) - b, compare = sortByLength(b, compare) - result = compare.Clone() - for i, word := range b.set { - result.set[i] = word | compare.set[i] - } - return -} - -// UnionCardinality computes the cardinality of the uniton of the base set -// and the compare set. -func (b *BitSet) UnionCardinality(compare *BitSet) uint { - panicIfNull(b) - panicIfNull(compare) - b, compare = sortByLength(b, compare) - cnt := popcntOrSlice(b.set, compare.set) - if len(compare.set) > len(b.set) { - cnt += popcntSlice(compare.set[len(b.set):]) - } - return uint(cnt) -} - -// InPlaceUnion creates the destructive union of base set and compare set. -// This is the BitSet equivalent of | (or). -func (b *BitSet) InPlaceUnion(compare *BitSet) { - panicIfNull(b) - panicIfNull(compare) - l := int(compare.wordCount()) - if l > int(b.wordCount()) { - l = int(b.wordCount()) - } - if compare.length > 0 { - b.extendSetMaybe(compare.length - 1) - } - for i := 0; i < l; i++ { - b.set[i] |= compare.set[i] - } - if len(compare.set) > l { - for i := l; i < len(compare.set); i++ { - b.set[i] = compare.set[i] - } - } -} - -// SymmetricDifference of base set and other set -// This is the BitSet equivalent of ^ (xor) -func (b *BitSet) SymmetricDifference(compare *BitSet) (result *BitSet) { - panicIfNull(b) - panicIfNull(compare) - b, compare = sortByLength(b, compare) - // compare is bigger, so clone it - result = compare.Clone() - for i, word := range b.set { - result.set[i] = word ^ compare.set[i] - } - return -} - -// SymmetricDifferenceCardinality computes the cardinality of the symmetric difference -func (b *BitSet) SymmetricDifferenceCardinality(compare *BitSet) uint { - panicIfNull(b) - panicIfNull(compare) - b, compare = sortByLength(b, compare) - cnt := popcntXorSlice(b.set, compare.set) - if len(compare.set) > len(b.set) { - cnt += popcntSlice(compare.set[len(b.set):]) - } - return uint(cnt) -} - -// InPlaceSymmetricDifference creates the destructive SymmetricDifference of base set and other set -// This is the BitSet equivalent of ^ (xor) -func (b *BitSet) InPlaceSymmetricDifference(compare *BitSet) { - panicIfNull(b) - panicIfNull(compare) - l := int(compare.wordCount()) - if l > int(b.wordCount()) { - l = int(b.wordCount()) - } - if compare.length > 0 { - b.extendSetMaybe(compare.length - 1) - } - for i := 0; i < l; i++ { - b.set[i] ^= compare.set[i] - } - if len(compare.set) > l { - for i := l; i < len(compare.set); i++ { - b.set[i] = compare.set[i] - } - } -} - -// Is the length an exact multiple of word sizes? -func (b *BitSet) isLenExactMultiple() bool { - return b.length%wordSize == 0 -} - -// Clean last word by setting unused bits to 0 -func (b *BitSet) cleanLastWord() { - if !b.isLenExactMultiple() { - b.set[len(b.set)-1] &= allBits >> (wordSize - b.length%wordSize) - } -} - -// Complement computes the (local) complement of a biset (up to length bits) -func (b *BitSet) Complement() (result *BitSet) { - panicIfNull(b) - result = New(b.length) - for i, word := range b.set { - result.set[i] = ^word - } - result.cleanLastWord() - return -} - -// All returns true if all bits are set, false otherwise. Returns true for -// empty sets. -func (b *BitSet) All() bool { - panicIfNull(b) - return b.Count() == b.length -} - -// None returns true if no bit is set, false otherwise. Returns true for -// empty sets. -func (b *BitSet) None() bool { - panicIfNull(b) - if b != nil && b.set != nil { - for _, word := range b.set { - if word > 0 { - return false - } - } - return true - } - return true -} - -// Any returns true if any bit is set, false otherwise -func (b *BitSet) Any() bool { - panicIfNull(b) - return !b.None() -} - -// IsSuperSet returns true if this is a superset of the other set -func (b *BitSet) IsSuperSet(other *BitSet) bool { - for i, e := other.NextSet(0); e; i, e = other.NextSet(i + 1) { - if !b.Test(i) { - return false - } - } - return true -} - -// IsStrictSuperSet returns true if this is a strict superset of the other set -func (b *BitSet) IsStrictSuperSet(other *BitSet) bool { - return b.Count() > other.Count() && b.IsSuperSet(other) -} - -// DumpAsBits dumps a bit set as a string of bits -func (b *BitSet) DumpAsBits() string { - if b.set == nil { - return "." - } - buffer := bytes.NewBufferString("") - i := len(b.set) - 1 - for ; i >= 0; i-- { - fmt.Fprintf(buffer, "%064b.", b.set[i]) - } - return buffer.String() -} - -// BinaryStorageSize returns the binary storage requirements -func (b *BitSet) BinaryStorageSize() int { - return binary.Size(uint64(0)) + binary.Size(b.set) -} - -// WriteTo writes a BitSet to a stream -func (b *BitSet) WriteTo(stream io.Writer) (int64, error) { - length := uint64(b.length) - - // Write length - err := binary.Write(stream, binaryOrder, length) - if err != nil { - return 0, err - } - - // Write set - err = binary.Write(stream, binaryOrder, b.set) - return int64(b.BinaryStorageSize()), err -} - -// ReadFrom reads a BitSet from a stream written using WriteTo -func (b *BitSet) ReadFrom(stream io.Reader) (int64, error) { - var length uint64 - - // Read length first - err := binary.Read(stream, binaryOrder, &length) - if err != nil { - return 0, err - } - newset := New(uint(length)) - - if uint64(newset.length) != length { - return 0, errors.New("unmarshalling error: type mismatch") - } - - // Read remaining bytes as set - err = binary.Read(stream, binaryOrder, newset.set) - if err != nil { - return 0, err - } - - *b = *newset - return int64(b.BinaryStorageSize()), nil -} - -// MarshalBinary encodes a BitSet into a binary form and returns the result. -func (b *BitSet) MarshalBinary() ([]byte, error) { - var buf bytes.Buffer - writer := bufio.NewWriter(&buf) - - _, err := b.WriteTo(writer) - if err != nil { - return []byte{}, err - } - - err = writer.Flush() - - return buf.Bytes(), err -} - -// UnmarshalBinary decodes the binary form generated by MarshalBinary. -func (b *BitSet) UnmarshalBinary(data []byte) error { - buf := bytes.NewReader(data) - reader := bufio.NewReader(buf) - - _, err := b.ReadFrom(reader) - - return err -} - -// MarshalJSON marshals a BitSet as a JSON structure -func (b *BitSet) MarshalJSON() ([]byte, error) { - buffer := bytes.NewBuffer(make([]byte, 0, b.BinaryStorageSize())) - _, err := b.WriteTo(buffer) - if err != nil { - return nil, err - } - - // URLEncode all bytes - return json.Marshal(base64Encoding.EncodeToString(buffer.Bytes())) -} - -// UnmarshalJSON unmarshals a BitSet from JSON created using MarshalJSON -func (b *BitSet) UnmarshalJSON(data []byte) error { - // Unmarshal as string - var s string - err := json.Unmarshal(data, &s) - if err != nil { - return err - } - - // URLDecode string - buf, err := base64Encoding.DecodeString(s) - if err != nil { - return err - } - - _, err = b.ReadFrom(bytes.NewReader(buf)) - return err -} diff --git a/vendor/github.com/bits-and-blooms/bitset/go.mod b/vendor/github.com/bits-and-blooms/bitset/go.mod deleted file mode 100644 index c43e4522b7f95..0000000000000 --- a/vendor/github.com/bits-and-blooms/bitset/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/bits-and-blooms/bitset - -go 1.14 diff --git a/vendor/github.com/bits-and-blooms/bitset/go.sum b/vendor/github.com/bits-and-blooms/bitset/go.sum deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/vendor/github.com/bits-and-blooms/bitset/popcnt.go b/vendor/github.com/bits-and-blooms/bitset/popcnt.go deleted file mode 100644 index 76577a8382844..0000000000000 --- a/vendor/github.com/bits-and-blooms/bitset/popcnt.go +++ /dev/null @@ -1,53 +0,0 @@ -package bitset - -// bit population count, take from -// https://code.google.com/p/go/issues/detail?id=4988#c11 -// credit: https://code.google.com/u/arnehormann/ -func popcount(x uint64) (n uint64) { - x -= (x >> 1) & 0x5555555555555555 - x = (x>>2)&0x3333333333333333 + x&0x3333333333333333 - x += x >> 4 - x &= 0x0f0f0f0f0f0f0f0f - x *= 0x0101010101010101 - return x >> 56 -} - -func popcntSliceGo(s []uint64) uint64 { - cnt := uint64(0) - for _, x := range s { - cnt += popcount(x) - } - return cnt -} - -func popcntMaskSliceGo(s, m []uint64) uint64 { - cnt := uint64(0) - for i := range s { - cnt += popcount(s[i] &^ m[i]) - } - return cnt -} - -func popcntAndSliceGo(s, m []uint64) uint64 { - cnt := uint64(0) - for i := range s { - cnt += popcount(s[i] & m[i]) - } - return cnt -} - -func popcntOrSliceGo(s, m []uint64) uint64 { - cnt := uint64(0) - for i := range s { - cnt += popcount(s[i] | m[i]) - } - return cnt -} - -func popcntXorSliceGo(s, m []uint64) uint64 { - cnt := uint64(0) - for i := range s { - cnt += popcount(s[i] ^ m[i]) - } - return cnt -} diff --git a/vendor/github.com/bits-and-blooms/bitset/popcnt_19.go b/vendor/github.com/bits-and-blooms/bitset/popcnt_19.go deleted file mode 100644 index fc8ff4f367c23..0000000000000 --- a/vendor/github.com/bits-and-blooms/bitset/popcnt_19.go +++ /dev/null @@ -1,45 +0,0 @@ -// +build go1.9 - -package bitset - -import "math/bits" - -func popcntSlice(s []uint64) uint64 { - var cnt int - for _, x := range s { - cnt += bits.OnesCount64(x) - } - return uint64(cnt) -} - -func popcntMaskSlice(s, m []uint64) uint64 { - var cnt int - for i := range s { - cnt += bits.OnesCount64(s[i] &^ m[i]) - } - return uint64(cnt) -} - -func popcntAndSlice(s, m []uint64) uint64 { - var cnt int - for i := range s { - cnt += bits.OnesCount64(s[i] & m[i]) - } - return uint64(cnt) -} - -func popcntOrSlice(s, m []uint64) uint64 { - var cnt int - for i := range s { - cnt += bits.OnesCount64(s[i] | m[i]) - } - return uint64(cnt) -} - -func popcntXorSlice(s, m []uint64) uint64 { - var cnt int - for i := range s { - cnt += bits.OnesCount64(s[i] ^ m[i]) - } - return uint64(cnt) -} diff --git a/vendor/github.com/bits-and-blooms/bitset/popcnt_amd64.go b/vendor/github.com/bits-and-blooms/bitset/popcnt_amd64.go deleted file mode 100644 index 4cf64f24ad03f..0000000000000 --- a/vendor/github.com/bits-and-blooms/bitset/popcnt_amd64.go +++ /dev/null @@ -1,68 +0,0 @@ -// +build !go1.9 -// +build amd64,!appengine - -package bitset - -// *** the following functions are defined in popcnt_amd64.s - -//go:noescape - -func hasAsm() bool - -// useAsm is a flag used to select the GO or ASM implementation of the popcnt function -var useAsm = hasAsm() - -//go:noescape - -func popcntSliceAsm(s []uint64) uint64 - -//go:noescape - -func popcntMaskSliceAsm(s, m []uint64) uint64 - -//go:noescape - -func popcntAndSliceAsm(s, m []uint64) uint64 - -//go:noescape - -func popcntOrSliceAsm(s, m []uint64) uint64 - -//go:noescape - -func popcntXorSliceAsm(s, m []uint64) uint64 - -func popcntSlice(s []uint64) uint64 { - if useAsm { - return popcntSliceAsm(s) - } - return popcntSliceGo(s) -} - -func popcntMaskSlice(s, m []uint64) uint64 { - if useAsm { - return popcntMaskSliceAsm(s, m) - } - return popcntMaskSliceGo(s, m) -} - -func popcntAndSlice(s, m []uint64) uint64 { - if useAsm { - return popcntAndSliceAsm(s, m) - } - return popcntAndSliceGo(s, m) -} - -func popcntOrSlice(s, m []uint64) uint64 { - if useAsm { - return popcntOrSliceAsm(s, m) - } - return popcntOrSliceGo(s, m) -} - -func popcntXorSlice(s, m []uint64) uint64 { - if useAsm { - return popcntXorSliceAsm(s, m) - } - return popcntXorSliceGo(s, m) -} diff --git a/vendor/github.com/bits-and-blooms/bitset/popcnt_amd64.s b/vendor/github.com/bits-and-blooms/bitset/popcnt_amd64.s deleted file mode 100644 index 666c0dcc17f5a..0000000000000 --- a/vendor/github.com/bits-and-blooms/bitset/popcnt_amd64.s +++ /dev/null @@ -1,104 +0,0 @@ -// +build !go1.9 -// +build amd64,!appengine - -TEXT ·hasAsm(SB),4,$0-1 -MOVQ $1, AX -CPUID -SHRQ $23, CX -ANDQ $1, CX -MOVB CX, ret+0(FP) -RET - -#define POPCNTQ_DX_DX BYTE $0xf3; BYTE $0x48; BYTE $0x0f; BYTE $0xb8; BYTE $0xd2 - -TEXT ·popcntSliceAsm(SB),4,$0-32 -XORQ AX, AX -MOVQ s+0(FP), SI -MOVQ s_len+8(FP), CX -TESTQ CX, CX -JZ popcntSliceEnd -popcntSliceLoop: -BYTE $0xf3; BYTE $0x48; BYTE $0x0f; BYTE $0xb8; BYTE $0x16 // POPCNTQ (SI), DX -ADDQ DX, AX -ADDQ $8, SI -LOOP popcntSliceLoop -popcntSliceEnd: -MOVQ AX, ret+24(FP) -RET - -TEXT ·popcntMaskSliceAsm(SB),4,$0-56 -XORQ AX, AX -MOVQ s+0(FP), SI -MOVQ s_len+8(FP), CX -TESTQ CX, CX -JZ popcntMaskSliceEnd -MOVQ m+24(FP), DI -popcntMaskSliceLoop: -MOVQ (DI), DX -NOTQ DX -ANDQ (SI), DX -POPCNTQ_DX_DX -ADDQ DX, AX -ADDQ $8, SI -ADDQ $8, DI -LOOP popcntMaskSliceLoop -popcntMaskSliceEnd: -MOVQ AX, ret+48(FP) -RET - -TEXT ·popcntAndSliceAsm(SB),4,$0-56 -XORQ AX, AX -MOVQ s+0(FP), SI -MOVQ s_len+8(FP), CX -TESTQ CX, CX -JZ popcntAndSliceEnd -MOVQ m+24(FP), DI -popcntAndSliceLoop: -MOVQ (DI), DX -ANDQ (SI), DX -POPCNTQ_DX_DX -ADDQ DX, AX -ADDQ $8, SI -ADDQ $8, DI -LOOP popcntAndSliceLoop -popcntAndSliceEnd: -MOVQ AX, ret+48(FP) -RET - -TEXT ·popcntOrSliceAsm(SB),4,$0-56 -XORQ AX, AX -MOVQ s+0(FP), SI -MOVQ s_len+8(FP), CX -TESTQ CX, CX -JZ popcntOrSliceEnd -MOVQ m+24(FP), DI -popcntOrSliceLoop: -MOVQ (DI), DX -ORQ (SI), DX -POPCNTQ_DX_DX -ADDQ DX, AX -ADDQ $8, SI -ADDQ $8, DI -LOOP popcntOrSliceLoop -popcntOrSliceEnd: -MOVQ AX, ret+48(FP) -RET - -TEXT ·popcntXorSliceAsm(SB),4,$0-56 -XORQ AX, AX -MOVQ s+0(FP), SI -MOVQ s_len+8(FP), CX -TESTQ CX, CX -JZ popcntXorSliceEnd -MOVQ m+24(FP), DI -popcntXorSliceLoop: -MOVQ (DI), DX -XORQ (SI), DX -POPCNTQ_DX_DX -ADDQ DX, AX -ADDQ $8, SI -ADDQ $8, DI -LOOP popcntXorSliceLoop -popcntXorSliceEnd: -MOVQ AX, ret+48(FP) -RET diff --git a/vendor/github.com/bits-and-blooms/bitset/popcnt_generic.go b/vendor/github.com/bits-and-blooms/bitset/popcnt_generic.go deleted file mode 100644 index 21e0ff7b4fc5c..0000000000000 --- a/vendor/github.com/bits-and-blooms/bitset/popcnt_generic.go +++ /dev/null @@ -1,24 +0,0 @@ -// +build !go1.9 -// +build !amd64 appengine - -package bitset - -func popcntSlice(s []uint64) uint64 { - return popcntSliceGo(s) -} - -func popcntMaskSlice(s, m []uint64) uint64 { - return popcntMaskSliceGo(s, m) -} - -func popcntAndSlice(s, m []uint64) uint64 { - return popcntAndSliceGo(s, m) -} - -func popcntOrSlice(s, m []uint64) uint64 { - return popcntOrSliceGo(s, m) -} - -func popcntXorSlice(s, m []uint64) uint64 { - return popcntXorSliceGo(s, m) -} diff --git a/vendor/github.com/bits-and-blooms/bitset/trailing_zeros_18.go b/vendor/github.com/bits-and-blooms/bitset/trailing_zeros_18.go deleted file mode 100644 index c52b61be9fc2b..0000000000000 --- a/vendor/github.com/bits-and-blooms/bitset/trailing_zeros_18.go +++ /dev/null @@ -1,14 +0,0 @@ -// +build !go1.9 - -package bitset - -var deBruijn = [...]byte{ - 0, 1, 56, 2, 57, 49, 28, 3, 61, 58, 42, 50, 38, 29, 17, 4, - 62, 47, 59, 36, 45, 43, 51, 22, 53, 39, 33, 30, 24, 18, 12, 5, - 63, 55, 48, 27, 60, 41, 37, 16, 46, 35, 44, 21, 52, 32, 23, 11, - 54, 26, 40, 15, 34, 20, 31, 10, 25, 14, 19, 9, 13, 8, 7, 6, -} - -func trailingZeroes64(v uint64) uint { - return uint(deBruijn[((v&-v)*0x03f79d71b4ca8b09)>>58]) -} diff --git a/vendor/github.com/bits-and-blooms/bitset/trailing_zeros_19.go b/vendor/github.com/bits-and-blooms/bitset/trailing_zeros_19.go deleted file mode 100644 index 36a988e714d15..0000000000000 --- a/vendor/github.com/bits-and-blooms/bitset/trailing_zeros_19.go +++ /dev/null @@ -1,9 +0,0 @@ -// +build go1.9 - -package bitset - -import "math/bits" - -func trailingZeroes64(v uint64) uint { - return uint(bits.TrailingZeros64(v)) -} diff --git a/vendor/github.com/cilium/ebpf/.gitignore b/vendor/github.com/cilium/ebpf/.gitignore index 38b15653c0f94..b46162b8ec333 100644 --- a/vendor/github.com/cilium/ebpf/.gitignore +++ b/vendor/github.com/cilium/ebpf/.gitignore @@ -5,6 +5,7 @@ *.so *.dylib *.o +!*_bpf*.o # Test binary, build with `go test -c` *.test diff --git a/vendor/github.com/cilium/ebpf/.golangci.yaml b/vendor/github.com/cilium/ebpf/.golangci.yaml index a88374197ecbc..dc62dd6d0fc72 100644 --- a/vendor/github.com/cilium/ebpf/.golangci.yaml +++ b/vendor/github.com/cilium/ebpf/.golangci.yaml @@ -24,6 +24,5 @@ linters: # Could be enabled later: # - gocyclo - # - prealloc # - maligned # - gosec diff --git a/vendor/github.com/cilium/ebpf/ARCHITECTURE.md b/vendor/github.com/cilium/ebpf/ARCHITECTURE.md index aee9c0a0d4d51..6cbb31b6481ed 100644 --- a/vendor/github.com/cilium/ebpf/ARCHITECTURE.md +++ b/vendor/github.com/cilium/ebpf/ARCHITECTURE.md @@ -57,7 +57,7 @@ Objects loading a spec will fail because the kernel is too old, or a feature is not enabled. There are multiple ways the library deals with that: -* Fallback: older kernels don't allowing naming programs and maps. The library +* Fallback: older kernels don't allow naming programs and maps. The library automatically detects support for names, and omits them during load if necessary. This works since name is primarily a debug aid. @@ -68,7 +68,7 @@ enabled. There are multiple ways the library deals with that: Once program and map objects are loaded they expose the kernel's low-level API, e.g. `NextKey`. Often this API is awkward to use in Go, so there are safer wrappers on top of the low-level API, like `MapIterator`. The low-level API is -useful as an out when our higher-level API doesn't support a particular use case. +useful when our higher-level API doesn't support a particular use case. Links --- diff --git a/vendor/github.com/cilium/ebpf/CONTRIBUTING.md b/vendor/github.com/cilium/ebpf/CONTRIBUTING.md index 72ceb43782972..0d29eae81e3ed 100644 --- a/vendor/github.com/cilium/ebpf/CONTRIBUTING.md +++ b/vendor/github.com/cilium/ebpf/CONTRIBUTING.md @@ -6,8 +6,8 @@ are welcome. Please take a look at [the architecture](ARCHITECTURE.md) to get a better understanding for the high-level goals. New features must be accompanied by tests. Before starting work on any large -feature, please [join](https://cilium.herokuapp.com/) the -[#libbpf-go](https://cilium.slack.com/messages/libbpf-go) channel on Slack to +feature, please [join](https://ebpf.io/slack) the +[#ebpf-go](https://cilium.slack.com/messages/ebpf-go) channel on Slack to discuss the design first. When submitting pull requests, consider writing details about what problem you diff --git a/vendor/github.com/cilium/ebpf/Makefile b/vendor/github.com/cilium/ebpf/Makefile index 5dd342c5b287a..0bc15c0810cbf 100644 --- a/vendor/github.com/cilium/ebpf/Makefile +++ b/vendor/github.com/cilium/ebpf/Makefile @@ -18,11 +18,14 @@ TARGETS := \ testdata/loader-clang-7 \ testdata/loader-clang-9 \ testdata/loader-$(CLANG) \ + testdata/btf_map_init \ testdata/invalid_map \ testdata/raw_tracepoint \ testdata/invalid_map_static \ - testdata/initialized_btf_map \ + testdata/invalid_btf_map_init \ testdata/strings \ + testdata/freplace \ + testdata/iproute2_map_compat \ internal/btf/testdata/relocs .PHONY: all clean docker-all docker-shell diff --git a/vendor/github.com/cilium/ebpf/README.md b/vendor/github.com/cilium/ebpf/README.md index 76c3c303bb1be..01e2fff92bbc8 100644 --- a/vendor/github.com/cilium/ebpf/README.md +++ b/vendor/github.com/cilium/ebpf/README.md @@ -2,28 +2,16 @@ [![PkgGoDev](https://pkg.go.dev/badge/github.com/cilium/ebpf)](https://pkg.go.dev/github.com/cilium/ebpf) +![HoneyGopher](.github/images/cilium-ebpf.png) + 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. -* [asm](https://pkg.go.dev/github.com/cilium/ebpf/asm) contains a basic - assembler -* [link](https://pkg.go.dev/github.com/cilium/ebpf/link) allows attaching eBPF - to various hooks -* [perf](https://pkg.go.dev/github.com/cilium/ebpf/perf) allows reading from a - `PERF_EVENT_ARRAY` -* [cmd/bpf2go](https://pkg.go.dev/github.com/cilium/ebpf/cmd/bpf2go) allows - compiling and embedding eBPF programs in Go code - 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 +[Cilium](https://www.cilium.io). -The package is production ready, but **the API is explicitly unstable right -now**. Expect to update your code if you want to follow along. +See [ebpf.io](https://ebpf.io) for other projects from the eBPF ecosystem. ## Getting Started @@ -33,21 +21,37 @@ your own tools can be found under [examples/](examples/). Contributions are highly encouraged, as they highlight certain use cases of eBPF and the library, and help shape the future of the project. +## Getting Help + +Please +[join](https://ebpf.io/slack) the +[#ebpf-go](https://cilium.slack.com/messages/ebpf-go) channel on Slack if you +have questions regarding the library. + +## Packages + +This library includes the following packages: + +* [asm](https://pkg.go.dev/github.com/cilium/ebpf/asm) contains a basic + assembler, allowing you to write eBPF assembly instructions directly + within your Go code. (You don't need to use this if you prefer to write your eBPF program in C.) +* [cmd/bpf2go](https://pkg.go.dev/github.com/cilium/ebpf/cmd/bpf2go) allows + compiling and embedding eBPF programs written in C within Go code. As well as + compiling the C code, it auto-generates Go code for loading and manipulating + the eBPF program and map objects. +* [link](https://pkg.go.dev/github.com/cilium/ebpf/link) allows attaching eBPF + to various hooks +* [perf](https://pkg.go.dev/github.com/cilium/ebpf/perf) allows reading from a + `PERF_EVENT_ARRAY` +* [ringbuf](https://pkg.go.dev/github.com/cilium/ebpf/ringbuf) allows reading from a + `BPF_MAP_TYPE_RINGBUF` map + + ## 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 - -* [eBPF.io](https://ebpf.io) (recommended) -* [Cilium eBPF documentation](https://docs.cilium.io/en/latest/bpf/#bpf-guide) - (recommended) -* [Linux documentation on - BPF](https://www.kernel.org/doc/html/latest/networking/filter.html) -* [eBPF features by Linux - version](https://github.com/iovisor/bcc/blob/master/docs/kernel-versions.md) +* Linux >= 4.9. CI is run against LTS releases. ## Regenerating Testdata @@ -60,3 +64,7 @@ The toolchain image build files are kept in [testdata/docker/](testdata/docker/) ## License MIT + +### eBPF Gopher + +The eBPF honeygopher is based on the Go gopher designed by Renee French. diff --git a/vendor/github.com/cilium/ebpf/asm/func.go b/vendor/github.com/cilium/ebpf/asm/func.go index aee2c7ac81062..bfa5d59c976ea 100644 --- a/vendor/github.com/cilium/ebpf/asm/func.go +++ b/vendor/github.com/cilium/ebpf/asm/func.go @@ -184,6 +184,12 @@ const ( FnKtimeGetCoarseNs FnImaInodeHash FnSockFromFile + FnCheckMtu + FnForEachMapElem + FnSnprintf + FnSysBpf + FnBtfFindByNameKind + FnSysClose ) // Call emits a function call. diff --git a/vendor/github.com/cilium/ebpf/asm/func_string.go b/vendor/github.com/cilium/ebpf/asm/func_string.go index a712c5da8af99..5a0e333639a36 100644 --- a/vendor/github.com/cilium/ebpf/asm/func_string.go +++ b/vendor/github.com/cilium/ebpf/asm/func_string.go @@ -171,11 +171,17 @@ func _() { _ = x[FnKtimeGetCoarseNs-160] _ = x[FnImaInodeHash-161] _ = x[FnSockFromFile-162] + _ = x[FnCheckMtu-163] + _ = x[FnForEachMapElem-164] + _ = x[FnSnprintf-165] + _ = x[FnSysBpf-166] + _ = x[FnBtfFindByNameKind-167] + _ = x[FnSysClose-168] } -const _BuiltinFunc_name = "FnUnspecFnMapLookupElemFnMapUpdateElemFnMapDeleteElemFnProbeReadFnKtimeGetNsFnTracePrintkFnGetPrandomU32FnGetSmpProcessorIdFnSkbStoreBytesFnL3CsumReplaceFnL4CsumReplaceFnTailCallFnCloneRedirectFnGetCurrentPidTgidFnGetCurrentUidGidFnGetCurrentCommFnGetCgroupClassidFnSkbVlanPushFnSkbVlanPopFnSkbGetTunnelKeyFnSkbSetTunnelKeyFnPerfEventReadFnRedirectFnGetRouteRealmFnPerfEventOutputFnSkbLoadBytesFnGetStackidFnCsumDiffFnSkbGetTunnelOptFnSkbSetTunnelOptFnSkbChangeProtoFnSkbChangeTypeFnSkbUnderCgroupFnGetHashRecalcFnGetCurrentTaskFnProbeWriteUserFnCurrentTaskUnderCgroupFnSkbChangeTailFnSkbPullDataFnCsumUpdateFnSetHashInvalidFnGetNumaNodeIdFnSkbChangeHeadFnXdpAdjustHeadFnProbeReadStrFnGetSocketCookieFnGetSocketUidFnSetHashFnSetsockoptFnSkbAdjustRoomFnRedirectMapFnSkRedirectMapFnSockMapUpdateFnXdpAdjustMetaFnPerfEventReadValueFnPerfProgReadValueFnGetsockoptFnOverrideReturnFnSockOpsCbFlagsSetFnMsgRedirectMapFnMsgApplyBytesFnMsgCorkBytesFnMsgPullDataFnBindFnXdpAdjustTailFnSkbGetXfrmStateFnGetStackFnSkbLoadBytesRelativeFnFibLookupFnSockHashUpdateFnMsgRedirectHashFnSkRedirectHashFnLwtPushEncapFnLwtSeg6StoreBytesFnLwtSeg6AdjustSrhFnLwtSeg6ActionFnRcRepeatFnRcKeydownFnSkbCgroupIdFnGetCurrentCgroupIdFnGetLocalStorageFnSkSelectReuseportFnSkbAncestorCgroupIdFnSkLookupTcpFnSkLookupUdpFnSkReleaseFnMapPushElemFnMapPopElemFnMapPeekElemFnMsgPushDataFnMsgPopDataFnRcPointerRelFnSpinLockFnSpinUnlockFnSkFullsockFnTcpSockFnSkbEcnSetCeFnGetListenerSockFnSkcLookupTcpFnTcpCheckSyncookieFnSysctlGetNameFnSysctlGetCurrentValueFnSysctlGetNewValueFnSysctlSetNewValueFnStrtolFnStrtoulFnSkStorageGetFnSkStorageDeleteFnSendSignalFnTcpGenSyncookieFnSkbOutputFnProbeReadUserFnProbeReadKernelFnProbeReadUserStrFnProbeReadKernelStrFnTcpSendAckFnSendSignalThreadFnJiffies64FnReadBranchRecordsFnGetNsCurrentPidTgidFnXdpOutputFnGetNetnsCookieFnGetCurrentAncestorCgroupIdFnSkAssignFnKtimeGetBootNsFnSeqPrintfFnSeqWriteFnSkCgroupIdFnSkAncestorCgroupIdFnRingbufOutputFnRingbufReserveFnRingbufSubmitFnRingbufDiscardFnRingbufQueryFnCsumLevelFnSkcToTcp6SockFnSkcToTcpSockFnSkcToTcpTimewaitSockFnSkcToTcpRequestSockFnSkcToUdp6SockFnGetTaskStackFnLoadHdrOptFnStoreHdrOptFnReserveHdrOptFnInodeStorageGetFnInodeStorageDeleteFnDPathFnCopyFromUserFnSnprintfBtfFnSeqPrintfBtfFnSkbCgroupClassidFnRedirectNeighFnPerCpuPtrFnThisCpuPtrFnRedirectPeerFnTaskStorageGetFnTaskStorageDeleteFnGetCurrentTaskBtfFnBprmOptsSetFnKtimeGetCoarseNsFnImaInodeHashFnSockFromFile" +const _BuiltinFunc_name = "FnUnspecFnMapLookupElemFnMapUpdateElemFnMapDeleteElemFnProbeReadFnKtimeGetNsFnTracePrintkFnGetPrandomU32FnGetSmpProcessorIdFnSkbStoreBytesFnL3CsumReplaceFnL4CsumReplaceFnTailCallFnCloneRedirectFnGetCurrentPidTgidFnGetCurrentUidGidFnGetCurrentCommFnGetCgroupClassidFnSkbVlanPushFnSkbVlanPopFnSkbGetTunnelKeyFnSkbSetTunnelKeyFnPerfEventReadFnRedirectFnGetRouteRealmFnPerfEventOutputFnSkbLoadBytesFnGetStackidFnCsumDiffFnSkbGetTunnelOptFnSkbSetTunnelOptFnSkbChangeProtoFnSkbChangeTypeFnSkbUnderCgroupFnGetHashRecalcFnGetCurrentTaskFnProbeWriteUserFnCurrentTaskUnderCgroupFnSkbChangeTailFnSkbPullDataFnCsumUpdateFnSetHashInvalidFnGetNumaNodeIdFnSkbChangeHeadFnXdpAdjustHeadFnProbeReadStrFnGetSocketCookieFnGetSocketUidFnSetHashFnSetsockoptFnSkbAdjustRoomFnRedirectMapFnSkRedirectMapFnSockMapUpdateFnXdpAdjustMetaFnPerfEventReadValueFnPerfProgReadValueFnGetsockoptFnOverrideReturnFnSockOpsCbFlagsSetFnMsgRedirectMapFnMsgApplyBytesFnMsgCorkBytesFnMsgPullDataFnBindFnXdpAdjustTailFnSkbGetXfrmStateFnGetStackFnSkbLoadBytesRelativeFnFibLookupFnSockHashUpdateFnMsgRedirectHashFnSkRedirectHashFnLwtPushEncapFnLwtSeg6StoreBytesFnLwtSeg6AdjustSrhFnLwtSeg6ActionFnRcRepeatFnRcKeydownFnSkbCgroupIdFnGetCurrentCgroupIdFnGetLocalStorageFnSkSelectReuseportFnSkbAncestorCgroupIdFnSkLookupTcpFnSkLookupUdpFnSkReleaseFnMapPushElemFnMapPopElemFnMapPeekElemFnMsgPushDataFnMsgPopDataFnRcPointerRelFnSpinLockFnSpinUnlockFnSkFullsockFnTcpSockFnSkbEcnSetCeFnGetListenerSockFnSkcLookupTcpFnTcpCheckSyncookieFnSysctlGetNameFnSysctlGetCurrentValueFnSysctlGetNewValueFnSysctlSetNewValueFnStrtolFnStrtoulFnSkStorageGetFnSkStorageDeleteFnSendSignalFnTcpGenSyncookieFnSkbOutputFnProbeReadUserFnProbeReadKernelFnProbeReadUserStrFnProbeReadKernelStrFnTcpSendAckFnSendSignalThreadFnJiffies64FnReadBranchRecordsFnGetNsCurrentPidTgidFnXdpOutputFnGetNetnsCookieFnGetCurrentAncestorCgroupIdFnSkAssignFnKtimeGetBootNsFnSeqPrintfFnSeqWriteFnSkCgroupIdFnSkAncestorCgroupIdFnRingbufOutputFnRingbufReserveFnRingbufSubmitFnRingbufDiscardFnRingbufQueryFnCsumLevelFnSkcToTcp6SockFnSkcToTcpSockFnSkcToTcpTimewaitSockFnSkcToTcpRequestSockFnSkcToUdp6SockFnGetTaskStackFnLoadHdrOptFnStoreHdrOptFnReserveHdrOptFnInodeStorageGetFnInodeStorageDeleteFnDPathFnCopyFromUserFnSnprintfBtfFnSeqPrintfBtfFnSkbCgroupClassidFnRedirectNeighFnPerCpuPtrFnThisCpuPtrFnRedirectPeerFnTaskStorageGetFnTaskStorageDeleteFnGetCurrentTaskBtfFnBprmOptsSetFnKtimeGetCoarseNsFnImaInodeHashFnSockFromFileFnCheckMtuFnForEachMapElemFnSnprintfFnSysBpfFnBtfFindByNameKindFnSysClose" -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, 1643, 1658, 1675, 1693, 1713, 1725, 1743, 1754, 1773, 1794, 1805, 1821, 1849, 1859, 1875, 1886, 1896, 1908, 1928, 1943, 1959, 1974, 1990, 2004, 2015, 2030, 2044, 2066, 2087, 2102, 2116, 2128, 2141, 2156, 2173, 2193, 2200, 2214, 2227, 2241, 2259, 2274, 2285, 2297, 2311, 2327, 2346, 2365, 2378, 2396, 2410, 2424} +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, 1643, 1658, 1675, 1693, 1713, 1725, 1743, 1754, 1773, 1794, 1805, 1821, 1849, 1859, 1875, 1886, 1896, 1908, 1928, 1943, 1959, 1974, 1990, 2004, 2015, 2030, 2044, 2066, 2087, 2102, 2116, 2128, 2141, 2156, 2173, 2193, 2200, 2214, 2227, 2241, 2259, 2274, 2285, 2297, 2311, 2327, 2346, 2365, 2378, 2396, 2410, 2424, 2434, 2450, 2460, 2468, 2487, 2497} func (i BuiltinFunc) String() string { if i < 0 || i >= BuiltinFunc(len(_BuiltinFunc_index)-1) { diff --git a/vendor/github.com/cilium/ebpf/asm/instruction.go b/vendor/github.com/cilium/ebpf/asm/instruction.go index e7ac0109e2dcc..64d717d156d5a 100644 --- a/vendor/github.com/cilium/ebpf/asm/instruction.go +++ b/vendor/github.com/cilium/ebpf/asm/instruction.go @@ -181,6 +181,11 @@ func (ins *Instruction) IsFunctionCall() bool { return ins.OpCode.JumpOp() == Call && ins.Src == PseudoCall } +// IsBuiltinCall returns true if the instruction is a built-in call, i.e. BPF helper call. +func (ins *Instruction) IsBuiltinCall() bool { + return ins.OpCode.JumpOp() == Call && ins.Src == R0 && ins.Dst == R0 +} + // IsConstantLoad returns true if the instruction loads a constant of the // given size. func (ins *Instruction) IsConstantLoad(size Size) bool { diff --git a/vendor/github.com/cilium/ebpf/attachtype_string.go b/vendor/github.com/cilium/ebpf/attachtype_string.go new file mode 100644 index 0000000000000..de355ed909227 --- /dev/null +++ b/vendor/github.com/cilium/ebpf/attachtype_string.go @@ -0,0 +1,65 @@ +// Code generated by "stringer -type AttachType -trimprefix Attach"; 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[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] + _ = x[AttachCgroupInet4GetPeername-29] + _ = x[AttachCgroupInet6GetPeername-30] + _ = x[AttachCgroupInet4GetSockname-31] + _ = x[AttachCgroupInet6GetSockname-32] + _ = x[AttachXDPDevMap-33] + _ = x[AttachCgroupInetSockRelease-34] + _ = x[AttachXDPCPUMap-35] + _ = x[AttachSkLookup-36] + _ = x[AttachXDP-37] + _ = x[AttachSkSKBVerdict-38] + _ = x[AttachSkReuseportSelect-39] + _ = x[AttachSkReuseportSelectOrMigrate-40] + _ = x[AttachPerfEvent-41] +} + +const _AttachType_name = "NoneCGroupInetEgressCGroupInetSockCreateCGroupSockOpsSkSKBStreamParserSkSKBStreamVerdictCGroupDeviceSkMsgVerdictCGroupInet4BindCGroupInet6BindCGroupInet4ConnectCGroupInet6ConnectCGroupInet4PostBindCGroupInet6PostBindCGroupUDP4SendmsgCGroupUDP6SendmsgLircMode2FlowDissectorCGroupSysctlCGroupUDP4RecvmsgCGroupUDP6RecvmsgCGroupGetsockoptCGroupSetsockoptTraceRawTpTraceFEntryTraceFExitModifyReturnLSMMacTraceIterCgroupInet4GetPeernameCgroupInet6GetPeernameCgroupInet4GetSocknameCgroupInet6GetSocknameXDPDevMapCgroupInetSockReleaseXDPCPUMapSkLookupXDPSkSKBVerdictSkReuseportSelectSkReuseportSelectOrMigratePerfEvent" + +var _AttachType_index = [...]uint16{0, 4, 20, 40, 53, 70, 88, 100, 112, 127, 142, 160, 178, 197, 216, 233, 250, 259, 272, 284, 301, 318, 334, 350, 360, 371, 381, 393, 399, 408, 430, 452, 474, 496, 505, 526, 535, 543, 546, 558, 575, 601, 610} + +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/cilium/ebpf/collection.go b/vendor/github.com/cilium/ebpf/collection.go index 17cc69492ea95..2ededc87a05c2 100644 --- a/vendor/github.com/cilium/ebpf/collection.go +++ b/vendor/github.com/cilium/ebpf/collection.go @@ -1,6 +1,7 @@ package ebpf import ( + "encoding/binary" "errors" "fmt" "io" @@ -25,6 +26,10 @@ type CollectionOptions struct { type CollectionSpec struct { Maps map[string]*MapSpec Programs map[string]*ProgramSpec + + // ByteOrder specifies whether the ELF was compiled for + // big-endian or little-endian architectures. + ByteOrder binary.ByteOrder } // Copy returns a recursive copy of the spec. @@ -34,8 +39,9 @@ func (cs *CollectionSpec) Copy() *CollectionSpec { } cpy := CollectionSpec{ - Maps: make(map[string]*MapSpec, len(cs.Maps)), - Programs: make(map[string]*ProgramSpec, len(cs.Programs)), + Maps: make(map[string]*MapSpec, len(cs.Maps)), + Programs: make(map[string]*ProgramSpec, len(cs.Programs)), + ByteOrder: cs.ByteOrder, } for name, spec := range cs.Maps { @@ -123,7 +129,7 @@ func (cs *CollectionSpec) RewriteConstants(consts map[string]interface{}) error buf := make([]byte, len(value)) copy(buf, value) - err := patchValue(buf, btf.MapValue(rodata.BTF), consts) + err := patchValue(buf, rodata.BTF.Value, consts) if err != nil { return err } @@ -134,15 +140,15 @@ func (cs *CollectionSpec) RewriteConstants(consts map[string]interface{}) error // Assign the contents of a CollectionSpec to a struct. // -// This function is a short-cut to manually checking the presence -// of maps and programs in a collection spec. Consider using bpf2go if this -// sounds useful. +// This function is a shortcut to manually checking the presence +// of maps and programs in a CollectionSpec. Consider using bpf2go +// if this sounds useful. // -// The argument to must be a pointer to a struct. A field of the +// 'to' must be a pointer to a struct. A field of the // struct is updated with values from Programs or Maps if it // has an `ebpf` tag and its type is *ProgramSpec or *MapSpec. -// The tag gives the name of the program or map as found in -// the CollectionSpec. +// The tag's value specifies the name of the program or map as +// found in the CollectionSpec. // // struct { // Foo *ebpf.ProgramSpec `ebpf:"xdp_foo"` @@ -150,42 +156,47 @@ func (cs *CollectionSpec) RewriteConstants(consts map[string]interface{}) error // Ignored int // } // -// Returns an error if any of the fields can't be found, or -// if the same map or program is assigned multiple times. +// Returns an error if any of the eBPF objects can't be found, or +// if the same MapSpec or ProgramSpec is assigned multiple times. func (cs *CollectionSpec) Assign(to interface{}) error { - valueOf := func(typ reflect.Type, name string) (reflect.Value, error) { + // Assign() only supports assigning ProgramSpecs and MapSpecs, + // so doesn't load any resources into the kernel. + getValue := func(typ reflect.Type, name string) (interface{}, error) { switch typ { + case reflect.TypeOf((*ProgramSpec)(nil)): - p := cs.Programs[name] - if p == nil { - return reflect.Value{}, fmt.Errorf("missing program %q", name) + if p := cs.Programs[name]; p != nil { + return p, nil } - return reflect.ValueOf(p), nil + return nil, fmt.Errorf("missing program %q", name) + case reflect.TypeOf((*MapSpec)(nil)): - m := cs.Maps[name] - if m == nil { - return reflect.Value{}, fmt.Errorf("missing map %q", name) + if m := cs.Maps[name]; m != nil { + return m, nil } - return reflect.ValueOf(m), nil + return nil, fmt.Errorf("missing map %q", name) + default: - return reflect.Value{}, fmt.Errorf("unsupported type %s", typ) + return nil, fmt.Errorf("unsupported type %s", typ) } } - return assignValues(to, valueOf) + return assignValues(to, getValue) } -// LoadAndAssign maps and programs into the kernel and assign them to a struct. +// LoadAndAssign loads Maps and Programs into the kernel and assigns them +// to a struct. // -// This function is a short-cut to manually checking the presence -// of maps and programs in a collection spec. Consider using bpf2go if this -// sounds useful. +// This function is a shortcut to manually checking the presence +// of maps and programs in a CollectionSpec. Consider using bpf2go +// if this sounds useful. // -// The argument to must be a pointer to a struct. A field of the -// struct is updated with values from Programs or Maps if it -// has an `ebpf` tag and its type is *Program or *Map. -// The tag gives the name of the program or map as found in -// the CollectionSpec. +// 'to' must be a pointer to a struct. A field of the struct is updated with +// a Program or Map if it has an `ebpf` tag and its type is *Program or *Map. +// The tag's value specifies the name of the program or map as found in the +// CollectionSpec. Before updating the struct, the requested objects and their +// dependent resources are loaded into the kernel and populated with values if +// specified. // // struct { // Foo *ebpf.Program `ebpf:"xdp_foo"` @@ -196,39 +207,53 @@ func (cs *CollectionSpec) Assign(to interface{}) error { // opts may be nil. // // Returns an error if any of the fields can't be found, or -// if the same map or program is assigned multiple times. +// if the same Map or Program is assigned multiple times. func (cs *CollectionSpec) LoadAndAssign(to interface{}, opts *CollectionOptions) error { - if opts == nil { - opts = &CollectionOptions{} - } - - loadMap, loadProgram, done, cleanup := lazyLoadCollection(cs, opts) - defer cleanup() + loader := newCollectionLoader(cs, opts) + defer loader.cleanup() - valueOf := func(typ reflect.Type, name string) (reflect.Value, error) { + // Support assigning Programs and Maps, lazy-loading the required objects. + assignedMaps := make(map[string]bool) + getValue := func(typ reflect.Type, name string) (interface{}, error) { switch typ { + case reflect.TypeOf((*Program)(nil)): - p, err := loadProgram(name) - if err != nil { - return reflect.Value{}, err - } - return reflect.ValueOf(p), nil + return loader.loadProgram(name) + case reflect.TypeOf((*Map)(nil)): - m, err := loadMap(name) - if err != nil { - return reflect.Value{}, err - } - return reflect.ValueOf(m), nil + assignedMaps[name] = true + return loader.loadMap(name) + default: - return reflect.Value{}, fmt.Errorf("unsupported type %s", typ) + return nil, fmt.Errorf("unsupported type %s", typ) } } - if err := assignValues(to, valueOf); err != nil { + // Load the Maps and Programs requested by the annotated struct. + if err := assignValues(to, getValue); err != nil { return err } - done() + // Populate the requested maps. Has a chance of lazy-loading other dependent maps. + if err := loader.populateMaps(); err != nil { + return err + } + + // Evaluate the loader's objects after all (lazy)loading has taken place. + for n, m := range loader.maps { + switch m.typ { + case ProgramArray: + // Require all lazy-loaded ProgramArrays to be assigned to the given object. + // Without any references, they will be closed on the first GC and all tail + // calls into them will miss. + if !assignedMaps[n] { + return fmt.Errorf("ProgramArray %s must be assigned to prevent missed tail calls", n) + } + } + } + + loader.finalize() + return nil } @@ -246,24 +271,32 @@ func NewCollection(spec *CollectionSpec) (*Collection, error) { // NewCollectionWithOptions creates a Collection from a specification. func NewCollectionWithOptions(spec *CollectionSpec, opts CollectionOptions) (*Collection, error) { - loadMap, loadProgram, done, cleanup := lazyLoadCollection(spec, &opts) - defer cleanup() + loader := newCollectionLoader(spec, &opts) + defer loader.cleanup() + // Create maps first, as their fds need to be linked into programs. for mapName := range spec.Maps { - _, err := loadMap(mapName) - if err != nil { + if _, err := loader.loadMap(mapName); err != nil { return nil, err } } for progName := range spec.Programs { - _, err := loadProgram(progName) - if err != nil { + if _, err := loader.loadProgram(progName); err != nil { return nil, err } } - maps, progs := done() + // Maps can contain Program and Map stubs, so populate them after + // all Maps and Programs have been successfully loaded. + if err := loader.populateMaps(); err != nil { + return nil, err + } + + maps, progs := loader.maps, loader.programs + + loader.finalize() + return &Collection{ progs, maps, @@ -314,113 +347,154 @@ func (hc handleCache) close() { for _, handle := range hc.btfHandles { handle.Close() } - hc.btfHandles = nil - hc.btfSpecs = nil } -func lazyLoadCollection(coll *CollectionSpec, opts *CollectionOptions) ( - loadMap func(string) (*Map, error), - loadProgram func(string) (*Program, error), - done func() (map[string]*Map, map[string]*Program), - cleanup func(), -) { - var ( - maps = make(map[string]*Map) - progs = make(map[string]*Program) - handles = newHandleCache() - skipMapsAndProgs = false - ) - - cleanup = func() { - handles.close() - - if skipMapsAndProgs { - return - } +type collectionLoader struct { + coll *CollectionSpec + opts *CollectionOptions + maps map[string]*Map + programs map[string]*Program + handles *handleCache +} - for _, m := range maps { - m.Close() - } +func newCollectionLoader(coll *CollectionSpec, opts *CollectionOptions) *collectionLoader { + if opts == nil { + opts = &CollectionOptions{} + } - for _, p := range progs { - p.Close() - } + return &collectionLoader{ + coll, + opts, + make(map[string]*Map), + make(map[string]*Program), + newHandleCache(), + } +} + +// finalize should be called when all the collectionLoader's resources +// have been successfully loaded into the kernel and populated with values. +func (cl *collectionLoader) finalize() { + cl.maps, cl.programs = nil, nil +} + +// cleanup cleans up all resources left over in the collectionLoader. +// Call finalize() when Map and Program creation/population is successful +// to prevent them from getting closed. +func (cl *collectionLoader) cleanup() { + cl.handles.close() + for _, m := range cl.maps { + m.Close() + } + for _, p := range cl.programs { + p.Close() + } +} + +func (cl *collectionLoader) loadMap(mapName string) (*Map, error) { + if m := cl.maps[mapName]; m != nil { + return m, nil + } + + mapSpec := cl.coll.Maps[mapName] + if mapSpec == nil { + return nil, fmt.Errorf("missing map %s", mapName) } - done = func() (map[string]*Map, map[string]*Program) { - skipMapsAndProgs = true - return maps, progs + m, err := newMapWithOptions(mapSpec, cl.opts.Maps, cl.handles) + if err != nil { + return nil, fmt.Errorf("map %s: %w", mapName, err) } - loadMap = func(mapName string) (*Map, error) { - if m := maps[mapName]; m != nil { - return m, nil + cl.maps[mapName] = m + return m, nil +} + +func (cl *collectionLoader) loadProgram(progName string) (*Program, error) { + if prog := cl.programs[progName]; prog != nil { + return prog, nil + } + + progSpec := cl.coll.Programs[progName] + if progSpec == nil { + return nil, fmt.Errorf("unknown program %s", progName) + } + + progSpec = progSpec.Copy() + + // Rewrite any reference to a valid map. + for i := range progSpec.Instructions { + ins := &progSpec.Instructions[i] + + if !ins.IsLoadFromMap() || ins.Reference == "" { + continue } - mapSpec := coll.Maps[mapName] - if mapSpec == nil { - return nil, fmt.Errorf("missing map %s", mapName) + if uint32(ins.Constant) != math.MaxUint32 { + // Don't overwrite maps already rewritten, users can + // rewrite programs in the spec themselves + continue } - m, err := newMapWithOptions(mapSpec, opts.Maps, handles) + m, err := cl.loadMap(ins.Reference) if err != nil { - return nil, fmt.Errorf("map %s: %w", mapName, err) + return nil, fmt.Errorf("program %s: %w", progName, err) } - maps[mapName] = m - return m, nil - } - - loadProgram = func(progName string) (*Program, error) { - if prog := progs[progName]; prog != nil { - return prog, nil + fd := m.FD() + if fd < 0 { + return nil, fmt.Errorf("map %s: %w", ins.Reference, internal.ErrClosedFd) } - - progSpec := coll.Programs[progName] - if progSpec == nil { - return nil, fmt.Errorf("unknown program %s", progName) + if err := ins.RewriteMapPtr(m.FD()); err != nil { + return nil, fmt.Errorf("program %s: map %s: %w", progName, ins.Reference, err) } + } - progSpec = progSpec.Copy() + prog, err := newProgramWithOptions(progSpec, cl.opts.Programs, cl.handles) + if err != nil { + return nil, fmt.Errorf("program %s: %w", progName, err) + } - // Rewrite any reference to a valid map. - for i := range progSpec.Instructions { - ins := &progSpec.Instructions[i] + cl.programs[progName] = prog + return prog, nil +} - if !ins.IsLoadFromMap() || ins.Reference == "" { - continue - } +func (cl *collectionLoader) populateMaps() error { + for mapName, m := range cl.maps { + mapSpec, ok := cl.coll.Maps[mapName] + if !ok { + return fmt.Errorf("missing map spec %s", mapName) + } - if uint32(ins.Constant) != math.MaxUint32 { - // Don't overwrite maps already rewritten, users can - // rewrite programs in the spec themselves - continue - } + mapSpec = mapSpec.Copy() - m, err := loadMap(ins.Reference) - if err != nil { - return nil, fmt.Errorf("program %s: %w", progName, err) - } + // Replace any object stubs with loaded objects. + for i, kv := range mapSpec.Contents { + switch v := kv.Value.(type) { + case programStub: + // loadProgram is idempotent and could return an existing Program. + prog, err := cl.loadProgram(string(v)) + if err != nil { + return fmt.Errorf("loading program %s, for map %s: %w", v, mapName, err) + } + mapSpec.Contents[i] = MapKV{kv.Key, prog} - 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) + case mapStub: + // loadMap is idempotent and could return an existing Map. + innerMap, err := cl.loadMap(string(v)) + if err != nil { + return fmt.Errorf("loading inner map %s, for map %s: %w", v, mapName, err) + } + mapSpec.Contents[i] = MapKV{kv.Key, innerMap} } } - prog, err := newProgramWithOptions(progSpec, opts.Programs, handles) - if err != nil { - return nil, fmt.Errorf("program %s: %w", progName, err) + // Populate and freeze the map if specified. + if err := m.finalize(mapSpec); err != nil { + return fmt.Errorf("populating map %s: %w", mapName, err) } - - progs[progName] = prog - return prog, nil } - return + return nil } // LoadCollection parses an object file and converts it to a collection. @@ -466,108 +540,81 @@ func (coll *Collection) DetachProgram(name string) *Program { return p } -// Assign the contents of a collection to a struct. -// -// Deprecated: use CollectionSpec.Assign instead. It provides the same -// functionality but creates only the maps and programs requested. -func (coll *Collection) Assign(to interface{}) error { - assignedMaps := make(map[string]struct{}) - assignedPrograms := make(map[string]struct{}) - valueOf := func(typ reflect.Type, name string) (reflect.Value, error) { - switch typ { - case reflect.TypeOf((*Program)(nil)): - p := coll.Programs[name] - if p == nil { - return reflect.Value{}, fmt.Errorf("missing program %q", name) - } - assignedPrograms[name] = struct{}{} - return reflect.ValueOf(p), nil - case reflect.TypeOf((*Map)(nil)): - m := coll.Maps[name] - if m == nil { - return reflect.Value{}, fmt.Errorf("missing map %q", name) - } - assignedMaps[name] = struct{}{} - return reflect.ValueOf(m), nil - default: - return reflect.Value{}, fmt.Errorf("unsupported type %s", typ) - } - } - - if err := assignValues(to, valueOf); err != nil { - return err - } +// structField represents a struct field containing the ebpf struct tag. +type structField struct { + reflect.StructField + value reflect.Value +} - for name := range assignedPrograms { - coll.DetachProgram(name) +// ebpfFields extracts field names tagged with 'ebpf' from a struct type. +// Keep track of visited types to avoid infinite recursion. +func ebpfFields(structVal reflect.Value, visited map[reflect.Type]bool) ([]structField, error) { + if visited == nil { + visited = make(map[reflect.Type]bool) } - for name := range assignedMaps { - coll.DetachMap(name) + structType := structVal.Type() + if structType.Kind() != reflect.Struct { + return nil, fmt.Errorf("%s is not a struct", structType) } - return nil -} - -func assignValues(to interface{}, valueOf func(reflect.Type, string) (reflect.Value, error)) error { - type structField struct { - reflect.StructField - value reflect.Value + if visited[structType] { + return nil, fmt.Errorf("recursion on type %s", structType) } - var ( - fields []structField - visitedTypes = make(map[reflect.Type]bool) - flattenStruct func(reflect.Value) error - ) + fields := make([]structField, 0, structType.NumField()) + for i := 0; i < structType.NumField(); i++ { + field := structField{structType.Field(i), structVal.Field(i)} - flattenStruct = func(structVal reflect.Value) error { - structType := structVal.Type() - if structType.Kind() != reflect.Struct { - return fmt.Errorf("%s is not a struct", structType) - } - - if visitedTypes[structType] { - return fmt.Errorf("recursion on type %s", structType) + // If the field is tagged, gather it and move on. + name := field.Tag.Get("ebpf") + if name != "" { + fields = append(fields, field) + continue } - for i := 0; i < structType.NumField(); i++ { - field := structField{structType.Field(i), structVal.Field(i)} - - name := field.Tag.Get("ebpf") - if name != "" { - fields = append(fields, field) + // If the field does not have an ebpf tag, but is a struct or a pointer + // to a struct, attempt to gather its fields as well. + var v reflect.Value + switch field.Type.Kind() { + case reflect.Ptr: + if field.Type.Elem().Kind() != reflect.Struct { continue } - var err error - switch field.Type.Kind() { - case reflect.Ptr: - if field.Type.Elem().Kind() != reflect.Struct { - continue - } - - if field.value.IsNil() { - return fmt.Errorf("nil pointer to %s", structType) - } + if field.value.IsNil() { + return nil, fmt.Errorf("nil pointer to %s", structType) + } - err = flattenStruct(field.value.Elem()) + // Obtain the destination type of the pointer. + v = field.value.Elem() - case reflect.Struct: - err = flattenStruct(field.value) + case reflect.Struct: + // Reference the value's type directly. + v = field.value - default: - continue - } + default: + continue + } - if err != nil { - return fmt.Errorf("field %s: %w", field.Name, err) - } + inner, err := ebpfFields(v, visited) + if err != nil { + return nil, fmt.Errorf("field %s: %w", field.Name, err) } - return nil + fields = append(fields, inner...) } + return fields, nil +} + +// assignValues attempts to populate all fields of 'to' tagged with 'ebpf'. +// +// getValue is called for every tagged field of 'to' and must return the value +// to be assigned to the field with the given typ and name. +func assignValues(to interface{}, + getValue func(typ reflect.Type, name string) (interface{}, error)) error { + toValue := reflect.ValueOf(to) if toValue.Type().Kind() != reflect.Ptr { return fmt.Errorf("%T is not a pointer to struct", to) @@ -577,7 +624,8 @@ func assignValues(to interface{}, valueOf func(reflect.Type, string) (reflect.Va return fmt.Errorf("nil pointer to %T", to) } - if err := flattenStruct(toValue.Elem()); err != nil { + fields, err := ebpfFields(toValue.Elem(), nil) + if err != nil { return err } @@ -587,19 +635,23 @@ func assignValues(to interface{}, valueOf func(reflect.Type, string) (reflect.Va name string } - assignedTo := make(map[elem]string) + assigned := make(map[elem]string) for _, field := range fields { - name := field.Tag.Get("ebpf") - if strings.Contains(name, ",") { + // Get string value the field is tagged with. + tag := field.Tag.Get("ebpf") + if strings.Contains(tag, ",") { return fmt.Errorf("field %s: ebpf tag contains a comma", field.Name) } - e := elem{field.Type, name} - if assignedField := assignedTo[e]; assignedField != "" { - return fmt.Errorf("field %s: %q was already assigned to %s", field.Name, name, assignedField) + // Check if the eBPF object with the requested + // type and tag was already assigned elsewhere. + e := elem{field.Type, tag} + if af := assigned[e]; af != "" { + return fmt.Errorf("field %s: object %q was already assigned to %s", field.Name, tag, af) } - value, err := valueOf(field.Type, name) + // Get the eBPF object referred to by the tag. + value, err := getValue(field.Type, tag) if err != nil { return fmt.Errorf("field %s: %w", field.Name, err) } @@ -607,9 +659,9 @@ func assignValues(to interface{}, valueOf func(reflect.Type, string) (reflect.Va if !field.value.CanSet() { return fmt.Errorf("field %s: can't set value", field.Name) } + field.value.Set(reflect.ValueOf(value)) - field.value.Set(value) - assignedTo[e] = field.Name + assigned[e] = field.Name } return nil diff --git a/vendor/github.com/cilium/ebpf/elf_reader.go b/vendor/github.com/cilium/ebpf/elf_reader.go index c2afbc36a5a9e..42010f43e5832 100644 --- a/vendor/github.com/cilium/ebpf/elf_reader.go +++ b/vendor/github.com/cilium/ebpf/elf_reader.go @@ -19,7 +19,7 @@ import ( ) // elfCode is a convenience to reduce the amount of arguments that have to -// be passed around explicitly. You should treat it's contents as immutable. +// be passed around explicitly. You should treat its contents as immutable. type elfCode struct { *internal.SafeELFFile sections map[elf.SectionIndex]*elfSection @@ -188,7 +188,7 @@ func LoadCollectionSpecFromReader(rd io.ReaderAt) (*CollectionSpec, error) { return nil, fmt.Errorf("load programs: %w", err) } - return &CollectionSpec{maps, progs}, nil + return &CollectionSpec{maps, progs, ec.ByteOrder}, nil } func loadLicense(sec *elf.Section) (string, error) { @@ -520,8 +520,12 @@ func (ec *elfCode) loadMaps(maps map[string]*MapSpec) error { return fmt.Errorf("map %s: missing flags", mapName) } - if _, err := io.Copy(internal.DiscardZeroes{}, lr); err != nil { - return fmt.Errorf("map %s: unknown and non-zero fields in definition", mapName) + extra, err := io.ReadAll(lr) + if err != nil { + return fmt.Errorf("map %s: reading map tail: %w", mapName, err) + } + if len(extra) > 0 { + spec.Extra = *bytes.NewReader(extra) } if err := spec.clampPerfEventArraySize(); err != nil { @@ -535,6 +539,9 @@ func (ec *elfCode) loadMaps(maps map[string]*MapSpec) error { return nil } +// loadBTFMaps iterates over all ELF sections marked as BTF map sections +// (like .maps) and parses them into MapSpecs. Dump the .maps section and +// any relocations with `readelf -x .maps -r `. func (ec *elfCode) loadBTFMaps(maps map[string]*MapSpec) error { for _, sec := range ec.sections { if sec.kind != btfMapSection { @@ -545,33 +552,46 @@ func (ec *elfCode) loadBTFMaps(maps map[string]*MapSpec) error { return fmt.Errorf("missing BTF") } - _, err := io.Copy(internal.DiscardZeroes{}, bufio.NewReader(sec.Open())) - if err != nil { - return fmt.Errorf("section %v: initializing BTF map definitions: %w", sec.Name, internal.ErrNotSupported) - } - - var ds btf.Datasec + // Each section must appear as a DataSec in the ELF's BTF blob. + var ds *btf.Datasec if err := ec.btf.FindType(sec.Name, &ds); err != nil { return fmt.Errorf("cannot find section '%s' in BTF: %w", sec.Name, err) } + // Open a Reader to the ELF's raw section bytes so we can assert that all + // of them are zero on a per-map (per-Var) basis. For now, the section's + // sole purpose is to receive relocations, so all must be zero. + rs := sec.Open() + for _, vs := range ds.Vars { + // BPF maps are declared as and assigned to global variables, + // so iterate over each Var in the DataSec and validate their types. v, ok := vs.Type.(*btf.Var) if !ok { return fmt.Errorf("section %v: unexpected type %s", sec.Name, vs.Type) } name := string(v.Name) + // The BTF metadata for each Var contains the full length of the map + // declaration, so read the corresponding amount of bytes from the ELF. + // This way, we can pinpoint which map declaration contains unexpected + // (and therefore unsupported) data. + _, err := io.Copy(internal.DiscardZeroes{}, io.LimitReader(rs, int64(vs.Size))) + if err != nil { + return fmt.Errorf("section %v: map %s: initializing BTF map definitions: %w", sec.Name, name, internal.ErrNotSupported) + } + if maps[name] != nil { return fmt.Errorf("section %v: map %s already exists", sec.Name, name) } + // Each Var representing a BTF map definition contains a Struct. mapStruct, ok := v.Type.(*btf.Struct) if !ok { return fmt.Errorf("expected struct, got %s", v.Type) } - mapSpec, err := mapSpecFromBTF(name, mapStruct, false, ec.btf) + mapSpec, err := mapSpecFromBTF(sec, &vs, mapStruct, ec.btf, name, false) if err != nil { return fmt.Errorf("map %v: %w", name, err) } @@ -582,32 +602,52 @@ func (ec *elfCode) loadBTFMaps(maps map[string]*MapSpec) error { maps[name] = mapSpec } + + // Drain the ELF section reader to make sure all bytes are accounted for + // with BTF metadata. + i, err := io.Copy(io.Discard, rs) + if err != nil { + return fmt.Errorf("section %v: unexpected error reading remainder of ELF section: %w", sec.Name, err) + } + if i > 0 { + return fmt.Errorf("section %v: %d unexpected remaining bytes in ELF section, invalid BTF?", sec.Name, i) + } } return nil } +// A programStub is a placeholder for a Program to be inserted at a certain map key. +// It needs to be resolved into a Program later on in the loader process. +type programStub string + +// A mapStub is a placeholder for a Map to be inserted at a certain map key. +// It needs to be resolved into a Map later on in the loader process. +type mapStub string + // mapSpecFromBTF produces a MapSpec based on a btf.Struct def representing // a BTF map definition. The name and spec arguments will be copied to the // resulting MapSpec, and inner must be true on any resursive invocations. -func mapSpecFromBTF(name string, def *btf.Struct, inner bool, spec *btf.Spec) (*MapSpec, error) { - +func mapSpecFromBTF(es *elfSection, vs *btf.VarSecinfo, def *btf.Struct, spec *btf.Spec, name string, inner bool) (*MapSpec, error) { var ( - key, value btf.Type - keySize, valueSize uint32 - mapType, flags, maxEntries uint32 - pinType PinType - innerMapSpec *MapSpec - err error + key, value btf.Type + keySize, valueSize uint32 + mapType MapType + flags, maxEntries uint32 + pinType PinType + innerMapSpec *MapSpec + contents []MapKV + err error ) for i, member := range def.Members { switch member.Name { case "type": - mapType, err = uintFromBTF(member.Type) + mt, err := uintFromBTF(member.Type) if err != nil { return nil, fmt.Errorf("can't get type: %w", err) } + mapType = MapType(mt) case "map_flags": flags, err = uintFromBTF(member.Type) @@ -717,7 +757,7 @@ func mapSpecFromBTF(name string, def *btf.Struct, inner bool, spec *btf.Spec) (* case *btf.Struct: // The values member pointing to an array of structs means we're expecting // a map-in-map declaration. - if MapType(mapType) != ArrayOfMaps && MapType(mapType) != HashOfMaps { + if mapType != ArrayOfMaps && mapType != HashOfMaps { return nil, errors.New("outer map needs to be an array or a hash of maps") } if inner { @@ -731,21 +771,38 @@ func mapSpecFromBTF(name string, def *btf.Struct, inner bool, spec *btf.Spec) (* // on kernels 5.2 and up) // Pass the BTF spec from the parent object, since both parent and // child must be created from the same BTF blob (on kernels that support BTF). - innerMapSpec, err = mapSpecFromBTF(name+"_inner", t, true, spec) + innerMapSpec, err = mapSpecFromBTF(es, vs, t, spec, name+"_inner", true) if err != nil { return nil, fmt.Errorf("can't parse BTF map definition of inner map: %w", err) } + case *btf.FuncProto: + // The values member contains an array of function pointers, meaning an + // autopopulated PROG_ARRAY. + if mapType != ProgramArray { + return nil, errors.New("map needs to be a program array") + } + default: return nil, fmt.Errorf("unsupported value type %q in 'values' field", t) } + contents, err = resolveBTFValuesContents(es, vs, member) + if err != nil { + return nil, fmt.Errorf("resolving values contents: %w", err) + } + default: return nil, fmt.Errorf("unrecognized field %s in BTF map definition", member.Name) } } - bm := btf.NewMap(spec, key, value) + if key == nil { + key = &btf.Void{} + } + if value == nil { + value = &btf.Void{} + } return &MapSpec{ Name: SanitizeName(name, -1), @@ -754,9 +811,10 @@ func mapSpecFromBTF(name string, def *btf.Struct, inner bool, spec *btf.Spec) (* ValueSize: valueSize, MaxEntries: maxEntries, Flags: flags, - BTF: &bm, + BTF: &btf.Map{Spec: spec, Key: key, Value: value}, Pinning: pinType, InnerMap: innerMapSpec, + Contents: contents, }, nil } @@ -793,6 +851,64 @@ func resolveBTFArrayMacro(typ btf.Type) (btf.Type, error) { return ptr.Target, nil } +// resolveBTFValuesContents resolves relocations into ELF sections belonging +// to btf.VarSecinfo's. This can be used on the 'values' member in BTF map +// definitions to extract static declarations of map contents. +func resolveBTFValuesContents(es *elfSection, vs *btf.VarSecinfo, member btf.Member) ([]MapKV, error) { + // The elements of a .values pointer array are not encoded in BTF. + // Instead, relocations are generated into each array index. + // However, it's possible to leave certain array indices empty, so all + // indices' offsets need to be checked for emitted relocations. + + // The offset of the 'values' member within the _struct_ (in bits) + // is the starting point of the array. Convert to bytes. Add VarSecinfo + // offset to get the absolute position in the ELF blob. + start := (member.OffsetBits / 8) + vs.Offset + // 'values' is encoded in BTF as a zero (variable) length struct + // member, and its contents run until the end of the VarSecinfo. + // Add VarSecinfo offset to get the absolute position in the ELF blob. + end := vs.Size + vs.Offset + // The size of an address in this section. This determines the width of + // an index in the array. + align := uint32(es.SectionHeader.Addralign) + + // Check if variable-length section is aligned. + if (end-start)%align != 0 { + return nil, errors.New("unaligned static values section") + } + elems := (end - start) / align + + if elems == 0 { + return nil, nil + } + + contents := make([]MapKV, 0, elems) + + // k is the array index, off is its corresponding ELF section offset. + for k, off := uint32(0), start; k < elems; k, off = k+1, off+align { + r, ok := es.relocations[uint64(off)] + if !ok { + continue + } + + // Relocation exists for the current offset in the ELF section. + // Emit a value stub based on the type of relocation to be replaced by + // a real fd later in the pipeline before populating the map. + // Map keys are encoded in MapKV entries, so empty array indices are + // skipped here. + switch t := elf.ST_TYPE(r.Info); t { + case elf.STT_FUNC: + contents = append(contents, MapKV{uint32(k), programStub(r.Name)}) + case elf.STT_OBJECT: + contents = append(contents, MapKV{uint32(k), mapStub(r.Name)}) + default: + return nil, fmt.Errorf("unknown relocation type %v", t) + } + } + + return contents, nil +} + func (ec *elfCode) loadDataSections(maps map[string]*MapSpec) error { for _, sec := range ec.sections { if sec.kind != dataSection { @@ -809,9 +925,9 @@ func (ec *elfCode) loadDataSections(maps map[string]*MapSpec) error { return errors.New("data sections require BTF, make sure all consts are marked as static") } - btfMap, err := ec.btf.Datasec(sec.Name) - if err != nil { - return err + var datasec *btf.Datasec + if err := ec.btf.FindType(sec.Name, &datasec); err != nil { + return fmt.Errorf("data section %s: can't get BTF: %w", sec.Name, err) } data, err := sec.Data() @@ -830,7 +946,7 @@ func (ec *elfCode) loadDataSections(maps map[string]*MapSpec) error { ValueSize: uint32(len(data)), MaxEntries: 1, Contents: []MapKV{{uint32(0), data}}, - BTF: btfMap, + BTF: &btf.Map{Spec: ec.btf, Key: &btf.Void{}, Value: datasec}, } switch sec.Name { @@ -855,6 +971,8 @@ func getProgType(sectionName string) (ProgramType, AttachType, uint32, string) { }{ // From https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/lib/bpf/libbpf.c "socket": {SocketFilter, AttachNone, 0}, + "sk_reuseport/migrate": {SkReuseport, AttachSkReuseportSelectOrMigrate, 0}, + "sk_reuseport": {SkReuseport, AttachSkReuseportSelect, 0}, "seccomp": {SocketFilter, AttachNone, 0}, "kprobe/": {Kprobe, AttachNone, 0}, "uprobe/": {Kprobe, AttachNone, 0}, @@ -884,6 +1002,7 @@ func getProgType(sectionName string) (ProgramType, AttachType, uint32, string) { "fmod_ret.s/": {Tracing, AttachModifyReturn, unix.BPF_F_SLEEPABLE}, "fexit.s/": {Tracing, AttachTraceFExit, unix.BPF_F_SLEEPABLE}, "sk_lookup/": {SkLookup, AttachSkLookup, 0}, + "freplace/": {Extension, AttachNone, 0}, "lsm/": {LSM, AttachLSMMac, 0}, "lsm.s/": {LSM, AttachLSMMac, unix.BPF_F_SLEEPABLE}, @@ -907,6 +1026,11 @@ func getProgType(sectionName string) (ProgramType, AttachType, uint32, string) { "cgroup/setsockopt": {CGroupSockopt, AttachCGroupSetsockopt, 0}, "classifier": {SchedCLS, AttachNone, 0}, "action": {SchedACT, AttachNone, 0}, + + "cgroup/getsockname4": {CGroupSockAddr, AttachCgroupInet4GetSockname, 0}, + "cgroup/getsockname6": {CGroupSockAddr, AttachCgroupInet6GetSockname, 0}, + "cgroup/getpeername4": {CGroupSockAddr, AttachCgroupInet4GetPeername, 0}, + "cgroup/getpeername6": {CGroupSockAddr, AttachCgroupInet6GetPeername, 0}, } for prefix, t := range types { diff --git a/vendor/github.com/cilium/ebpf/elf_reader_fuzz.go b/vendor/github.com/cilium/ebpf/elf_reader_fuzz.go index d46d135f2fcd1..5f4e0a0ad023c 100644 --- a/vendor/github.com/cilium/ebpf/elf_reader_fuzz.go +++ b/vendor/github.com/cilium/ebpf/elf_reader_fuzz.go @@ -1,3 +1,4 @@ +//go:build gofuzz // +build gofuzz // Use with https://github.com/dvyukov/go-fuzz diff --git a/vendor/github.com/cilium/ebpf/go.mod b/vendor/github.com/cilium/ebpf/go.mod index df8139621c3e5..f5edf690ab064 100644 --- a/vendor/github.com/cilium/ebpf/go.mod +++ b/vendor/github.com/cilium/ebpf/go.mod @@ -1,9 +1,9 @@ module github.com/cilium/ebpf -go 1.15 +go 1.16 require ( github.com/frankban/quicktest v1.11.3 github.com/google/go-cmp v0.5.4 - golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c + golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34 ) diff --git a/vendor/github.com/cilium/ebpf/go.sum b/vendor/github.com/cilium/ebpf/go.sum index a5039262aab0c..1ef5a4767e818 100644 --- a/vendor/github.com/cilium/ebpf/go.sum +++ b/vendor/github.com/cilium/ebpf/go.sum @@ -7,7 +7,7 @@ github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfn github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34 h1:GkvMjFtXUmahfDtashnc1mnrCtuBVcwse5QV2lUk/tI= +golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/vendor/github.com/cilium/ebpf/info.go b/vendor/github.com/cilium/ebpf/info.go index b95131ef57262..65fa4d7d85023 100644 --- a/vendor/github.com/cilium/ebpf/info.go +++ b/vendor/github.com/cilium/ebpf/info.go @@ -12,6 +12,7 @@ import ( "time" "github.com/cilium/ebpf/internal" + "github.com/cilium/ebpf/internal/btf" ) // MapInfo describes a map. @@ -87,12 +88,16 @@ type ProgramInfo struct { Tag string // Name as supplied by user space at load time. Name string + // BTF for the program. + btf btf.ID + // IDS map ids related to program. + ids []MapID stats *programStats } func newProgramInfoFromFd(fd *internal.FD) (*ProgramInfo, error) { - info, err := bpfGetProgInfoByFD(fd) + info, err := bpfGetProgInfoByFD(fd, nil) if errors.Is(err, syscall.EINVAL) { return newProgramInfoFromProc(fd) } @@ -100,6 +105,15 @@ func newProgramInfoFromFd(fd *internal.FD) (*ProgramInfo, error) { return nil, err } + var mapIDs []MapID + if info.nr_map_ids > 0 { + mapIDs = make([]MapID, info.nr_map_ids) + info, err = bpfGetProgInfoByFD(fd, mapIDs) + if err != nil { + return nil, err + } + } + return &ProgramInfo{ Type: ProgramType(info.prog_type), id: ProgramID(info.id), @@ -107,6 +121,8 @@ func newProgramInfoFromFd(fd *internal.FD) (*ProgramInfo, error) { Tag: hex.EncodeToString(info.tag[:]), // name is available from 4.15. Name: internal.CString(info.name[:]), + btf: btf.ID(info.btf_id), + ids: mapIDs, stats: &programStats{ runtime: time.Duration(info.run_time_ns), runCount: info.run_cnt, @@ -142,6 +158,17 @@ func (pi *ProgramInfo) ID() (ProgramID, bool) { return pi.id, pi.id > 0 } +// BTFID returns the BTF ID associated with the program. +// +// Available from 5.0. +// +// The bool return value indicates whether this optional field is available and +// populated. (The field may be available but not populated if the kernel +// supports the field but the program was loaded without BTF information.) +func (pi *ProgramInfo) BTFID() (btf.ID, bool) { + return pi.btf, pi.btf > 0 +} + // RunCount returns the total number of times the program was called. // // Can return 0 if the collection of statistics is not enabled. See EnableStats(). @@ -164,6 +191,13 @@ func (pi *ProgramInfo) Runtime() (time.Duration, bool) { return time.Duration(0), false } +// MapIDs returns the maps related to the program. +// +// The bool return value indicates whether this optional field is available. +func (pi *ProgramInfo) MapIDs() ([]MapID, bool) { + return pi.ids, pi.ids != nil +} + func scanFdInfo(fd *internal.FD, fields map[string]interface{}) error { raw, err := fd.Value() if err != nil { diff --git a/vendor/github.com/cilium/ebpf/internal/align.go b/vendor/github.com/cilium/ebpf/internal/align.go new file mode 100644 index 0000000000000..8b4f2658eacbc --- /dev/null +++ b/vendor/github.com/cilium/ebpf/internal/align.go @@ -0,0 +1,6 @@ +package internal + +// Align returns 'n' updated to 'alignment' boundary. +func Align(n, alignment int) int { + return (int(n) + alignment - 1) / alignment * alignment +} diff --git a/vendor/github.com/cilium/ebpf/internal/btf/btf.go b/vendor/github.com/cilium/ebpf/internal/btf/btf.go index 5da9e11921a3b..2b5f6d226a4f5 100644 --- a/vendor/github.com/cilium/ebpf/internal/btf/btf.go +++ b/vendor/github.com/cilium/ebpf/internal/btf/btf.go @@ -7,7 +7,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "math" "os" "reflect" @@ -27,12 +26,15 @@ var ( ErrNoExtendedInfo = errors.New("no extended info") ) +// ID represents the unique ID of a BTF object. +type ID uint32 + // Spec represents decoded BTF. type Spec struct { rawTypes []rawType strings stringTable types []Type - namedTypes map[string][]namedType + namedTypes map[string][]NamedType funcInfos map[string]extInfo lineInfos map[string]extInfo coreRelos map[string]coreRelos @@ -61,15 +63,6 @@ func LoadSpecFromReader(rd io.ReaderAt) (*Spec, error) { } defer file.Close() - btfSection, btfExtSection, sectionSizes, err := findBtfSections(file) - if err != nil { - return nil, err - } - - if btfSection == nil { - return nil, fmt.Errorf("btf: %w", ErrNotFound) - } - symbols, err := file.Symbols() if err != nil { return nil, fmt.Errorf("can't read symbols: %v", err) @@ -87,10 +80,6 @@ func LoadSpecFromReader(rd io.ReaderAt) (*Spec, error) { } 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) } @@ -98,24 +87,10 @@ func LoadSpecFromReader(rd io.ReaderAt) (*Spec, error) { 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, spec.coreRelos, 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 + return loadSpecFromELF(file, variableOffsets) } -func findBtfSections(file *internal.SafeELFFile) (*elf.Section, *elf.Section, map[string]uint32, error) { +func loadSpecFromELF(file *internal.SafeELFFile, variableOffsets map[variable]uint32) (*Spec, error) { var ( btfSection *elf.Section btfExtSection *elf.Section @@ -134,33 +109,45 @@ func findBtfSections(file *internal.SafeELFFile) (*elf.Section, *elf.Section, ma } if sec.Size > math.MaxUint32 { - return nil, nil, nil, fmt.Errorf("section %s exceeds maximum size", sec.Name) + return nil, fmt.Errorf("section %s exceeds maximum size", sec.Name) } sectionSizes[sec.Name] = uint32(sec.Size) } } - return btfSection, btfExtSection, sectionSizes, nil -} -func loadSpecFromVmlinux(rd io.ReaderAt) (*Spec, error) { - file, err := internal.NewSafeELFFile(rd) + if btfSection == nil { + return nil, fmt.Errorf("btf: %w", ErrNotFound) + } + + spec, err := loadRawSpec(btfSection.Open(), file.ByteOrder, sectionSizes, variableOffsets) if err != nil { return nil, err } - defer file.Close() - btfSection, _, _, err := findBtfSections(file) - if err != nil { - return nil, fmt.Errorf(".BTF ELF section: %s", err) + if btfExtSection == nil { + return spec, nil } - if btfSection == nil { - return nil, fmt.Errorf("unable to find .BTF ELF section") + + spec.funcInfos, spec.lineInfos, spec.coreRelos, err = parseExtInfos(btfExtSection.Open(), file.ByteOrder, spec.strings) + if err != nil { + return nil, fmt.Errorf("can't read ext info: %w", err) } - return loadNakedSpec(btfSection.Open(), file.ByteOrder, nil, nil) + + return spec, nil +} + +// LoadRawSpec reads a blob of BTF data that isn't wrapped in an ELF file. +// +// Prefer using LoadSpecFromReader, since this function only supports a subset +// of BTF. +func LoadRawSpec(btf io.Reader, bo binary.ByteOrder) (*Spec, error) { + // This will return an error if we encounter a Datasec, since we can't fix + // it up. + return loadRawSpec(btf, bo, nil, nil) } -func loadNakedSpec(btf io.ReadSeeker, bo binary.ByteOrder, sectionSizes map[string]uint32, variableOffsets map[variable]uint32) (*Spec, error) { +func loadRawSpec(btf io.Reader, 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 @@ -217,7 +204,7 @@ func loadKernelSpec() (*Spec, error) { if err == nil { defer fh.Close() - return loadNakedSpec(fh, internal.NativeEndian, nil, nil) + return LoadRawSpec(fh, internal.NativeEndian) } // use same list of locations as libbpf @@ -241,14 +228,20 @@ func loadKernelSpec() (*Spec, error) { } defer fh.Close() - return loadSpecFromVmlinux(fh) + file, err := internal.NewSafeELFFile(fh) + if err != nil { + return nil, err + } + defer file.Close() + + return loadSpecFromELF(file, nil) } return nil, fmt.Errorf("no BTF for kernel version %s: %w", release, internal.ErrNotSupported) } -func parseBTF(btf io.ReadSeeker, bo binary.ByteOrder) ([]rawType, stringTable, error) { - rawBTF, err := ioutil.ReadAll(btf) +func parseBTF(btf io.Reader, bo binary.ByteOrder) ([]rawType, stringTable, error) { + rawBTF, err := io.ReadAll(btf) if err != nil { return nil, nil, fmt.Errorf("can't read BTF: %v", err) } @@ -357,6 +350,30 @@ func fixupDatasec(rawTypes []rawType, rawStrings stringTable, sectionSizes map[s return nil } +// Copy creates a copy of Spec. +func (s *Spec) Copy() *Spec { + types, _ := copyTypes(s.types, nil) + namedTypes := make(map[string][]NamedType) + for _, typ := range types { + if named, ok := typ.(NamedType); ok { + name := essentialName(named.TypeName()) + namedTypes[name] = append(namedTypes[name], named) + } + } + + // NB: Other parts of spec are not copied since they are immutable. + return &Spec{ + s.rawTypes, + s.strings, + types, + namedTypes, + s.funcInfos, + s.lineInfos, + s.coreRelos, + s.byteOrder, + } +} + type marshalOpts struct { ByteOrder binary.ByteOrder StripFuncLinkage bool @@ -447,36 +464,37 @@ func (s *Spec) Program(name string, length uint64) (*Program, error) { return &Program{s, length, funcInfos, lineInfos, relos}, 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) - } - - m := NewMap(s, &Void{}, &datasec) - return &m, nil -} - // FindType searches for a type with a specific name. // -// hint determines the type of the returned Type. +// Called T a type that satisfies Type, typ must be a non-nil **T. +// On success, the address of the found type will be copied in typ. // // 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 - ) +func (s *Spec) FindType(name string, typ interface{}) error { + typValue := reflect.ValueOf(typ) + if typValue.Kind() != reflect.Ptr { + return fmt.Errorf("%T is not a pointer", typ) + } + + typPtr := typValue.Elem() + if !typPtr.CanSet() { + return fmt.Errorf("%T cannot be set", typ) + } + wanted := typPtr.Type() + if !wanted.AssignableTo(reflect.TypeOf((*Type)(nil)).Elem()) { + return fmt.Errorf("%T does not satisfy Type interface", typ) + } + + var candidate Type for _, typ := range s.namedTypes[essentialName(name)] { if reflect.TypeOf(typ) != wanted { continue } // Match against the full name, not just the essential one. - if typ.name() != name { + if typ.TypeName() != name { continue } @@ -491,15 +509,15 @@ func (s *Spec) FindType(name string, typ Type) error { return fmt.Errorf("type %s: %w", name, ErrNotFound) } - cpy, _ := copyType(candidate, nil) - value := reflect.Indirect(reflect.ValueOf(cpy)) - reflect.Indirect(reflect.ValueOf(typ)).Set(value) + typPtr.Set(reflect.ValueOf(candidate)) + return nil } // Handle is a reference to BTF loaded into the kernel. type Handle struct { - fd *internal.FD + spec *Spec + fd *internal.FD } // NewHandle loads BTF into the kernel. @@ -541,7 +559,32 @@ func NewHandle(spec *Spec) (*Handle, error) { return nil, internal.ErrorWithLog(err, logBuf, logErr) } - return &Handle{fd}, nil + return &Handle{spec.Copy(), fd}, nil +} + +// NewHandleFromID returns the BTF handle for a given id. +// +// Returns ErrNotExist, if there is no BTF with the given id. +// +// Requires CAP_SYS_ADMIN. +func NewHandleFromID(id ID) (*Handle, error) { + fd, err := internal.BPFObjGetFDByID(internal.BPF_BTF_GET_FD_BY_ID, uint32(id)) + if err != nil { + return nil, fmt.Errorf("get BTF by id: %w", err) + } + + info, err := newInfoFromFd(fd) + if err != nil { + _ = fd.Close() + return nil, fmt.Errorf("get BTF spec for handle: %w", err) + } + + return &Handle{info.BTF, fd}, nil +} + +// Spec returns the Spec that defined the BTF loaded into the kernel. +func (h *Handle) Spec() *Spec { + return h.spec } // Close destroys the handle. @@ -563,43 +606,8 @@ func (h *Handle) FD() int { // Map is the BTF for a map. type Map struct { - spec *Spec - key, value Type -} - -// NewMap returns a new Map containing the given values. -// The key and value arguments are initialized to Void if nil values are given. -func NewMap(spec *Spec, key Type, value Type) Map { - if key == nil { - key = &Void{} - } - if value == nil { - value = &Void{} - } - - return Map{ - spec: spec, - key: key, - value: value, - } -} - -// 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 + Spec *Spec + Key, Value Type } // Program is the BTF information for a stream of instructions. @@ -610,68 +618,59 @@ type Program struct { coreRelos coreRelos } -// 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 +// Spec returns the BTF spec of this program. +func (p *Program) Spec() *Spec { + return p.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) +// Append the information from other to the Program. +func (p *Program) Append(other *Program) error { + if other.spec != p.spec { + return fmt.Errorf("can't append program with different BTF specs") + } + + funcInfos, err := p.funcInfos.append(other.funcInfos, p.length) if err != nil { return fmt.Errorf("func infos: %w", err) } - lineInfos, err := s.lineInfos.append(other.lineInfos, s.length) + lineInfos, err := p.lineInfos.append(other.lineInfos, p.length) if err != nil { return fmt.Errorf("line infos: %w", err) } - s.funcInfos = funcInfos - s.lineInfos = lineInfos - s.coreRelos = s.coreRelos.append(other.coreRelos, s.length) - s.length += other.length + p.funcInfos = funcInfos + p.lineInfos = lineInfos + p.coreRelos = p.coreRelos.append(other.coreRelos, p.length) + p.length += other.length 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() +// FuncInfos returns the binary form of BTF function infos. +func (p *Program) FuncInfos() (recordSize uint32, bytes []byte, err error) { + bytes, err = p.funcInfos.MarshalBinary() if err != nil { - return 0, nil, err + return 0, nil, fmt.Errorf("func infos: %w", err) } - return s.funcInfos.recordSize, bytes, nil + return p.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() +// LineInfos returns the binary form of BTF line infos. +func (p *Program) LineInfos() (recordSize uint32, bytes []byte, err error) { + bytes, err = p.lineInfos.MarshalBinary() if err != nil { - return 0, nil, err + return 0, nil, fmt.Errorf("line infos: %w", err) } - return s.lineInfos.recordSize, bytes, nil + return p.lineInfos.recordSize, bytes, nil } -// ProgramFixups returns the changes required to adjust the program to the target. +// Fixups returns the changes required to adjust the program to the target. // -// This is a free function instead of a method to hide it from users -// of package ebpf. -func ProgramFixups(s *Program, target *Spec) (COREFixups, error) { - if len(s.coreRelos) == 0 { +// Passing a nil target will relocate against the running kernel. +func (p *Program) Fixups(target *Spec) (COREFixups, error) { + if len(p.coreRelos) == 0 { return nil, nil } @@ -683,7 +682,7 @@ func ProgramFixups(s *Program, target *Spec) (COREFixups, error) { } } - return coreRelocate(s.spec, target, s.coreRelos) + return coreRelocate(p.spec, target, p.coreRelos) } type bpfLoadBTFAttr struct { diff --git a/vendor/github.com/cilium/ebpf/internal/btf/btf_types.go b/vendor/github.com/cilium/ebpf/internal/btf/btf_types.go index a5ef945120138..d98c73ca594ae 100644 --- a/vendor/github.com/cilium/ebpf/internal/btf/btf_types.go +++ b/vendor/github.com/cilium/ebpf/internal/btf/btf_types.go @@ -31,6 +31,8 @@ const ( // Added ~5.1 kindVar kindDatasec + // Added ~5.13 + kindFloat ) // FuncLinkage describes BTF function linkage metadata. @@ -54,7 +56,7 @@ const ( const ( btfTypeKindShift = 24 - btfTypeKindLen = 4 + btfTypeKindLen = 5 btfTypeVlenShift = 0 btfTypeVlenMask = 16 btfTypeKindFlagShift = 31 @@ -67,8 +69,8 @@ type btfType struct { /* "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 + * bits 24-28: kind (e.g. int, ptr, array...etc) + * bits 29-30: unused * bit 31: kind_flag, currently used by * struct, union and fwd */ @@ -117,6 +119,8 @@ func (k btfKind) String() string { return "Variable" case kindDatasec: return "Section" + case kindFloat: + return "Float" default: return fmt.Sprintf("Unknown (%d)", k) } @@ -260,6 +264,7 @@ func readTypes(r io.Reader, bo binary.ByteOrder) ([]rawType, error) { data = new(btfVariable) case kindDatasec: data = make([]btfVarSecinfo, header.Vlen()) + case kindFloat: default: return nil, fmt.Errorf("type id %v: unknown kind: %v", id, header.Kind()) } diff --git a/vendor/github.com/cilium/ebpf/internal/btf/core.go b/vendor/github.com/cilium/ebpf/internal/btf/core.go index 7c888f602d0df..d02df9d50bb31 100644 --- a/vendor/github.com/cilium/ebpf/internal/btf/core.go +++ b/vendor/github.com/cilium/ebpf/internal/btf/core.go @@ -234,13 +234,13 @@ func coreRelocate(local, target *Spec, relos coreRelos) (COREFixups, error) { } localType := local.types[id] - named, ok := localType.(namedType) - if !ok || named.name() == "" { + named, ok := localType.(NamedType) + if !ok || named.TypeName() == "" { return nil, fmt.Errorf("relocate unnamed or anonymous type %s: %w", localType, ErrNotSupported) } relos := relosByID[id] - targets := target.namedTypes[named.essentialName()] + targets := target.namedTypes[essentialName(named.TypeName())] fixups, err := coreCalculateFixups(localType, targets, relos) if err != nil { return nil, fmt.Errorf("relocate %s: %w", localType, err) @@ -262,7 +262,7 @@ var errImpossibleRelocation = errors.New("impossible relocation") // // The best target is determined by scoring: the less poisoning we have to do // the better the target is. -func coreCalculateFixups(local Type, targets []namedType, relos coreRelos) ([]COREFixup, error) { +func coreCalculateFixups(local Type, targets []NamedType, relos coreRelos) ([]COREFixup, error) { localID := local.ID() local, err := copyType(local, skipQualifierAndTypedef) if err != nil { @@ -467,8 +467,8 @@ func parseCoreAccessor(accessor string) (coreAccessor, error) { return nil, fmt.Errorf("empty accessor") } - var result coreAccessor parts := strings.Split(accessor, ":") + result := make(coreAccessor, 0, len(parts)) for _, part := range parts { // 31 bits to avoid overflowing int on 32 bit platforms. index, err := strconv.ParseUint(part, 10, 31) @@ -564,7 +564,7 @@ func coreFindField(local Type, localAcc coreAccessor, target Type) (_, _ coreFie // This is an anonymous struct or union, ignore it. local = localMember.Type - localOffset += localMember.Offset + localOffset += localMember.OffsetBits localMaybeFlex = false continue } @@ -585,10 +585,10 @@ func coreFindField(local Type, localAcc coreAccessor, target Type) (_, _ coreFie local = localMember.Type localMaybeFlex = acc == len(localMembers)-1 - localOffset += localMember.Offset + localOffset += localMember.OffsetBits target = targetMember.Type targetMaybeFlex = last - targetOffset += targetMember.Offset + targetOffset += targetMember.OffsetBits case *Array: // For arrays, acc is the index in the target. @@ -639,7 +639,7 @@ func coreFindField(local Type, localAcc coreAccessor, target Type) (_, _ coreFie // coreFindMember finds a member in a composite type while handling anonymous // structs and unions. -func coreFindMember(typ composite, name Name) (Member, bool, error) { +func coreFindMember(typ composite, name string) (Member, bool, error) { if name == "" { return Member{}, false, errors.New("can't search for anonymous member") } @@ -670,7 +670,7 @@ func coreFindMember(typ composite, name Name) (Member, bool, error) { for j, member := range members { if member.Name == name { // NB: This is safe because member is a copy. - member.Offset += target.offset + member.OffsetBits += target.offset return member, j == len(members)-1, nil } @@ -685,7 +685,7 @@ func coreFindMember(typ composite, name Name) (Member, bool, error) { return Member{}, false, fmt.Errorf("anonymous non-composite type %T not allowed", member.Type) } - targets = append(targets, offsetTarget{comp, target.offset + member.Offset}) + targets = append(targets, offsetTarget{comp, target.offset + member.OffsetBits}) } } @@ -704,9 +704,9 @@ func coreFindEnumValue(local Type, localAcc coreAccessor, target Type) (localVal return nil, nil, errImpossibleRelocation } - localName := localValue.Name.essentialName() + localName := essentialName(localValue.Name) for i, targetValue := range targetEnum.Values { - if targetValue.Name.essentialName() != localName { + if essentialName(targetValue.Name) != localName { continue } @@ -813,6 +813,7 @@ func coreAreTypesCompatible(localType Type, targetType Type) error { * least one of enums should be anonymous; * - for ENUMs, check sizes, names are ignored; * - for INT, size and signedness are ignored; + * - any two FLOATs are always compatible; * - for ARRAY, dimensionality is ignored, element types are checked for * compatibility recursively; * [ NB: coreAreMembersCompatible doesn't recurse, this check is done @@ -848,16 +849,16 @@ func coreAreMembersCompatible(localType Type, targetType Type) error { } switch lv := localType.(type) { - case *Array, *Pointer: + case *Array, *Pointer, *Float: return nil case *Enum: tv := targetType.(*Enum) - return doNamesMatch(lv.name(), tv.name()) + return doNamesMatch(lv.Name, tv.Name) case *Fwd: tv := targetType.(*Fwd) - return doNamesMatch(lv.name(), tv.name()) + return doNamesMatch(lv.Name, tv.Name) case *Int: tv := targetType.(*Int) diff --git a/vendor/github.com/cilium/ebpf/internal/btf/ext_info.go b/vendor/github.com/cilium/ebpf/internal/btf/ext_info.go index beba1bce6980b..cdae2ec40827b 100644 --- a/vendor/github.com/cilium/ebpf/internal/btf/ext_info.go +++ b/vendor/github.com/cilium/ebpf/internal/btf/ext_info.go @@ -7,7 +7,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "github.com/cilium/ebpf/asm" "github.com/cilium/ebpf/internal" @@ -64,7 +63,7 @@ func parseExtInfos(r io.ReadSeeker, bo binary.ByteOrder, strings stringTable) (f // 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) + _, err = io.CopyN(io.Discard, r, remainder) if err != nil { return nil, nil, nil, fmt.Errorf("header padding: %v", err) } @@ -114,11 +113,16 @@ type extInfoRecord struct { } type extInfo struct { + byteOrder binary.ByteOrder recordSize uint32 records []extInfoRecord } func (ei extInfo) append(other extInfo, offset uint64) (extInfo, error) { + if other.byteOrder != ei.byteOrder { + return extInfo{}, fmt.Errorf("ext_info byte order mismatch, want %v (got %v)", ei.byteOrder, other.byteOrder) + } + if other.recordSize != ei.recordSize { return extInfo{}, fmt.Errorf("ext_info record size mismatch, want %d (got %d)", ei.recordSize, other.recordSize) } @@ -131,10 +135,14 @@ func (ei extInfo) append(other extInfo, offset uint64) (extInfo, error) { Opaque: info.Opaque, }) } - return extInfo{ei.recordSize, records}, nil + return extInfo{ei.byteOrder, ei.recordSize, records}, nil } func (ei extInfo) MarshalBinary() ([]byte, error) { + if ei.byteOrder != internal.NativeEndian { + return nil, fmt.Errorf("%s is not the native byte order", ei.byteOrder) + } + if len(ei.records) == 0 { return nil, nil } @@ -197,6 +205,7 @@ func parseExtInfo(r io.Reader, bo binary.ByteOrder, strings stringTable) (map[st } result[secName] = extInfo{ + bo, recordSize, records, } diff --git a/vendor/github.com/cilium/ebpf/internal/btf/fuzz.go b/vendor/github.com/cilium/ebpf/internal/btf/fuzz.go index 37e043fd378c7..220b285afe008 100644 --- a/vendor/github.com/cilium/ebpf/internal/btf/fuzz.go +++ b/vendor/github.com/cilium/ebpf/internal/btf/fuzz.go @@ -1,3 +1,4 @@ +//go:build gofuzz // +build gofuzz // Use with https://github.com/dvyukov/go-fuzz diff --git a/vendor/github.com/cilium/ebpf/internal/btf/info.go b/vendor/github.com/cilium/ebpf/internal/btf/info.go new file mode 100644 index 0000000000000..6a9b5d2e0ba36 --- /dev/null +++ b/vendor/github.com/cilium/ebpf/internal/btf/info.go @@ -0,0 +1,48 @@ +package btf + +import ( + "bytes" + + "github.com/cilium/ebpf/internal" +) + +// info describes a BTF object. +type info struct { + BTF *Spec + ID ID + // Name is an identifying name for the BTF, currently only used by the + // kernel. + Name string + // KernelBTF is true if the BTf originated with the kernel and not + // userspace. + KernelBTF bool +} + +func newInfoFromFd(fd *internal.FD) (*info, error) { + // We invoke the syscall once with a empty BTF and name buffers to get size + // information to allocate buffers. Then we invoke it a second time with + // buffers to receive the data. + bpfInfo, err := bpfGetBTFInfoByFD(fd, nil, nil) + if err != nil { + return nil, err + } + + btfBuffer := make([]byte, bpfInfo.btfSize) + nameBuffer := make([]byte, bpfInfo.nameLen) + bpfInfo, err = bpfGetBTFInfoByFD(fd, btfBuffer, nameBuffer) + if err != nil { + return nil, err + } + + spec, err := loadRawSpec(bytes.NewReader(btfBuffer), internal.NativeEndian, nil, nil) + if err != nil { + return nil, err + } + + return &info{ + BTF: spec, + ID: ID(bpfInfo.id), + Name: internal.CString(nameBuffer), + KernelBTF: bpfInfo.kernelBTF != 0, + }, nil +} diff --git a/vendor/github.com/cilium/ebpf/internal/btf/strings.go b/vendor/github.com/cilium/ebpf/internal/btf/strings.go index 8782643a043ef..9876aa227c0a9 100644 --- a/vendor/github.com/cilium/ebpf/internal/btf/strings.go +++ b/vendor/github.com/cilium/ebpf/internal/btf/strings.go @@ -5,13 +5,12 @@ import ( "errors" "fmt" "io" - "io/ioutil" ) type stringTable []byte func readStringTable(r io.Reader) (stringTable, error) { - contents, err := ioutil.ReadAll(r) + contents, err := io.ReadAll(r) if err != nil { return nil, fmt.Errorf("can't read string table: %v", err) } @@ -53,8 +52,3 @@ func (st stringTable) Lookup(offset uint32) (string, error) { 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/syscalls.go b/vendor/github.com/cilium/ebpf/internal/btf/syscalls.go new file mode 100644 index 0000000000000..a4f80abd011f7 --- /dev/null +++ b/vendor/github.com/cilium/ebpf/internal/btf/syscalls.go @@ -0,0 +1,31 @@ +package btf + +import ( + "fmt" + "unsafe" + + "github.com/cilium/ebpf/internal" +) + +type bpfBTFInfo struct { + btf internal.Pointer + btfSize uint32 + id uint32 + name internal.Pointer + nameLen uint32 + kernelBTF uint32 +} + +func bpfGetBTFInfoByFD(fd *internal.FD, btf, name []byte) (*bpfBTFInfo, error) { + info := bpfBTFInfo{ + btf: internal.NewSlicePointer(btf), + btfSize: uint32(len(btf)), + name: internal.NewSlicePointer(name), + nameLen: uint32(len(name)), + } + if err := internal.BPFObjGetInfoByFD(fd, unsafe.Pointer(&info), unsafe.Sizeof(info)); err != nil { + return nil, fmt.Errorf("can't get program info: %w", err) + } + + return &info, nil +} diff --git a/vendor/github.com/cilium/ebpf/internal/btf/types.go b/vendor/github.com/cilium/ebpf/internal/btf/types.go index 62aa31bcd7819..5c8e7c6e59da1 100644 --- a/vendor/github.com/cilium/ebpf/internal/btf/types.go +++ b/vendor/github.com/cilium/ebpf/internal/btf/types.go @@ -30,27 +30,26 @@ type Type interface { walk(*typeDeque) } -// namedType is a type with a name. -// -// Most named types simply embed Name. -type namedType interface { +// NamedType is a type with a name. +type NamedType interface { Type - name() string - essentialName() string -} - -// Name identifies a type. -// -// Anonymous types have an empty name. -type Name string -func (n Name) name() string { - return string(n) + // Name of the type, empty for anonymous types. + TypeName() string } -func (n Name) essentialName() string { - return essentialName(string(n)) -} +var ( + _ NamedType = (*Int)(nil) + _ NamedType = (*Struct)(nil) + _ NamedType = (*Union)(nil) + _ NamedType = (*Enum)(nil) + _ NamedType = (*Fwd)(nil) + _ NamedType = (*Func)(nil) + _ NamedType = (*Typedef)(nil) + _ NamedType = (*Var)(nil) + _ NamedType = (*Datasec)(nil) + _ NamedType = (*Float)(nil) +) // Void is the unit type of BTF. type Void struct{} @@ -72,19 +71,17 @@ const ( // Int is an integer of a given length. type Int struct { TypeID - Name + Name string // The size of the integer in bytes. Size uint32 Encoding IntEncoding - // Offset is the starting bit offset. Currently always 0. + // OffsetBits is the starting bit offset. Currently always 0. // See https://www.kernel.org/doc/html/latest/bpf/btf.html#btf-kind-int - Offset uint32 - Bits byte + OffsetBits uint32 + Bits byte } -var _ namedType = (*Int)(nil) - func (i *Int) String() string { var s strings.Builder @@ -110,15 +107,16 @@ func (i *Int) String() string { return s.String() } -func (i *Int) size() uint32 { return i.Size } -func (i *Int) walk(*typeDeque) {} +func (i *Int) TypeName() string { return i.Name } +func (i *Int) size() uint32 { return i.Size } +func (i *Int) walk(*typeDeque) {} func (i *Int) copy() Type { cpy := *i return &cpy } func (i *Int) isBitfield() bool { - return i.Offset > 0 + return i.OffsetBits > 0 } // Pointer is a pointer to another type. @@ -158,7 +156,7 @@ func (arr *Array) copy() Type { // Struct is a compound type of consecutive members. type Struct struct { TypeID - Name + Name string // The size of the struct including padding, in bytes Size uint32 Members []Member @@ -168,6 +166,8 @@ func (s *Struct) String() string { return fmt.Sprintf("struct#%d[%q]", s.TypeID, s.Name) } +func (s *Struct) TypeName() string { return s.Name } + func (s *Struct) size() uint32 { return s.Size } func (s *Struct) walk(tdq *typeDeque) { @@ -189,7 +189,7 @@ func (s *Struct) members() []Member { // Union is a compound type where members occupy the same memory. type Union struct { TypeID - Name + Name string // The size of the union including padding, in bytes. Size uint32 Members []Member @@ -199,6 +199,8 @@ func (u *Union) String() string { return fmt.Sprintf("union#%d[%q]", u.TypeID, u.Name) } +func (u *Union) TypeName() string { return u.Name } + func (u *Union) size() uint32 { return u.Size } func (u *Union) walk(tdq *typeDeque) { @@ -236,17 +238,17 @@ var ( // // It is not a valid Type. type Member struct { - Name + Name string Type Type - // Offset is the bit offset of this member - Offset uint32 + // OffsetBits is the bit offset of this member. + OffsetBits uint32 BitfieldSize uint32 } // Enum lists possible values. type Enum struct { TypeID - Name + Name string Values []EnumValue } @@ -254,11 +256,13 @@ func (e *Enum) String() string { return fmt.Sprintf("enum#%d[%q]", e.TypeID, e.Name) } +func (e *Enum) TypeName() string { return e.Name } + // EnumValue is part of an Enum // // Is is not a valid Type type EnumValue struct { - Name + Name string Value int32 } @@ -294,7 +298,7 @@ func (fk FwdKind) String() string { // Fwd is a forward declaration of a Type. type Fwd struct { TypeID - Name + Name string Kind FwdKind } @@ -302,6 +306,8 @@ func (f *Fwd) String() string { return fmt.Sprintf("fwd#%d[%s %q]", f.TypeID, f.Kind, f.Name) } +func (f *Fwd) TypeName() string { return f.Name } + func (f *Fwd) walk(*typeDeque) {} func (f *Fwd) copy() Type { cpy := *f @@ -311,7 +317,7 @@ func (f *Fwd) copy() Type { // Typedef is an alias of a Type. type Typedef struct { TypeID - Name + Name string Type Type } @@ -319,6 +325,8 @@ func (td *Typedef) String() string { return fmt.Sprintf("typedef#%d[%q #%d]", td.TypeID, td.Name, td.Type.ID()) } +func (td *Typedef) TypeName() string { return td.Name } + func (td *Typedef) walk(tdq *typeDeque) { tdq.push(&td.Type) } func (td *Typedef) copy() Type { cpy := *td @@ -379,7 +387,7 @@ func (r *Restrict) copy() Type { // Func is a function definition. type Func struct { TypeID - Name + Name string Type Type Linkage FuncLinkage } @@ -388,6 +396,8 @@ func (f *Func) String() string { return fmt.Sprintf("func#%d[%s %q proto=#%d]", f.TypeID, f.Linkage, f.Name, f.Type.ID()) } +func (f *Func) TypeName() string { return f.Name } + func (f *Func) walk(tdq *typeDeque) { tdq.push(&f.Type) } func (f *Func) copy() Type { cpy := *f @@ -426,14 +436,14 @@ func (fp *FuncProto) copy() Type { } type FuncParam struct { - Name + Name string Type Type } // Var is a global variable. type Var struct { TypeID - Name + Name string Type Type Linkage VarLinkage } @@ -442,6 +452,8 @@ func (v *Var) String() string { return fmt.Sprintf("var#%d[%s %q]", v.TypeID, v.Linkage, v.Name) } +func (v *Var) TypeName() string { return v.Name } + func (v *Var) walk(tdq *typeDeque) { tdq.push(&v.Type) } func (v *Var) copy() Type { cpy := *v @@ -451,7 +463,7 @@ func (v *Var) copy() Type { // Datasec is a global program section containing data. type Datasec struct { TypeID - Name + Name string Size uint32 Vars []VarSecinfo } @@ -460,6 +472,8 @@ func (ds *Datasec) String() string { return fmt.Sprintf("section#%d[%q]", ds.TypeID, ds.Name) } +func (ds *Datasec) TypeName() string { return ds.Name } + func (ds *Datasec) size() uint32 { return ds.Size } func (ds *Datasec) walk(tdq *typeDeque) { @@ -475,7 +489,7 @@ func (ds *Datasec) copy() Type { return &cpy } -// VarSecinfo describes variable in a Datasec +// VarSecinfo describes variable in a Datasec. // // It is not a valid Type. type VarSecinfo struct { @@ -484,6 +498,27 @@ type VarSecinfo struct { Size uint32 } +// Float is a float of a given length. +type Float struct { + TypeID + Name string + + // The size of the float in bytes. + Size uint32 +} + +func (f *Float) String() string { + return fmt.Sprintf("float%d#%d[%q]", f.Size*8, f.TypeID, f.Name) +} + +func (f *Float) TypeName() string { return f.Name } +func (f *Float) size() uint32 { return f.Size } +func (f *Float) walk(*typeDeque) {} +func (f *Float) copy() Type { + cpy := *f + return &cpy +} + type sizer interface { size() uint32 } @@ -565,14 +600,36 @@ func Sizeof(typ Type) (int, error) { // // Returns any errors from transform verbatim. func copyType(typ Type, transform func(Type) (Type, error)) (Type, error) { - var ( - copies = make(map[Type]Type) - work typeDeque - ) + copies := make(copier) + return typ, copies.copy(&typ, transform) +} - for t := &typ; t != nil; t = work.pop() { +// copy a slice of Types recursively. +// +// Types may form a cycle. +// +// Returns any errors from transform verbatim. +func copyTypes(types []Type, transform func(Type) (Type, error)) ([]Type, error) { + result := make([]Type, len(types)) + copy(result, types) + + copies := make(copier) + for i := range result { + if err := copies.copy(&result[i], transform); err != nil { + return nil, err + } + } + + return result, nil +} + +type copier map[Type]Type + +func (c copier) copy(typ *Type, transform func(Type) (Type, error)) error { + var work typeDeque + for t := typ; t != nil; t = work.pop() { // *t is the identity of the type. - if cpy := copies[*t]; cpy != nil { + if cpy := c[*t]; cpy != nil { *t = cpy continue } @@ -581,21 +638,21 @@ func copyType(typ Type, transform func(Type) (Type, error)) (Type, error) { if transform != nil { tf, err := transform(*t) if err != nil { - return nil, fmt.Errorf("copy %s: %w", typ, err) + return fmt.Errorf("copy %s: %w", *t, err) } cpy = tf.copy() } else { cpy = (*t).copy() } - copies[*t] = cpy + c[*t] = cpy *t = cpy // Mark any nested types for copying. cpy.walk(&work) } - return typ, nil + return nil } // typeDeque keeps track of pointers to types which still @@ -606,6 +663,10 @@ type typeDeque struct { mask uint64 } +func (dq *typeDeque) empty() bool { + return dq.read == dq.write +} + // push adds a type to the stack. func (dq *typeDeque) push(t *Type) { if dq.write-dq.read < uint64(len(dq.types)) { @@ -632,7 +693,7 @@ func (dq *typeDeque) push(t *Type) { // shift returns the first element or null. func (dq *typeDeque) shift() *Type { - if dq.read == dq.write { + if dq.empty() { return nil } @@ -645,7 +706,7 @@ func (dq *typeDeque) shift() *Type { // pop returns the last element or null. func (dq *typeDeque) pop() *Type { - if dq.read == dq.write { + if dq.empty() { return nil } @@ -674,7 +735,7 @@ func (dq *typeDeque) all() []*Type { // Returns a map of named types (so, where NameOff is non-zero) and a slice of types // indexed by TypeID. 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) (types []Type, namedTypes map[string][]namedType, err error) { +func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (types []Type, namedTypes map[string][]NamedType, err error) { type fixupDef struct { id TypeID expectedKind btfKind @@ -691,17 +752,17 @@ func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (types []Type, // 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) + name, err := rawStrings.Lookup(btfMember.NameOff) if err != nil { return nil, fmt.Errorf("can't get name for member %d: %w", i, err) } m := Member{ - Name: name, - Offset: btfMember.Offset, + Name: name, + OffsetBits: btfMember.Offset, } if kindFlag { m.BitfieldSize = btfMember.Offset >> 24 - m.Offset &= 0xffffff + m.OffsetBits &= 0xffffff } members = append(members, m) } @@ -713,7 +774,7 @@ func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (types []Type, types = make([]Type, 0, len(rawTypes)) types = append(types, (*Void)(nil)) - namedTypes = make(map[string][]namedType) + namedTypes = make(map[string][]NamedType) for i, raw := range rawTypes { var ( @@ -723,7 +784,7 @@ func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (types []Type, typ Type ) - name, err := rawStrings.LookupName(raw.NameOff) + name, err := rawStrings.Lookup(raw.NameOff) if err != nil { return nil, nil, fmt.Errorf("get name for type id %d: %w", id, err) } @@ -765,7 +826,7 @@ func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (types []Type, rawvals := raw.data.([]btfEnum) vals := make([]EnumValue, 0, len(rawvals)) for i, btfVal := range rawvals { - name, err := rawStrings.LookupName(btfVal.NameOff) + name, err := rawStrings.Lookup(btfVal.NameOff) if err != nil { return nil, nil, fmt.Errorf("get name for enum value %d: %s", i, err) } @@ -812,7 +873,7 @@ func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (types []Type, rawparams := raw.data.([]btfParam) params := make([]FuncParam, 0, len(rawparams)) for i, param := range rawparams { - name, err := rawStrings.LookupName(param.NameOff) + name, err := rawStrings.Lookup(param.NameOff) if err != nil { return nil, nil, fmt.Errorf("get name for func proto parameter %d: %s", i, err) } @@ -848,14 +909,17 @@ func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (types []Type, } typ = &Datasec{id, name, raw.SizeType, vars} + case kindFloat: + typ = &Float{id, name, raw.Size()} + default: return nil, nil, fmt.Errorf("type id %d: unknown kind: %v", id, raw.Kind()) } types = append(types, typ) - if named, ok := typ.(namedType); ok { - if name := essentialName(named.name()); name != "" { + if named, ok := typ.(NamedType); ok { + if name := essentialName(named.TypeName()); name != "" { namedTypes[name] = append(namedTypes[name], named) } } diff --git a/vendor/github.com/cilium/ebpf/internal/cpu.go b/vendor/github.com/cilium/ebpf/internal/cpu.go index d3424ba4345d1..3affa1efb9dbb 100644 --- a/vendor/github.com/cilium/ebpf/internal/cpu.go +++ b/vendor/github.com/cilium/ebpf/internal/cpu.go @@ -2,7 +2,7 @@ package internal import ( "fmt" - "io/ioutil" + "os" "strings" "sync" ) @@ -24,7 +24,7 @@ func PossibleCPUs() (int, error) { } func parseCPUsFromFile(path string) (int, error) { - spec, err := ioutil.ReadFile(path) + spec, err := os.ReadFile(path) if err != nil { return 0, err } diff --git a/vendor/github.com/cilium/ebpf/internal/ptr_32_be.go b/vendor/github.com/cilium/ebpf/internal/ptr_32_be.go index a56fbcc8e01b2..8c114ddf4763b 100644 --- a/vendor/github.com/cilium/ebpf/internal/ptr_32_be.go +++ b/vendor/github.com/cilium/ebpf/internal/ptr_32_be.go @@ -1,3 +1,4 @@ +//go:build armbe || mips || mips64p32 // +build armbe mips mips64p32 package internal diff --git a/vendor/github.com/cilium/ebpf/internal/ptr_32_le.go b/vendor/github.com/cilium/ebpf/internal/ptr_32_le.go index be2ecfca7313f..e65a61e45d34b 100644 --- a/vendor/github.com/cilium/ebpf/internal/ptr_32_le.go +++ b/vendor/github.com/cilium/ebpf/internal/ptr_32_le.go @@ -1,3 +1,4 @@ +//go:build 386 || amd64p32 || arm || mipsle || mips64p32le // +build 386 amd64p32 arm mipsle mips64p32le package internal diff --git a/vendor/github.com/cilium/ebpf/internal/ptr_64.go b/vendor/github.com/cilium/ebpf/internal/ptr_64.go index 69452dceb9a03..71a3afe307b35 100644 --- a/vendor/github.com/cilium/ebpf/internal/ptr_64.go +++ b/vendor/github.com/cilium/ebpf/internal/ptr_64.go @@ -1,5 +1,5 @@ -// +build !386,!amd64p32,!arm,!mipsle,!mips64p32le -// +build !armbe,!mips,!mips64p32 +//go:build !386 && !amd64p32 && !arm && !mipsle && !mips64p32le && !armbe && !mips && !mips64p32 +// +build !386,!amd64p32,!arm,!mipsle,!mips64p32le,!armbe,!mips,!mips64p32 package internal diff --git a/vendor/github.com/cilium/ebpf/internal/syscall.go b/vendor/github.com/cilium/ebpf/internal/syscall.go index b766e643e07af..b75037bb9d68e 100644 --- a/vendor/github.com/cilium/ebpf/internal/syscall.go +++ b/vendor/github.com/cilium/ebpf/internal/syscall.go @@ -1,6 +1,7 @@ package internal import ( + "errors" "fmt" "path/filepath" "runtime" @@ -68,6 +69,48 @@ func BPF(cmd BPFCmd, attr unsafe.Pointer, size uintptr) (uintptr, error) { return r1, err } +type BPFProgLoadAttr struct { + ProgType uint32 + InsCount uint32 + Instructions Pointer + License Pointer + LogLevel uint32 + LogSize uint32 + LogBuf 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 uint32 // since 4.17 5e43f899b03a + ProgBTFFd uint32 + FuncInfoRecSize uint32 + FuncInfo Pointer + FuncInfoCnt uint32 + LineInfoRecSize uint32 + LineInfo Pointer + LineInfoCnt uint32 + AttachBTFID uint32 + AttachProgFd uint32 +} + +// BPFProgLoad wraps BPF_PROG_LOAD. +func BPFProgLoad(attr *BPFProgLoadAttr) (*FD, error) { + for { + fd, err := BPF(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 errors.Is(err, unix.EAGAIN) { + continue + } + + if err != nil { + return nil, err + } + + return NewFD(uint32(fd)), nil + } +} + type BPFProgAttachAttr struct { TargetFd uint32 AttachBpfFd uint32 @@ -180,6 +223,22 @@ func BPFObjGetInfoByFD(fd *FD, info unsafe.Pointer, size uintptr) error { return nil } +type bpfGetFDByIDAttr struct { + id uint32 + next uint32 +} + +// BPFObjGetInfoByFD wraps BPF_*_GET_FD_BY_ID. +// +// Available from 4.13. +func BPFObjGetFDByID(cmd BPFCmd, id uint32) (*FD, error) { + attr := bpfGetFDByIDAttr{ + id: id, + } + ptr, err := BPF(cmd, unsafe.Pointer(&attr), unsafe.Sizeof(attr)) + return NewFD(uint32(ptr)), err +} + // BPFObjName is a null-terminated string made up of // 'A-Za-z0-9_' characters. type BPFObjName [unix.BPF_OBJ_NAME_LEN]byte diff --git a/vendor/github.com/cilium/ebpf/internal/unix/types_linux.go b/vendor/github.com/cilium/ebpf/internal/unix/types_linux.go index 0a18eaf0cf84d..9aa70fa78c2a9 100644 --- a/vendor/github.com/cilium/ebpf/internal/unix/types_linux.go +++ b/vendor/github.com/cilium/ebpf/internal/unix/types_linux.go @@ -1,3 +1,4 @@ +//go:build linux // +build linux package unix @@ -20,10 +21,11 @@ const ( EPERM = linux.EPERM ESRCH = linux.ESRCH ENODEV = linux.ENODEV + EBADF = linux.EBADF + E2BIG = linux.E2BIG // ENOTSUPP is not the same as ENOTSUP or EOPNOTSUP ENOTSUPP = syscall.Errno(0x20c) - EBADF = linux.EBADF BPF_F_NO_PREALLOC = linux.BPF_F_NO_PREALLOC BPF_F_NUMA_NODE = linux.BPF_F_NUMA_NODE BPF_F_RDONLY = linux.BPF_F_RDONLY @@ -35,6 +37,9 @@ const ( BPF_F_INNER_MAP = linux.BPF_F_INNER_MAP BPF_OBJ_NAME_LEN = linux.BPF_OBJ_NAME_LEN BPF_TAG_SIZE = linux.BPF_TAG_SIZE + BPF_RINGBUF_BUSY_BIT = linux.BPF_RINGBUF_BUSY_BIT + BPF_RINGBUF_DISCARD_BIT = linux.BPF_RINGBUF_DISCARD_BIT + BPF_RINGBUF_HDR_SZ = linux.BPF_RINGBUF_HDR_SZ SYS_BPF = linux.SYS_BPF F_DUPFD_CLOEXEC = linux.F_DUPFD_CLOEXEC EPOLL_CTL_ADD = linux.EPOLL_CTL_ADD @@ -69,11 +74,6 @@ 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) @@ -202,3 +202,7 @@ func KernelRelease() (string, error) { release := string(uname.Release[:end]) return release, nil } + +func Prlimit(pid, resource int, new, old *Rlimit) error { + return linux.Prlimit(pid, resource, new, old) +} diff --git a/vendor/github.com/cilium/ebpf/internal/unix/types_other.go b/vendor/github.com/cilium/ebpf/internal/unix/types_other.go index 1b06defc0a095..4f50d896ebb88 100644 --- a/vendor/github.com/cilium/ebpf/internal/unix/types_other.go +++ b/vendor/github.com/cilium/ebpf/internal/unix/types_other.go @@ -1,3 +1,4 @@ +//go:build !linux // +build !linux package unix @@ -21,6 +22,7 @@ const ( ESRCH = syscall.ESRCH ENODEV = syscall.ENODEV EBADF = syscall.Errno(0) + E2BIG = syscall.Errno(0) // ENOTSUPP is not the same as ENOTSUP or EOPNOTSUP ENOTSUPP = syscall.Errno(0x20c) @@ -35,6 +37,9 @@ const ( BPF_F_INNER_MAP = 0 BPF_OBJ_NAME_LEN = 0x10 BPF_TAG_SIZE = 0x8 + BPF_RINGBUF_BUSY_BIT = 0 + BPF_RINGBUF_DISCARD_BIT = 0 + BPF_RINGBUF_HDR_SZ = 0 SYS_BPF = 321 F_DUPFD_CLOEXEC = 0x406 EPOLLIN = 0x1 @@ -86,11 +91,6 @@ type Rlimit struct { 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) @@ -261,3 +261,7 @@ func Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags func KernelRelease() (string, error) { return "", errNonLinux } + +func Prlimit(pid, resource int, new, old *Rlimit) error { + return errNonLinux +} diff --git a/vendor/github.com/cilium/ebpf/internal/version.go b/vendor/github.com/cilium/ebpf/internal/version.go index 1a678bfe65749..4915e583767a9 100644 --- a/vendor/github.com/cilium/ebpf/internal/version.go +++ b/vendor/github.com/cilium/ebpf/internal/version.go @@ -2,7 +2,7 @@ package internal import ( "fmt" - "io/ioutil" + "os" "regexp" "sync" @@ -109,7 +109,7 @@ func detectKernelVersion() (Version, error) { // Example format: Ubuntu 4.15.0-91.92-generic 4.15.18 // This method exists in the kernel itself, see d18acd15c // ("perf tools: Fix kernel version error in ubuntu"). - if pvs, err := ioutil.ReadFile("/proc/version_signature"); err == nil { + if pvs, err := os.ReadFile("/proc/version_signature"); err == nil { // If /proc/version_signature exists, failing to parse it is an error. // It only exists on Ubuntu, where the real patch level is not obtainable // through any other method. diff --git a/vendor/github.com/cilium/ebpf/link/freplace.go b/vendor/github.com/cilium/ebpf/link/freplace.go new file mode 100644 index 0000000000000..a698e1a9d30cb --- /dev/null +++ b/vendor/github.com/cilium/ebpf/link/freplace.go @@ -0,0 +1,88 @@ +package link + +import ( + "fmt" + + "github.com/cilium/ebpf" + "github.com/cilium/ebpf/internal/btf" +) + +type FreplaceLink struct { + RawLink +} + +// AttachFreplace attaches the given eBPF program to the function it replaces. +// +// The program and name can either be provided at link time, or can be provided +// at program load time. If they were provided at load time, they should be nil +// and empty respectively here, as they will be ignored by the kernel. +// Examples: +// +// AttachFreplace(dispatcher, "function", replacement) +// AttachFreplace(nil, "", replacement) +func AttachFreplace(targetProg *ebpf.Program, name string, prog *ebpf.Program) (*FreplaceLink, error) { + if (name == "") != (targetProg == nil) { + return nil, fmt.Errorf("must provide both or neither of name and targetProg: %w", errInvalidInput) + } + if prog == nil { + return nil, fmt.Errorf("prog cannot be nil: %w", errInvalidInput) + } + if prog.Type() != ebpf.Extension { + return nil, fmt.Errorf("eBPF program type %s is not an Extension: %w", prog.Type(), errInvalidInput) + } + + var ( + target int + typeID btf.TypeID + ) + if targetProg != nil { + info, err := targetProg.Info() + if err != nil { + return nil, err + } + btfID, ok := info.BTFID() + if !ok { + return nil, fmt.Errorf("could not get BTF ID for program %s: %w", info.Name, errInvalidInput) + } + btfHandle, err := btf.NewHandleFromID(btfID) + if err != nil { + return nil, err + } + defer btfHandle.Close() + + var function *btf.Func + if err := btfHandle.Spec().FindType(name, &function); err != nil { + return nil, err + } + + target = targetProg.FD() + typeID = function.ID() + } + + link, err := AttachRawLink(RawLinkOptions{ + Target: target, + Program: prog, + Attach: ebpf.AttachNone, + BTF: typeID, + }) + if err != nil { + return nil, err + } + + return &FreplaceLink{*link}, nil +} + +// Update implements the Link interface. +func (f *FreplaceLink) Update(new *ebpf.Program) error { + return fmt.Errorf("freplace update: %w", ErrNotSupported) +} + +// LoadPinnedFreplace loads a pinned iterator from a bpffs. +func LoadPinnedFreplace(fileName string, opts *ebpf.LoadPinOptions) (*FreplaceLink, error) { + link, err := LoadPinnedRawLink(fileName, TracingType, opts) + if err != nil { + return nil, err + } + + return &FreplaceLink{*link}, err +} diff --git a/vendor/github.com/cilium/ebpf/link/kprobe.go b/vendor/github.com/cilium/ebpf/link/kprobe.go index ea71d6d608a82..b6577b5a9925c 100644 --- a/vendor/github.com/cilium/ebpf/link/kprobe.go +++ b/vendor/github.com/cilium/ebpf/link/kprobe.go @@ -5,7 +5,6 @@ import ( "crypto/rand" "errors" "fmt" - "io/ioutil" "os" "path/filepath" "runtime" @@ -72,10 +71,11 @@ func (pt probeType) RetprobeBit() (uint64, error) { // given kernel symbol starts executing. See /proc/kallsyms for available // symbols. For example, printk(): // -// Kprobe("printk", prog) +// kp, err := Kprobe("printk", prog) // -// The resulting Link must be Closed during program shutdown to avoid leaking -// system resources. +// Losing the reference to the resulting Link (kp) will close the Kprobe +// and prevent further execution of prog. The Link must be Closed during +// program shutdown to avoid leaking system resources. func Kprobe(symbol string, prog *ebpf.Program) (Link, error) { k, err := kprobe(symbol, prog, false) if err != nil { @@ -95,10 +95,11 @@ func Kprobe(symbol string, prog *ebpf.Program) (Link, error) { // before the given kernel symbol exits, with the function stack left intact. // See /proc/kallsyms for available symbols. For example, printk(): // -// Kretprobe("printk", prog) +// kp, err := Kretprobe("printk", prog) // -// The resulting Link must be Closed during program shutdown to avoid leaking -// system resources. +// Losing the reference to the resulting Link (kp) will close the Kretprobe +// and prevent further execution of prog. The Link must be Closed during +// program shutdown to avoid leaking system resources. func Kretprobe(symbol string, prog *ebpf.Program) (Link, error) { k, err := kprobe(symbol, prog, true) if err != nil { @@ -157,7 +158,7 @@ func kprobe(symbol string, prog *ebpf.Program, ret bool) (*perfEvent, error) { // pmuKprobe opens a perf event based on the kprobe PMU. // Returns os.ErrNotExist if the given symbol does not exist in the kernel. func pmuKprobe(symbol string, ret bool) (*perfEvent, error) { - return pmuProbe(kprobeType, symbol, "", 0, ret) + return pmuProbe(kprobeType, symbol, "", 0, perfAllThreads, ret) } // pmuProbe opens a perf event based on a Performance Monitoring Unit. @@ -167,7 +168,7 @@ func pmuKprobe(symbol string, ret bool) (*perfEvent, error) { // 33ea4b24277b "perf/core: Implement the 'perf_uprobe' PMU" // // Returns ErrNotSupported if the kernel doesn't support perf_[k,u]probe PMU -func pmuProbe(typ probeType, symbol, path string, offset uint64, ret bool) (*perfEvent, error) { +func pmuProbe(typ probeType, symbol, path string, offset uint64, pid int, ret bool) (*perfEvent, error) { // Getting the PMU type will fail if the kernel doesn't support // the perf_[k,u]probe PMU. et, err := getPMUEventType(typ) @@ -191,7 +192,7 @@ func pmuProbe(typ probeType, symbol, path string, offset uint64, ret bool) (*per switch typ { case kprobeType: // Create a pointer to a NUL-terminated string for the kernel. - sp, err := unsafeStringPtr(symbol) + sp, err = unsafeStringPtr(symbol) if err != nil { return nil, err } @@ -202,7 +203,7 @@ func pmuProbe(typ probeType, symbol, path string, offset uint64, ret bool) (*per Config: config, // Retprobe flag } case uprobeType: - sp, err := unsafeStringPtr(path) + sp, err = unsafeStringPtr(path) if err != nil { return nil, err } @@ -220,7 +221,7 @@ func pmuProbe(typ probeType, symbol, path string, offset uint64, ret bool) (*per } } - fd, err := unix.PerfEventOpen(&attr, perfAllThreads, 0, -1, unix.PERF_FLAG_FD_CLOEXEC) + fd, err := unix.PerfEventOpen(&attr, pid, 0, -1, unix.PERF_FLAG_FD_CLOEXEC) // Since commit 97c753e62e6c, ENOENT is correctly returned instead of EINVAL // when trying to create a kretprobe for a missing symbol. Make sure ENOENT @@ -228,6 +229,11 @@ func pmuProbe(typ probeType, symbol, path string, offset uint64, ret bool) (*per if errors.Is(err, os.ErrNotExist) || errors.Is(err, unix.EINVAL) { return nil, fmt.Errorf("symbol '%s' not found: %w", symbol, os.ErrNotExist) } + // Since at least commit cb9a19fe4aa51, ENOTSUPP is returned + // when attempting to set a uprobe on a trap instruction. + if errors.Is(err, unix.ENOTSUPP) { + return nil, fmt.Errorf("failed setting uprobe on offset %#x (possible trap insn): %w", offset, err) + } if err != nil { return nil, fmt.Errorf("opening perf event: %w", err) } @@ -246,7 +252,7 @@ func pmuProbe(typ probeType, symbol, path string, offset uint64, ret bool) (*per // tracefsKprobe creates a Kprobe tracefs entry. func tracefsKprobe(symbol string, ret bool) (*perfEvent, error) { - return tracefsProbe(kprobeType, symbol, "", 0, ret) + return tracefsProbe(kprobeType, symbol, "", 0, perfAllThreads, ret) } // tracefsProbe creates a trace event by writing an entry to /[k,u]probe_events. @@ -255,7 +261,7 @@ func tracefsKprobe(symbol string, ret bool) (*perfEvent, error) { // Path and offset are only set in the case of uprobe(s) and are used to set // the executable/library path on the filesystem and the offset where the probe is inserted. // A perf event is then opened on the newly-created trace event and returned to the caller. -func tracefsProbe(typ probeType, symbol, path string, offset uint64, ret bool) (*perfEvent, error) { +func tracefsProbe(typ probeType, symbol, path string, offset uint64, pid int, ret bool) (*perfEvent, error) { // Generate a random string for each trace event we attempt to create. // This value is used as the 'group' token in tracefs to allow creating // multiple kprobe trace events with the same name. @@ -288,7 +294,7 @@ func tracefsProbe(typ probeType, symbol, path string, offset uint64, ret bool) ( } // Kprobes are ephemeral tracepoints and share the same perf event type. - fd, err := openTracepointPerfEvent(tid) + fd, err := openTracepointPerfEvent(tid, pid) if err != nil { return nil, err } @@ -413,7 +419,7 @@ func probePrefix(ret bool) string { func determineRetprobeBit(typ probeType) (uint64, error) { p := filepath.Join("/sys/bus/event_source/devices/", typ.String(), "/format/retprobe") - data, err := ioutil.ReadFile(p) + data, err := os.ReadFile(p) if err != nil { return 0, err } diff --git a/vendor/github.com/cilium/ebpf/link/link.go b/vendor/github.com/cilium/ebpf/link/link.go index 16cfff415dd40..4926584696bb9 100644 --- a/vendor/github.com/cilium/ebpf/link/link.go +++ b/vendor/github.com/cilium/ebpf/link/link.go @@ -6,6 +6,7 @@ import ( "github.com/cilium/ebpf" "github.com/cilium/ebpf/internal" + "github.com/cilium/ebpf/internal/btf" ) var ErrNotSupported = internal.ErrNotSupported @@ -29,8 +30,8 @@ type Link interface { // Close frees resources. // - // The link will be broken unless it has been pinned. A link - // may continue past the lifetime of the process if Close is + // The link will be broken unless it has been successfully pinned. + // A link may continue past the lifetime of the process if Close is // not called. Close() error @@ -49,6 +50,8 @@ type RawLinkOptions struct { Program *ebpf.Program // Attach must match the attach type of Program. Attach ebpf.AttachType + // BTF is the BTF of the attachment target. + BTF btf.TypeID } // RawLinkInfo contains metadata on a link. @@ -83,9 +86,10 @@ func AttachRawLink(opts RawLinkOptions) (*RawLink, error) { } attr := bpfLinkCreateAttr{ - targetFd: uint32(opts.Target), - progFd: uint32(progFd), - attachType: opts.Attach, + targetFd: uint32(opts.Target), + progFd: uint32(progFd), + attachType: opts.Attach, + targetBTFID: uint32(opts.BTF), } fd, err := bpfLinkCreate(&attr) if err != nil { diff --git a/vendor/github.com/cilium/ebpf/link/perf_event.go b/vendor/github.com/cilium/ebpf/link/perf_event.go index 5267a47ec9bbd..7e0443a75cb0b 100644 --- a/vendor/github.com/cilium/ebpf/link/perf_event.go +++ b/vendor/github.com/cilium/ebpf/link/perf_event.go @@ -4,7 +4,6 @@ import ( "bytes" "errors" "fmt" - "io/ioutil" "os" "path/filepath" "regexp" @@ -236,7 +235,7 @@ func getPMUEventType(typ probeType) (uint64, error) { // openTracepointPerfEvent opens a tracepoint-type perf event. System-wide // [k,u]probes created by writing to /[k,u]probe_events are tracepoints // behind the scenes, and can be attached to using these perf events. -func openTracepointPerfEvent(tid uint64) (*internal.FD, error) { +func openTracepointPerfEvent(tid uint64, pid int) (*internal.FD, error) { attr := unix.PerfEventAttr{ Type: unix.PERF_TYPE_TRACEPOINT, Config: tid, @@ -245,7 +244,7 @@ func openTracepointPerfEvent(tid uint64) (*internal.FD, error) { Wakeup: 1, } - fd, err := unix.PerfEventOpen(&attr, perfAllThreads, 0, -1, unix.PERF_FLAG_FD_CLOEXEC) + fd, err := unix.PerfEventOpen(&attr, pid, 0, -1, unix.PERF_FLAG_FD_CLOEXEC) if err != nil { return nil, fmt.Errorf("opening tracepoint perf event: %w", err) } @@ -263,7 +262,7 @@ func uint64FromFile(base string, path ...string) (uint64, error) { return 0, fmt.Errorf("path '%s' attempts to escape base path '%s': %w", l, base, errInvalidInput) } - data, err := ioutil.ReadFile(p) + data, err := os.ReadFile(p) if err != nil { return 0, fmt.Errorf("reading file %s: %w", p, err) } diff --git a/vendor/github.com/cilium/ebpf/link/syscalls.go b/vendor/github.com/cilium/ebpf/link/syscalls.go index 30e8a88050723..a61499438b220 100644 --- a/vendor/github.com/cilium/ebpf/link/syscalls.go +++ b/vendor/github.com/cilium/ebpf/link/syscalls.go @@ -88,10 +88,11 @@ var haveProgAttachReplace = internal.FeatureTest("BPF_PROG_ATTACH atomic replace }) type bpfLinkCreateAttr struct { - progFd uint32 - targetFd uint32 - attachType ebpf.AttachType - flags uint32 + progFd uint32 + targetFd uint32 + attachType ebpf.AttachType + flags uint32 + targetBTFID uint32 } func bpfLinkCreate(attr *bpfLinkCreateAttr) (*internal.FD, error) { diff --git a/vendor/github.com/cilium/ebpf/link/tracepoint.go b/vendor/github.com/cilium/ebpf/link/tracepoint.go index b8ae04bf0a058..7423df86b137d 100644 --- a/vendor/github.com/cilium/ebpf/link/tracepoint.go +++ b/vendor/github.com/cilium/ebpf/link/tracepoint.go @@ -11,7 +11,11 @@ import ( // tracepoints. The top-level directory is the group, the event's subdirectory // is the name. Example: // -// Tracepoint("syscalls", "sys_enter_fork", prog) +// tp, err := Tracepoint("syscalls", "sys_enter_fork", prog) +// +// Losing the reference to the resulting Link (tp) will close the Tracepoint +// and prevent further execution of prog. The Link must be Closed during +// program shutdown to avoid leaking system resources. // // Note that attaching eBPF programs to syscalls (sys_enter_*/sys_exit_*) is // only possible as of kernel 4.14 (commit cf5f5ce). @@ -34,7 +38,7 @@ func Tracepoint(group, name string, prog *ebpf.Program) (Link, error) { return nil, err } - fd, err := openTracepointPerfEvent(tid) + fd, err := openTracepointPerfEvent(tid, perfAllThreads) if err != nil { return nil, err } diff --git a/vendor/github.com/cilium/ebpf/link/uprobe.go b/vendor/github.com/cilium/ebpf/link/uprobe.go index 2bc395ee3cd2e..59170ce0468d2 100644 --- a/vendor/github.com/cilium/ebpf/link/uprobe.go +++ b/vendor/github.com/cilium/ebpf/link/uprobe.go @@ -25,14 +25,18 @@ var ( value uint64 err error }{} + + // ErrNoSymbol indicates that the given symbol was not found + // in the ELF symbols table. + ErrNoSymbol = errors.New("not found") ) // Executable defines an executable program on the filesystem. type Executable struct { // Path of the executable on the filesystem. path string - // Parsed ELF symbols and dynamic symbols. - symbols map[string]elf.Symbol + // Parsed ELF symbols and dynamic symbols offsets. + offsets map[string]uint64 } // UprobeOptions defines additional parameters that will be used @@ -41,6 +45,9 @@ type UprobeOptions struct { // Symbol offset. Must be provided in case of external symbols (shared libs). // If set, overrides the offset eventually parsed from the executable. Offset uint64 + // Only set the uprobe on the given process ID. Useful when tracing + // shared library calls or programs that have many running instances. + PID int } // To open a new Executable, use: @@ -64,42 +71,84 @@ func OpenExecutable(path string) (*Executable, error) { return nil, fmt.Errorf("parse ELF file: %w", err) } - var ex = Executable{ - path: path, - symbols: make(map[string]elf.Symbol), + if se.Type != elf.ET_EXEC && se.Type != elf.ET_DYN { + // ELF is not an executable or a shared object. + return nil, errors.New("the given file is not an executable or a shared object") } - if err := ex.addSymbols(se.Symbols); err != nil { - return nil, err + + ex := Executable{ + path: path, + offsets: make(map[string]uint64), } - if err := ex.addSymbols(se.DynamicSymbols); err != nil { + if err := ex.load(se); err != nil { return nil, err } return &ex, nil } -func (ex *Executable) addSymbols(f func() ([]elf.Symbol, error)) error { - // elf.Symbols and elf.DynamicSymbols return ErrNoSymbols if the section is not found. - syms, err := f() +func (ex *Executable) load(f *internal.SafeELFFile) error { + syms, err := f.Symbols() if err != nil && !errors.Is(err, elf.ErrNoSymbols) { return err } + + dynsyms, err := f.DynamicSymbols() + if err != nil && !errors.Is(err, elf.ErrNoSymbols) { + return err + } + + syms = append(syms, dynsyms...) + for _, s := range syms { if elf.ST_TYPE(s.Info) != elf.STT_FUNC { // Symbol not associated with a function or other executable code. continue } - ex.symbols[s.Name] = s + + off := s.Value + + // Loop over ELF segments. + for _, prog := range f.Progs { + // Skip uninteresting segments. + if prog.Type != elf.PT_LOAD || (prog.Flags&elf.PF_X) == 0 { + continue + } + + if prog.Vaddr <= s.Value && s.Value < (prog.Vaddr+prog.Memsz) { + // If the symbol value is contained in the segment, calculate + // the symbol offset. + // + // fn symbol offset = fn symbol VA - .text VA + .text offset + // + // stackoverflow.com/a/40249502 + off = s.Value - prog.Vaddr + prog.Off + break + } + } + + ex.offsets[s.Name] = off } + return nil } -func (ex *Executable) symbol(symbol string) (*elf.Symbol, error) { - if s, ok := ex.symbols[symbol]; ok { - return &s, nil +func (ex *Executable) offset(symbol string) (uint64, error) { + if off, ok := ex.offsets[symbol]; ok { + // Symbols with location 0 from section undef are shared library calls and + // are relocated before the binary is executed. Dynamic linking is not + // implemented by the library, so mark this as unsupported for now. + // + // Since only offset values are stored and not elf.Symbol, if the value is 0, + // assume it's an external symbol. + if off == 0 { + return 0, fmt.Errorf("cannot resolve %s library call '%s', "+ + "consider providing the offset via options: %w", ex.path, symbol, ErrNotSupported) + } + return off, nil } - return nil, fmt.Errorf("symbol %s not found", symbol) + return 0, fmt.Errorf("symbol %s: %w", symbol, ErrNoSymbol) } // Uprobe attaches the given eBPF program to a perf event that fires when the @@ -112,11 +161,14 @@ func (ex *Executable) symbol(symbol string) (*elf.Symbol, error) { // When using symbols which belongs to shared libraries, // an offset must be provided via options: // -// ex.Uprobe("main", prog, &UprobeOptions{Offset: 0x123}) +// up, err := ex.Uprobe("main", prog, &UprobeOptions{Offset: 0x123}) +// +// Losing the reference to the resulting Link (up) will close the Uprobe +// and prevent further execution of prog. The Link must be Closed during +// program shutdown to avoid leaking system resources. // -// The resulting Link must be Closed during program shutdown to avoid leaking -// system resources. Functions provided by shared libraries can currently not -// be traced and will result in an ErrNotSupported. +// Functions provided by shared libraries can currently not be traced and +// will result in an ErrNotSupported. func (ex *Executable) Uprobe(symbol string, prog *ebpf.Program, opts *UprobeOptions) (Link, error) { u, err := ex.uprobe(symbol, prog, opts, false) if err != nil { @@ -141,11 +193,14 @@ func (ex *Executable) Uprobe(symbol string, prog *ebpf.Program, opts *UprobeOpti // When using symbols which belongs to shared libraries, // an offset must be provided via options: // -// ex.Uretprobe("main", prog, &UprobeOptions{Offset: 0x123}) +// up, err := ex.Uretprobe("main", prog, &UprobeOptions{Offset: 0x123}) +// +// Losing the reference to the resulting Link (up) will close the Uprobe +// and prevent further execution of prog. The Link must be Closed during +// program shutdown to avoid leaking system resources. // -// The resulting Link must be Closed during program shutdown to avoid leaking -// system resources. Functions provided by shared libraries can currently not -// be traced and will result in an ErrNotSupported. +// Functions provided by shared libraries can currently not be traced and +// will result in an ErrNotSupported. func (ex *Executable) Uretprobe(symbol string, prog *ebpf.Program, opts *UprobeOptions) (Link, error) { u, err := ex.uprobe(symbol, prog, opts, true) if err != nil { @@ -175,24 +230,20 @@ func (ex *Executable) uprobe(symbol string, prog *ebpf.Program, opts *UprobeOpti if opts != nil && opts.Offset != 0 { offset = opts.Offset } else { - sym, err := ex.symbol(symbol) + off, err := ex.offset(symbol) if err != nil { - return nil, fmt.Errorf("symbol '%s' not found: %w", symbol, err) - } - - // Symbols with location 0 from section undef are shared library calls and - // are relocated before the binary is executed. Dynamic linking is not - // implemented by the library, so mark this as unsupported for now. - if sym.Section == elf.SHN_UNDEF && sym.Value == 0 { - return nil, fmt.Errorf("cannot resolve %s library call '%s', "+ - "consider providing the offset via options: %w", ex.path, symbol, ErrNotSupported) + return nil, err } + offset = off + } - offset = sym.Value + pid := perfAllThreads + if opts != nil && opts.PID != 0 { + pid = opts.PID } // Use uprobe PMU if the kernel has it available. - tp, err := pmuUprobe(symbol, ex.path, offset, ret) + tp, err := pmuUprobe(symbol, ex.path, offset, pid, ret) if err == nil { return tp, nil } @@ -201,7 +252,7 @@ func (ex *Executable) uprobe(symbol string, prog *ebpf.Program, opts *UprobeOpti } // Use tracefs if uprobe PMU is missing. - tp, err = tracefsUprobe(uprobeSanitizedSymbol(symbol), ex.path, offset, ret) + tp, err = tracefsUprobe(uprobeSanitizedSymbol(symbol), ex.path, offset, pid, ret) if err != nil { return nil, fmt.Errorf("creating trace event '%s:%s' in tracefs: %w", ex.path, symbol, err) } @@ -210,13 +261,13 @@ func (ex *Executable) uprobe(symbol string, prog *ebpf.Program, opts *UprobeOpti } // pmuUprobe opens a perf event based on the uprobe PMU. -func pmuUprobe(symbol, path string, offset uint64, ret bool) (*perfEvent, error) { - return pmuProbe(uprobeType, symbol, path, offset, ret) +func pmuUprobe(symbol, path string, offset uint64, pid int, ret bool) (*perfEvent, error) { + return pmuProbe(uprobeType, symbol, path, offset, pid, ret) } // tracefsUprobe creates a Uprobe tracefs entry. -func tracefsUprobe(symbol, path string, offset uint64, ret bool) (*perfEvent, error) { - return tracefsProbe(uprobeType, symbol, path, offset, ret) +func tracefsUprobe(symbol, path string, offset uint64, pid int, ret bool) (*perfEvent, error) { + return tracefsProbe(uprobeType, symbol, path, offset, pid, ret) } // uprobeSanitizedSymbol replaces every invalid characted for the tracefs api with an underscore. diff --git a/vendor/github.com/cilium/ebpf/linker.go b/vendor/github.com/cilium/ebpf/linker.go index 6c2efef9e42c8..f3b1629e70a88 100644 --- a/vendor/github.com/cilium/ebpf/linker.go +++ b/vendor/github.com/cilium/ebpf/linker.go @@ -4,7 +4,6 @@ import ( "fmt" "github.com/cilium/ebpf/asm" - "github.com/cilium/ebpf/internal/btf" ) // link resolves bpf-to-bpf calls. @@ -40,7 +39,7 @@ func link(prog *ProgramSpec, libs []*ProgramSpec) error { pending = append(pending, lib.Instructions) if prog.BTF != nil && lib.BTF != nil { - if err := btf.ProgramAppend(prog.BTF, lib.BTF); err != nil { + if err := prog.BTF.Append(lib.BTF); err != nil { return fmt.Errorf("linking BTF of %s: %w", lib.Name, err) } } @@ -136,5 +135,25 @@ func fixupJumpsAndCalls(insns asm.Instructions) error { } } + // fixupBPFCalls replaces bpf_probe_read_{kernel,user}[_str] with bpf_probe_read[_str] on older kernels + // https://github.com/libbpf/libbpf/blob/master/src/libbpf.c#L6009 + iter = insns.Iterate() + for iter.Next() { + ins := iter.Ins + if !ins.IsBuiltinCall() { + continue + } + switch asm.BuiltinFunc(ins.Constant) { + case asm.FnProbeReadKernel, asm.FnProbeReadUser: + if err := haveProbeReadKernel(); err != nil { + ins.Constant = int64(asm.FnProbeRead) + } + case asm.FnProbeReadKernelStr, asm.FnProbeReadUserStr: + if err := haveProbeReadKernel(); err != nil { + ins.Constant = int64(asm.FnProbeReadStr) + } + } + } + return nil } diff --git a/vendor/github.com/cilium/ebpf/map.go b/vendor/github.com/cilium/ebpf/map.go index f257d88c03e3c..cca387ead0192 100644 --- a/vendor/github.com/cilium/ebpf/map.go +++ b/vendor/github.com/cilium/ebpf/map.go @@ -1,6 +1,7 @@ package ebpf import ( + "bytes" "errors" "fmt" "io" @@ -65,6 +66,11 @@ type MapSpec struct { // InnerMap is used as a template for ArrayOfMaps and HashOfMaps InnerMap *MapSpec + // Extra trailing bytes found in the ELF map definition when using structs + // larger than libbpf's bpf_map_def. Must be empty before instantiating + // the MapSpec into a Map. + Extra bytes.Reader + // The BTF associated with this map. BTF *btf.Map } @@ -82,9 +88,12 @@ func (ms *MapSpec) Copy() *MapSpec { } cpy := *ms + cpy.Contents = make([]MapKV, len(ms.Contents)) copy(cpy.Contents, ms.Contents) + cpy.InnerMap = ms.InnerMap.Copy() + return &cpy } @@ -188,14 +197,24 @@ func NewMap(spec *MapSpec) (*Map, error) { // // 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 NewMapWithOptions. +// by calling rlimit.RemoveMemlock() prior to calling NewMapWithOptions. // // May return an error wrapping ErrMapIncompatible. func NewMapWithOptions(spec *MapSpec, opts MapOptions) (*Map, error) { handles := newHandleCache() defer handles.close() - return newMapWithOptions(spec, opts, handles) + m, err := newMapWithOptions(spec, opts, handles) + if err != nil { + return nil, fmt.Errorf("creating map: %w", err) + } + + err = m.finalize(spec) + if err != nil { + return nil, fmt.Errorf("populating map: %w", err) + } + + return m, nil } func newMapWithOptions(spec *MapSpec, opts MapOptions, handles *handleCache) (_ *Map, err error) { @@ -207,8 +226,12 @@ func newMapWithOptions(spec *MapSpec, opts MapOptions, handles *handleCache) (_ switch spec.Pinning { case PinByName: - if spec.Name == "" || opts.PinPath == "" { - return nil, fmt.Errorf("pin by name: missing Name or PinPath") + if spec.Name == "" { + return nil, fmt.Errorf("pin by name: missing Name") + } + + if opts.PinPath == "" { + return nil, fmt.Errorf("pin by name: missing MapOptions.PinPath") } path := filepath.Join(opts.PinPath, spec.Name) @@ -244,16 +267,19 @@ func newMapWithOptions(spec *MapSpec, opts MapOptions, handles *handleCache) (_ return nil, errors.New("inner maps cannot be pinned") } - template, err := createMap(spec.InnerMap, nil, opts, handles) + template, err := spec.InnerMap.createMap(nil, opts, handles) if err != nil { - return nil, err + return nil, fmt.Errorf("inner map: %w", err) } defer template.Close() + // Intentionally skip populating and freezing (finalizing) + // the inner map template since it will be removed shortly. + innerFd = template.fd } - m, err := createMap(spec, innerFd, opts, handles) + m, err := spec.createMap(innerFd, opts, handles) if err != nil { return nil, err } @@ -269,7 +295,9 @@ func newMapWithOptions(spec *MapSpec, opts MapOptions, handles *handleCache) (_ return m, nil } -func createMap(spec *MapSpec, inner *internal.FD, opts MapOptions, handles *handleCache) (_ *Map, err error) { +// createMap validates the spec's properties and creates the map in the kernel +// using the given opts. It does not populate or freeze the map. +func (spec *MapSpec) createMap(inner *internal.FD, opts MapOptions, handles *handleCache) (_ *Map, err error) { closeOnError := func(closer io.Closer) { if err != nil { closer.Close() @@ -278,10 +306,16 @@ func createMap(spec *MapSpec, inner *internal.FD, opts MapOptions, handles *hand spec = spec.Copy() + // Kernels 4.13 through 5.4 used a struct bpf_map_def that contained + // additional 'inner_map_idx' and later 'numa_node' fields. + // In order to support loading these definitions, tolerate the presence of + // extra bytes, but require them to be zeroes. + if _, err := io.Copy(internal.DiscardZeroes{}, &spec.Extra); err != nil { + return nil, errors.New("extra contains unhandled non-zero bytes, drain before creating map") + } + switch spec.Type { - case ArrayOfMaps: - fallthrough - case HashOfMaps: + case ArrayOfMaps, HashOfMaps: if err := haveNestedMaps(); err != nil { return nil, err } @@ -350,7 +384,7 @@ func createMap(spec *MapSpec, inner *internal.FD, opts MapOptions, handles *hand var btfDisabled bool if spec.BTF != nil { - handle, err := handles.btfHandle(btf.MapSpec(spec.BTF)) + handle, err := handles.btfHandle(spec.BTF.Spec) btfDisabled = errors.Is(err, btf.ErrNotSupported) if err != nil && !btfDisabled { return nil, fmt.Errorf("load BTF: %w", err) @@ -358,15 +392,15 @@ func createMap(spec *MapSpec, inner *internal.FD, opts MapOptions, handles *hand if handle != nil { attr.BTFFd = uint32(handle.FD()) - attr.BTFKeyTypeID = uint32(btf.MapKey(spec.BTF).ID()) - attr.BTFValueTypeID = uint32(btf.MapValue(spec.BTF).ID()) + attr.BTFKeyTypeID = uint32(spec.BTF.Key.ID()) + attr.BTFValueTypeID = uint32(spec.BTF.Value.ID()) } } fd, err := internal.BPFMapCreate(&attr) if err != nil { if errors.Is(err, unix.EPERM) { - return nil, fmt.Errorf("map create: RLIMIT_MEMLOCK may be too low: %w", err) + return nil, fmt.Errorf("map create: %w (MEMLOCK bay be too low, consider rlimit.RemoveMemlock)", err) } if btfDisabled { return nil, fmt.Errorf("map create without BTF: %w", err) @@ -380,19 +414,11 @@ func createMap(spec *MapSpec, inner *internal.FD, opts MapOptions, handles *hand return nil, fmt.Errorf("map create: %w", err) } - if err := m.populate(spec.Contents); err != nil { - return nil, fmt.Errorf("map create: can't set initial contents: %w", err) - } - - if spec.Freeze { - if err := m.Freeze(); err != nil { - return nil, fmt.Errorf("can't freeze map: %w", err) - } - } - return m, nil } +// newMap allocates and returns a new Map structure. +// Sets the fullValueSize on per-CPU maps. func newMap(fd *internal.FD, name string, typ MapType, keySize, valueSize, maxEntries, flags uint32) (*Map, error) { m := &Map{ name, @@ -415,7 +441,7 @@ func newMap(fd *internal.FD, name string, typ MapType, keySize, valueSize, maxEn return nil, err } - m.fullValueSize = align(int(valueSize), 8) * possibleCPUs + m.fullValueSize = internal.Align(int(valueSize), 8) * possibleCPUs return m, nil } @@ -892,12 +918,21 @@ func (m *Map) Freeze() error { return nil } -func (m *Map) populate(contents []MapKV) error { - for _, kv := range contents { +// finalize populates the Map according to the Contents specified +// in spec and freezes the Map if requested by spec. +func (m *Map) finalize(spec *MapSpec) error { + for _, kv := range spec.Contents { if err := m.Put(kv.Key, kv.Value); err != nil { - return fmt.Errorf("key %v: %w", kv.Key, err) + return fmt.Errorf("putting value: key %v: %w", kv.Key, err) } } + + if spec.Freeze { + if err := m.Freeze(); err != nil { + return fmt.Errorf("freezing map: %w", err) + } + } + return nil } @@ -1212,7 +1247,7 @@ func MapGetNextID(startID MapID) (MapID, error) { // // 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)) + fd, err := internal.BPFObjGetFDByID(internal.BPF_MAP_GET_FD_BY_ID, uint32(id)) if err != nil { return nil, err } diff --git a/vendor/github.com/cilium/ebpf/marshalers.go b/vendor/github.com/cilium/ebpf/marshalers.go index f2610eff9c781..e461d673d7014 100644 --- a/vendor/github.com/cilium/ebpf/marshalers.go +++ b/vendor/github.com/cilium/ebpf/marshalers.go @@ -8,6 +8,7 @@ import ( "fmt" "reflect" "runtime" + "sync" "unsafe" "github.com/cilium/ebpf/internal" @@ -39,6 +40,10 @@ func marshalPtr(data interface{}, length int) (internal.Pointer, error) { // Returns an error if the given value isn't representable in exactly // length bytes. func marshalBytes(data interface{}, length int) (buf []byte, err error) { + if data == nil { + return nil, errors.New("can't marshal a nil value") + } + switch value := data.(type) { case encoding.BinaryMarshaler: buf, err = value.MarshalBinary() @@ -77,22 +82,30 @@ func makeBuffer(dst interface{}, length int) (internal.Pointer, []byte) { return internal.NewSlicePointer(buf), buf } +var bytesReaderPool = sync.Pool{ + New: func() interface{} { + return new(bytes.Reader) + }, +} + // unmarshalBytes converts a byte buffer into an arbitrary value. // // Prefer using Map.unmarshalKey and Map.unmarshalValue if possible, since // those have special cases that allow more types to be encoded. +// +// The common int32 and int64 types are directly handled to avoid +// unnecessary heap allocations as happening in the default case. func unmarshalBytes(data interface{}, buf []byte) error { switch value := data.(type) { case unsafe.Pointer: - // This could be solved in Go 1.17 by unsafe.Slice instead. (https://github.com/golang/go/issues/19367) - // We could opt for removing unsafe.Pointer support in the lib as well. - sh := &reflect.SliceHeader{ //nolint:govet - Data: uintptr(value), - Len: len(buf), - Cap: len(buf), - } + var dst []byte + // Use unsafe.Slice when we drop support for pre1.17 (https://github.com/golang/go/issues/19367) + // We could opt for removing unsafe.Pointer support in the lib as well + sh := (*reflect.SliceHeader)(unsafe.Pointer(&dst)) + sh.Data = uintptr(value) + sh.Len = len(buf) + sh.Cap = len(buf) - dst := *(*[]byte)(unsafe.Pointer(sh)) copy(dst, buf) runtime.KeepAlive(value) return nil @@ -106,12 +119,38 @@ func unmarshalBytes(data interface{}, buf []byte) error { case *[]byte: *value = buf return nil + case *int32: + if len(buf) < 4 { + return errors.New("int32 requires 4 bytes") + } + *value = int32(internal.NativeEndian.Uint32(buf)) + return nil + case *uint32: + if len(buf) < 4 { + return errors.New("uint32 requires 4 bytes") + } + *value = internal.NativeEndian.Uint32(buf) + return nil + case *int64: + if len(buf) < 8 { + return errors.New("int64 requires 8 bytes") + } + *value = int64(internal.NativeEndian.Uint64(buf)) + return nil + case *uint64: + if len(buf) < 8 { + return errors.New("uint64 requires 8 bytes") + } + *value = internal.NativeEndian.Uint64(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) + rd := bytesReaderPool.Get().(*bytes.Reader) + rd.Reset(buf) + defer bytesReaderPool.Put(rd) if err := binary.Read(rd, internal.NativeEndian, value); err != nil { return fmt.Errorf("decoding %T: %v", value, err) } @@ -142,7 +181,7 @@ func marshalPerCPUValue(slice interface{}, elemLength int) (internal.Pointer, er return internal.Pointer{}, fmt.Errorf("per-CPU value exceeds number of CPUs") } - alignedElemLength := align(elemLength, 8) + alignedElemLength := internal.Align(elemLength, 8) buf := make([]byte, alignedElemLength*possibleCPUs) for i := 0; i < sliceLen; i++ { @@ -212,7 +251,3 @@ func unmarshalPerCPUValue(slicePtr interface{}, elemLength int, buf []byte) erro 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 index 13bdb6ddad1e2..3549a3fe3f0cb 100644 --- a/vendor/github.com/cilium/ebpf/prog.go +++ b/vendor/github.com/cilium/ebpf/prog.go @@ -57,16 +57,21 @@ 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 + // Name of a kernel data structure or function to attach to. Its + // interpretation depends on Type and AttachType. + AttachTo string + // The program to attach to. Must be provided manually. + AttachTarget *Program Instructions asm.Instructions + // Flags is passed to the kernel and specifies additional program // load attributes. Flags uint32 + // License of the program. Some helpers are only available if // the license is deemed compatible with the GPL. // @@ -146,7 +151,7 @@ func NewProgramWithOptions(spec *ProgramSpec, opts ProgramOptions) (*Program, er func newProgramWithOptions(spec *ProgramSpec, opts ProgramOptions, handles *handleCache) (*Program, error) { if len(spec.Instructions) == 0 { - return nil, errors.New("Instructions cannot be empty") + return nil, errors.New("instructions cannot be empty") } if spec.ByteOrder != nil && spec.ByteOrder != internal.NativeEndian { @@ -166,16 +171,16 @@ func newProgramWithOptions(spec *ProgramSpec, opts ProgramOptions, handles *hand kv = v.Kernel() } - attr := &bpfProgLoadAttr{ - progType: spec.Type, - progFlags: spec.Flags, - expectedAttachType: spec.AttachType, - license: internal.NewStringPointer(spec.License), - kernelVersion: kv, + attr := &internal.BPFProgLoadAttr{ + ProgType: uint32(spec.Type), + ProgFlags: spec.Flags, + ExpectedAttachType: uint32(spec.AttachType), + License: internal.NewStringPointer(spec.License), + KernelVersion: kv, } if haveObjName() == nil { - attr.progName = internal.NewBPFObjName(spec.Name) + attr.ProgName = internal.NewBPFObjName(spec.Name) } var err error @@ -190,35 +195,35 @@ func newProgramWithOptions(spec *ProgramSpec, opts ProgramOptions, handles *hand var btfDisabled bool var core btf.COREFixups if spec.BTF != nil { - core, err = btf.ProgramFixups(spec.BTF, targetBTF) + core, err = spec.BTF.Fixups(targetBTF) if err != nil { return nil, fmt.Errorf("CO-RE relocations: %w", err) } - handle, err := handles.btfHandle(btf.ProgramSpec(spec.BTF)) + handle, err := handles.btfHandle(spec.BTF.Spec()) btfDisabled = errors.Is(err, btf.ErrNotSupported) if err != nil && !btfDisabled { return nil, fmt.Errorf("load BTF: %w", err) } if handle != nil { - attr.progBTFFd = uint32(handle.FD()) + attr.ProgBTFFd = uint32(handle.FD()) - recSize, bytes, err := btf.ProgramLineInfos(spec.BTF) + recSize, bytes, err := spec.BTF.LineInfos() if err != nil { return nil, fmt.Errorf("get BTF line infos: %w", err) } - attr.lineInfoRecSize = recSize - attr.lineInfoCnt = uint32(uint64(len(bytes)) / uint64(recSize)) - attr.lineInfo = internal.NewSlicePointer(bytes) + attr.LineInfoRecSize = recSize + attr.LineInfoCnt = uint32(uint64(len(bytes)) / uint64(recSize)) + attr.LineInfo = internal.NewSlicePointer(bytes) - recSize, bytes, err = btf.ProgramFuncInfos(spec.BTF) + recSize, bytes, err = spec.BTF.FuncInfos() if err != nil { return nil, fmt.Errorf("get BTF function infos: %w", err) } - attr.funcInfoRecSize = recSize - attr.funcInfoCnt = uint32(uint64(len(bytes)) / uint64(recSize)) - attr.funcInfo = internal.NewSlicePointer(bytes) + attr.FuncInfoRecSize = recSize + attr.FuncInfoCnt = uint32(uint64(len(bytes)) / uint64(recSize)) + attr.FuncInfo = internal.NewSlicePointer(bytes) } } @@ -238,16 +243,41 @@ func newProgramWithOptions(spec *ProgramSpec, opts ProgramOptions, handles *hand } bytecode := buf.Bytes() - attr.instructions = internal.NewSlicePointer(bytecode) - attr.insCount = uint32(len(bytecode) / asm.InstructionSize) + attr.Instructions = internal.NewSlicePointer(bytecode) + attr.InsCount = uint32(len(bytecode) / asm.InstructionSize) if spec.AttachTo != "" { + if spec.AttachTarget != nil { + info, err := spec.AttachTarget.Info() + if err != nil { + return nil, fmt.Errorf("load target BTF: %w", err) + } + + btfID, ok := info.BTFID() + if !ok { + return nil, fmt.Errorf("load target BTF: no BTF info available") + } + btfHandle, err := btf.NewHandleFromID(btfID) + if err != nil { + return nil, fmt.Errorf("load target BTF: %w", err) + } + defer btfHandle.Close() + + targetBTF = btfHandle.Spec() + if err != nil { + return nil, fmt.Errorf("load target BTF: %w", err) + } + } + target, err := resolveBTFType(targetBTF, spec.AttachTo, spec.Type, spec.AttachType) if err != nil { return nil, err } if target != nil { - attr.attachBTFID = target.ID() + attr.AttachBTFID = uint32(target.ID()) + } + if spec.AttachTarget != nil { + attr.AttachProgFd = uint32(spec.AttachTarget.FD()) } } @@ -259,12 +289,12 @@ func newProgramWithOptions(spec *ProgramSpec, opts ProgramOptions, handles *hand 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) + attr.LogLevel = opts.LogLevel + attr.LogSize = uint32(len(logBuf)) + attr.LogBuf = internal.NewSlicePointer(logBuf) } - fd, err := bpfProgLoad(attr) + fd, err := internal.BPFProgLoad(attr) if err == nil { return &Program{internal.CString(logBuf), fd, spec.Name, "", spec.Type}, nil } @@ -273,17 +303,20 @@ func newProgramWithOptions(spec *ProgramSpec, opts ProgramOptions, handles *hand if opts.LogLevel == 0 && opts.LogSize >= 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) + attr.LogLevel = 1 + attr.LogSize = uint32(len(logBuf)) + attr.LogBuf = internal.NewSlicePointer(logBuf) - _, logErr = bpfProgLoad(attr) + fd, logErr = internal.BPFProgLoad(attr) + if logErr == nil { + fd.Close() + } } if errors.Is(logErr, unix.EPERM) && logBuf[0] == 0 { // EPERM due to RLIMIT_MEMLOCK happens before the verifier, so we can // check that the log is empty to reduce false positives. - return nil, fmt.Errorf("load program: RLIMIT_MEMLOCK may be too low: %w", logErr) + return nil, fmt.Errorf("load program: %w (MEMLOCK bay be too low, consider rlimit.RemoveMemlock)", logErr) } err = internal.ErrorWithLog(err, logBuf, logErr) @@ -310,7 +343,7 @@ func NewProgramFromFD(fd int) (*Program, error) { // // 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)) + fd, err := internal.BPFObjGetFDByID(internal.BPF_PROG_GET_FD_BY_ID, uint32(id)) if err != nil { return nil, fmt.Errorf("get program by id: %w", err) } @@ -677,45 +710,44 @@ func ProgramGetNextID(startID ProgramID) (ProgramID, error) { // // Deprecated: use ProgramInfo.ID() instead. func (p *Program) ID() (ProgramID, error) { - info, err := bpfGetProgInfoByFD(p.fd) + info, err := bpfGetProgInfoByFD(p.fd, nil) if err != nil { return ProgramID(0), err } return ProgramID(info.id), nil } -func resolveBTFType(kernel *btf.Spec, name string, progType ProgramType, attachType AttachType) (btf.Type, error) { +func resolveBTFType(spec *btf.Spec, name string, progType ProgramType, attachType AttachType) (btf.Type, error) { type match struct { p ProgramType a AttachType } - var target btf.Type var typeName, featureName string switch (match{progType, attachType}) { case match{LSM, AttachLSMMac}: - target = new(btf.Func) typeName = "bpf_lsm_" + name featureName = name + " LSM hook" - case match{Tracing, AttachTraceIter}: - target = new(btf.Func) typeName = "bpf_iter_" + name featureName = name + " iterator" - + case match{Extension, AttachNone}: + typeName = name + featureName = fmt.Sprintf("freplace %s", name) default: return nil, nil } - if kernel == nil { + if spec == nil { var err error - kernel, err = btf.LoadKernelSpec() + spec, err = btf.LoadKernelSpec() if err != nil { return nil, fmt.Errorf("load kernel spec: %w", err) } } - err := kernel.FindType(typeName, target) + var target *btf.Func + err := spec.FindType(typeName, &target) if errors.Is(err, btf.ErrNotFound) { return nil, &internal.UnsupportedFeatureError{ Name: featureName, @@ -724,5 +756,6 @@ func resolveBTFType(kernel *btf.Spec, name string, progType ProgramType, attachT if err != nil { return nil, fmt.Errorf("resolve BTF for %s: %w", featureName, err) } + return target, nil } diff --git a/vendor/github.com/cilium/ebpf/run-tests.sh b/vendor/github.com/cilium/ebpf/run-tests.sh index e2437beed2a56..a079edc7e18c1 100644 --- a/vendor/github.com/cilium/ebpf/run-tests.sh +++ b/vendor/github.com/cilium/ebpf/run-tests.sh @@ -5,7 +5,7 @@ # Run all tests on a 5.4 kernel # $ ./run-tests.sh 5.4 # Run a subset of tests: -# $ ./run-tests.sh 5.4 go test ./link +# $ ./run-tests.sh 5.4 ./link set -euo pipefail @@ -48,15 +48,17 @@ if [[ "${1:-}" = "--exec-vm" ]]; then rm "${output}/fake-stdin" fi - $sudo virtme-run --kimg "${input}/bzImage" --memory 768M --pwd \ - --rwdir="${testdir}=${testdir}" \ - --rodir=/run/input="${input}" \ - --rwdir=/run/output="${output}" \ - --script-sh "PATH=\"$PATH\" \"$script\" --exec-test $cmd" \ - --qemu-opts -smp 2 # need at least two CPUs for some tests + if ! $sudo virtme-run --kimg "${input}/bzImage" --memory 768M --pwd \ + --rwdir="${testdir}=${testdir}" \ + --rodir=/run/input="${input}" \ + --rwdir=/run/output="${output}" \ + --script-sh "PATH=\"$PATH\" \"$script\" --exec-test $cmd" \ + --kopt possible_cpus=2; then # need at least two CPUs for some tests + exit 23 + fi if [[ ! -e "${output}/success" ]]; then - exit 1 + exit 42 fi $sudo rm -r "$output" @@ -74,7 +76,7 @@ elif [[ "${1:-}" = "--exec-test" ]]; then dmesg -C if ! "$@"; then dmesg - exit 1 + exit 1 # this return code is "swallowed" by qemu fi touch "/run/output/success" exit 0 @@ -108,7 +110,7 @@ else echo "No selftests found, disabling" fi -args=(-v -short -coverpkg=./... -coverprofile=coverage.out -count 1 ./...) +args=(-short -coverpkg=./... -coverprofile=coverage.out -count 1 ./...) if (( $# > 0 )); then args=("$@") fi diff --git a/vendor/github.com/cilium/ebpf/syscalls.go b/vendor/github.com/cilium/ebpf/syscalls.go index f5a38549bb7cf..f8cb5f0e0cd6f 100644 --- a/vendor/github.com/cilium/ebpf/syscalls.go +++ b/vendor/github.com/cilium/ebpf/syscalls.go @@ -1,13 +1,14 @@ package ebpf import ( + "bytes" "errors" "fmt" "os" "unsafe" + "github.com/cilium/ebpf/asm" "github.com/cilium/ebpf/internal" - "github.com/cilium/ebpf/internal/btf" "github.com/cilium/ebpf/internal/unix" ) @@ -73,30 +74,6 @@ type bpfMapInfo struct { btf_value_type_id uint32 } -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 internal.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 { prog_type uint32 id uint32 @@ -107,7 +84,7 @@ type bpfProgInfo struct { xlated_prog_insns internal.Pointer load_time uint64 // since 4.15 cb4d2b3f03d8 created_by_uid uint32 - nr_map_ids uint32 + nr_map_ids uint32 // since 4.15 cb4d2b3f03d8 map_ids internal.Pointer name internal.BPFObjName // since 4.15 067cae47771c ifindex uint32 @@ -145,11 +122,6 @@ type bpfProgTestRunAttr struct { duration uint32 } -type bpfGetFDByIDAttr struct { - id uint32 - next uint32 -} - type bpfMapFreezeAttr struct { mapFd uint32 } @@ -160,23 +132,6 @@ type bpfObjGetNextIDAttr struct { 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 errors.Is(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 @@ -372,6 +327,10 @@ func wrapMapError(err error) error { return internal.SyscallError(ErrNotSupported, unix.ENOTSUPP) } + if errors.Is(err, unix.E2BIG) { + return fmt.Errorf("key too big for map: %w", err) + } + return err } @@ -388,8 +347,13 @@ func bpfMapFreeze(m *internal.FD) error { return err } -func bpfGetProgInfoByFD(fd *internal.FD) (*bpfProgInfo, error) { +func bpfGetProgInfoByFD(fd *internal.FD, ids []MapID) (*bpfProgInfo, error) { var info bpfProgInfo + if len(ids) > 0 { + info.nr_map_ids = uint32(len(ids)) + info.map_ids = internal.NewPointer(unsafe.Pointer(&ids[0])) + } + if err := internal.BPFObjGetInfoByFD(fd, unsafe.Pointer(&info), unsafe.Sizeof(info)); err != nil { return nil, fmt.Errorf("can't get program info: %w", err) } @@ -471,10 +435,30 @@ var haveBatchAPI = internal.FeatureTest("map batch api", "5.6", func() error { return nil }) -func bpfObjGetFDByID(cmd internal.BPFCmd, id uint32) (*internal.FD, error) { - attr := bpfGetFDByIDAttr{ - id: id, +var haveProbeReadKernel = internal.FeatureTest("bpf_probe_read_kernel", "5.5", func() error { + insns := asm.Instructions{ + asm.Mov.Reg(asm.R1, asm.R10), + asm.Add.Imm(asm.R1, -8), + asm.Mov.Imm(asm.R2, 8), + asm.Mov.Imm(asm.R3, 0), + asm.FnProbeReadKernel.Call(), + asm.Return(), + } + buf := bytes.NewBuffer(make([]byte, 0, len(insns)*asm.InstructionSize)) + if err := insns.Marshal(buf, internal.NativeEndian); err != nil { + return err } - ptr, err := internal.BPF(cmd, unsafe.Pointer(&attr), unsafe.Sizeof(attr)) - return internal.NewFD(uint32(ptr)), err -} + bytecode := buf.Bytes() + + fd, err := internal.BPFProgLoad(&internal.BPFProgLoadAttr{ + ProgType: uint32(Kprobe), + License: internal.NewStringPointer("GPL"), + Instructions: internal.NewSlicePointer(bytecode), + InsCount: uint32(len(bytecode) / asm.InstructionSize), + }) + if err != nil { + return internal.ErrNotSupported + } + _ = fd.Close() + return nil +}) diff --git a/vendor/github.com/cilium/ebpf/types.go b/vendor/github.com/cilium/ebpf/types.go index 441a82fe4c1c6..84b83f9f9855d 100644 --- a/vendor/github.com/cilium/ebpf/types.go +++ b/vendor/github.com/cilium/ebpf/types.go @@ -4,12 +4,17 @@ import ( "github.com/cilium/ebpf/internal/unix" ) -//go:generate stringer -output types_string.go -type=MapType,ProgramType,AttachType,PinType +//go:generate stringer -output types_string.go -type=MapType,ProgramType,PinType // MapType indicates the type map structure // that will be initialized in the kernel. type MapType uint32 +// Max returns the latest supported MapType. +func (_ MapType) Max() MapType { + return maxMapType - 1 +} + // All the various map types that can be created const ( UnspecifiedMap MapType = iota @@ -85,15 +90,28 @@ const ( SkStorage // DevMapHash - Hash-based indexing scheme for references to network devices. DevMapHash - StructOpts + // StructOpsMap - This map holds a kernel struct with its function pointer implemented in a BPF + // program. + StructOpsMap + // RingBuf - Similar to PerfEventArray, but shared across all CPUs. RingBuf + // InodeStorage - Specialized local storage map for inodes. InodeStorage + // TaskStorage - Specialized local storage map for task_struct. TaskStorage + // maxMapType - Bound enum of MapTypes, has to be last in enum. + maxMapType ) +// Deprecated: StructOpts was a typo, use StructOpsMap instead. +// +// Declared as a variable to prevent stringer from picking it up +// as an enum value. +var StructOpts MapType = StructOpsMap + // hasPerCPUValue returns true if the Map stores a value per CPU. func (mt MapType) hasPerCPUValue() bool { - return mt == PerCPUHash || mt == PerCPUArray || mt == LRUCPUHash + return mt == PerCPUHash || mt == PerCPUArray || mt == LRUCPUHash || mt == PerCPUCGroupStorage } // canStoreMap returns true if the map type accepts a map fd @@ -111,6 +129,11 @@ func (mt MapType) canStoreProgram() bool { // ProgramType of the eBPF program type ProgramType uint32 +// Max return the latest supported ProgramType. +func (_ ProgramType) Max() ProgramType { + return maxProgramType - 1 +} + // eBPF program types const ( UnspecifiedProgram ProgramType = iota @@ -144,6 +167,7 @@ const ( Extension LSM SkLookup + maxProgramType ) // AttachType of the eBPF program, needed to differentiate allowed context accesses in @@ -151,6 +175,8 @@ const ( // Will cause invalid argument (EINVAL) at program load time if set incorrectly. type AttachType uint32 +//go:generate stringer -type AttachType -trimprefix Attach + // AttachNone is an alias for AttachCGroupInetIngress for readability reasons. const AttachNone AttachType = 0 @@ -193,6 +219,10 @@ const ( AttachXDPCPUMap AttachSkLookup AttachXDP + AttachSkSKBVerdict + AttachSkReuseportSelect + AttachSkReuseportSelectOrMigrate + AttachPerfEvent ) // AttachFlags of the eBPF program used in BPF_PROG_ATTACH command diff --git a/vendor/github.com/cilium/ebpf/types_string.go b/vendor/github.com/cilium/ebpf/types_string.go index c25f7656479bf..81cbc9efde0c5 100644 --- a/vendor/github.com/cilium/ebpf/types_string.go +++ b/vendor/github.com/cilium/ebpf/types_string.go @@ -1,4 +1,4 @@ -// Code generated by "stringer -output types_string.go -type=MapType,ProgramType,AttachType,PinType"; DO NOT EDIT. +// Code generated by "stringer -output types_string.go -type=MapType,ProgramType,PinType"; DO NOT EDIT. package ebpf @@ -34,15 +34,16 @@ func _() { _ = x[Stack-23] _ = x[SkStorage-24] _ = x[DevMapHash-25] - _ = x[StructOpts-26] + _ = x[StructOpsMap-26] _ = x[RingBuf-27] _ = x[InodeStorage-28] _ = x[TaskStorage-29] + _ = x[maxMapType-30] } -const _MapType_name = "UnspecifiedMapHashArrayProgramArrayPerfEventArrayPerCPUHashPerCPUArrayStackTraceCGroupArrayLRUHashLRUCPUHashLPMTrieArrayOfMapsHashOfMapsDevMapSockMapCPUMapXSKMapSockHashCGroupStorageReusePortSockArrayPerCPUCGroupStorageQueueStackSkStorageDevMapHashStructOptsRingBufInodeStorageTaskStorage" +const _MapType_name = "UnspecifiedMapHashArrayProgramArrayPerfEventArrayPerCPUHashPerCPUArrayStackTraceCGroupArrayLRUHashLRUCPUHashLPMTrieArrayOfMapsHashOfMapsDevMapSockMapCPUMapXSKMapSockHashCGroupStorageReusePortSockArrayPerCPUCGroupStorageQueueStackSkStorageDevMapHashStructOpsMapRingBufInodeStorageTaskStoragemaxMapType" -var _MapType_index = [...]uint16{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, 258, 265, 277, 288} +var _MapType_index = [...]uint16{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, 260, 267, 279, 290, 300} func (i MapType) String() string { if i >= MapType(len(_MapType_index)-1) { @@ -85,11 +86,12 @@ func _() { _ = x[Extension-28] _ = x[LSM-29] _ = x[SkLookup-30] + _ = x[maxProgramType-31] } -const _ProgramType_name = "UnspecifiedProgramSocketFilterKprobeSchedCLSSchedACTTracePointXDPPerfEventCGroupSKBCGroupSockLWTInLWTOutLWTXmitSockOpsSkSKBCGroupDeviceSkMsgRawTracepointCGroupSockAddrLWTSeg6LocalLircMode2SkReuseportFlowDissectorCGroupSysctlRawTracepointWritableCGroupSockoptTracingStructOpsExtensionLSMSkLookup" +const _ProgramType_name = "UnspecifiedProgramSocketFilterKprobeSchedCLSSchedACTTracePointXDPPerfEventCGroupSKBCGroupSockLWTInLWTOutLWTXmitSockOpsSkSKBCGroupDeviceSkMsgRawTracepointCGroupSockAddrLWTSeg6LocalLircMode2SkReuseportFlowDissectorCGroupSysctlRawTracepointWritableCGroupSockoptTracingStructOpsExtensionLSMSkLookupmaxProgramType" -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, 274, 283, 286, 294} +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, 274, 283, 286, 294, 308} func (i ProgramType) String() string { if i >= ProgramType(len(_ProgramType_index)-1) { @@ -97,61 +99,6 @@ func (i ProgramType) String() string { } 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] - _ = x[AttachCgroupInet4GetPeername-29] - _ = x[AttachCgroupInet6GetPeername-30] - _ = x[AttachCgroupInet4GetSockname-31] - _ = x[AttachCgroupInet6GetSockname-32] - _ = x[AttachXDPDevMap-33] - _ = x[AttachCgroupInetSockRelease-34] - _ = x[AttachXDPCPUMap-35] - _ = x[AttachSkLookup-36] - _ = x[AttachXDP-37] -} - -const _AttachType_name = "AttachNoneAttachCGroupInetEgressAttachCGroupInetSockCreateAttachCGroupSockOpsAttachSkSKBStreamParserAttachSkSKBStreamVerdictAttachCGroupDeviceAttachSkMsgVerdictAttachCGroupInet4BindAttachCGroupInet6BindAttachCGroupInet4ConnectAttachCGroupInet6ConnectAttachCGroupInet4PostBindAttachCGroupInet6PostBindAttachCGroupUDP4SendmsgAttachCGroupUDP6SendmsgAttachLircMode2AttachFlowDissectorAttachCGroupSysctlAttachCGroupUDP4RecvmsgAttachCGroupUDP6RecvmsgAttachCGroupGetsockoptAttachCGroupSetsockoptAttachTraceRawTpAttachTraceFEntryAttachTraceFExitAttachModifyReturnAttachLSMMacAttachTraceIterAttachCgroupInet4GetPeernameAttachCgroupInet6GetPeernameAttachCgroupInet4GetSocknameAttachCgroupInet6GetSocknameAttachXDPDevMapAttachCgroupInetSockReleaseAttachXDPCPUMapAttachSkLookupAttachXDP" - -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, 610, 638, 666, 694, 709, 736, 751, 765, 774} - -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]] -} func _() { // An "invalid array index" compiler error signifies that the constant values have changed. // Re-run the stringer command to generate them again. diff --git a/vendor/github.com/containerd/cgroups/go.mod b/vendor/github.com/containerd/cgroups/go.mod index b3df917d52f06..80d3f6ea630f1 100644 --- a/vendor/github.com/containerd/cgroups/go.mod +++ b/vendor/github.com/containerd/cgroups/go.mod @@ -11,7 +11,8 @@ require ( github.com/gogo/protobuf v1.3.2 github.com/opencontainers/runtime-spec v1.0.2 github.com/sirupsen/logrus v1.8.1 - github.com/stretchr/testify v1.6.1 + github.com/stretchr/testify v1.7.0 github.com/urfave/cli v1.22.2 - golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c + go.uber.org/goleak v1.1.12 + golang.org/x/sys v0.0.0-20210510120138-977fb7262007 ) diff --git a/vendor/github.com/containerd/cgroups/go.sum b/vendor/github.com/containerd/cgroups/go.sum index 20ed896adcee4..cda30b49f6c55 100644 --- a/vendor/github.com/containerd/cgroups/go.sum +++ b/vendor/github.com/containerd/cgroups/go.sum @@ -21,6 +21,7 @@ github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -38,43 +39,60 @@ github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/urfave/cli v1.22.2 h1:gsqYFH8bb9ekPA12kRo0hfjngWQjkJPlN9R0N78BoUo= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= +go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.5 h1:ouewzE6p+/VEB31YYnTbEJdi8pFqKp4P4n85vwo3DHA= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/vendor/github.com/containerd/cgroups/rdma.go b/vendor/github.com/containerd/cgroups/rdma.go index b6f0d416c7f48..3b59b10714260 100644 --- a/vendor/github.com/containerd/cgroups/rdma.go +++ b/vendor/github.com/containerd/cgroups/rdma.go @@ -67,6 +67,7 @@ func (p *rdmaController) Create(path string, resources *specs.LinuxResources) er for device, limit := range resources.Rdma { if device != "" && (limit.HcaHandles != nil || limit.HcaObjects != nil) { + limit := limit return retryingWriteFile( filepath.Join(p.Path(path), "rdma.max"), []byte(createCmdString(device, &limit)), diff --git a/vendor/github.com/containerd/cgroups/v2/manager.go b/vendor/github.com/containerd/cgroups/v2/manager.go index 203b02723f2aa..afed14c6ef3b4 100644 --- a/vendor/github.com/containerd/cgroups/v2/manager.go +++ b/vendor/github.com/containerd/cgroups/v2/manager.go @@ -560,6 +560,22 @@ func (c *Manager) freeze(path string, state State) error { } } +func (c *Manager) isCgroupEmpty() bool { + // In case of any error we return true so that we exit and don't leak resources + out := make(map[string]interface{}) + if err := readKVStatsFile(c.path, "cgroup.events", out); err != nil { + return true + } + if v, ok := out["populated"]; ok { + populated, ok := v.(uint64) + if !ok { + return true + } + return populated == 0 + } + return true +} + // 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") @@ -568,9 +584,15 @@ func (c *Manager) MemoryEventFD() (int, uint32, error) { return 0, 0, errors.New("failed to create inotify fd") } wd, err := syscall.InotifyAddWatch(fd, fpath, unix.IN_MODIFY) - if wd < 0 { + if err != nil { + syscall.Close(fd) + return 0, 0, fmt.Errorf("failed to add inotify watch for %q: %w", fpath, err) + } + // monitor to detect process exit/cgroup deletion + evpath := filepath.Join(c.path, "cgroup.events") + if _, err = syscall.InotifyAddWatch(fd, evpath, unix.IN_MODIFY); err != nil { syscall.Close(fd) - return 0, 0, fmt.Errorf("failed to add inotify watch for %q", fpath) + return 0, 0, fmt.Errorf("failed to add inotify watch for %q: %w", evpath, err) } return fd, uint32(wd), nil @@ -578,22 +600,56 @@ func (c *Manager) MemoryEventFD() (int, uint32, error) { func (c *Manager) EventChan() (<-chan Event, <-chan error) { ec := make(chan Event) - errCh := make(chan error) + errCh := make(chan error, 1) go c.waitForEvents(ec, errCh) - return ec, nil + return ec, errCh } -func (c *Manager) waitForEvents(ec chan<- Event, errCh chan<- error) { - fd, wd, err := c.MemoryEventFD() +func parseMemoryEvents(out map[string]interface{}) (Event, error) { + e := Event{} + if v, ok := out["high"]; ok { + e.High, ok = v.(uint64) + if !ok { + return Event{}, fmt.Errorf("cannot convert high to uint64: %+v", v) + } + } + if v, ok := out["low"]; ok { + e.Low, ok = v.(uint64) + if !ok { + return Event{}, fmt.Errorf("cannot convert low to uint64: %+v", v) + } + } + if v, ok := out["max"]; ok { + e.Max, ok = v.(uint64) + if !ok { + return Event{}, fmt.Errorf("cannot convert max to uint64: %+v", v) + } + } + if v, ok := out["oom"]; ok { + e.OOM, ok = v.(uint64) + if !ok { + return Event{}, fmt.Errorf("cannot convert oom to uint64: %+v", v) + } + } + if v, ok := out["oom_kill"]; ok { + e.OOMKill, ok = v.(uint64) + if !ok { + return Event{}, fmt.Errorf("cannot convert oom_kill to uint64: %+v", v) + } + } + return e, nil +} - defer syscall.InotifyRmWatch(fd, wd) - defer syscall.Close(fd) +func (c *Manager) waitForEvents(ec chan<- Event, errCh chan<- error) { + defer close(errCh) + fd, _, err := c.MemoryEventFD() if err != nil { errCh <- err return } + defer syscall.Close(fd) for { buffer := make([]byte, syscall.SizeofInotifyEvent*10) @@ -604,48 +660,22 @@ func (c *Manager) waitForEvents(ec chan<- Event, errCh chan<- error) { } 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 <- fmt.Errorf("cannot convert high to uint64: %+v", v) - return - } + if err := readKVStatsFile(c.path, "memory.events", out); err != nil { + // When cgroup is deleted read may return -ENODEV instead of -ENOENT from open. + if _, statErr := os.Lstat(filepath.Join(c.path, "memory.events")); !os.IsNotExist(statErr) { + errCh <- err } - if v, ok := out["low"]; ok { - e.Low, ok = v.(uint64) - if !ok { - errCh <- fmt.Errorf("cannot convert low to uint64: %+v", v) - return - } - } - if v, ok := out["max"]; ok { - e.Max, ok = v.(uint64) - if !ok { - errCh <- fmt.Errorf("cannot convert max to uint64: %+v", v) - return - } - } - if v, ok := out["oom"]; ok { - e.OOM, ok = v.(uint64) - if !ok { - errCh <- fmt.Errorf("cannot convert oom to uint64: %+v", v) - return - } - } - if v, ok := out["oom_kill"]; ok { - e.OOMKill, ok = v.(uint64) - if !ok { - errCh <- fmt.Errorf("cannot convert oom_kill to uint64: %+v", v) - return - } - } - ec <- e - } else { + return + } + e, err := parseMemoryEvents(out) + if err != nil { errCh <- err return } + ec <- e + if c.isCgroupEmpty() { + return + } } } } @@ -658,7 +688,7 @@ func setDevices(path string, devices []specs.LinuxDeviceCgroup) error { if err != nil { return err } - dirFD, err := unix.Open(path, unix.O_DIRECTORY|unix.O_RDONLY, 0600) + dirFD, err := unix.Open(path, unix.O_DIRECTORY|unix.O_RDONLY|unix.O_CLOEXEC, 0600) if err != nil { return fmt.Errorf("cannot get dir FD for %s", path) } 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 fe002e0736c26..0000000000000 --- a/vendor/github.com/containerd/containerd/api/events/container.pb.go +++ /dev/null @@ -1,1413 +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) || (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) || (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) || (iNdEx+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) || (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) || (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 dfeca308ea314..0000000000000 --- a/vendor/github.com/containerd/containerd/api/events/container.proto +++ /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. -*/ - -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 0a7ec9325d351..0000000000000 --- a/vendor/github.com/containerd/containerd/api/events/content.pb.go +++ /dev/null @@ -1,359 +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) || (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 b8f84bc89b736..0000000000000 --- a/vendor/github.com/containerd/containerd/api/events/content.proto +++ /dev/null @@ -1,29 +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. -*/ - -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/image.pb.go b/vendor/github.com/containerd/containerd/api/events/image.pb.go deleted file mode 100644 index 747026945449d..0000000000000 --- a/vendor/github.com/containerd/containerd/api/events/image.pb.go +++ /dev/null @@ -1,1109 +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) || (iNdEx+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) || (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) || (iNdEx+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) || (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) || (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 fe455b54cab22..0000000000000 --- a/vendor/github.com/containerd/containerd/api/events/image.proto +++ /dev/null @@ -1,38 +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. -*/ - -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 d406a987e98d1..0000000000000 --- a/vendor/github.com/containerd/containerd/api/events/namespace.pb.go +++ /dev/null @@ -1,1109 +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) || (iNdEx+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) || (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) || (iNdEx+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) || (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) || (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 53a8ee6306afd..0000000000000 --- a/vendor/github.com/containerd/containerd/api/events/namespace.proto +++ /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. -*/ - -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 bec25c3a7c991..0000000000000 --- a/vendor/github.com/containerd/containerd/api/events/snapshot.pb.go +++ /dev/null @@ -1,848 +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) || (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) || (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) || (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 eb1f06725c702..0000000000000 --- a/vendor/github.com/containerd/containerd/api/events/snapshot.proto +++ /dev/null @@ -1,38 +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. -*/ - -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 f8f3a3f3d3070..0000000000000 --- a/vendor/github.com/containerd/containerd/api/events/task.pb.go +++ /dev/null @@ -1,3261 +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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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 3cbbbf00a03a7..0000000000000 --- a/vendor/github.com/containerd/containerd/api/events/task.proto +++ /dev/null @@ -1,94 +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. -*/ - -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 af56c7de2badb..0000000000000 --- a/vendor/github.com/containerd/containerd/api/services/containers/v1/containers.pb.go +++ /dev/null @@ -1,3584 +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) || (iNdEx+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) || (iNdEx+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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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 36ab177de7781..0000000000000 --- a/vendor/github.com/containerd/containerd/api/services/containers/v1/containers.proto +++ /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. -*/ - -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/containers/v1/doc.go b/vendor/github.com/containerd/containerd/api/services/containers/v1/doc.go deleted file mode 100644 index a6ef491ce5f21..0000000000000 --- a/vendor/github.com/containerd/containerd/api/services/containers/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 containers 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 97c7d4a92b360..0000000000000 --- a/vendor/github.com/containerd/containerd/api/services/content/v1/content.pb.go +++ /dev/null @@ -1,5425 +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) || (iNdEx+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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (iNdEx+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) || (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) || (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) || (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 b33ea5b2e8c4f..0000000000000 --- a/vendor/github.com/containerd/containerd/api/services/content/v1/content.proto +++ /dev/null @@ -1,334 +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. -*/ - -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/content/v1/doc.go b/vendor/github.com/containerd/containerd/api/services/content/v1/doc.go deleted file mode 100644 index 3bf106c89b67a..0000000000000 --- a/vendor/github.com/containerd/containerd/api/services/content/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 content 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 b1450ceb82f64..0000000000000 --- a/vendor/github.com/containerd/containerd/api/services/diff/v1/diff.pb.go +++ /dev/null @@ -1,1666 +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) || (iNdEx+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) || (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) || (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) || (iNdEx+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) || (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) || (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 cc24e3f2caa02..0000000000000 --- a/vendor/github.com/containerd/containerd/api/services/diff/v1/diff.proto +++ /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. -*/ - -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/diff/v1/doc.go b/vendor/github.com/containerd/containerd/api/services/diff/v1/doc.go deleted file mode 100644 index 37d16deae3da9..0000000000000 --- a/vendor/github.com/containerd/containerd/api/services/diff/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 diff 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 b7f86da86951d..0000000000000 --- 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 4373f3bf2fc6d..0000000000000 --- a/vendor/github.com/containerd/containerd/api/services/events/v1/events.pb.go +++ /dev/null @@ -1,1372 +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) || (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) || (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) || (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) || (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 9a2444e54ca10..0000000000000 --- a/vendor/github.com/containerd/containerd/api/services/events/v1/events.proto +++ /dev/null @@ -1,72 +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. -*/ - -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 4170f38aff06b..0000000000000 --- 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 de08cc08358a5..0000000000000 --- a/vendor/github.com/containerd/containerd/api/services/images/v1/images.pb.go +++ /dev/null @@ -1,2738 +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) || (iNdEx+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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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 338f4fb08d78e..0000000000000 --- a/vendor/github.com/containerd/containerd/api/services/images/v1/images.proto +++ /dev/null @@ -1,140 +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. -*/ - -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 f6f65eadfd271..0000000000000 --- 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 d23c8b61a8e22..0000000000000 --- a/vendor/github.com/containerd/containerd/api/services/introspection/v1/introspection.pb.go +++ /dev/null @@ -1,1536 +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) || (iNdEx+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) || (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) || (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) || (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) || (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 65a8bc21b6cd1..0000000000000 --- a/vendor/github.com/containerd/containerd/api/services/introspection/v1/introspection.proto +++ /dev/null @@ -1,104 +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. -*/ - -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 db2422a8bb9dd..0000000000000 --- 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 5e7cab71f1312..0000000000000 --- a/vendor/github.com/containerd/containerd/api/services/leases/v1/leases.pb.go +++ /dev/null @@ -1,3108 +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) || (iNdEx+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) || (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) || (iNdEx+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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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 6aa61faedf778..0000000000000 --- a/vendor/github.com/containerd/containerd/api/services/leases/v1/leases.proto +++ /dev/null @@ -1,117 +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. -*/ -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/doc.go b/vendor/github.com/containerd/containerd/api/services/namespaces/v1/doc.go deleted file mode 100644 index 4315f94072f22..0000000000000 --- a/vendor/github.com/containerd/containerd/api/services/namespaces/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 namespaces 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 76f9e117266e1..0000000000000 --- a/vendor/github.com/containerd/containerd/api/services/namespaces/v1/namespace.pb.go +++ /dev/null @@ -1,2518 +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) || (iNdEx+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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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 90e3051238b6f..0000000000000 --- a/vendor/github.com/containerd/containerd/api/services/namespaces/v1/namespace.proto +++ /dev/null @@ -1,108 +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. -*/ - -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/doc.go b/vendor/github.com/containerd/containerd/api/services/snapshots/v1/doc.go deleted file mode 100644 index 00b3cd9625c4d..0000000000000 --- a/vendor/github.com/containerd/containerd/api/services/snapshots/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 snapshots 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 046c97b015fee..0000000000000 --- a/vendor/github.com/containerd/containerd/api/services/snapshots/v1/snapshots.pb.go +++ /dev/null @@ -1,5541 +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) || (iNdEx+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) || (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) || (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) || (iNdEx+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) || (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) || (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) || (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) || (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) || (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) || (iNdEx+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) || (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) || (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) || (iNdEx+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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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 dfb8ff1e70a9b..0000000000000 --- a/vendor/github.com/containerd/containerd/api/services/snapshots/v1/snapshots.proto +++ /dev/null @@ -1,183 +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. -*/ - -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/doc.go b/vendor/github.com/containerd/containerd/api/services/tasks/v1/doc.go deleted file mode 100644 index 0888ba8a85f8f..0000000000000 --- a/vendor/github.com/containerd/containerd/api/services/tasks/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 tasks 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 dcc76808938e9..0000000000000 --- a/vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks.pb.go +++ /dev/null @@ -1,7511 +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_sortkeys "github.com/gogo/protobuf/sortkeys" - 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"` - RuntimePath string `protobuf:"bytes,10,opt,name=runtime_path,json=runtimePath,proto3" json:"runtime_path,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"` - Annotations map[string]string `protobuf:"bytes,3,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 *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.RegisterMapType((map[string]string)(nil), "containerd.services.tasks.v1.UpdateTaskRequest.AnnotationsEntry") - 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{ - // 1400 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x5b, 0x6f, 0x1b, 0x45, - 0x14, 0xee, 0xfa, 0xee, 0xe3, 0xa4, 0x4d, 0x96, 0x34, 0x98, 0xa5, 0x8a, 0xd3, 0xe5, 0xc5, 0x04, - 0xba, 0xa6, 0x2e, 0xaa, 0xaa, 0xb6, 0xaa, 0xc8, 0x8d, 0xc8, 0x82, 0xaa, 0xe9, 0xb6, 0x40, 0x55, - 0x09, 0x99, 0x8d, 0x77, 0x62, 0x8f, 0x62, 0xef, 0x6c, 0x77, 0xc6, 0x69, 0xcd, 0x0b, 0xfc, 0x84, - 0xbe, 0xf2, 0x02, 0x7f, 0xa7, 0x8f, 0x3c, 0x22, 0x54, 0x05, 0xea, 0x57, 0x7e, 0x01, 0x6f, 0x68, - 0x2e, 0xbb, 0xde, 0xd8, 0xf1, 0x25, 0x4d, 0xc3, 0x4b, 0x3b, 0x33, 0x7b, 0xce, 0x99, 0x33, 0xdf, - 0xb9, 0x7d, 0x0e, 0x6c, 0x34, 0x31, 0x6b, 0x75, 0xf7, 0xac, 0x06, 0xe9, 0x54, 0x1a, 0xc4, 0x63, - 0x0e, 0xf6, 0x50, 0xe0, 0xc6, 0x97, 0x8e, 0x8f, 0x2b, 0x14, 0x05, 0x87, 0xb8, 0x81, 0x68, 0x85, - 0x39, 0xf4, 0x80, 0x56, 0x0e, 0xaf, 0xcb, 0x85, 0xe5, 0x07, 0x84, 0x11, 0xfd, 0xca, 0x40, 0xda, - 0x0a, 0x25, 0x2d, 0x29, 0x70, 0x78, 0xdd, 0xf8, 0xb0, 0x49, 0x48, 0xb3, 0x8d, 0x2a, 0x42, 0x76, - 0xaf, 0xbb, 0x5f, 0x41, 0x1d, 0x9f, 0xf5, 0xa4, 0xaa, 0xf1, 0xc1, 0xf0, 0x47, 0xc7, 0x0b, 0x3f, - 0x2d, 0x35, 0x49, 0x93, 0x88, 0x65, 0x85, 0xaf, 0xd4, 0xe9, 0xcd, 0x99, 0xfc, 0x65, 0x3d, 0x1f, - 0xd1, 0x4a, 0x87, 0x74, 0x3d, 0xa6, 0xf4, 0x6e, 0x9d, 0x46, 0x0f, 0xb1, 0x00, 0x37, 0xd4, 0xeb, - 0x8c, 0x3b, 0xa7, 0xd0, 0x74, 0x11, 0x6d, 0x04, 0xd8, 0x67, 0x24, 0x50, 0xca, 0xb7, 0x4f, 0xa1, - 0xcc, 0x11, 0x13, 0xff, 0x28, 0xdd, 0xd2, 0x30, 0x36, 0x0c, 0x77, 0x10, 0x65, 0x4e, 0xc7, 0x97, - 0x02, 0xe6, 0x3f, 0x09, 0x58, 0xdc, 0x0c, 0x90, 0xc3, 0xd0, 0x63, 0x87, 0x1e, 0xd8, 0xe8, 0x59, - 0x17, 0x51, 0xa6, 0x57, 0x61, 0x2e, 0x32, 0x5f, 0xc7, 0x6e, 0x51, 0x5b, 0xd5, 0xca, 0xf9, 0x8d, - 0x4b, 0xfd, 0xa3, 0x52, 0x61, 0x33, 0x3c, 0xaf, 0x6d, 0xd9, 0x85, 0x48, 0xa8, 0xe6, 0xea, 0x15, - 0xc8, 0x04, 0x84, 0xb0, 0x7d, 0x5a, 0x4c, 0xae, 0x26, 0xcb, 0x85, 0xea, 0xfb, 0x56, 0x2c, 0xa4, - 0xc2, 0x3b, 0xeb, 0x3e, 0x07, 0xd3, 0x56, 0x62, 0xfa, 0x12, 0xa4, 0x29, 0x73, 0xb1, 0x57, 0x4c, - 0x71, 0xeb, 0xb6, 0xdc, 0xe8, 0xcb, 0x90, 0xa1, 0xcc, 0x25, 0x5d, 0x56, 0x4c, 0x8b, 0x63, 0xb5, - 0x53, 0xe7, 0x28, 0x08, 0x8a, 0x99, 0xe8, 0x1c, 0x05, 0x81, 0x6e, 0x40, 0x8e, 0xa1, 0xa0, 0x83, - 0x3d, 0xa7, 0x5d, 0xcc, 0xae, 0x6a, 0xe5, 0x9c, 0x1d, 0xed, 0xf5, 0xbb, 0x00, 0x8d, 0x16, 0x6a, - 0x1c, 0xf8, 0x04, 0x7b, 0xac, 0x98, 0x5b, 0xd5, 0xca, 0x85, 0xea, 0x95, 0x51, 0xb7, 0xb6, 0x22, - 0xc4, 0xed, 0x98, 0xbc, 0x6e, 0x41, 0x96, 0xf8, 0x0c, 0x13, 0x8f, 0x16, 0xf3, 0x42, 0x75, 0xc9, - 0x92, 0x68, 0x5a, 0x21, 0x9a, 0xd6, 0xba, 0xd7, 0xb3, 0x43, 0x21, 0xfd, 0x2a, 0xcc, 0x05, 0x5d, - 0x8f, 0x03, 0x5c, 0xf7, 0x1d, 0xd6, 0x2a, 0x82, 0xf0, 0xb3, 0xa0, 0xce, 0x76, 0x1d, 0xd6, 0x32, - 0x9f, 0x82, 0x1e, 0x07, 0x9b, 0xfa, 0xc4, 0xa3, 0xe8, 0xad, 0xd0, 0x5e, 0x80, 0xa4, 0x8f, 0xdd, - 0x62, 0x62, 0x55, 0x2b, 0xcf, 0xdb, 0x7c, 0x69, 0x36, 0x61, 0xee, 0x11, 0x73, 0x02, 0x76, 0x96, - 0x18, 0x7e, 0x04, 0x59, 0xf4, 0x02, 0x35, 0xea, 0xca, 0x72, 0x7e, 0x03, 0xfa, 0x47, 0xa5, 0xcc, - 0xf6, 0x0b, 0xd4, 0xa8, 0x6d, 0xd9, 0x19, 0xfe, 0xa9, 0xe6, 0x9a, 0x57, 0x61, 0x5e, 0x5d, 0xa4, - 0xfc, 0x57, 0xbe, 0x68, 0x03, 0x5f, 0x76, 0x60, 0x71, 0x0b, 0xb5, 0xd1, 0x99, 0x93, 0xca, 0xfc, - 0x55, 0x83, 0x8b, 0xd2, 0x52, 0x74, 0xdb, 0x32, 0x24, 0x22, 0xe5, 0x4c, 0xff, 0xa8, 0x94, 0xa8, - 0x6d, 0xd9, 0x09, 0x7c, 0x02, 0x22, 0x7a, 0x09, 0x0a, 0xe8, 0x05, 0x66, 0x75, 0xca, 0x1c, 0xd6, - 0xe5, 0x69, 0xc9, 0xbf, 0x00, 0x3f, 0x7a, 0x24, 0x4e, 0xf4, 0x75, 0xc8, 0xf3, 0x1d, 0x72, 0xeb, - 0x0e, 0x13, 0x59, 0x58, 0xa8, 0x1a, 0x23, 0x31, 0x7e, 0x1c, 0x56, 0xcc, 0x46, 0xee, 0xd5, 0x51, - 0xe9, 0xc2, 0xcb, 0xbf, 0x4a, 0x9a, 0x9d, 0x93, 0x6a, 0xeb, 0xcc, 0x24, 0xb0, 0x24, 0xfd, 0xdb, - 0x0d, 0x48, 0x03, 0x51, 0x7a, 0xee, 0xe8, 0x23, 0x80, 0x1d, 0x74, 0xfe, 0x41, 0xde, 0x86, 0x82, - 0xb8, 0x46, 0x81, 0x7e, 0x13, 0xb2, 0xbe, 0x7c, 0xa0, 0xb8, 0x62, 0xa8, 0x8c, 0x0e, 0xaf, 0xab, - 0x4a, 0x0a, 0x41, 0x08, 0x85, 0xcd, 0x35, 0x58, 0xf8, 0x1a, 0x53, 0xc6, 0xd3, 0x20, 0x82, 0x66, - 0x19, 0x32, 0xfb, 0xb8, 0xcd, 0x50, 0x20, 0xbd, 0xb5, 0xd5, 0x8e, 0x27, 0x4d, 0x4c, 0x36, 0xaa, - 0x8d, 0xb4, 0x98, 0x02, 0x45, 0x4d, 0x34, 0x95, 0xc9, 0xd7, 0x4a, 0x51, 0xf3, 0xa5, 0x06, 0x85, - 0xaf, 0x70, 0xbb, 0x7d, 0xde, 0x20, 0x89, 0x9e, 0x84, 0x9b, 0xbc, 0xf3, 0xc8, 0xdc, 0x52, 0x3b, - 0x9e, 0x8a, 0x4e, 0xbb, 0x2d, 0x32, 0x2a, 0x67, 0xf3, 0xa5, 0xf9, 0xaf, 0x06, 0x3a, 0x57, 0x7e, - 0x07, 0x59, 0x12, 0xb5, 0xcd, 0xc4, 0xc9, 0x6d, 0x33, 0x39, 0xa6, 0x6d, 0xa6, 0xc6, 0xb6, 0xcd, - 0xf4, 0x50, 0xdb, 0x2c, 0x43, 0x8a, 0xfa, 0xa8, 0x21, 0x1a, 0xed, 0xb8, 0xae, 0x27, 0x24, 0xe2, - 0x28, 0x65, 0xc7, 0xa6, 0xd2, 0x65, 0x78, 0xef, 0xd8, 0xd3, 0x65, 0x64, 0xcd, 0x5f, 0x34, 0x58, - 0xb0, 0x11, 0xc5, 0x3f, 0xa2, 0x5d, 0xd6, 0x3b, 0xf7, 0x50, 0x2d, 0x41, 0xfa, 0x39, 0x76, 0x59, - 0x4b, 0x45, 0x4a, 0x6e, 0x38, 0x3a, 0x2d, 0x84, 0x9b, 0x2d, 0x59, 0xfd, 0xf3, 0xb6, 0xda, 0x99, - 0x3f, 0xc1, 0xc5, 0xcd, 0x36, 0xa1, 0xa8, 0xf6, 0xe0, 0xff, 0x70, 0x4c, 0x86, 0x33, 0x29, 0xa2, - 0x20, 0x37, 0xe6, 0x97, 0xb0, 0xb0, 0xeb, 0x74, 0xe9, 0x99, 0xfb, 0xe7, 0x0e, 0x2c, 0xda, 0x88, - 0x76, 0x3b, 0x67, 0x36, 0xb4, 0x0d, 0x97, 0x78, 0x71, 0xee, 0x62, 0xf7, 0x2c, 0xc9, 0x6b, 0xda, - 0xb2, 0x1f, 0x48, 0x33, 0xaa, 0xc4, 0xef, 0x41, 0x5e, 0xb5, 0x0b, 0x14, 0x96, 0xf9, 0xea, 0xa4, - 0x32, 0xaf, 0x79, 0xfb, 0xc4, 0x1e, 0xa8, 0x98, 0xaf, 0x35, 0xb8, 0xbc, 0x19, 0x8d, 0xed, 0xb3, - 0xd2, 0x98, 0x3a, 0x2c, 0xfa, 0x4e, 0x80, 0x3c, 0x56, 0x8f, 0x51, 0x07, 0x19, 0xbe, 0x2a, 0xef, - 0xff, 0x7f, 0x1e, 0x95, 0xd6, 0x62, 0x84, 0x8c, 0xf8, 0xc8, 0x8b, 0xd4, 0x69, 0xa5, 0x49, 0xae, - 0xb9, 0xb8, 0x89, 0x28, 0xb3, 0xb6, 0xc4, 0x7f, 0xf6, 0x82, 0x34, 0xb6, 0x79, 0x22, 0xad, 0x48, - 0xce, 0x40, 0x2b, 0xcc, 0x27, 0xb0, 0x3c, 0xfc, 0xba, 0x08, 0xb8, 0xc2, 0x80, 0x2c, 0x9e, 0xd8, - 0x21, 0x47, 0xf8, 0x4d, 0x5c, 0xc1, 0xfc, 0x2d, 0x01, 0x8b, 0xdf, 0xf8, 0xee, 0x3b, 0xe0, 0x7e, - 0x55, 0xc8, 0x07, 0x88, 0x92, 0x6e, 0xd0, 0x40, 0x54, 0x80, 0x35, 0xee, 0x55, 0x03, 0x31, 0x7d, - 0x0f, 0x0a, 0x8e, 0xe7, 0x11, 0xe6, 0x84, 0x58, 0x70, 0xef, 0xbf, 0xb0, 0x26, 0xfd, 0x0e, 0xb0, - 0x46, 0xbc, 0xb5, 0xd6, 0x07, 0x26, 0xb6, 0x3d, 0x16, 0xf4, 0xec, 0xb8, 0x51, 0xe3, 0x1e, 0x2c, - 0x0c, 0x0b, 0xf0, 0xe6, 0x7c, 0x80, 0x7a, 0x6a, 0xf6, 0xf0, 0x25, 0x2f, 0xc1, 0x43, 0xa7, 0xdd, - 0x45, 0x61, 0x47, 0x15, 0x9b, 0xdb, 0x89, 0x5b, 0x9a, 0xb9, 0x06, 0x17, 0xef, 0x4b, 0x22, 0x1f, - 0xa2, 0x53, 0x84, 0xac, 0x1c, 0x57, 0x12, 0xef, 0xbc, 0x1d, 0x6e, 0x79, 0x85, 0x44, 0xb2, 0xd1, - 0xf0, 0xca, 0xaa, 0xdf, 0x01, 0x2a, 0x38, 0xc5, 0x13, 0x38, 0xb1, 0x10, 0xb0, 0x43, 0x41, 0x73, - 0x1f, 0x0a, 0xdf, 0x39, 0xf8, 0xfc, 0x07, 0x7c, 0x00, 0x73, 0xf2, 0x1e, 0xe5, 0xeb, 0x10, 0x59, - 0xd2, 0x26, 0x93, 0xa5, 0xc4, 0xdb, 0x90, 0xa5, 0xea, 0xeb, 0x39, 0x48, 0x8b, 0xf1, 0xae, 0x1f, - 0x40, 0x46, 0x12, 0x61, 0xbd, 0x32, 0x39, 0xe2, 0x23, 0xbf, 0x4d, 0x8c, 0xcf, 0x66, 0x57, 0x50, - 0x4f, 0xfb, 0x01, 0xd2, 0x82, 0xb0, 0xea, 0x6b, 0x93, 0x55, 0xe3, 0xf4, 0xd9, 0xf8, 0x64, 0x26, - 0x59, 0x75, 0x43, 0x13, 0x32, 0x92, 0x05, 0x4e, 0x7b, 0xce, 0x08, 0x2b, 0x36, 0x3e, 0x9d, 0x45, - 0x21, 0xba, 0xe8, 0x19, 0xcc, 0x1f, 0xa3, 0x9b, 0x7a, 0x75, 0x16, 0xf5, 0xe3, 0xac, 0xe3, 0x94, - 0x57, 0x3e, 0x85, 0xe4, 0x0e, 0x62, 0x7a, 0x79, 0xb2, 0xd2, 0x80, 0x93, 0x1a, 0x1f, 0xcf, 0x20, - 0x19, 0xe1, 0x96, 0xe2, 0xe3, 0x40, 0xb7, 0x26, 0xab, 0x0c, 0x53, 0x48, 0xa3, 0x32, 0xb3, 0xbc, - 0xba, 0xa8, 0x06, 0x29, 0xce, 0x08, 0xf5, 0x29, 0xbe, 0xc5, 0x58, 0xa3, 0xb1, 0x3c, 0x92, 0xdc, - 0xdb, 0x1d, 0x9f, 0xf5, 0xf4, 0x5d, 0x48, 0xf1, 0x52, 0xd2, 0xa7, 0xe4, 0xe1, 0x28, 0xdb, 0x1b, - 0x6b, 0xf1, 0x11, 0xe4, 0x23, 0x22, 0x34, 0x0d, 0x8a, 0x61, 0xc6, 0x34, 0xd6, 0xe8, 0x03, 0xc8, - 0x2a, 0x0a, 0xa3, 0x4f, 0x89, 0xf7, 0x71, 0xa6, 0x33, 0xc1, 0x60, 0x5a, 0x50, 0x92, 0x69, 0x1e, - 0x0e, 0xf3, 0x96, 0xb1, 0x06, 0x1f, 0x42, 0x46, 0x72, 0x93, 0x69, 0x45, 0x33, 0xc2, 0x60, 0xc6, - 0x9a, 0xc4, 0x90, 0x0b, 0xe9, 0x85, 0x7e, 0x6d, 0x7a, 0x8e, 0xc4, 0xd8, 0x8c, 0x61, 0xcd, 0x2a, - 0xae, 0x32, 0xea, 0x39, 0x40, 0x6c, 0xa8, 0xdf, 0x98, 0x02, 0xf1, 0x49, 0xf4, 0xc4, 0xf8, 0xfc, - 0x74, 0x4a, 0xea, 0xe2, 0x87, 0x90, 0x91, 0x63, 0x70, 0x1a, 0x6c, 0x23, 0xc3, 0x72, 0x2c, 0x6c, - 0xfb, 0x90, 0x55, 0xa3, 0x6b, 0x5a, 0xae, 0x1c, 0x9f, 0x86, 0xc6, 0xb5, 0x19, 0xa5, 0x95, 0xeb, - 0xdf, 0x43, 0x8a, 0xcf, 0x9c, 0x69, 0x55, 0x18, 0x9b, 0x7f, 0xc6, 0xda, 0x2c, 0xa2, 0xd2, 0xfc, - 0xc6, 0xb7, 0xaf, 0xde, 0xac, 0x5c, 0xf8, 0xe3, 0xcd, 0xca, 0x85, 0x9f, 0xfb, 0x2b, 0xda, 0xab, - 0xfe, 0x8a, 0xf6, 0x7b, 0x7f, 0x45, 0xfb, 0xbb, 0xbf, 0xa2, 0x3d, 0xbd, 0xfb, 0x76, 0x7f, 0xa1, - 0xbc, 0x23, 0x16, 0x4f, 0x12, 0x7b, 0x19, 0x01, 0xd8, 0x8d, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, - 0xc7, 0x3c, 0xaa, 0x56, 0xea, 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 len(m.RuntimePath) > 0 { - i -= len(m.RuntimePath) - copy(dAtA[i:], m.RuntimePath) - i = encodeVarintTasks(dAtA, i, uint64(len(m.RuntimePath))) - i-- - dAtA[i] = 0x52 - } - 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 len(m.Annotations) > 0 { - for k := range m.Annotations { - v := m.Annotations[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintTasks(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintTasks(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintTasks(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1a - } - } - 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)) - } - l = len(m.RuntimePath) - if l > 0 { - 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 len(m.Annotations) > 0 { - for k, v := range m.Annotations { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovTasks(uint64(len(k))) + 1 + len(v) + sovTasks(uint64(len(v))) - n += mapEntrySize + 1 + sovTasks(uint64(mapEntrySize)) - } - } - 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) + `,`, - `RuntimePath:` + fmt.Sprintf("%v", this.RuntimePath) + `,`, - `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" - } - 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{`&UpdateTaskRequest{`, - `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`, - `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Any", "types1.Any", 1) + `,`, - `Annotations:` + mapStringForAnnotations + `,`, - `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 - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RuntimePath", 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.RuntimePath = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTasks(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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) || (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 - case 3: - 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 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.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 ErrIntOverflowTasks - } - 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 ErrIntOverflowTasks - } - 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 ErrInvalidLengthTasks - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthTasks - } - 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 ErrIntOverflowTasks - } - 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 ErrInvalidLengthTasks - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthTasks - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipTasks(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTasks - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Annotations[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTasks(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (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) || (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) || (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) || (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) || (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 6299c760265fb..0000000000000 --- a/vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks.proto +++ /dev/null @@ -1,228 +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. -*/ - -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; - - string runtime_path = 10; -} - -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; - map annotations = 3; -} - -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 d3d9839d639ad..0000000000000 --- 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 ttrpc event 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 b1f275bf0de83..0000000000000 --- a/vendor/github.com/containerd/containerd/api/services/ttrpc/events/v1/events.pb.go +++ /dev/null @@ -1,760 +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) || (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) || (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 ade1c7abefd53..0000000000000 --- a/vendor/github.com/containerd/containerd/api/services/ttrpc/events/v1/events.proto +++ /dev/null @@ -1,48 +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. -*/ - -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/doc.go b/vendor/github.com/containerd/containerd/api/services/version/v1/doc.go deleted file mode 100644 index c5c0b85ddb22a..0000000000000 --- a/vendor/github.com/containerd/containerd/api/services/version/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 version defines the version service. -package version 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 b742c6ae62f57..0000000000000 --- a/vendor/github.com/containerd/containerd/api/services/version/v1/version.pb.go +++ /dev/null @@ -1,476 +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) || (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 97681bb86ee79..0000000000000 --- a/vendor/github.com/containerd/containerd/api/services/version/v1/version.proto +++ /dev/null @@ -1,34 +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. -*/ - -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 fe71dbf433000..0000000000000 --- a/vendor/github.com/containerd/containerd/api/types/descriptor.pb.go +++ /dev/null @@ -1,598 +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) || (iNdEx+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) || (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 a841d1bb22d44..0000000000000 --- a/vendor/github.com/containerd/containerd/api/types/descriptor.proto +++ /dev/null @@ -1,35 +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. -*/ - -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 475b465ed4434..0000000000000 --- 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 75773e442ab74..0000000000000 --- a/vendor/github.com/containerd/containerd/api/types/metrics.pb.go +++ /dev/null @@ -1,450 +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) || (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 b8bc673267fc5..0000000000000 --- a/vendor/github.com/containerd/containerd/api/types/metrics.proto +++ /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. -*/ - -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 d0a0bee761f03..0000000000000 --- a/vendor/github.com/containerd/containerd/api/types/mount.pb.go +++ /dev/null @@ -1,494 +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) || (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 41ab13313871e..0000000000000 --- a/vendor/github.com/containerd/containerd/api/types/mount.proto +++ /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. -*/ - -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 a0f78c8a769d6..0000000000000 --- a/vendor/github.com/containerd/containerd/api/types/platform.pb.go +++ /dev/null @@ -1,435 +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) || (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 7813606841104..0000000000000 --- a/vendor/github.com/containerd/containerd/api/types/platform.proto +++ /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. -*/ - -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/doc.go b/vendor/github.com/containerd/containerd/api/types/task/doc.go deleted file mode 100644 index e10c7a469934a..0000000000000 --- a/vendor/github.com/containerd/containerd/api/types/task/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 task defines the task service. -package task 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 f511bbd058c85..0000000000000 --- a/vendor/github.com/containerd/containerd/api/types/task/task.pb.go +++ /dev/null @@ -1,980 +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) || (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) || (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 df08dfd99d943..0000000000000 --- a/vendor/github.com/containerd/containerd/api/types/task/task.proto +++ /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. -*/ - -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/continuity/context.go b/vendor/github.com/containerd/continuity/context.go index 2166142c7b355..019b185f8640f 100644 --- a/vendor/github.com/containerd/continuity/context.go +++ b/vendor/github.com/containerd/continuity/context.go @@ -20,7 +20,6 @@ import ( "bytes" "fmt" "io" - "log" "os" "path/filepath" "strings" @@ -152,9 +151,7 @@ func (c *context) Resource(p string, fi os.FileInfo) (Resource, error) { } base.xattrs, err = c.resolveXAttrs(fp, fi, base) - if err == ErrNotSupported { - log.Printf("resolving xattrs on %s not supported", fp) - } else if err != nil { + if err != nil && err != ErrNotSupported { return nil, err } @@ -192,8 +189,7 @@ func (c *context) Resource(p string, fi os.FileInfo) (Resource, error) { if fi.Mode()&os.ModeDevice != 0 { deviceDriver, ok := c.driver.(driverpkg.DeviceInfoDriver) if !ok { - log.Printf("device extraction not supported %s", fp) - return nil, ErrNotSupported + return nil, fmt.Errorf("device extraction is not supported for %s: %w", fp, ErrNotSupported) } // character and block devices merely need to recover the @@ -206,8 +202,7 @@ func (c *context) Resource(p string, fi os.FileInfo) (Resource, error) { return newDevice(*base, base.paths, major, minor) } - log.Printf("%q (%v) is not supported", fp, fi.Mode()) - return nil, ErrNotFound + return nil, fmt.Errorf("%q (%v) is not supported: %w", fp, fi.Mode(), ErrNotFound) } func (c *context) verifyMetadata(resource, target Resource) error { @@ -646,8 +641,7 @@ func (c *context) resolveXAttrs(fp string, fi os.FileInfo, base *resource) (map[ if fi.Mode().IsRegular() || fi.Mode().IsDir() { xattrDriver, ok := c.driver.(driverpkg.XAttrDriver) if !ok { - log.Println("xattr extraction not supported") - return nil, ErrNotSupported + return nil, fmt.Errorf("xattr extraction is not supported: %w", ErrNotSupported) } return xattrDriver.Getxattr(fp) @@ -656,8 +650,7 @@ func (c *context) resolveXAttrs(fp string, fi os.FileInfo, base *resource) (map[ if fi.Mode()&os.ModeSymlink != 0 { lxattrDriver, ok := c.driver.(driverpkg.LXAttrDriver) if !ok { - log.Println("xattr extraction for symlinks not supported") - return nil, ErrNotSupported + return nil, fmt.Errorf("xattr extraction for symlinks is not supported: %w", ErrNotSupported) } return lxattrDriver.LGetxattr(fp) diff --git a/vendor/github.com/containerd/continuity/devices/devices_unix.go b/vendor/github.com/containerd/continuity/devices/devices_unix.go index 4177e54f8ea96..3dd3bb42e8315 100644 --- a/vendor/github.com/containerd/continuity/devices/devices_unix.go +++ b/vendor/github.com/containerd/continuity/devices/devices_unix.go @@ -1,5 +1,5 @@ -//go:build linux || darwin || freebsd || solaris -// +build linux darwin freebsd solaris +//go:build !windows +// +build !windows /* Copyright The containerd Authors. diff --git a/vendor/github.com/containerd/continuity/devices/mknod_unix.go b/vendor/github.com/containerd/continuity/devices/mknod_unix.go index 52932029f7480..5c7f5525b69e4 100644 --- a/vendor/github.com/containerd/continuity/devices/mknod_unix.go +++ b/vendor/github.com/containerd/continuity/devices/mknod_unix.go @@ -1,5 +1,5 @@ -//go:build linux || darwin || solaris -// +build linux darwin solaris +//go:build !(freebsd || windows) +// +build !freebsd,!windows /* Copyright The containerd Authors. diff --git a/vendor/github.com/containerd/continuity/driver/driver_unix.go b/vendor/github.com/containerd/continuity/driver/driver_unix.go index fe67cf04cdf11..d64dd503cca3d 100644 --- a/vendor/github.com/containerd/continuity/driver/driver_unix.go +++ b/vendor/github.com/containerd/continuity/driver/driver_unix.go @@ -1,5 +1,5 @@ -//go:build linux || darwin || freebsd || solaris -// +build linux darwin freebsd solaris +//go:build !windows +// +build !windows /* Copyright The containerd Authors. diff --git a/vendor/github.com/containerd/continuity/driver/lchmod_unix.go b/vendor/github.com/containerd/continuity/driver/lchmod_unix.go index d1954ae11a94d..161c79fa57420 100644 --- a/vendor/github.com/containerd/continuity/driver/lchmod_unix.go +++ b/vendor/github.com/containerd/continuity/driver/lchmod_unix.go @@ -1,5 +1,5 @@ -//go:build darwin || freebsd || solaris -// +build darwin freebsd solaris +//go:build darwin || freebsd || netbsd || openbsd || solaris +// +build darwin freebsd netbsd openbsd solaris /* Copyright The containerd Authors. diff --git a/vendor/github.com/containerd/continuity/fs/copy_darwin.go b/vendor/github.com/containerd/continuity/fs/copy_darwin.go index 1a837d58ab5cd..ce55f0aa24214 100644 --- a/vendor/github.com/containerd/continuity/fs/copy_darwin.go +++ b/vendor/github.com/containerd/continuity/fs/copy_darwin.go @@ -34,10 +34,3 @@ func copyDevice(dst string, fi os.FileInfo) error { } return unix.Mknod(dst, uint32(fi.Mode()), int(st.Rdev)) } - -func utimesNano(name string, atime, mtime syscall.Timespec) error { - at := unix.NsecToTimespec(atime.Nano()) - mt := unix.NsecToTimespec(mtime.Nano()) - utimes := [2]unix.Timespec{at, mt} - return unix.UtimesNanoAt(unix.AT_FDCWD, name, utimes[0:], unix.AT_SYMLINK_NOFOLLOW) -} diff --git a/vendor/github.com/containerd/continuity/fs/copy_openbsdsolaris.go b/vendor/github.com/containerd/continuity/fs/copy_device_unix.go similarity index 80% rename from vendor/github.com/containerd/continuity/fs/copy_openbsdsolaris.go rename to vendor/github.com/containerd/continuity/fs/copy_device_unix.go index 9791fd4a2f2b6..f821890cb7fd1 100644 --- a/vendor/github.com/containerd/continuity/fs/copy_openbsdsolaris.go +++ b/vendor/github.com/containerd/continuity/fs/copy_device_unix.go @@ -1,5 +1,5 @@ -//go:build openbsd || solaris -// +build openbsd solaris +//go:build openbsd || solaris || netbsd +// +build openbsd solaris netbsd /* Copyright The containerd Authors. @@ -34,8 +34,3 @@ func copyDevice(dst string, fi os.FileInfo) error { } return unix.Mknod(dst, uint32(fi.Mode()), int(st.Rdev)) } - -func utimesNano(name string, atime, mtime syscall.Timespec) error { - timespec := []syscall.Timespec{atime, mtime} - return syscall.UtimesNano(name, timespec) -} diff --git a/vendor/github.com/containerd/continuity/fs/copy_freebsd.go b/vendor/github.com/containerd/continuity/fs/copy_freebsd.go index 61af4c484d862..4aaf743e5a94c 100644 --- a/vendor/github.com/containerd/continuity/fs/copy_freebsd.go +++ b/vendor/github.com/containerd/continuity/fs/copy_freebsd.go @@ -34,10 +34,3 @@ func copyDevice(dst string, fi os.FileInfo) error { } return unix.Mknod(dst, uint32(fi.Mode()), st.Rdev) } - -func utimesNano(name string, atime, mtime syscall.Timespec) error { - at := unix.NsecToTimespec(atime.Nano()) - mt := unix.NsecToTimespec(mtime.Nano()) - utimes := [2]unix.Timespec{at, mt} - return unix.UtimesNanoAt(unix.AT_FDCWD, name, utimes[0:], unix.AT_SYMLINK_NOFOLLOW) -} diff --git a/vendor/github.com/containerd/continuity/fs/copy_unix.go b/vendor/github.com/containerd/continuity/fs/copy_unix.go index 8bb456da3e677..0e68ba9ec2b9b 100644 --- a/vendor/github.com/containerd/continuity/fs/copy_unix.go +++ b/vendor/github.com/containerd/continuity/fs/copy_unix.go @@ -1,5 +1,5 @@ -//go:build darwin || freebsd || openbsd || solaris -// +build darwin freebsd openbsd solaris +//go:build darwin || freebsd || openbsd || netbsd || solaris +// +build darwin freebsd openbsd netbsd solaris /* Copyright The containerd Authors. diff --git a/vendor/github.com/containerd/continuity/fs/stat_linuxopenbsd.go b/vendor/github.com/containerd/continuity/fs/stat_atim.go similarity index 83% rename from vendor/github.com/containerd/continuity/fs/stat_linuxopenbsd.go rename to vendor/github.com/containerd/continuity/fs/stat_atim.go index 4a4c8a9413aa0..996b9c1ae7bc3 100644 --- a/vendor/github.com/containerd/continuity/fs/stat_linuxopenbsd.go +++ b/vendor/github.com/containerd/continuity/fs/stat_atim.go @@ -1,5 +1,5 @@ -//go:build linux || openbsd -// +build linux openbsd +//go:build linux || openbsd || solaris +// +build linux openbsd solaris /* Copyright The containerd Authors. @@ -41,5 +41,5 @@ func StatMtime(st *syscall.Stat_t) syscall.Timespec { // StatATimeAsTime returns st.Atim as a time.Time func StatATimeAsTime(st *syscall.Stat_t) time.Time { - return time.Unix(int64(st.Atim.Sec), int64(st.Atim.Nsec)) //nolint: unconvert // int64 conversions ensure the line compiles for 32-bit systems as well. + return time.Unix(st.Atim.Unix()) } diff --git a/vendor/github.com/containerd/continuity/fs/stat_darwinbsd.go b/vendor/github.com/containerd/continuity/fs/stat_darwinbsd.go index d05a79fbedc41..dbdb90ec83c30 100644 --- a/vendor/github.com/containerd/continuity/fs/stat_darwinbsd.go +++ b/vendor/github.com/containerd/continuity/fs/stat_darwinbsd.go @@ -41,5 +41,5 @@ func StatMtime(st *syscall.Stat_t) syscall.Timespec { // StatATimeAsTime returns the access time as a time.Time func StatATimeAsTime(st *syscall.Stat_t) time.Time { - return time.Unix(int64(st.Atimespec.Sec), int64(st.Atimespec.Nsec)) //nolint: unconvert // int64 conversions ensure the line compiles for 32-bit systems as well. + return time.Unix(st.Atimespec.Unix()) } diff --git a/vendor/github.com/containerd/containerd/api/events/doc.go b/vendor/github.com/containerd/continuity/fs/utimesnanoat.go similarity index 60% rename from vendor/github.com/containerd/containerd/api/events/doc.go rename to vendor/github.com/containerd/continuity/fs/utimesnanoat.go index 354bef79fd7c8..5435398d48797 100644 --- a/vendor/github.com/containerd/containerd/api/events/doc.go +++ b/vendor/github.com/containerd/continuity/fs/utimesnanoat.go @@ -1,3 +1,6 @@ +//go:build !(windows || linux) +// +build !windows,!linux + /* Copyright The containerd Authors. @@ -14,6 +17,17 @@ limitations under the License. */ -// Package events has protobuf types for various events that are used in -// containerd. -package events +package fs + +import ( + "syscall" + + "golang.org/x/sys/unix" +) + +func utimesNano(name string, atime, mtime syscall.Timespec) error { + at := unix.NsecToTimespec(atime.Nano()) + mt := unix.NsecToTimespec(mtime.Nano()) + utimes := [2]unix.Timespec{at, mt} + return unix.UtimesNanoAt(unix.AT_FDCWD, name, utimes[0:], unix.AT_SYMLINK_NOFOLLOW) +} diff --git a/vendor/github.com/containerd/continuity/hardlinks_unix.go b/vendor/github.com/containerd/continuity/hardlinks_unix.go index 40aa99fe260fe..a1fafb0a114c6 100644 --- a/vendor/github.com/containerd/continuity/hardlinks_unix.go +++ b/vendor/github.com/containerd/continuity/hardlinks_unix.go @@ -1,5 +1,5 @@ -//go:build linux || darwin || freebsd || solaris -// +build linux darwin freebsd solaris +//go:build !windows +// +build !windows /* Copyright The containerd Authors. diff --git a/vendor/github.com/containerd/continuity/manifest.go b/vendor/github.com/containerd/continuity/manifest.go index 012af556e6330..8e83317ee754f 100644 --- a/vendor/github.com/containerd/continuity/manifest.go +++ b/vendor/github.com/containerd/continuity/manifest.go @@ -19,7 +19,6 @@ package continuity import ( "fmt" "io" - "log" "os" "sort" @@ -92,8 +91,7 @@ func BuildManifest(ctx Context) (*Manifest, error) { if err == ErrNotFound { return nil } - log.Printf("error getting resource %q: %v", p, err) - return err + return fmt.Errorf("failed to get resource %q: %w", p, err) } // add to the hardlink manager diff --git a/vendor/github.com/containerd/continuity/resource_unix.go b/vendor/github.com/containerd/continuity/resource_unix.go index 7f01425ac1bc9..eaf7c1dafa587 100644 --- a/vendor/github.com/containerd/continuity/resource_unix.go +++ b/vendor/github.com/containerd/continuity/resource_unix.go @@ -1,5 +1,5 @@ -//go:build linux || darwin || freebsd || solaris -// +build linux darwin freebsd solaris +//go:build !windows +// +build !windows /* Copyright The containerd Authors. diff --git a/vendor/github.com/containerd/continuity/sysx/nodata_unix.go b/vendor/github.com/containerd/continuity/sysx/nodata_unix.go index 3c704c4fc1028..e78f77f6a1226 100644 --- a/vendor/github.com/containerd/continuity/sysx/nodata_unix.go +++ b/vendor/github.com/containerd/continuity/sysx/nodata_unix.go @@ -1,5 +1,5 @@ -//go:build darwin || freebsd || openbsd -// +build darwin freebsd openbsd +//go:build !(linux || solaris || windows) +// +build !linux,!solaris,!windows /* Copyright The containerd Authors. diff --git a/vendor/github.com/containerd/go-cni/README.md b/vendor/github.com/containerd/go-cni/README.md index 969c56e21331e..d028749f128f5 100644 --- a/vendor/github.com/containerd/go-cni/README.md +++ b/vendor/github.com/containerd/go-cni/README.md @@ -11,6 +11,7 @@ A generic CNI library to provide APIs for CNI plugin interactions. The library p - Setup networks for container namespace - Remove networks from container namespace - Query status of CNI network plugin initialization +- Check verifies the network is still in desired state go-cni aims to support plugins that implement [Container Network Interface](https://github.com/containernetworking/cni) diff --git a/vendor/github.com/containerd/go-cni/cni.go b/vendor/github.com/containerd/go-cni/cni.go index 923c280fbf119..44dceaea46117 100644 --- a/vendor/github.com/containerd/go-cni/cni.go +++ b/vendor/github.com/containerd/go-cni/cni.go @@ -19,12 +19,15 @@ package cni import ( "context" "fmt" + "os" "strings" "sync" cnilibrary "github.com/containernetworking/cni/libcni" + "github.com/containernetworking/cni/pkg/invoke" "github.com/containernetworking/cni/pkg/types" types100 "github.com/containernetworking/cni/pkg/types/100" + "github.com/containernetworking/cni/pkg/version" ) type CNI interface { @@ -32,6 +35,8 @@ type CNI interface { Setup(ctx context.Context, id string, path string, opts ...NamespaceOpts) (*Result, error) // Remove tears down the network of the namespace. Remove(ctx context.Context, id string, path string, opts ...NamespaceOpts) error + // Check checks if the network is still in desired state + Check(ctx context.Context, id string, path string, opts ...NamespaceOpts) error // Load loads the cni network config Load(opts ...Opt) error // Status checks the status of the cni initialization @@ -84,9 +89,15 @@ func defaultCNIConfig() *libcni { pluginMaxConfNum: DefaultMaxConfNum, prefix: DefaultPrefix, }, - cniConfig: &cnilibrary.CNIConfig{ - Path: []string{DefaultCNIDir}, - }, + cniConfig: cnilibrary.NewCNIConfig( + []string{ + DefaultCNIDir, + }, + &invoke.DefaultExec{ + RawExec: &invoke.RawExec{Stderr: os.Stderr}, + PluginDecoder: version.PluginDecoder{}, + }, + ), networkCount: 1, } } @@ -154,16 +165,39 @@ func (c *libcni) Setup(ctx context.Context, id string, path string, opts ...Name return c.createResult(result) } +type asynchAttachResult struct { + index int + res *types100.Result + err error +} + +func asynchAttach(ctx context.Context, index int, n *Network, ns *Namespace, wg *sync.WaitGroup, rc chan asynchAttachResult) { + defer wg.Done() + r, err := n.Attach(ctx, ns) + rc <- asynchAttachResult{index: index, res: r, err: err} +} + func (c *libcni) attachNetworks(ctx context.Context, ns *Namespace) ([]*types100.Result, error) { - var results []*types100.Result - for _, network := range c.Networks() { - r, err := network.Attach(ctx, ns) - if err != nil { - return nil, err + var wg sync.WaitGroup + var firstError error + results := make([]*types100.Result, len(c.Networks())) + rc := make(chan asynchAttachResult) + + for i, network := range c.Networks() { + wg.Add(1) + go asynchAttach(ctx, i, network, ns, &wg, rc) + } + + for range c.Networks() { + rs := <-rc + if rs.err != nil && firstError == nil { + firstError = rs.err } - results = append(results, r) + results[rs.index] = rs.res } - return results, nil + wg.Wait() + + return results, firstError } // Remove removes the network config from the namespace @@ -194,6 +228,25 @@ func (c *libcni) Remove(ctx context.Context, id string, path string, opts ...Nam return nil } +// Check checks if the network is still in desired state +func (c *libcni) Check(ctx context.Context, id string, path string, opts ...NamespaceOpts) error { + if err := c.Status(); err != nil { + return err + } + ns, err := newNamespace(id, path, opts...) + if err != nil { + return err + } + for _, network := range c.Networks() { + err := network.Check(ctx, ns) + if err != nil { + return err + } + } + + return nil +} + // GetConfig returns a copy of the CNI plugin configurations as parsed by CNI func (c *libcni) GetConfig() *ConfigResult { c.RLock() diff --git a/vendor/github.com/containerd/go-cni/namespace.go b/vendor/github.com/containerd/go-cni/namespace.go index 9dd3b1d10741f..319182bc05f43 100644 --- a/vendor/github.com/containerd/go-cni/namespace.go +++ b/vendor/github.com/containerd/go-cni/namespace.go @@ -41,6 +41,10 @@ func (n *Network) Remove(ctx context.Context, ns *Namespace) error { return n.cni.DelNetworkList(ctx, n.config, ns.config(n.ifName)) } +func (n *Network) Check(ctx context.Context, ns *Namespace) error { + return n.cni.CheckNetworkList(ctx, n.config, ns.config(n.ifName)) +} + type Namespace struct { id string path string diff --git a/vendor/github.com/containerd/go-cni/opts.go b/vendor/github.com/containerd/go-cni/opts.go index 76c68153cda1b..309d014ef1091 100644 --- a/vendor/github.com/containerd/go-cni/opts.go +++ b/vendor/github.com/containerd/go-cni/opts.go @@ -18,10 +18,13 @@ package cni import ( "fmt" + "os" "sort" "strings" cnilibrary "github.com/containernetworking/cni/libcni" + "github.com/containernetworking/cni/pkg/invoke" + "github.com/containernetworking/cni/pkg/version" ) // Opt sets options for a CNI instance @@ -41,7 +44,13 @@ func WithInterfacePrefix(prefix string) Opt { func WithPluginDir(dirs []string) Opt { return func(c *libcni) error { c.pluginDirs = dirs - c.cniConfig = &cnilibrary.CNIConfig{Path: dirs} + c.cniConfig = cnilibrary.NewCNIConfig( + dirs, + &invoke.DefaultExec{ + RawExec: &invoke.RawExec{Stderr: os.Stderr}, + PluginDecoder: version.PluginDecoder{}, + }, + ) return nil } } diff --git a/vendor/github.com/containerd/imgcrypt/.gitignore b/vendor/github.com/containerd/imgcrypt/.gitignore index 814d8e1887717..10da9f76bb536 100644 --- a/vendor/github.com/containerd/imgcrypt/.gitignore +++ b/vendor/github.com/containerd/imgcrypt/.gitignore @@ -1,3 +1,2 @@ *~ -/ctr -/ctd-decoder +/bin/ diff --git a/vendor/github.com/containerd/imgcrypt/.golangci.yml b/vendor/github.com/containerd/imgcrypt/.golangci.yml index 9b16b5ce85d14..13ec860f901a6 100644 --- a/vendor/github.com/containerd/imgcrypt/.golangci.yml +++ b/vendor/github.com/containerd/imgcrypt/.golangci.yml @@ -6,7 +6,7 @@ linters: - unconvert - gofmt - goimports - - golint + - revive - ineffassign - vet - unused diff --git a/vendor/github.com/containerd/imgcrypt/CHANGES b/vendor/github.com/containerd/imgcrypt/CHANGES index cecf28f8cdada..b8971ba4a59ae 100644 --- a/vendor/github.com/containerd/imgcrypt/CHANGES +++ b/vendor/github.com/containerd/imgcrypt/CHANGES @@ -1,5 +1,20 @@ CHANGES +v1.1.3: + - Release v1.1.3 addresses issue #62 due to re-tagging of v1.1.2 + - docs: update referenced containerd project branch to main + - Update linter to match containerd repo + - Update CI golang version + - Updated to containerd 1.5.8 + +v1.1.2: + - Decouple CreateCryptoConfig() from github.com/urfave/cli + - Updated to containerd 1.5.7 + - Implemented ConvertFunc for image en- and decryption + - Replace pkg/errors with errors package + - Updated to ocicrypt 1.1.2 + - Sync'ed ctr-enc with ctr of containerd-1.5.0 + v1.1.1: - rebased on ocicrypt 1.1.1 diff --git a/vendor/github.com/containerd/imgcrypt/MAINTAINERS b/vendor/github.com/containerd/imgcrypt/MAINTAINERS index acb227c337886..15c43be897349 100644 --- a/vendor/github.com/containerd/imgcrypt/MAINTAINERS +++ b/vendor/github.com/containerd/imgcrypt/MAINTAINERS @@ -1,7 +1,7 @@ # imgcrypt maintainers # -# 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 +# As a containerd sub-project, containerd maintainers are also included from https://github.com/containerd/project/blob/main/MAINTAINERS. +# See https://github.com/containerd/project/blob/main/GOVERNANCE.md for description of maintainer role # # MAINTAINERS # GitHub ID, Name, Email address diff --git a/vendor/github.com/containerd/imgcrypt/Makefile b/vendor/github.com/containerd/imgcrypt/Makefile index 88c331e214c0c..df6d9b5237672 100644 --- a/vendor/github.com/containerd/imgcrypt/Makefile +++ b/vendor/github.com/containerd/imgcrypt/Makefile @@ -16,9 +16,14 @@ # Base path used to install. DESTDIR ?= /usr/local +VERSION=$(shell git describe --match 'v[0-9]*' --dirty='.m' --always) + +CTR_LDFLAGS=-ldflags '-X github.com/containerd/containerd/version.Version=$(VERSION)' COMMANDS=ctd-decoder ctr-enc +RELEASE_COMMANDS=ctd-decoder BINARIES=$(addprefix bin/,$(COMMANDS)) +RELEASE_BINARIES=$(addprefix bin/,$(RELEASE_COMMANDS)) .PHONY: check build ctd-decoder @@ -32,7 +37,7 @@ bin/ctd-decoder: cmd/ctd-decoder FORCE go build -o $@ -v ./cmd/ctd-decoder/ bin/ctr-enc: cmd/ctr FORCE - go build -o $@ -v ./cmd/ctr/ + go build -o $@ ${CTR_LDFLAGS} -v ./cmd/ctr/ check: @echo "$@" @@ -44,6 +49,11 @@ install: @mkdir -p $(DESTDIR)/bin @install $(BINARIES) $(DESTDIR)/bin +containerd-release: + @echo "$@" + @mkdir -p $(DESTDIR)/bin + @install $(RELEASE_BINARIES) $(DESTDIR)/bin + uninstall: @echo "$@" @rm -f $(addprefix $(DESTDIR)/bin/,$(notdir $(BINARIES))) diff --git a/vendor/github.com/containerd/imgcrypt/README.md b/vendor/github.com/containerd/imgcrypt/README.md index c90fdd547b4d1..01ea1c8406cc0 100644 --- a/vendor/github.com/containerd/imgcrypt/README.md +++ b/vendor/github.com/containerd/imgcrypt/README.md @@ -11,7 +11,7 @@ of containerd's `ctr` tool (`ctr-enc') with support for encrypting and decryptin # Usage `imgcrypt` requires containerd 1.3 or later. Containerd 1.4 or later is required when used with Kubernetes. -For configuration instructions for kubernetes, please consult the [CRI decryption document](https://github.com/containerd/containerd/blob/master/docs/decryption.md). +For configuration instructions for kubernetes, please consult the [CRI decryption document](https://github.com/containerd/containerd/blob/main/docs/cri/decryption.md). Build and install `imgcrypt`: @@ -96,8 +96,8 @@ Hello World! **imgcrypt** is a non-core 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), + * [Project governance](https://github.com/containerd/project/blob/main/GOVERNANCE.md), * [Maintainers](MAINTAINERS), - * and [Contributing guidelines](https://github.com/containerd/project/blob/master/CONTRIBUTING.md) + * and [Contributing guidelines](https://github.com/containerd/project/blob/main/CONTRIBUTING.md) information in our [`containerd/project`](https://github.com/containerd/project) repository. diff --git a/vendor/github.com/containerd/imgcrypt/go.mod b/vendor/github.com/containerd/imgcrypt/go.mod index 06dc16bb7c492..416ad8e6fb1c6 100644 --- a/vendor/github.com/containerd/imgcrypt/go.mod +++ b/vendor/github.com/containerd/imgcrypt/go.mod @@ -1,20 +1,20 @@ module github.com/containerd/imgcrypt -go 1.13 +go 1.16 require ( - github.com/Microsoft/go-winio v0.4.17-0.20210324224401-5516f17a5958 - github.com/Microsoft/hcsshim v0.8.16 - github.com/containerd/console v1.0.2 - github.com/containerd/containerd v1.5.0-rc.0 - github.com/containerd/typeurl v1.0.1 - github.com/containers/ocicrypt v1.1.1 + github.com/Microsoft/go-winio v0.4.17 + github.com/Microsoft/hcsshim v0.8.23 + github.com/containerd/console v1.0.3 + github.com/containerd/containerd v1.5.8 + github.com/containerd/go-cni v1.1.0 + github.com/containerd/typeurl v1.0.2 + github.com/containers/ocicrypt v1.1.2 github.com/gogo/protobuf v1.3.2 github.com/opencontainers/go-digest v1.0.0 github.com/opencontainers/image-spec v1.0.1 - github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d - github.com/pkg/errors v0.9.1 - github.com/sirupsen/logrus v1.7.0 + github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 + github.com/sirupsen/logrus v1.8.1 github.com/urfave/cli v1.22.2 golang.org/x/sync v0.0.0-20201207232520-09787c993a3a google.golang.org/grpc v1.33.2 diff --git a/vendor/github.com/containerd/imgcrypt/go.sum b/vendor/github.com/containerd/imgcrypt/go.sum index 1d87c3ddcdce3..5cad7ce16b0f2 100644 --- a/vendor/github.com/containerd/imgcrypt/go.sum +++ b/vendor/github.com/containerd/imgcrypt/go.sum @@ -42,19 +42,22 @@ github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tT github.com/Microsoft/go-winio v0.4.16-0.20201130162521-d1ffc52c7331/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= github.com/Microsoft/go-winio v0.4.17-0.20210211115548-6eac466e5fa3/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.4.17-0.20210324224401-5516f17a5958 h1:koVgEW/cX7NavmMAkL6LgoMZJ9gJnxuWMwwfw5A2s34= github.com/Microsoft/go-winio v0.4.17-0.20210324224401-5516f17a5958/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= +github.com/Microsoft/go-winio v0.4.17 h1:iT12IBVClFevaf8PuVyi3UmZOVh4OqnaLxDTW2O6j3w= +github.com/Microsoft/go-winio v0.4.17/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/hcsshim v0.8.6/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= github.com/Microsoft/hcsshim v0.8.7-0.20190325164909-8abdbb8205e4/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= github.com/Microsoft/hcsshim v0.8.7/go.mod h1:OHd7sQqRFrYd3RmSgbgji+ctCwkbq2wbEYNSzOYtcBQ= github.com/Microsoft/hcsshim v0.8.9/go.mod h1:5692vkUqntj1idxauYlpoINNKeqCiG6Sg38RRsjT5y8= github.com/Microsoft/hcsshim v0.8.14/go.mod h1:NtVKoYxQuTLx6gEq0L96c9Ju4JbRJ4nY2ow3VK6a9Lg= github.com/Microsoft/hcsshim v0.8.15/go.mod h1:x38A4YbHbdxJtc0sF6oIz+RG0npwSCAvn69iY6URG00= -github.com/Microsoft/hcsshim v0.8.16 h1:8/auA4LFIZFTGrqfKhGBSXwM6/4X1fHa/xniyEHu8ac= github.com/Microsoft/hcsshim v0.8.16/go.mod h1:o5/SZqmR7x9JNKsW3pu+nqHm0MF8vbA+VxGOoXdC600= +github.com/Microsoft/hcsshim v0.8.23 h1:47MSwtKGXet80aIn+7h4YI6fwPmwIghAnsx2aOUrG2M= +github.com/Microsoft/hcsshim v0.8.23/go.mod h1:4zegtUJth7lAvFyc6cH2gGQ5B3OFQim01nnU2M8jKDg= github.com/Microsoft/hcsshim/test v0.0.0-20201218223536-d3e5debf77da/go.mod h1:5hlzMzRKMLyo42nCZ9oml8AdTlq/0cvIaBv6tK1RehU= github.com/Microsoft/hcsshim/test v0.0.0-20210227013316-43a75bb4edd3/go.mod h1:mw7qgWloBUl75W/gVH3cQszUg1+gUITj7D6NY7ywVnY= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= @@ -63,6 +66,7 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -71,6 +75,8 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= +github.com/bits-and-blooms/bitset v1.2.0 h1:Kn4yilvwNtMACtf1eYDlG8H77R07mZSPbMjLyS07ChA= +github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= @@ -79,37 +85,46 @@ github.com/buger/jsonparser v0.0.0-20180808090653-f4dd9f5a6b44/go.mod h1:bbYlZJ7 github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50= github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= +github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= +github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmEg9bt0VpxxWqJlO4iwu3FBdHUzV7wQVg= github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775/go.mod h1:7cR51M8ViRLIdUjrmSXlK9pkrsDlLHbO8jiB8X8JnOc= -github.com/cilium/ebpf v0.2.0 h1:Fv93L3KKckEcEHR3oApXVzyBTDA8WAm6VXhPE00N3f8= github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= +github.com/cilium/ebpf v0.4.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= +github.com/cilium/ebpf v0.6.2 h1:iHsfF/t4aW4heW2YKfeHrVPGdtYTL4C4KocpM8KTSnI= +github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/containerd/aufs v0.0.0-20200908144142-dab0cbea06f4/go.mod h1:nukgQABAEopAHvB6j7cnP5zJ+/3aVcE7hCYqvIwAHyE= github.com/containerd/aufs v0.0.0-20201003224125-76a6863f2989/go.mod h1:AkGGQs9NM2vtYHaUen+NljV0/baGCAPELGm2q9ZXpWU= github.com/containerd/aufs v0.0.0-20210316121734-20793ff83c97/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= +github.com/containerd/aufs v1.0.0/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= github.com/containerd/btrfs v0.0.0-20201111183144-404b9149801e/go.mod h1:jg2QkJcsabfHugurUvvPhS3E08Oxiuh5W/g1ybB4e0E= github.com/containerd/btrfs v0.0.0-20210316141732-918d888fb676/go.mod h1:zMcX3qkXTAi9GI50+0HOeuV8LU2ryCE/V2vG/ZBiTss= +github.com/containerd/btrfs v1.0.0/go.mod h1:zMcX3qkXTAi9GI50+0HOeuV8LU2ryCE/V2vG/ZBiTss= github.com/containerd/cgroups v0.0.0-20190717030353-c4b9ac5c7601/go.mod h1:X9rLEHIqSf/wfK8NsPqxJmeZgW4pcfzdXITDrUSJ6uI= github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko= github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59/go.mod h1:pA0z1pT8KYB3TCXK/ocprsh7MAkoW8bZVzPdih9snmM= github.com/containerd/cgroups v0.0.0-20200710171044-318312a37340/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo= github.com/containerd/cgroups v0.0.0-20200824123100-0b889c03f102/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo= -github.com/containerd/cgroups v0.0.0-20210114181951-8a68de567b68 h1:hkGVFjz+plgr5UfxZUTPFbUFIF/Km6/s+RVRIRHLrrY= github.com/containerd/cgroups v0.0.0-20210114181951-8a68de567b68/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE= +github.com/containerd/cgroups v1.0.1 h1:iJnMvco9XGvKUvNQkv88bE4uJXxRQH18efbKo9w5vHQ= +github.com/containerd/cgroups v1.0.1/go.mod h1:0SJrPIenamHDcZhEcJMNBB85rHcUsw4f25ZfBiPYRkU= github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= github.com/containerd/console v0.0.0-20191206165004-02ecf6a7291e/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE= github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw= -github.com/containerd/console v1.0.2 h1:Pi6D+aZXM+oUw1czuKgH5IJ+y0jhYcwBJfx5/Ghn9dE= github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8acV1PGKCbzQ= +github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw= +github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= github.com/containerd/containerd v1.2.10/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/containerd/containerd v1.3.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= @@ -118,57 +133,78 @@ github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMX github.com/containerd/containerd v1.4.0-beta.2.0.20200729163537-40b22ef07410/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/containerd/containerd v1.4.1/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/containerd/containerd v1.4.3/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/containerd v1.4.9/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/containerd/containerd v1.5.0-beta.1/go.mod h1:5HfvG1V2FsKesEGQ17k5/T7V960Tmcumvqn8Mc+pCYQ= github.com/containerd/containerd v1.5.0-beta.3/go.mod h1:/wr9AVtEM7x9c+n0+stptlo/uBBoBORwEx6ardVcmKU= github.com/containerd/containerd v1.5.0-beta.4/go.mod h1:GmdgZd2zA2GYIBZ0w09ZvgqEq8EfBp/m3lcVZIvPHhI= -github.com/containerd/containerd v1.5.0-rc.0 h1:fVmAxX648SbHlWm3UnrkKQrZ+aeXznUnZttjbIYCF60= github.com/containerd/containerd v1.5.0-rc.0/go.mod h1:V/IXoMqNGgBlabz3tHD2TWDoTJseu1FGOKuoA4nNb2s= +github.com/containerd/containerd v1.5.8 h1:NmkCC1/QxyZFBny8JogwLpOy2f+VEbO/f6bV2Mqtwuw= +github.com/containerd/containerd v1.5.8/go.mod h1:YdFSv5bTFLpG2HIYmfqDpSYYTDX+mc5qtSuYx1YUb/s= github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/containerd/continuity v0.0.0-20191127005431-f65d91d395eb/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/containerd/continuity v0.0.0-20200710164510-efbc4488d8fe/go.mod h1:cECdGN1O8G9bgKTlLhuPJimka6Xb/Gg7vYzCTNVxhvo= github.com/containerd/continuity v0.0.0-20201208142359-180525291bb7/go.mod h1:kR3BEg7bDFaEddKm54WSmrol1fKWDU1nKYkgrcgZT7Y= -github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e h1:6JKvHHt396/qabvMhnhUZvWaHZzfVfldxE60TK8YLhg= github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e/go.mod h1:EXlVlkqNba9rJe3j7w3Xa924itAMLgZH4UD/Q4PExuQ= +github.com/containerd/continuity v0.1.0 h1:UFRRY5JemiAhPZrr/uE0n8fMTLcZsUvySPr1+D7pgr8= +github.com/containerd/continuity v0.1.0/go.mod h1:ICJu0PwR54nI0yPEnJ6jcS+J7CZAUXrLh8lPo2knzsM= github.com/containerd/fifo v0.0.0-20180307165137-3d5202aec260/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= github.com/containerd/fifo v0.0.0-20200410184934-f15a3290365b/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0= github.com/containerd/fifo v0.0.0-20201026212402-0724c46b320c/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0= -github.com/containerd/fifo v0.0.0-20210316144830-115abcc95a1d h1:u6sWqdNGAy7+O8qG/r1dqdnZE7IdEjteK3WGuvbfreo= github.com/containerd/fifo v0.0.0-20210316144830-115abcc95a1d/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= +github.com/containerd/fifo v1.0.0 h1:6PirWBr9/L7GDamKr+XM0IeUFXu5mf3M/BPpH9gaLBU= +github.com/containerd/fifo v1.0.0/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= github.com/containerd/go-cni v1.0.1/go.mod h1:+vUpYxKvAF72G9i1WoDOiPGRtQpqsNW/ZHtSlv++smU= +github.com/containerd/go-cni v1.0.2/go.mod h1:nrNABBHzu0ZwCug9Ije8hL2xBCYh/pjfMb1aZGrrohk= +github.com/containerd/go-cni v1.1.0 h1:kAe75MdTddsLCZDqP2BJn6e1ovD+il9oFkNlfGULEos= +github.com/containerd/go-cni v1.1.0/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA= github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= github.com/containerd/go-runc v0.0.0-20190911050354-e029b79d8cda/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= github.com/containerd/go-runc v0.0.0-20200220073739-7016d3ce2328/go.mod h1:PpyHrqVs8FTi9vpyHwPwiNEGaACDxT/N/pLcvMSRA9g= -github.com/containerd/go-runc v0.0.0-20201020171139-16b287bc67d0 h1:e+50zk22gvHLJKe8+d+xSMyA88PPQk/XfWuUw1BdnPA= github.com/containerd/go-runc v0.0.0-20201020171139-16b287bc67d0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= +github.com/containerd/go-runc v1.0.0 h1:oU+lLv1ULm5taqgV/CJivypVODI4SUz1znWjv3nNYS0= +github.com/containerd/go-runc v1.0.0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= github.com/containerd/imgcrypt v1.0.1/go.mod h1:mdd8cEPW7TPgNG4FpuP3sGBiQ7Yi/zak9TYCG3juvb0= github.com/containerd/imgcrypt v1.0.4-0.20210301171431-0ae5c75f59ba/go.mod h1:6TNsg0ctmizkrOgXRNQjAPFWpMYRWuiB6dSF4Pfa5SA= github.com/containerd/imgcrypt v1.1.1-0.20210312161619-7ed62a527887/go.mod h1:5AZJNI6sLHJljKuI9IHnw1pWqo/F0nGDOuR9zgTs7ow= +github.com/containerd/imgcrypt v1.1.1/go.mod h1:xpLnwiQmEUJPvQoAapeb2SNCxz7Xr6PJrXQb0Dpc4ms= github.com/containerd/nri v0.0.0-20201007170849-eb1350a75164/go.mod h1:+2wGSDGFYfE5+So4M5syatU0N0f0LbWpuqyMi4/BE8c= github.com/containerd/nri v0.0.0-20210316161719-dbaa18c31c14/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= +github.com/containerd/nri v0.1.0/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= github.com/containerd/ttrpc v0.0.0-20190828172938-92c8520ef9f8/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= github.com/containerd/ttrpc v0.0.0-20191028202541-4f1b8fe65a5c/go.mod h1:LPm1u0xBw8r8NOKoOdNMeVHSawSsltak+Ihv+etqsE8= github.com/containerd/ttrpc v1.0.1/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y= -github.com/containerd/ttrpc v1.0.2 h1:2/O3oTZN36q2xRolk0a2WWGgh7/Vf/liElg5hFYLX9U= github.com/containerd/ttrpc v1.0.2/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y= +github.com/containerd/ttrpc v1.1.0 h1:GbtyLRxb0gOLR0TYQWt3O6B0NvT8tMdorEHqIQo/lWI= +github.com/containerd/ttrpc v1.1.0/go.mod h1:XX4ZTnoOId4HklF4edwc4DcqskFZuvXB1Evzy5KFQpQ= github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= github.com/containerd/typeurl v0.0.0-20190911142611-5eb25027c9fd/go.mod h1:GeKYzf2pQcqv7tJ0AoCuuhtnqhva5LNU3U+OyKxxJpk= -github.com/containerd/typeurl v1.0.1 h1:PvuK4E3D5S5q6IqsPDCy928FhP0LUIGcmZ/Yhgp5Djw= github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg= +github.com/containerd/typeurl v1.0.2 h1:Chlt8zIieDbzQFzXzAeBEF92KhExuE4p9p92/QmY7aY= +github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s= github.com/containerd/zfs v0.0.0-20200918131355-0a33824f23a2/go.mod h1:8IgZOBdv8fAgXddBT4dBXJPtxyRsejFIpXoklgxgEjw= github.com/containerd/zfs v0.0.0-20210301145711-11e8f1707f62/go.mod h1:A9zfAbMlQwE+/is6hi0Xw8ktpL+6glmqZYtevJgaB8Y= github.com/containerd/zfs v0.0.0-20210315114300-dde8f0fda960/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= github.com/containerd/zfs v0.0.0-20210324211415-d5c4544f0433/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= +github.com/containerd/zfs v1.0.0/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= github.com/containernetworking/cni v0.7.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= github.com/containernetworking/cni v0.8.0/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= +github.com/containernetworking/cni v0.8.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= +github.com/containernetworking/cni v1.0.1 h1:9OIL/sZmMYDBe+G8svzILAlulUpaDTUjeAbtH/JNLBo= +github.com/containernetworking/cni v1.0.1/go.mod h1:AKuhXbN5EzmD4yTNtfSsX3tPcmtrBI6QcRV0NiNt15Y= github.com/containernetworking/plugins v0.8.6/go.mod h1:qnw5mN19D8fIwkqW7oHHYDHVlzhJpcY6TQxn/fUyDDM= +github.com/containernetworking/plugins v0.9.1/go.mod h1:xP/idU2ldlzN6m4p5LmGiwRDjeJr6FLK6vuiUwoH7P8= github.com/containers/ocicrypt v1.0.1/go.mod h1:MeJDzk1RJHv89LjsH0Sp5KTY3ZYkjXO/C+bKAeWFIrc= github.com/containers/ocicrypt v1.1.0/go.mod h1:b8AOe0YR67uU8OqfVNcznfFpAzu3rdgUV4GP9qXPfu4= -github.com/containers/ocicrypt v1.1.1 h1:prL8l9w3ntVqXvNH1CiNn5ENjcCnr38JqpSyvKKB4GI= github.com/containers/ocicrypt v1.1.1/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= +github.com/containers/ocicrypt v1.1.2 h1:Ez+GAMP/4GLix5Ywo/fL7O0nY771gsBIigiqUm1aXz0= +github.com/containers/ocicrypt v1.1.2/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= +github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-iptables v0.4.5/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= +github.com/coreos/go-iptables v0.5.0/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -177,8 +213,9 @@ github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7 github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e h1:Wf6HqHfScWJN9/ZjdUKyjop4mf3Qdd+1TvvltAvM3m8= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= -github.com/coreos/go-systemd/v22 v22.1.0 h1:kq/SbG2BCKLkDKkjQf5OWwKWUKj1lgs3lFI4PxnR5lg= github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= +github.com/coreos/go-systemd/v22 v22.3.2 h1:D9/bQk5vlXQFZ6Kwuu6zaiXJ9oTPe68++AzAJc1DzSI= +github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= @@ -196,6 +233,7 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/docker/distribution v0.0.0-20190905152932-14b96e55d84c/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY= github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= @@ -222,7 +260,10 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= +github.com/frankban/quicktest v1.11.3 h1:8sXhOn0uLys67V8EsXLc6eszDs8VXWxL3iRvebPhedY= +github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXtdwXqoenmZCw6S+25EAm2MkxbG0deNDu4cbSA= github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= @@ -250,8 +291,9 @@ github.com/godbus/dbus v0.0.0-20151105175453-c7fdd8b5cd55/go.mod h1:/YcGZj5zSblf github.com/godbus/dbus v0.0.0-20180201030542-885f9cc04c9c/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e h1:BWhy2j3IXJhjCbC68FptL43tDKIq8FladmaTs3Xs7Z8= github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= -github.com/godbus/dbus/v5 v5.0.3 h1:ZqHaoEF7TBzh4jzPmqVhE/5A1z9of6orkAe5uHoAeME= github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/godbus/dbus/v5 v5.0.4 h1:9349emZab16e7zQvpmsbtjc18ykshndd8y2PG3sgJbA= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU= github.com/gogo/googleapis v1.4.0 h1:zgVt4UpGxcqVOw97aRGxT4svlcmdK35fynLNctY32zI= github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= @@ -264,6 +306,7 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= @@ -286,8 +329,9 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0 h1:LUVKkCeviFUMKqHa4tXIIij/lbhnMbP7Fn5wKdKkRh4= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -297,8 +341,9 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -310,8 +355,9 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= +github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= @@ -319,10 +365,13 @@ github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORR github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -330,12 +379,14 @@ github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1: github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.10/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= @@ -360,12 +411,14 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxv github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= @@ -379,8 +432,11 @@ github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182aff github.com/miekg/pkcs11 v1.0.3 h1:iMwmD7I5225wv84WxIG/bmxz9AXjWvTWIbM/TYHvWtw= github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A= +github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= +github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= github.com/moby/sys/mountinfo v0.4.1 h1:1O+1cHA1aujwEwwVMa2Xm2l+gIpUHyd3+D+d7LZh1kM= github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= @@ -396,6 +452,9 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= +github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v0.0.0-20151202141238-7f8ab55aaf3b/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -403,10 +462,16 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.13.0 h1:M76yO2HkZASFjXL0HSoZJ1AYEmQxNJmY41Jx1zNUq1Y= +github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.10.3 h1:gph6h/qe9GSUw1NhH1gp+qb+h8rXD8Cy60Z32Qw3ELA= +github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= @@ -420,18 +485,22 @@ github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5X github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= github.com/opencontainers/runc v1.0.0-rc8.0.20190926000215-3e425f80a8c9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= github.com/opencontainers/runc v1.0.0-rc9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.0-rc93 h1:x2UMpOOVf3kQ8arv/EsDGwim8PTNqzL1/EYDr/+scOM= github.com/opencontainers/runc v1.0.0-rc93/go.mod h1:3NOsor4w32B2tC0Zbl8Knk4Wg84SM2ImC1fxBuqJ/H0= +github.com/opencontainers/runc v1.0.2 h1:opHZMaswlyxz1OuGpBE53Dwe4/xF7EZTY0A2L/FpCOg= +github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.2-0.20190207185410-29686dbc5559/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d h1:pNa8metDkwZjb9g4T8s+krQ+HRgZAkqnXml+wNir/+s= github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 h1:3snG66yBm59tKhhSPQrQ/0bCrv1LQbKt40LnUPiUxdc= +github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs= github.com/opencontainers/selinux v1.6.0/go.mod h1:VVGKuOLlE7v4PJyT6h7mNWvq1rzqiriPsEqVhc+svHE= -github.com/opencontainers/selinux v1.8.0 h1:+77ba4ar4jsCbL1GLbFL8fFM57w6suPfSS9PDLDY7KM= github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3ogry1nUQF8Evvo= +github.com/opencontainers/selinux v1.8.2 h1:c4ca10UMgRcvZ6h0K4HtS15UaVSBEaE+iln2LVpAuGc= +github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.8.1 h1:1Nf83orprkJyknT6h7zbuEGUEjcyVlCxSUGTENmNCRM= github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= @@ -445,6 +514,7 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= @@ -454,11 +524,14 @@ github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1: github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.0-20190522114515-bc1a522cf7b1/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= @@ -468,12 +541,14 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= @@ -483,24 +558,32 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980 h1:lIOOHPEbXzO3vnmx2gok1Tfs31Q8GQqKLc8vVqyQq/I= github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8= github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= @@ -514,6 +597,7 @@ github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= @@ -521,20 +605,23 @@ github.com/urfave/cli v1.22.2 h1:gsqYFH8bb9ekPA12kRo0hfjngWQjkJPlN9R0N78BoUo= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= +github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc/go.mod h1:ZjcWmFBXmLKZu9Nxj3WKYEafiSqer2rnvPr0en9UNpI= github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= +github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= -github.com/willf/bitset v1.1.11 h1:N7Z7E9UvjW+sGsEl7k/SJrvY2reP1A07MrGuCjIOjRE= github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= +go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= @@ -621,7 +708,9 @@ golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= @@ -664,6 +753,7 @@ golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190812073006-9eafafc0a87e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -681,9 +771,11 @@ golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -693,12 +785,14 @@ golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200922070232-aee5d888a860/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201117170446-d9b008d0a637/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201202213521-69691e467435/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210324051608-47abb6519492 h1:Paq34FxTluEPvVyayQqMPgHm+vTOrIifmcYxFBx9TLg= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210426230700-d19ff857e887 h1:dXfMednGJh/SUUFjTLsWJz3P+TQt9qnR11GgeI3vWKs= +golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -819,8 +913,11 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -839,6 +936,7 @@ gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76 gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w= gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -864,17 +962,23 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= k8s.io/api v0.20.4/go.mod h1:++lNL1AJMkDymriNniQsWRkMDzRaX2Y/POTUi8yvqYQ= +k8s.io/api v0.20.6/go.mod h1:X9e8Qag6JV/bL5G6bU8sdVRltWKmdHsFUGS3eVndqE8= k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= k8s.io/apimachinery v0.20.4/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= +k8s.io/apimachinery v0.20.6/go.mod h1:ejZXtW1Ra6V1O5H8xPBGz+T3+4gfkTCeExAHKU57MAc= k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= k8s.io/apiserver v0.20.4/go.mod h1:Mc80thBKOyy7tbvFtB4kJv1kbdD0eIH8k8vianJcbFM= +k8s.io/apiserver v0.20.6/go.mod h1:QIJXNt6i6JB+0YQRNcS0hdRHJlMhflFmsBDeSgT1r8Q= k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= k8s.io/client-go v0.20.4/go.mod h1:LiMv25ND1gLUdBeYxBIwKpkSC5IsozMMmOOeSJboP+k= +k8s.io/client-go v0.20.6/go.mod h1:nNQMnOvEUEsOzRRFIIkdmYOjAZrC8bgq0ExboWSU1I0= k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeYNLk= k8s.io/component-base v0.20.4/go.mod h1:t4p9EdiagbVCJKrQ1RsA5/V4rFQNDfRlevJajlGwgjI= +k8s.io/component-base v0.20.6/go.mod h1:6f1MPBAeI+mvuts3sIdtpjljHWBQ2cIy38oBIWMYnrM= k8s.io/cri-api v0.17.3/go.mod h1:X1sbHmuXhwaHs9xxYffLqJogVsnI+f6cPRcgPel7ywM= k8s.io/cri-api v0.20.1/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= k8s.io/cri-api v0.20.4/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= +k8s.io/cri-api v0.20.6/go.mod h1:ew44AjNXwyn1s0U4xCKGodU7J1HzBeZ1MpGrpa5r8Yc= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= @@ -885,6 +989,8 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8 rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.14/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/structured-merge-diff/v4 v4.0.3/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/vendor/github.com/containerd/imgcrypt/images/encryption/client.go b/vendor/github.com/containerd/imgcrypt/images/encryption/client.go index 6419d5928d3a9..3d988b54ab1fb 100644 --- a/vendor/github.com/containerd/imgcrypt/images/encryption/client.go +++ b/vendor/github.com/containerd/imgcrypt/images/encryption/client.go @@ -18,6 +18,7 @@ package encryption import ( "context" + "fmt" "github.com/containerd/containerd" "github.com/containerd/containerd/containers" @@ -25,10 +26,10 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/imgcrypt" "github.com/containerd/typeurl" + encconfig "github.com/containers/ocicrypt/config" "github.com/gogo/protobuf/types" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" ) // WithDecryptedUnpack allows to pass parameters the 'layertool' needs to the applier @@ -40,7 +41,7 @@ func WithDecryptedUnpack(data *imgcrypt.Payload) diff.ApplyOpt { data.Descriptor = desc any, err := typeurl.MarshalAny(data) if err != nil { - return errors.Wrapf(err, "failed to marshal payload") + return fmt.Errorf("failed to marshal payload: %w", err) } for _, id := range imgcrypt.PayloadToolIDs { diff --git a/vendor/github.com/containerd/imgcrypt/images/encryption/encryption.go b/vendor/github.com/containerd/imgcrypt/images/encryption/encryption.go index 59bef8c970c9e..204d32c0a1a92 100644 --- a/vendor/github.com/containerd/imgcrypt/images/encryption/encryption.go +++ b/vendor/github.com/containerd/imgcrypt/images/encryption/encryption.go @@ -20,22 +20,22 @@ import ( "bytes" "context" "encoding/json" + "errors" "fmt" "io" "math/rand" - "github.com/containerd/containerd/images" - "github.com/containers/ocicrypt" - encconfig "github.com/containers/ocicrypt/config" - "github.com/containerd/containerd/content" "github.com/containerd/containerd/errdefs" + "github.com/containerd/containerd/images" + "github.com/containerd/containerd/images/converter" "github.com/containerd/containerd/platforms" - encocispec "github.com/containers/ocicrypt/spec" - digest "github.com/opencontainers/go-digest" - specs "github.com/opencontainers/image-spec/specs-go" - "github.com/pkg/errors" + "github.com/containers/ocicrypt" + encconfig "github.com/containers/ocicrypt/config" + encocispec "github.com/containers/ocicrypt/spec" + "github.com/opencontainers/go-digest" + "github.com/opencontainers/image-spec/specs-go" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) @@ -116,7 +116,7 @@ func encryptLayer(cc *encconfig.CryptoConfig, dataReader content.ReaderAt, desc newDesc.MediaType = encocispec.MediaTypeLayerEnc default: - return ocispec.Descriptor{}, nil, nil, errors.Errorf("Encryption: unsupporter layer MediaType: %s\n", desc.MediaType) + return ocispec.Descriptor{}, nil, nil, fmt.Errorf("unsupporter layer MediaType: %s", desc.MediaType) } return newDesc, encLayerReader, encLayerFinalizer, nil @@ -141,7 +141,7 @@ func DecryptLayer(dc *encconfig.DecryptConfig, dataReader io.Reader, desc ocispe case encocispec.MediaTypeLayerEnc: newDesc.MediaType = images.MediaTypeDockerSchema2Layer default: - return ocispec.Descriptor{}, nil, "", errors.Errorf("Decryption: unsupporter layer MediaType: %s\n", desc.MediaType) + return ocispec.Descriptor{}, nil, "", fmt.Errorf("unsupporter layer MediaType: %s", desc.MediaType) } return newDesc, resultReader, layerDigest, nil } @@ -166,7 +166,7 @@ func decryptLayer(cc *encconfig.CryptoConfig, dataReader content.ReaderAt, desc case encocispec.MediaTypeLayerEnc: newDesc.MediaType = images.MediaTypeDockerSchema2Layer default: - return ocispec.Descriptor{}, nil, errors.Errorf("Decryption: unsupporter layer MediaType: %s\n", desc.MediaType) + return ocispec.Descriptor{}, nil, fmt.Errorf("unsupporter layer MediaType: %s", desc.MediaType) } return newDesc, resultReader, nil } @@ -209,7 +209,7 @@ func cryptLayer(ctx context.Context, cs content.Store, desc ocispec.Descriptor, if haveDigest { if err := content.WriteBlob(ctx, cs, ref, resultReader, newDesc); err != nil { - return ocispec.Descriptor{}, errors.Wrap(err, "failed to write config") + return ocispec.Descriptor{}, fmt.Errorf("failed to write config: %w", err) } } else { newDesc.Digest, newDesc.Size, err = ingestReader(ctx, cs, ref, resultReader) @@ -223,7 +223,7 @@ func cryptLayer(ctx context.Context, cs content.Store, desc ocispec.Descriptor, if encLayerFinalizer != nil { annotations, err := encLayerFinalizer() if err != nil { - return ocispec.Descriptor{}, errors.Wrap(err, "Error getting annotations from encLayer finalizer") + return ocispec.Descriptor{}, fmt.Errorf("error getting annotations from encLayer finalizer: %w", err) } for k, v := range annotations { newDesc.Annotations[k] = v @@ -235,22 +235,22 @@ func cryptLayer(ctx context.Context, cs content.Store, desc ocispec.Descriptor, func ingestReader(ctx context.Context, cs content.Ingester, ref string, r io.Reader) (digest.Digest, int64, error) { cw, err := content.OpenWriter(ctx, cs, content.WithRef(ref)) if err != nil { - return "", 0, errors.Wrap(err, "failed to open writer") + return "", 0, fmt.Errorf("failed to open writer: %w", err) } defer cw.Close() if _, err := content.CopyReader(cw, r); err != nil { - return "", 0, errors.Wrap(err, "copy failed") + return "", 0, fmt.Errorf("copy failed: %w", err) } st, err := cw.Status() if err != nil { - return "", 0, errors.Wrap(err, "failed to get state") + return "", 0, fmt.Errorf("failed to get state: %w", err) } if err := cw.Commit(ctx, st.Offset, ""); err != nil { if !errdefs.IsAlreadyExists(err) { - return "", 0, errors.Wrapf(err, "failed commit on ref %q", ref) + return "", 0, fmt.Errorf("failed commit on ref %q: %w", ref, err) } } @@ -304,7 +304,7 @@ func cryptChildren(ctx context.Context, cs content.Store, desc ocispec.Descripto // never encrypt/decrypt newLayers = append(newLayers, child) default: - return ocispec.Descriptor{}, false, errors.Errorf("bad/unhandled MediaType %s in encryptChildren\n", child.MediaType) + return ocispec.Descriptor{}, false, fmt.Errorf("bad/unhandled MediaType %s in encryptChildren", child.MediaType) } } @@ -319,7 +319,7 @@ func cryptChildren(ctx context.Context, cs content.Store, desc ocispec.Descripto mb, err := json.MarshalIndent(newManifest, "", " ") if err != nil { - return ocispec.Descriptor{}, false, errors.Wrap(err, "failed to marshal image") + return ocispec.Descriptor{}, false, fmt.Errorf("failed to marshal image: %w", err) } newDesc := ocispec.Descriptor{ @@ -338,7 +338,7 @@ func cryptChildren(ctx context.Context, cs content.Store, desc ocispec.Descripto ref := fmt.Sprintf("manifest-%s", newDesc.Digest.String()) if err := content.WriteBlob(ctx, cs, ref, bytes.NewReader(mb), newDesc, content.WithLabels(labels)); err != nil { - return ocispec.Descriptor{}, false, errors.Wrap(err, "failed to write config") + return ocispec.Descriptor{}, false, fmt.Errorf("failed to write config: %w", err) } return newDesc, true, nil } @@ -399,7 +399,7 @@ func cryptManifestList(ctx context.Context, cs content.Store, desc ocispec.Descr mb, err := json.MarshalIndent(newIndex, "", " ") if err != nil { - return ocispec.Descriptor{}, false, errors.Wrap(err, "failed to marshal index") + return ocispec.Descriptor{}, false, fmt.Errorf("failed to marshal index: %w", err) } newDesc := ocispec.Descriptor{ @@ -416,7 +416,7 @@ func cryptManifestList(ctx context.Context, cs content.Store, desc ocispec.Descr ref := fmt.Sprintf("index-%s", newDesc.Digest.String()) if err = content.WriteBlob(ctx, cs, ref, bytes.NewReader(mb), newDesc, content.WithLabels(labels)); err != nil { - return ocispec.Descriptor{}, false, errors.Wrap(err, "failed to write index") + return ocispec.Descriptor{}, false, fmt.Errorf("failed to write index: %w", err) } return newDesc, true, nil } @@ -428,7 +428,7 @@ func cryptManifestList(ctx context.Context, cs content.Store, desc ocispec.Descr // representing a manifest list or a single manifest func cryptImage(ctx context.Context, cs content.Store, desc ocispec.Descriptor, cc *encconfig.CryptoConfig, lf LayerFilter, cryptoOp cryptoOp) (ocispec.Descriptor, bool, error) { if cc == nil { - return ocispec.Descriptor{}, false, errors.Wrapf(errdefs.ErrInvalidArgument, "CryptoConfig must not be nil") + return ocispec.Descriptor{}, false, errors.New("invalid argument: CryptoConfig must not be nil") } switch desc.MediaType { case ocispec.MediaTypeImageIndex, images.MediaTypeDockerSchema2ManifestList: @@ -436,7 +436,7 @@ func cryptImage(ctx context.Context, cs content.Store, desc ocispec.Descriptor, case ocispec.MediaTypeImageManifest, images.MediaTypeDockerSchema2Manifest: return cryptManifest(ctx, cs, desc, cc, lf, cryptoOp) default: - return ocispec.Descriptor{}, false, errors.Errorf("CryptImage: Unhandled media type: %s", desc.MediaType) + return ocispec.Descriptor{}, false, fmt.Errorf("unhandled media type: %s", desc.MediaType) } } @@ -450,6 +450,28 @@ func DecryptImage(ctx context.Context, cs content.Store, desc ocispec.Descriptor return cryptImage(ctx, cs, desc, cc, lf, cryptoOpDecrypt) } +// GetImageEncryptConverter returns a converter function for image encryption +func GetImageEncryptConverter(cc *encconfig.CryptoConfig, lf LayerFilter) converter.ConvertFunc { + return func(ctx context.Context, cs content.Store, desc ocispec.Descriptor) (*ocispec.Descriptor, error) { + newDesc, _, err := EncryptImage(ctx, cs, desc, cc, lf) + if err != nil { + return nil, err + } + return &newDesc, nil + } +} + +// GetImageDecryptConverter returns a converter function for image decryption +func GetImageDecryptConverter(cc *encconfig.CryptoConfig, lf LayerFilter) converter.ConvertFunc { + return func(ctx context.Context, cs content.Store, desc ocispec.Descriptor) (*ocispec.Descriptor, error) { + newDesc, _, err := DecryptImage(ctx, cs, desc, cc, lf) + if err != nil { + return nil, err + } + return &newDesc, nil + } +} + // CheckAuthorization checks whether a user has the right keys to be allowed to access an image (every layer) // It takes decrypting of the layers only as far as decrypting the asymmetrically encrypted data // The decryption is only done for the current platform @@ -462,7 +484,7 @@ func CheckAuthorization(ctx context.Context, cs content.Store, desc ocispec.Desc _, _, err := cryptImage(ctx, cs, desc, &cc, lf, cryptoOpUnwrapOnly) if err != nil { - return errors.Wrapf(err, "you are not authorized to use this image") + return fmt.Errorf("you are not authorized to use this image: %w", err) } return nil } diff --git a/vendor/github.com/containerd/imgcrypt/payload.go b/vendor/github.com/containerd/imgcrypt/payload.go index 7d92543a34d78..0c8a48fd8dd6c 100644 --- a/vendor/github.com/containerd/imgcrypt/payload.go +++ b/vendor/github.com/containerd/imgcrypt/payload.go @@ -18,6 +18,7 @@ package imgcrypt import ( "github.com/containerd/typeurl" + encconfig "github.com/containers/ocicrypt/config" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/vendor/github.com/containers/ocicrypt/ADOPTERS.md b/vendor/github.com/containers/ocicrypt/ADOPTERS.md new file mode 100644 index 0000000000000..fa4b03bb88104 --- /dev/null +++ b/vendor/github.com/containers/ocicrypt/ADOPTERS.md @@ -0,0 +1,10 @@ +Below are list of adopters of the `ocicrypt` library or supports use of OCI encrypted images: +- [skopeo](https://github.com/containers/skopeo) +- [buildah](https://github.com/containers/buildah) +- [containerd](https://github.com/containerd/imgcrypt) +- [nerdctl](https://github.com/containerd/nerdctl) +- [distribution](https://github.com/distribution/distribution) + +Below are the list of projects that are in the process of adopting support: +- [quay](https://github.com/quay/quay) +- [kata-containers](https://github.com/kata-containers/kata-containers) diff --git a/vendor/github.com/containers/ocicrypt/README.md b/vendor/github.com/containers/ocicrypt/README.md index 84cab7a4089d2..b69d14e3b8176 100644 --- a/vendor/github.com/containers/ocicrypt/README.md +++ b/vendor/github.com/containers/ocicrypt/README.md @@ -34,6 +34,12 @@ The implementation for both symmetric and asymmetric encryption used in this lib We note that adding interfaces here is risky outside the OCI spec is not recommended, unless for very specialized and confined usecases. Please open an issue or PR if there is a general usecase that could be added to the OCI spec. + +#### Keyprovider interface + +As part of the keywrap interface, there is a [keyprovider](https://github.com/containers/ocicrypt/blob/main/docs/keyprovider.md) implementation that allows one to call out to a binary or service. + + ## Security Issues We consider security issues related to this library critical. Please report and security related issues by emailing maintainers in the [MAINTAINERS](MAINTAINERS) file. diff --git a/vendor/github.com/godbus/dbus/v5/README.markdown b/vendor/github.com/godbus/dbus/v5/README.md similarity index 81% rename from vendor/github.com/godbus/dbus/v5/README.markdown rename to vendor/github.com/godbus/dbus/v5/README.md index 1fb2eacaa15a7..5c24125838d26 100644 --- a/vendor/github.com/godbus/dbus/v5/README.markdown +++ b/vendor/github.com/godbus/dbus/v5/README.md @@ -14,14 +14,12 @@ D-Bus message bus system. ### Installation -This packages requires Go 1.7. If you installed it and set up your GOPATH, just run: +This packages requires Go 1.12 or later. It can be installed by running the command below: ``` -go get github.com/godbus/dbus +go get github.com/godbus/dbus/v5 ``` -If you want to use the subpackages, you can install them the same way. - ### Usage The complete package documentation and some simple examples are available at @@ -30,10 +28,12 @@ The complete package documentation and some simple examples are available at gives a short overview over the basic usage. #### Projects using godbus -- [notify](https://github.com/esiqveland/notify) provides desktop notifications over dbus into a library. +- [fyne](https://github.com/fyne-io/fyne) a cross platform GUI in Go inspired by Material Design. +- [fynedesk](https://github.com/fyne-io/fynedesk) a full desktop environment for Linux/Unix using Fyne. - [go-bluetooth](https://github.com/muka/go-bluetooth) provides a bluetooth client over bluez dbus API. -- [playerbm](https://github.com/altdesktop/playerbm) a bookmark utility for media players. - [iwd](https://github.com/shibumi/iwd) go bindings for the internet wireless daemon "iwd". +- [notify](https://github.com/esiqveland/notify) provides desktop notifications over dbus into a library. +- [playerbm](https://github.com/altdesktop/playerbm) a bookmark utility for media players. Please note that the API is considered unstable for now and may change without further notice. diff --git a/vendor/github.com/godbus/dbus/v5/auth.go b/vendor/github.com/godbus/dbus/v5/auth.go index 283487a0e3138..a59b4c0eb7659 100644 --- a/vendor/github.com/godbus/dbus/v5/auth.go +++ b/vendor/github.com/godbus/dbus/v5/auth.go @@ -53,7 +53,7 @@ type Auth interface { // bus. Auth must not be called on shared connections. func (conn *Conn) Auth(methods []Auth) error { if methods == nil { - uid := strconv.Itoa(os.Getuid()) + uid := strconv.Itoa(os.Geteuid()) methods = []Auth{AuthExternal(uid), AuthCookieSha1(uid, getHomeDir())} } in := bufio.NewReader(conn.transport) @@ -75,9 +75,9 @@ func (conn *Conn) Auth(methods []Auth) error { s = s[1:] for _, v := range s { for _, m := range methods { - if name, data, status := m.FirstData(); bytes.Equal(v, name) { + if name, _, status := m.FirstData(); bytes.Equal(v, name) { var ok bool - err = authWriteLine(conn.transport, []byte("AUTH"), v, data) + err = authWriteLine(conn.transport, []byte("AUTH"), v) if err != nil { return err } @@ -194,11 +194,14 @@ func (conn *Conn) tryAuth(m Auth, state authState, in *bufio.Reader) (error, boo } conn.uuid = string(s[1]) return nil, true + case state == waitingForOk && string(s[0]) == "DATA": + err = authWriteLine(conn.transport, []byte("DATA")) + if err != nil { + return err, false + } case state == waitingForOk && string(s[0]) == "REJECTED": return nil, false - case state == waitingForOk && (string(s[0]) == "DATA" || - string(s[0]) == "ERROR"): - + case state == waitingForOk && string(s[0]) == "ERROR": err = authWriteLine(conn.transport, []byte("CANCEL")) if err != nil { return err, false diff --git a/vendor/github.com/godbus/dbus/v5/conn.go b/vendor/github.com/godbus/dbus/v5/conn.go index 29fe018ad823b..76fc5cde3d26d 100644 --- a/vendor/github.com/godbus/dbus/v5/conn.go +++ b/vendor/github.com/godbus/dbus/v5/conn.go @@ -73,7 +73,7 @@ func SessionBus() (conn *Conn, err error) { return } -func getSessionBusAddress() (string, error) { +func getSessionBusAddress(autolaunch bool) (string, error) { if address := os.Getenv("DBUS_SESSION_BUS_ADDRESS"); address != "" && address != "autolaunch:" { return address, nil @@ -81,12 +81,26 @@ func getSessionBusAddress() (string, error) { os.Setenv("DBUS_SESSION_BUS_ADDRESS", address) return address, nil } + if !autolaunch { + return "", errors.New("dbus: couldn't determine address of session bus") + } return getSessionBusPlatformAddress() } // SessionBusPrivate returns a new private connection to the session bus. func SessionBusPrivate(opts ...ConnOption) (*Conn, error) { - address, err := getSessionBusAddress() + address, err := getSessionBusAddress(true) + if err != nil { + return nil, err + } + + return Dial(address, opts...) +} + +// SessionBusPrivate returns a new private connection to the session bus. If +// the session bus is not already open, do not attempt to launch it. +func SessionBusPrivateNoAutoStartup(opts ...ConnOption) (*Conn, error) { + address, err := getSessionBusAddress(false) if err != nil { return nil, err } @@ -121,7 +135,7 @@ func SystemBus() (conn *Conn, err error) { // ConnectSessionBus connects to the session bus. func ConnectSessionBus(opts ...ConnOption) (*Conn, error) { - address, err := getSessionBusAddress() + address, err := getSessionBusAddress(true) if err != nil { return nil, err } @@ -180,7 +194,7 @@ func Dial(address string, opts ...ConnOption) (*Conn, error) { // // Deprecated: use Dial with options instead. func DialHandler(address string, handler Handler, signalHandler SignalHandler) (*Conn, error) { - return Dial(address, WithSignalHandler(signalHandler)) + return Dial(address, WithHandler(handler), WithSignalHandler(signalHandler)) } // ConnOption is a connection option. @@ -478,14 +492,24 @@ func (conn *Conn) sendMessageAndIfClosed(msg *Message, ifClosed func()) { conn.outInt(msg) } err := conn.outHandler.sendAndIfClosed(msg, ifClosed) - conn.calls.handleSendError(msg, err) if err != nil { - conn.serialGen.RetireSerial(msg.serial) + conn.handleSendError(msg, err) } else if msg.Type != TypeMethodCall { conn.serialGen.RetireSerial(msg.serial) } } +func (conn *Conn) handleSendError(msg *Message, err error) { + if msg.Type == TypeMethodCall { + conn.calls.handleSendError(msg, err) + } else if msg.Type == TypeMethodReply { + if _, ok := err.(FormatError); ok { + conn.sendError(err, msg.Headers[FieldDestination].value.(string), msg.Headers[FieldReplySerial].value.(uint32)) + } + } + conn.serialGen.RetireSerial(msg.serial) +} + // Send sends the given message to the message bus. You usually don't need to // use this; use the higher-level equivalents (Call / Go, Emit and Export) // instead. If msg is a method call and NoReplyExpected is not set, a non-nil diff --git a/vendor/github.com/godbus/dbus/v5/decoder.go b/vendor/github.com/godbus/dbus/v5/decoder.go index ede91575b3e86..89bfed9d1a1c5 100644 --- a/vendor/github.com/godbus/dbus/v5/decoder.go +++ b/vendor/github.com/godbus/dbus/v5/decoder.go @@ -10,14 +10,16 @@ type decoder struct { in io.Reader order binary.ByteOrder pos int + fds []int } // newDecoder returns a new decoder that reads values from in. The input is // expected to be in the given byte order. -func newDecoder(in io.Reader, order binary.ByteOrder) *decoder { +func newDecoder(in io.Reader, order binary.ByteOrder, fds []int) *decoder { dec := new(decoder) dec.in = in dec.order = order + dec.fds = fds return dec } @@ -53,7 +55,7 @@ func (dec *decoder) Decode(sig Signature) (vs []interface{}, err error) { vs = make([]interface{}, 0) s := sig.str for s != "" { - err, rem := validSingle(s, 0) + err, rem := validSingle(s, &depthCounter{}) if err != nil { return nil, err } @@ -150,7 +152,7 @@ func (dec *decoder) decode(s string, depth int) interface{} { if len(sig.str) == 0 { panic(FormatError("variant signature is empty")) } - err, rem := validSingle(sig.str, 0) + err, rem := validSingle(sig.str, &depthCounter{}) if err != nil { panic(err) } @@ -161,7 +163,11 @@ func (dec *decoder) decode(s string, depth int) interface{} { variant.value = dec.decode(sig.str, depth+1) return variant case 'h': - return UnixFDIndex(dec.decode("u", depth).(uint32)) + idx := dec.decode("u", depth).(uint32) + if int(idx) < len(dec.fds) { + return UnixFD(dec.fds[idx]) + } + return UnixFDIndex(idx) case 'a': if len(s) > 1 && s[1] == '{' { ksig := s[2:3] @@ -219,7 +225,7 @@ func (dec *decoder) decode(s string, depth int) interface{} { v := make([]interface{}, 0) s = s[1 : len(s)-1] for s != "" { - err, rem := validSingle(s, 0) + err, rem := validSingle(s, &depthCounter{}) if err != nil { panic(err) } diff --git a/vendor/github.com/godbus/dbus/v5/encoder.go b/vendor/github.com/godbus/dbus/v5/encoder.go index adfbb75c5595b..015b26cd5c495 100644 --- a/vendor/github.com/godbus/dbus/v5/encoder.go +++ b/vendor/github.com/godbus/dbus/v5/encoder.go @@ -5,28 +5,33 @@ import ( "encoding/binary" "io" "reflect" + "strings" + "unicode/utf8" ) // An encoder encodes values to the D-Bus wire format. type encoder struct { out io.Writer + fds []int order binary.ByteOrder pos int } // NewEncoder returns a new encoder that writes to out in the given byte order. -func newEncoder(out io.Writer, order binary.ByteOrder) *encoder { - return newEncoderAtOffset(out, 0, order) +func newEncoder(out io.Writer, order binary.ByteOrder, fds []int) *encoder { + enc := newEncoderAtOffset(out, 0, order, fds) + return enc } // newEncoderAtOffset returns a new encoder that writes to out in the given // byte order. Specify the offset to initialize pos for proper alignment // computation. -func newEncoderAtOffset(out io.Writer, offset int, order binary.ByteOrder) *encoder { +func newEncoderAtOffset(out io.Writer, offset int, order binary.ByteOrder, fds []int) *encoder { enc := new(encoder) enc.out = out enc.order = order enc.pos = offset + enc.fds = fds return enc } @@ -75,6 +80,9 @@ func (enc *encoder) Encode(vs ...interface{}) (err error) { // encode encodes the given value to the writer and panics on error. depth holds // the depth of the container nesting. func (enc *encoder) encode(v reflect.Value, depth int) { + if depth > 64 { + panic(FormatError("input exceeds depth limitation")) + } enc.align(alignment(v.Type())) switch v.Kind() { case reflect.Uint8: @@ -97,7 +105,14 @@ func (enc *encoder) encode(v reflect.Value, depth int) { enc.binwrite(uint16(v.Uint())) enc.pos += 2 case reflect.Int, reflect.Int32: - enc.binwrite(int32(v.Int())) + if v.Type() == unixFDType { + fd := v.Int() + idx := len(enc.fds) + enc.fds = append(enc.fds, int(fd)) + enc.binwrite(uint32(idx)) + } else { + enc.binwrite(int32(v.Int())) + } enc.pos += 4 case reflect.Uint, reflect.Uint32: enc.binwrite(uint32(v.Uint())) @@ -112,9 +127,21 @@ func (enc *encoder) encode(v reflect.Value, depth int) { enc.binwrite(v.Float()) enc.pos += 8 case reflect.String: - enc.encode(reflect.ValueOf(uint32(len(v.String()))), depth) + str := v.String() + if !utf8.ValidString(str) { + panic(FormatError("input has a not-utf8 char in string")) + } + if strings.IndexByte(str, byte(0)) != -1 { + panic(FormatError("input has a null char('\\000') in string")) + } + if v.Type() == objectPathType { + if !ObjectPath(str).IsValid() { + panic(FormatError("invalid object path")) + } + } + enc.encode(reflect.ValueOf(uint32(len(str))), depth) b := make([]byte, v.Len()+1) - copy(b, v.String()) + copy(b, str) b[len(b)-1] = 0 n, err := enc.out.Write(b) if err != nil { @@ -124,20 +151,23 @@ func (enc *encoder) encode(v reflect.Value, depth int) { case reflect.Ptr: enc.encode(v.Elem(), depth) case reflect.Slice, reflect.Array: - if depth >= 64 { - panic(FormatError("input exceeds container depth limit")) - } // Lookahead offset: 4 bytes for uint32 length (with alignment), // plus alignment for elements. n := enc.padding(0, 4) + 4 offset := enc.pos + n + enc.padding(n, alignment(v.Type().Elem())) var buf bytes.Buffer - bufenc := newEncoderAtOffset(&buf, offset, enc.order) + bufenc := newEncoderAtOffset(&buf, offset, enc.order, enc.fds) for i := 0; i < v.Len(); i++ { bufenc.encode(v.Index(i), depth+1) } + + if buf.Len() > 1<<26 { + panic(FormatError("input exceeds array size limitation")) + } + + enc.fds = bufenc.fds enc.encode(reflect.ValueOf(uint32(buf.Len())), depth) length := buf.Len() enc.align(alignment(v.Type().Elem())) @@ -146,13 +176,10 @@ func (enc *encoder) encode(v reflect.Value, depth int) { } enc.pos += length case reflect.Struct: - if depth >= 64 && v.Type() != signatureType { - panic(FormatError("input exceeds container depth limit")) - } switch t := v.Type(); t { case signatureType: str := v.Field(0) - enc.encode(reflect.ValueOf(byte(str.Len())), depth+1) + enc.encode(reflect.ValueOf(byte(str.Len())), depth) b := make([]byte, str.Len()+1) copy(b, str.String()) b[len(b)-1] = 0 @@ -176,9 +203,6 @@ func (enc *encoder) encode(v reflect.Value, depth int) { case reflect.Map: // Maps are arrays of structures, so they actually increase the depth by // 2. - if depth >= 63 { - panic(FormatError("input exceeds container depth limit")) - } if !isKeyType(v.Type().Key()) { panic(InvalidTypeError{v.Type()}) } @@ -189,12 +213,13 @@ func (enc *encoder) encode(v reflect.Value, depth int) { offset := enc.pos + n + enc.padding(n, 8) var buf bytes.Buffer - bufenc := newEncoderAtOffset(&buf, offset, enc.order) + bufenc := newEncoderAtOffset(&buf, offset, enc.order, enc.fds) for _, k := range keys { bufenc.align(8) bufenc.encode(k, depth+2) bufenc.encode(v.MapIndex(k), depth+2) } + enc.fds = bufenc.fds enc.encode(reflect.ValueOf(uint32(buf.Len())), depth) length := buf.Len() enc.align(8) diff --git a/vendor/github.com/godbus/dbus/v5/export.go b/vendor/github.com/godbus/dbus/v5/export.go index 2447b51d469d3..522334715b603 100644 --- a/vendor/github.com/godbus/dbus/v5/export.go +++ b/vendor/github.com/godbus/dbus/v5/export.go @@ -26,6 +26,27 @@ var ( } ) +func MakeNoObjectError(path ObjectPath) Error { + return Error{ + "org.freedesktop.DBus.Error.NoSuchObject", + []interface{}{fmt.Sprintf("No such object '%s'", string(path))}, + } +} + +func MakeUnknownMethodError(methodName string) Error { + return Error{ + "org.freedesktop.DBus.Error.UnknownMethod", + []interface{}{fmt.Sprintf("Unknown / invalid method '%s'", methodName)}, + } +} + +func MakeUnknownInterfaceError(ifaceName string) Error { + return Error{ + "org.freedesktop.DBus.Error.UnknownInterface", + []interface{}{fmt.Sprintf("Object does not implement the interface '%s'", ifaceName)}, + } +} + func MakeFailedError(err error) *Error { return &Error{ "org.freedesktop.DBus.Error.Failed", @@ -128,6 +149,11 @@ func (conn *Conn) handleCall(msg *Message) { ifaceName, _ := msg.Headers[FieldInterface].value.(string) sender, hasSender := msg.Headers[FieldSender].value.(string) serial := msg.serial + + if len(name) == 0 { + conn.sendError(ErrMsgUnknownMethod, sender, serial) + } + if ifaceName == "org.freedesktop.DBus.Peer" { switch name { case "Ping": @@ -135,29 +161,26 @@ func (conn *Conn) handleCall(msg *Message) { case "GetMachineId": conn.sendReply(sender, serial, conn.uuid) default: - conn.sendError(ErrMsgUnknownMethod, sender, serial) + conn.sendError(MakeUnknownMethodError(name), sender, serial) } return } - if len(name) == 0 { - conn.sendError(ErrMsgUnknownMethod, sender, serial) - } object, ok := conn.handler.LookupObject(path) if !ok { - conn.sendError(ErrMsgNoObject, sender, serial) + conn.sendError(MakeNoObjectError(path), sender, serial) return } iface, exists := object.LookupInterface(ifaceName) if !exists { - conn.sendError(ErrMsgUnknownInterface, sender, serial) + conn.sendError(MakeUnknownInterfaceError(ifaceName), sender, serial) return } m, exists := iface.LookupMethod(name) if !exists { - conn.sendError(ErrMsgUnknownMethod, sender, serial) + conn.sendError(MakeUnknownMethodError(name), sender, serial) return } args, err := conn.decodeArguments(m, sender, msg) diff --git a/vendor/github.com/godbus/dbus/v5/message.go b/vendor/github.com/godbus/dbus/v5/message.go index 6a925367ebe91..16693eb3017ea 100644 --- a/vendor/github.com/godbus/dbus/v5/message.go +++ b/vendor/github.com/godbus/dbus/v5/message.go @@ -118,11 +118,7 @@ type header struct { Variant } -// DecodeMessage tries to decode a single message in the D-Bus wire format -// from the given reader. The byte order is figured out from the first byte. -// The possibly returned error can be an error of the underlying reader, an -// InvalidMessageError or a FormatError. -func DecodeMessage(rd io.Reader) (msg *Message, err error) { +func DecodeMessageWithFDs(rd io.Reader, fds []int) (msg *Message, err error) { var order binary.ByteOrder var hlength, length uint32 var typ, flags, proto byte @@ -142,7 +138,7 @@ func DecodeMessage(rd io.Reader) (msg *Message, err error) { return nil, InvalidMessageError("invalid byte order") } - dec := newDecoder(rd, order) + dec := newDecoder(rd, order, fds) dec.pos = 1 msg = new(Message) @@ -166,7 +162,7 @@ func DecodeMessage(rd io.Reader) (msg *Message, err error) { if hlength+length+16 > 1<<27 { return nil, InvalidMessageError("message is too long") } - dec = newDecoder(io.MultiReader(bytes.NewBuffer(b), rd), order) + dec = newDecoder(io.MultiReader(bytes.NewBuffer(b), rd), order, fds) dec.pos = 12 vs, err = dec.Decode(Signature{"a(yv)"}) if err != nil { @@ -196,7 +192,7 @@ func DecodeMessage(rd io.Reader) (msg *Message, err error) { sig, _ := msg.Headers[FieldSignature].value.(Signature) if sig.str != "" { buf := bytes.NewBuffer(body) - dec = newDecoder(buf, order) + dec = newDecoder(buf, order, fds) vs, err := dec.Decode(sig) if err != nil { return nil, err @@ -207,12 +203,32 @@ func DecodeMessage(rd io.Reader) (msg *Message, err error) { return } -// EncodeTo encodes and sends a message to the given writer. The byte order must -// be either binary.LittleEndian or binary.BigEndian. If the message is not -// valid or an error occurs when writing, an error is returned. -func (msg *Message) EncodeTo(out io.Writer, order binary.ByteOrder) error { +// DecodeMessage tries to decode a single message in the D-Bus wire format +// from the given reader. The byte order is figured out from the first byte. +// The possibly returned error can be an error of the underlying reader, an +// InvalidMessageError or a FormatError. +func DecodeMessage(rd io.Reader) (msg *Message, err error) { + return DecodeMessageWithFDs(rd, make([]int, 0)); +} + +type nullwriter struct{} + +func (nullwriter) Write(p []byte) (cnt int, err error) { + return len(p), nil +} + +func (msg *Message) CountFds() (int, error) { + if len(msg.Body) == 0 { + return 0, nil + } + enc := newEncoder(nullwriter{}, nativeEndian, make([]int, 0)) + err := enc.Encode(msg.Body...) + return len(enc.fds), err +} + +func (msg *Message) EncodeToWithFDs(out io.Writer, order binary.ByteOrder) (fds []int, err error) { if err := msg.IsValid(); err != nil { - return err + return make([]int, 0), err } var vs [7]interface{} switch order { @@ -221,12 +237,16 @@ func (msg *Message) EncodeTo(out io.Writer, order binary.ByteOrder) error { case binary.BigEndian: vs[0] = byte('B') default: - return errors.New("dbus: invalid byte order") + return make([]int, 0), errors.New("dbus: invalid byte order") } body := new(bytes.Buffer) - enc := newEncoder(body, order) + fds = make([]int, 0) + enc := newEncoder(body, order, fds) if len(msg.Body) != 0 { - enc.Encode(msg.Body...) + err = enc.Encode(msg.Body...) + if err != nil { + return + } } vs[1] = msg.Type vs[2] = msg.Flags @@ -239,17 +259,28 @@ func (msg *Message) EncodeTo(out io.Writer, order binary.ByteOrder) error { } vs[6] = headers var buf bytes.Buffer - enc = newEncoder(&buf, order) - enc.Encode(vs[:]...) + enc = newEncoder(&buf, order, enc.fds) + err = enc.Encode(vs[:]...) + if err != nil { + return + } enc.align(8) body.WriteTo(&buf) if buf.Len() > 1<<27 { - return InvalidMessageError("message is too long") + return make([]int, 0), InvalidMessageError("message is too long") } if _, err := buf.WriteTo(out); err != nil { - return err + return make([]int, 0), err } - return nil + return enc.fds, nil +} + +// EncodeTo encodes and sends a message to the given writer. The byte order must +// be either binary.LittleEndian or binary.BigEndian. If the message is not +// valid or an error occurs when writing, an error is returned. +func (msg *Message) EncodeTo(out io.Writer, order binary.ByteOrder) (err error) { + _, err = msg.EncodeToWithFDs(out, order) + return err } // IsValid checks whether msg is a valid message and returns an diff --git a/vendor/github.com/godbus/dbus/v5/sig.go b/vendor/github.com/godbus/dbus/v5/sig.go index 2d326cebc0d84..41a0398129d25 100644 --- a/vendor/github.com/godbus/dbus/v5/sig.go +++ b/vendor/github.com/godbus/dbus/v5/sig.go @@ -34,7 +34,7 @@ type Signature struct { func SignatureOf(vs ...interface{}) Signature { var s string for _, v := range vs { - s += getSignature(reflect.TypeOf(v)) + s += getSignature(reflect.TypeOf(v), &depthCounter{}) } return Signature{s} } @@ -42,11 +42,19 @@ func SignatureOf(vs ...interface{}) Signature { // SignatureOfType returns the signature of the given type. It panics if the // type is not representable in D-Bus. func SignatureOfType(t reflect.Type) Signature { - return Signature{getSignature(t)} + return Signature{getSignature(t, &depthCounter{})} } // getSignature returns the signature of the given type and panics on unknown types. -func getSignature(t reflect.Type) string { +func getSignature(t reflect.Type, depth *depthCounter) (sig string) { + if !depth.Valid() { + panic("container nesting too deep") + } + defer func() { + if len(sig) > 255 { + panic("signature exceeds the length limitation") + } + }() // handle simple types first switch t.Kind() { case reflect.Uint8: @@ -74,7 +82,7 @@ func getSignature(t reflect.Type) string { case reflect.Float64: return "d" case reflect.Ptr: - return getSignature(t.Elem()) + return getSignature(t.Elem(), depth) case reflect.String: if t == objectPathType { return "o" @@ -90,17 +98,20 @@ func getSignature(t reflect.Type) string { for i := 0; i < t.NumField(); i++ { field := t.Field(i) if field.PkgPath == "" && field.Tag.Get("dbus") != "-" { - s += getSignature(t.Field(i).Type) + s += getSignature(t.Field(i).Type, depth.EnterStruct()) } } + if len(s) == 0 { + panic("empty struct") + } return "(" + s + ")" case reflect.Array, reflect.Slice: - return "a" + getSignature(t.Elem()) + return "a" + getSignature(t.Elem(), depth.EnterArray()) case reflect.Map: if !isKeyType(t.Key()) { panic(InvalidTypeError{t}) } - return "a{" + getSignature(t.Key()) + getSignature(t.Elem()) + "}" + return "a{" + getSignature(t.Key(), depth.EnterArray().EnterDictEntry()) + getSignature(t.Elem(), depth.EnterArray().EnterDictEntry()) + "}" case reflect.Interface: return "v" } @@ -118,7 +129,7 @@ func ParseSignature(s string) (sig Signature, err error) { } sig.str = s for err == nil && len(s) != 0 { - err, s = validSingle(s, 0) + err, s = validSingle(s, &depthCounter{}) } if err != nil { sig = Signature{""} @@ -144,7 +155,7 @@ func (s Signature) Empty() bool { // Single returns whether the signature represents a single, complete type. func (s Signature) Single() bool { - err, r := validSingle(s.str, 0) + err, r := validSingle(s.str, &depthCounter{}) return err != nil && r == "" } @@ -164,15 +175,38 @@ func (e SignatureError) Error() string { return fmt.Sprintf("dbus: invalid signature: %q (%s)", e.Sig, e.Reason) } +type depthCounter struct { + arrayDepth, structDepth, dictEntryDepth int +} + +func (cnt *depthCounter) Valid() bool { + return cnt.arrayDepth <= 32 && cnt.structDepth <= 32 && cnt.dictEntryDepth <= 32 +} + +func (cnt depthCounter) EnterArray() *depthCounter { + cnt.arrayDepth++ + return &cnt +} + +func (cnt depthCounter) EnterStruct() *depthCounter { + cnt.structDepth++ + return &cnt +} + +func (cnt depthCounter) EnterDictEntry() *depthCounter { + cnt.dictEntryDepth++ + return &cnt +} + // Try to read a single type from this string. If it was successful, err is nil // and rem is the remaining unparsed part. Otherwise, err is a non-nil // SignatureError and rem is "". depth is the current recursion depth which may // not be greater than 64 and should be given as 0 on the first call. -func validSingle(s string, depth int) (err error, rem string) { +func validSingle(s string, depth *depthCounter) (err error, rem string) { if s == "" { return SignatureError{Sig: s, Reason: "empty signature"}, "" } - if depth > 64 { + if !depth.Valid() { return SignatureError{Sig: s, Reason: "container nesting too deep"}, "" } switch s[0] { @@ -187,10 +221,10 @@ func validSingle(s string, depth int) (err error, rem string) { i++ rem = s[i+1:] s = s[2:i] - if err, _ = validSingle(s[:1], depth+1); err != nil { + if err, _ = validSingle(s[:1], depth.EnterArray().EnterDictEntry()); err != nil { return err, "" } - err, nr := validSingle(s[1:], depth+1) + err, nr := validSingle(s[1:], depth.EnterArray().EnterDictEntry()) if err != nil { return err, "" } @@ -199,7 +233,7 @@ func validSingle(s string, depth int) (err error, rem string) { } return nil, rem } - return validSingle(s[1:], depth+1) + return validSingle(s[1:], depth.EnterArray()) case '(': i := findMatching(s, '(', ')') if i == -1 { @@ -208,7 +242,7 @@ func validSingle(s string, depth int) (err error, rem string) { rem = s[i+1:] s = s[1:i] for err == nil && s != "" { - err, s = validSingle(s, depth+1) + err, s = validSingle(s, depth.EnterStruct()) } if err != nil { rem = "" @@ -236,7 +270,7 @@ func findMatching(s string, left, right rune) int { // typeFor returns the type of the given signature. It ignores any left over // characters and panics if s doesn't start with a valid type signature. func typeFor(s string) (t reflect.Type) { - err, _ := validSingle(s, 0) + err, _ := validSingle(s, &depthCounter{}) if err != nil { panic(err) } diff --git a/vendor/github.com/godbus/dbus/v5/transport_generic.go b/vendor/github.com/godbus/dbus/v5/transport_generic.go index 718a1ff0219a1..a08e2813ca53c 100644 --- a/vendor/github.com/godbus/dbus/v5/transport_generic.go +++ b/vendor/github.com/godbus/dbus/v5/transport_generic.go @@ -41,10 +41,12 @@ func (t genericTransport) ReadMessage() (*Message, error) { } func (t genericTransport) SendMessage(msg *Message) error { - for _, v := range msg.Body { - if _, ok := v.(UnixFD); ok { - return errors.New("dbus: unix fd passing not enabled") - } + fds, err := msg.CountFds() + if err != nil { + return err + } + if fds != 0 { + return errors.New("dbus: unix fd passing not enabled") } return msg.EncodeTo(t, nativeEndian) } diff --git a/vendor/github.com/godbus/dbus/v5/transport_unix.go b/vendor/github.com/godbus/dbus/v5/transport_unix.go index c7cd02f97fdf2..2212e7fa7f2d8 100644 --- a/vendor/github.com/godbus/dbus/v5/transport_unix.go +++ b/vendor/github.com/godbus/dbus/v5/transport_unix.go @@ -113,7 +113,7 @@ func (t *unixTransport) ReadMessage() (*Message, error) { if _, err := io.ReadFull(t.rdr, headerdata[4:]); err != nil { return nil, err } - dec := newDecoder(bytes.NewBuffer(headerdata), order) + dec := newDecoder(bytes.NewBuffer(headerdata), order, make([]int, 0)) dec.pos = 12 vs, err := dec.Decode(Signature{"a(yv)"}) if err != nil { @@ -147,7 +147,7 @@ func (t *unixTransport) ReadMessage() (*Message, error) { if err != nil { return nil, err } - msg, err := DecodeMessage(bytes.NewBuffer(all)) + msg, err := DecodeMessageWithFDs(bytes.NewBuffer(all), fds) if err != nil { return nil, err } @@ -179,21 +179,21 @@ func (t *unixTransport) ReadMessage() (*Message, error) { } func (t *unixTransport) SendMessage(msg *Message) error { - fds := make([]int, 0) - for i, v := range msg.Body { - if fd, ok := v.(UnixFD); ok { - msg.Body[i] = UnixFDIndex(len(fds)) - fds = append(fds, int(fd)) - } + fdcnt, err := msg.CountFds() + if err != nil { + return err } - if len(fds) != 0 { + if fdcnt != 0 { if !t.hasUnixFDs { return errors.New("dbus: unix fd passing not enabled") } - msg.Headers[FieldUnixFDs] = MakeVariant(uint32(len(fds))) - oob := syscall.UnixRights(fds...) + msg.Headers[FieldUnixFDs] = MakeVariant(uint32(fdcnt)) buf := new(bytes.Buffer) - msg.EncodeTo(buf, nativeEndian) + fds, err := msg.EncodeToWithFDs(buf, nativeEndian) + if err != nil { + return err + } + oob := syscall.UnixRights(fds...) n, oobn, err := t.UnixConn.WriteMsgUnix(buf.Bytes(), oob, nil) if err != nil { return err diff --git a/vendor/github.com/godbus/dbus/v5/transport_unixcred_netbsd.go b/vendor/github.com/godbus/dbus/v5/transport_unixcred_netbsd.go new file mode 100644 index 0000000000000..af7bafdf953b8 --- /dev/null +++ b/vendor/github.com/godbus/dbus/v5/transport_unixcred_netbsd.go @@ -0,0 +1,14 @@ +package dbus + +import "io" + +func (t *unixTransport) SendNullByte() error { + n, _, err := t.UnixConn.WriteMsgUnix([]byte{0}, nil, nil) + if err != nil { + return err + } + if n != 1 { + return io.ErrShortWrite + } + return nil +} diff --git a/vendor/github.com/json-iterator/go/README.md b/vendor/github.com/json-iterator/go/README.md index 52b111d5f36ef..c589addf98c28 100644 --- a/vendor/github.com/json-iterator/go/README.md +++ b/vendor/github.com/json-iterator/go/README.md @@ -8,8 +8,6 @@ A high-performance 100% compatible drop-in replacement of "encoding/json" -You can also use thrift like JSON using [thrift-iterator](https://github.com/thrift-iterator/go) - # Benchmark ![benchmark](http://jsoniter.com/benchmarks/go-benchmark.png) diff --git a/vendor/github.com/json-iterator/go/go.mod b/vendor/github.com/json-iterator/go/go.mod index e05c42ff58b81..e817cccbf6fdb 100644 --- a/vendor/github.com/json-iterator/go/go.mod +++ b/vendor/github.com/json-iterator/go/go.mod @@ -6,6 +6,6 @@ require ( github.com/davecgh/go-spew v1.1.1 github.com/google/gofuzz v1.0.0 github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 - github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 + github.com/modern-go/reflect2 v1.0.2 github.com/stretchr/testify v1.3.0 ) diff --git a/vendor/github.com/json-iterator/go/go.sum b/vendor/github.com/json-iterator/go/go.sum index be00a6df969df..4b7bb8a29520a 100644 --- a/vendor/github.com/json-iterator/go/go.sum +++ b/vendor/github.com/json-iterator/go/go.sum @@ -5,11 +5,10 @@ github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= diff --git a/vendor/github.com/modern-go/reflect2/.travis.yml b/vendor/github.com/modern-go/reflect2/.travis.yml index fbb43744d94b2..b097728dbffda 100644 --- a/vendor/github.com/modern-go/reflect2/.travis.yml +++ b/vendor/github.com/modern-go/reflect2/.travis.yml @@ -1,7 +1,7 @@ language: go go: - - 1.8.x + - 1.9.x - 1.x before_install: diff --git a/vendor/github.com/modern-go/reflect2/Gopkg.lock b/vendor/github.com/modern-go/reflect2/Gopkg.lock index 2a3a69893b508..10ef811182d1c 100644 --- a/vendor/github.com/modern-go/reflect2/Gopkg.lock +++ b/vendor/github.com/modern-go/reflect2/Gopkg.lock @@ -1,15 +1,9 @@ # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. -[[projects]] - name = "github.com/modern-go/concurrent" - packages = ["."] - revision = "e0a39a4cb4216ea8db28e22a69f4ec25610d513a" - version = "1.0.0" - [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "daee8a88b3498b61c5640056665b8b9eea062006f5e596bbb6a3ed9119a11ec7" + input-imports = [] solver-name = "gps-cdcl" solver-version = 1 diff --git a/vendor/github.com/modern-go/reflect2/Gopkg.toml b/vendor/github.com/modern-go/reflect2/Gopkg.toml index 2f4f4dbdcc5e5..a9bc5061b042a 100644 --- a/vendor/github.com/modern-go/reflect2/Gopkg.toml +++ b/vendor/github.com/modern-go/reflect2/Gopkg.toml @@ -26,10 +26,6 @@ ignored = [] -[[constraint]] - name = "github.com/modern-go/concurrent" - version = "1.0.0" - [prune] go-tests = true unused-packages = true diff --git a/vendor/github.com/modern-go/reflect2/go.mod b/vendor/github.com/modern-go/reflect2/go.mod new file mode 100644 index 0000000000000..9057e9b33f2a7 --- /dev/null +++ b/vendor/github.com/modern-go/reflect2/go.mod @@ -0,0 +1,3 @@ +module github.com/modern-go/reflect2 + +go 1.12 diff --git a/vendor/github.com/modern-go/reflect2/go_above_118.go b/vendor/github.com/modern-go/reflect2/go_above_118.go new file mode 100644 index 0000000000000..2b4116f6c9bec --- /dev/null +++ b/vendor/github.com/modern-go/reflect2/go_above_118.go @@ -0,0 +1,23 @@ +//+build go1.18 + +package reflect2 + +import ( + "unsafe" +) + +// m escapes into the return value, but the caller of mapiterinit +// doesn't let the return value escape. +//go:noescape +//go:linkname mapiterinit reflect.mapiterinit +func mapiterinit(rtype unsafe.Pointer, m unsafe.Pointer, it *hiter) + +func (type2 *UnsafeMapType) UnsafeIterate(obj unsafe.Pointer) MapIterator { + var it hiter + mapiterinit(type2.rtype, *(*unsafe.Pointer)(obj), &it) + return &UnsafeMapIterator{ + hiter: &it, + pKeyRType: type2.pKeyRType, + pElemRType: type2.pElemRType, + } +} \ No newline at end of file diff --git a/vendor/github.com/modern-go/reflect2/go_above_17.go b/vendor/github.com/modern-go/reflect2/go_above_17.go deleted file mode 100644 index 5c1cea8683ab3..0000000000000 --- a/vendor/github.com/modern-go/reflect2/go_above_17.go +++ /dev/null @@ -1,8 +0,0 @@ -//+build go1.7 - -package reflect2 - -import "unsafe" - -//go:linkname resolveTypeOff reflect.resolveTypeOff -func resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer diff --git a/vendor/github.com/modern-go/reflect2/go_above_19.go b/vendor/github.com/modern-go/reflect2/go_above_19.go index c7e3b780116a3..974f7685e495d 100644 --- a/vendor/github.com/modern-go/reflect2/go_above_19.go +++ b/vendor/github.com/modern-go/reflect2/go_above_19.go @@ -6,6 +6,9 @@ import ( "unsafe" ) +//go:linkname resolveTypeOff reflect.resolveTypeOff +func resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer + //go:linkname makemap reflect.makemap func makemap(rtype unsafe.Pointer, cap int) (m unsafe.Pointer) diff --git a/vendor/github.com/modern-go/reflect2/go_below_118.go b/vendor/github.com/modern-go/reflect2/go_below_118.go new file mode 100644 index 0000000000000..00003dbd7c57d --- /dev/null +++ b/vendor/github.com/modern-go/reflect2/go_below_118.go @@ -0,0 +1,21 @@ +//+build !go1.18 + +package reflect2 + +import ( + "unsafe" +) + +// m escapes into the return value, but the caller of mapiterinit +// doesn't let the return value escape. +//go:noescape +//go:linkname mapiterinit reflect.mapiterinit +func mapiterinit(rtype unsafe.Pointer, m unsafe.Pointer) (val *hiter) + +func (type2 *UnsafeMapType) UnsafeIterate(obj unsafe.Pointer) MapIterator { + return &UnsafeMapIterator{ + hiter: mapiterinit(type2.rtype, *(*unsafe.Pointer)(obj)), + pKeyRType: type2.pKeyRType, + pElemRType: type2.pElemRType, + } +} \ No newline at end of file diff --git a/vendor/github.com/modern-go/reflect2/go_below_17.go b/vendor/github.com/modern-go/reflect2/go_below_17.go deleted file mode 100644 index 65a93c889b777..0000000000000 --- a/vendor/github.com/modern-go/reflect2/go_below_17.go +++ /dev/null @@ -1,9 +0,0 @@ -//+build !go1.7 - -package reflect2 - -import "unsafe" - -func resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer { - return nil -} diff --git a/vendor/github.com/modern-go/reflect2/go_below_19.go b/vendor/github.com/modern-go/reflect2/go_below_19.go deleted file mode 100644 index b050ef70cddbd..0000000000000 --- a/vendor/github.com/modern-go/reflect2/go_below_19.go +++ /dev/null @@ -1,14 +0,0 @@ -//+build !go1.9 - -package reflect2 - -import ( - "unsafe" -) - -//go:linkname makemap reflect.makemap -func makemap(rtype unsafe.Pointer) (m unsafe.Pointer) - -func makeMapWithSize(rtype unsafe.Pointer, cap int) unsafe.Pointer { - return makemap(rtype) -} diff --git a/vendor/github.com/modern-go/reflect2/reflect2.go b/vendor/github.com/modern-go/reflect2/reflect2.go index 63b49c7991947..c43c8b9d6297d 100644 --- a/vendor/github.com/modern-go/reflect2/reflect2.go +++ b/vendor/github.com/modern-go/reflect2/reflect2.go @@ -1,8 +1,9 @@ package reflect2 import ( - "github.com/modern-go/concurrent" "reflect" + "runtime" + "sync" "unsafe" ) @@ -130,13 +131,13 @@ var ConfigSafe = Config{UseSafeImplementation: true}.Froze() type frozenConfig struct { useSafeImplementation bool - cache *concurrent.Map + cache *sync.Map } func (cfg Config) Froze() *frozenConfig { return &frozenConfig{ useSafeImplementation: cfg.UseSafeImplementation, - cache: concurrent.NewMap(), + cache: new(sync.Map), } } @@ -288,11 +289,12 @@ func NoEscape(p unsafe.Pointer) unsafe.Pointer { } func UnsafeCastString(str string) []byte { + bytes := make([]byte, 0) stringHeader := (*reflect.StringHeader)(unsafe.Pointer(&str)) - sliceHeader := &reflect.SliceHeader{ - Data: stringHeader.Data, - Cap: stringHeader.Len, - Len: stringHeader.Len, - } - return *(*[]byte)(unsafe.Pointer(sliceHeader)) + sliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&bytes)) + sliceHeader.Data = stringHeader.Data + sliceHeader.Cap = stringHeader.Len + sliceHeader.Len = stringHeader.Len + runtime.KeepAlive(str) + return bytes } diff --git a/vendor/github.com/modern-go/reflect2/test.sh b/vendor/github.com/modern-go/reflect2/test.sh deleted file mode 100644 index 3d2b9768ce611..0000000000000 --- a/vendor/github.com/modern-go/reflect2/test.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -set -e -echo "" > coverage.txt - -for d in $(go list github.com/modern-go/reflect2-tests/... | grep -v vendor); do - go test -coverprofile=profile.out -coverpkg=github.com/modern-go/reflect2 $d - if [ -f profile.out ]; then - cat profile.out >> coverage.txt - rm profile.out - fi -done diff --git a/vendor/github.com/modern-go/reflect2/type_map.go b/vendor/github.com/modern-go/reflect2/type_map.go index 3acfb55803a83..4b13c3155c80d 100644 --- a/vendor/github.com/modern-go/reflect2/type_map.go +++ b/vendor/github.com/modern-go/reflect2/type_map.go @@ -1,17 +1,13 @@ +// +build !gccgo + package reflect2 import ( "reflect" - "runtime" - "strings" "sync" "unsafe" ) -// typelinks1 for 1.5 ~ 1.6 -//go:linkname typelinks1 reflect.typelinks -func typelinks1() [][]unsafe.Pointer - // typelinks2 for 1.7 ~ //go:linkname typelinks2 reflect.typelinks func typelinks2() (sections []unsafe.Pointer, offset [][]int32) @@ -27,49 +23,10 @@ func discoverTypes() { types = make(map[string]reflect.Type) packages = make(map[string]map[string]reflect.Type) - ver := runtime.Version() - if ver == "go1.5" || strings.HasPrefix(ver, "go1.5.") { - loadGo15Types() - } else if ver == "go1.6" || strings.HasPrefix(ver, "go1.6.") { - loadGo15Types() - } else { - loadGo17Types() - } -} - -func loadGo15Types() { - var obj interface{} = reflect.TypeOf(0) - typePtrss := typelinks1() - for _, typePtrs := range typePtrss { - for _, typePtr := range typePtrs { - (*emptyInterface)(unsafe.Pointer(&obj)).word = typePtr - typ := obj.(reflect.Type) - if typ.Kind() == reflect.Ptr && typ.Elem().Kind() == reflect.Struct { - loadedType := typ.Elem() - pkgTypes := packages[loadedType.PkgPath()] - if pkgTypes == nil { - pkgTypes = map[string]reflect.Type{} - packages[loadedType.PkgPath()] = pkgTypes - } - types[loadedType.String()] = loadedType - pkgTypes[loadedType.Name()] = loadedType - } - if typ.Kind() == reflect.Slice && typ.Elem().Kind() == reflect.Ptr && - typ.Elem().Elem().Kind() == reflect.Struct { - loadedType := typ.Elem().Elem() - pkgTypes := packages[loadedType.PkgPath()] - if pkgTypes == nil { - pkgTypes = map[string]reflect.Type{} - packages[loadedType.PkgPath()] = pkgTypes - } - types[loadedType.String()] = loadedType - pkgTypes[loadedType.Name()] = loadedType - } - } - } + loadGoTypes() } -func loadGo17Types() { +func loadGoTypes() { var obj interface{} = reflect.TypeOf(0) sections, offset := typelinks2() for i, offs := range offset { diff --git a/vendor/github.com/modern-go/reflect2/unsafe_link.go b/vendor/github.com/modern-go/reflect2/unsafe_link.go index 57229c8db4170..b49f614efc58d 100644 --- a/vendor/github.com/modern-go/reflect2/unsafe_link.go +++ b/vendor/github.com/modern-go/reflect2/unsafe_link.go @@ -19,18 +19,12 @@ func typedslicecopy(elemType unsafe.Pointer, dst, src sliceHeader) int //go:linkname mapassign reflect.mapassign //go:noescape -func mapassign(rtype unsafe.Pointer, m unsafe.Pointer, key, val unsafe.Pointer) +func mapassign(rtype unsafe.Pointer, m unsafe.Pointer, key unsafe.Pointer, val unsafe.Pointer) //go:linkname mapaccess reflect.mapaccess //go:noescape func mapaccess(rtype unsafe.Pointer, m unsafe.Pointer, key unsafe.Pointer) (val unsafe.Pointer) -// m escapes into the return value, but the caller of mapiterinit -// doesn't let the return value escape. -//go:noescape -//go:linkname mapiterinit reflect.mapiterinit -func mapiterinit(rtype unsafe.Pointer, m unsafe.Pointer) *hiter - //go:noescape //go:linkname mapiternext reflect.mapiternext func mapiternext(it *hiter) @@ -42,9 +36,21 @@ func ifaceE2I(rtype unsafe.Pointer, src interface{}, dst unsafe.Pointer) // If you modify hiter, also change cmd/internal/gc/reflect.go to indicate // the layout of this structure. type hiter struct { - key unsafe.Pointer // Must be in first position. Write nil to indicate iteration end (see cmd/internal/gc/range.go). - value unsafe.Pointer // Must be in second position (see cmd/internal/gc/range.go). - // rest fields are ignored + key unsafe.Pointer + value unsafe.Pointer + t unsafe.Pointer + h unsafe.Pointer + buckets unsafe.Pointer + bptr unsafe.Pointer + overflow *[]unsafe.Pointer + oldoverflow *[]unsafe.Pointer + startBucket uintptr + offset uint8 + wrapped bool + B uint8 + i uint8 + bucket uintptr + checkBucket uintptr } // add returns p+x. diff --git a/vendor/github.com/modern-go/reflect2/unsafe_map.go b/vendor/github.com/modern-go/reflect2/unsafe_map.go index f2e76e6bb1491..37872da819107 100644 --- a/vendor/github.com/modern-go/reflect2/unsafe_map.go +++ b/vendor/github.com/modern-go/reflect2/unsafe_map.go @@ -107,14 +107,6 @@ func (type2 *UnsafeMapType) Iterate(obj interface{}) MapIterator { return type2.UnsafeIterate(objEFace.data) } -func (type2 *UnsafeMapType) UnsafeIterate(obj unsafe.Pointer) MapIterator { - return &UnsafeMapIterator{ - hiter: mapiterinit(type2.rtype, *(*unsafe.Pointer)(obj)), - pKeyRType: type2.pKeyRType, - pElemRType: type2.pElemRType, - } -} - type UnsafeMapIterator struct { *hiter pKeyRType unsafe.Pointer diff --git a/vendor/github.com/opencontainers/runc/libcontainer/user/lookup_unix.go b/vendor/github.com/opencontainers/runc/libcontainer/user/lookup_unix.go index 967717a1b1c5a..f95c1409fce03 100644 --- a/vendor/github.com/opencontainers/runc/libcontainer/user/lookup_unix.go +++ b/vendor/github.com/opencontainers/runc/libcontainer/user/lookup_unix.go @@ -1,3 +1,4 @@ +//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris // +build darwin dragonfly freebsd linux netbsd openbsd solaris package user diff --git a/vendor/github.com/opencontainers/runc/libcontainer/user/user.go b/vendor/github.com/opencontainers/runc/libcontainer/user/user.go index cc7a106be5db9..2473c5eaddcee 100644 --- a/vendor/github.com/opencontainers/runc/libcontainer/user/user.go +++ b/vendor/github.com/opencontainers/runc/libcontainer/user/user.go @@ -120,7 +120,7 @@ func ParsePasswdFileFilter(path string, filter func(User) bool) ([]User, error) func ParsePasswdFilter(r io.Reader, filter func(User) bool) ([]User, error) { if r == nil { - return nil, fmt.Errorf("nil source for passwd-formatted data") + return nil, errors.New("nil source for passwd-formatted data") } var ( @@ -178,7 +178,7 @@ func ParseGroupFileFilter(path string, filter func(Group) bool) ([]Group, error) func ParseGroupFilter(r io.Reader, filter func(Group) bool) ([]Group, error) { if r == nil { - return nil, fmt.Errorf("nil source for group-formatted data") + return nil, errors.New("nil source for group-formatted data") } rd := bufio.NewReader(r) out := []Group{} @@ -339,7 +339,7 @@ func GetExecUser(userSpec string, defaults *ExecUser, passwd, group io.Reader) ( if userArg == "" { userArg = strconv.Itoa(user.Uid) } - return nil, fmt.Errorf("unable to find user %s: %v", userArg, err) + return nil, fmt.Errorf("unable to find user %s: %w", userArg, err) } var matchedUserName string @@ -355,7 +355,7 @@ func GetExecUser(userSpec string, defaults *ExecUser, passwd, group io.Reader) ( if uidErr != nil { // Not numeric. - return nil, fmt.Errorf("unable to find user %s: %v", userArg, ErrNoPasswdEntries) + return nil, fmt.Errorf("unable to find user %s: %w", userArg, ErrNoPasswdEntries) } user.Uid = uidArg @@ -390,7 +390,7 @@ func GetExecUser(userSpec string, defaults *ExecUser, passwd, group io.Reader) ( return g.Name == groupArg }) if err != nil && group != nil { - return nil, fmt.Errorf("unable to find groups for spec %v: %v", matchedUserName, err) + return nil, fmt.Errorf("unable to find groups for spec %v: %w", matchedUserName, err) } // Only start modifying user.Gid if it is in explicit form. @@ -404,7 +404,7 @@ func GetExecUser(userSpec string, defaults *ExecUser, passwd, group io.Reader) ( if gidErr != nil { // Not numeric. - return nil, fmt.Errorf("unable to find group %s: %v", groupArg, ErrNoGroupEntries) + return nil, fmt.Errorf("unable to find group %s: %w", groupArg, ErrNoGroupEntries) } user.Gid = gidArg @@ -445,7 +445,7 @@ func GetAdditionalGroups(additionalGroups []string, group io.Reader) ([]int, err return false }) if err != nil { - return nil, fmt.Errorf("Unable to find additional groups %v: %v", additionalGroups, err) + return nil, fmt.Errorf("Unable to find additional groups %v: %w", additionalGroups, err) } } @@ -468,7 +468,8 @@ func GetAdditionalGroups(additionalGroups []string, group io.Reader) ([]int, err if !found { gid, err := strconv.ParseInt(ag, 10, 64) if err != nil { - return nil, fmt.Errorf("Unable to find group %s", ag) + // Not a numeric ID either. + return nil, fmt.Errorf("Unable to find group %s: %w", ag, ErrNoGroupEntries) } // Ensure gid is inside gid range. if gid < minID || gid > maxID { @@ -521,7 +522,7 @@ func ParseSubIDFileFilter(path string, filter func(SubID) bool) ([]SubID, error) func ParseSubIDFilter(r io.Reader, filter func(SubID) bool) ([]SubID, error) { if r == nil { - return nil, fmt.Errorf("nil source for subid-formatted data") + return nil, errors.New("nil source for subid-formatted data") } var ( @@ -574,7 +575,7 @@ func ParseIDMapFileFilter(path string, filter func(IDMap) bool) ([]IDMap, error) func ParseIDMapFilter(r io.Reader, filter func(IDMap) bool) ([]IDMap, error) { if r == nil { - return nil, fmt.Errorf("nil source for idmap-formatted data") + return nil, errors.New("nil source for idmap-formatted data") } var ( diff --git a/vendor/github.com/opencontainers/runc/libcontainer/user/user_fuzzer.go b/vendor/github.com/opencontainers/runc/libcontainer/user/user_fuzzer.go index 8c9bb5df39c2a..e018eae614e38 100644 --- a/vendor/github.com/opencontainers/runc/libcontainer/user/user_fuzzer.go +++ b/vendor/github.com/opencontainers/runc/libcontainer/user/user_fuzzer.go @@ -1,3 +1,4 @@ +//go:build gofuzz // +build gofuzz package user diff --git a/vendor/github.com/opencontainers/selinux/go-selinux/label/label_linux.go b/vendor/github.com/opencontainers/selinux/go-selinux/label/label_linux.go index b3d142d8c5bf7..12de0ae5d65ed 100644 --- a/vendor/github.com/opencontainers/selinux/go-selinux/label/label_linux.go +++ b/vendor/github.com/opencontainers/selinux/go-selinux/label/label_linux.go @@ -1,12 +1,13 @@ package label import ( + "errors" + "fmt" "os" "os/user" "strings" "github.com/opencontainers/selinux/go-selinux" - "github.com/pkg/errors" ) // Valid Label Options @@ -53,11 +54,11 @@ func InitLabels(options []string) (plabel string, mlabel string, retErr error) { return "", selinux.PrivContainerMountLabel(), nil } if i := strings.Index(opt, ":"); i == -1 { - return "", "", errors.Errorf("Bad label option %q, valid options 'disable' or \n'user, role, level, type, filetype' followed by ':' and a value", opt) + return "", "", fmt.Errorf("Bad label option %q, valid options 'disable' or \n'user, role, level, type, filetype' followed by ':' and a value", opt) } con := strings.SplitN(opt, ":", 2) if !validOptions[con[0]] { - return "", "", errors.Errorf("Bad label option %q, valid options 'disable, user, role, level, type, filetype'", con[0]) + return "", "", fmt.Errorf("Bad label option %q, valid options 'disable, user, role, level, type, filetype'", con[0]) } if con[0] == "filetype" { mcon["type"] = con[1] @@ -102,9 +103,11 @@ func SetFileCreateLabel(fileLabel string) error { return selinux.SetFSCreateLabel(fileLabel) } -// Relabel changes the label of path to the filelabel string. +// Relabel changes the label of path and all the entries beneath the path. // It changes the MCS label to s0 if shared is true. // This will allow all containers to share the content. +// +// The path itself is guaranteed to be relabeled last. func Relabel(path string, fileLabel string, shared bool) error { if !selinux.GetEnabled() || fileLabel == "" { return nil @@ -151,7 +154,7 @@ func Relabel(path string, fileLabel string, shared bool) error { path = strings.TrimSuffix(path, "/") } if exclude_paths[path] { - return errors.Errorf("SELinux relabeling of %s is not allowed", path) + return fmt.Errorf("SELinux relabeling of %s is not allowed", path) } if shared { diff --git a/vendor/github.com/opencontainers/selinux/go-selinux/rchcon.go b/vendor/github.com/opencontainers/selinux/go-selinux/rchcon.go new file mode 100644 index 0000000000000..897ecbac41cee --- /dev/null +++ b/vendor/github.com/opencontainers/selinux/go-selinux/rchcon.go @@ -0,0 +1,22 @@ +// +build linux,go1.16 + +package selinux + +import ( + "errors" + "io/fs" + "os" + + "github.com/opencontainers/selinux/pkg/pwalkdir" +) + +func rchcon(fpath, label string) error { + return pwalkdir.Walk(fpath, func(p string, _ fs.DirEntry, _ error) error { + e := setFileLabel(p, label) + // Walk a file tree can race with removal, so ignore ENOENT. + if errors.Is(e, os.ErrNotExist) { + return nil + } + return e + }) +} diff --git a/vendor/github.com/opencontainers/selinux/go-selinux/rchcon_go115.go b/vendor/github.com/opencontainers/selinux/go-selinux/rchcon_go115.go new file mode 100644 index 0000000000000..2c8b033ce058b --- /dev/null +++ b/vendor/github.com/opencontainers/selinux/go-selinux/rchcon_go115.go @@ -0,0 +1,21 @@ +// +build linux,!go1.16 + +package selinux + +import ( + "errors" + "os" + + "github.com/opencontainers/selinux/pkg/pwalk" +) + +func rchcon(fpath, label string) error { + return pwalk.Walk(fpath, func(p string, _ os.FileInfo, _ error) error { + e := setFileLabel(p, label) + // Walk a file tree can race with removal, so ignore ENOENT. + if errors.Is(e, os.ErrNotExist) { + return nil + } + return e + }) +} diff --git a/vendor/github.com/opencontainers/selinux/go-selinux/selinux.go b/vendor/github.com/opencontainers/selinux/go-selinux/selinux.go index b336ebad3abb9..5a59d151f6759 100644 --- a/vendor/github.com/opencontainers/selinux/go-selinux/selinux.go +++ b/vendor/github.com/opencontainers/selinux/go-selinux/selinux.go @@ -1,7 +1,7 @@ package selinux import ( - "github.com/pkg/errors" + "errors" ) const ( @@ -38,6 +38,8 @@ var ( // CategoryRange allows the upper bound on the category range to be adjusted CategoryRange = DefaultCategoryRange + + privContainerMountLabel string ) // Context is a representation of the SELinux label broken into 4 parts @@ -59,16 +61,30 @@ func ClassIndex(class string) (int, error) { return classIndex(class) } -// SetFileLabel sets the SELinux label for this path or returns an error. +// SetFileLabel sets the SELinux label for this path, following symlinks, +// or returns an error. func SetFileLabel(fpath string, label string) error { return setFileLabel(fpath, label) } -// FileLabel returns the SELinux label for this path or returns an error. +// LsetFileLabel sets the SELinux label for this path, not following symlinks, +// or returns an error. +func LsetFileLabel(fpath string, label string) error { + return lSetFileLabel(fpath, label) +} + +// FileLabel returns the SELinux label for this path, following symlinks, +// or returns an error. func FileLabel(fpath string) (string, error) { return fileLabel(fpath) } +// LfileLabel returns the SELinux label for this path, not following symlinks, +// or returns an error. +func LfileLabel(fpath string) (string, error) { + return lFileLabel(fpath) +} + // SetFSCreateLabel tells the kernel what label to use for all file system objects // created by this task. // Set the label to an empty string to return to the default label. Calls to SetFSCreateLabel @@ -253,6 +269,8 @@ func CopyLevel(src, dest string) (string, error) { // Chcon changes the fpath file object to the SELinux label label. // If fpath is a directory and recurse is true, then Chcon walks the // directory tree setting the label. +// +// The fpath itself is guaranteed to be relabeled last. func Chcon(fpath string, label string, recurse bool) error { return chcon(fpath, label, recurse) } @@ -280,5 +298,7 @@ func GetDefaultContextWithLevel(user, level, scon string) (string, error) { // PrivContainerMountLabel returns mount label for privileged containers func PrivContainerMountLabel() string { + // Make sure label is initialized. + _ = label("") return privContainerMountLabel } diff --git a/vendor/github.com/opencontainers/selinux/go-selinux/selinux_linux.go b/vendor/github.com/opencontainers/selinux/go-selinux/selinux_linux.go index a91a116f8481f..ee602ab96ddc4 100644 --- a/vendor/github.com/opencontainers/selinux/go-selinux/selinux_linux.go +++ b/vendor/github.com/opencontainers/selinux/go-selinux/selinux_linux.go @@ -5,20 +5,18 @@ import ( "bytes" "crypto/rand" "encoding/binary" + "errors" "fmt" "io" "io/ioutil" + "math/big" "os" "path" "path/filepath" - "regexp" "strconv" "strings" "sync" - "github.com/bits-and-blooms/bitset" - "github.com/opencontainers/selinux/pkg/pwalk" - "github.com/pkg/errors" "golang.org/x/sys/unix" ) @@ -35,8 +33,6 @@ const ( xattrNameSelinux = "security.selinux" ) -var policyRoot = filepath.Join(selinuxDir, readConfig(selinuxTypeTag)) - type selinuxState struct { enabledSet bool enabled bool @@ -48,7 +44,7 @@ type selinuxState struct { type level struct { sens uint - cats *bitset.BitSet + cats *big.Int } type mlsRange struct { @@ -71,7 +67,6 @@ const ( ) var ( - assignRegex = regexp.MustCompile(`^([^=]+)=(.*)$`) readOnlyFileLabel string state = selinuxState{ mcsList: make(map[string]bool), @@ -80,8 +75,24 @@ var ( // for attrPath() attrPathOnce sync.Once haveThreadSelf bool + + // for policyRoot() + policyRootOnce sync.Once + policyRootVal string + + // for label() + loadLabelsOnce sync.Once + labels map[string]string ) +func policyRoot() string { + policyRootOnce.Do(func() { + policyRootVal = filepath.Join(selinuxDir, readConfig(selinuxTypeTag)) + }) + + return policyRootVal +} + func (s *selinuxState) setEnable(enabled bool) bool { s.Lock() defer s.Unlock() @@ -120,7 +131,7 @@ func verifySELinuxfsMount(mnt string) bool { if err == nil { break } - if err == unix.EAGAIN || err == unix.EINTR { + if err == unix.EAGAIN || err == unix.EINTR { //nolint:errorlint // unix errors are bare continue } return false @@ -223,7 +234,7 @@ func readConfig(target string) string { scanner := bufio.NewScanner(in) for scanner.Scan() { - line := strings.TrimSpace(scanner.Text()) + line := bytes.TrimSpace(scanner.Bytes()) if len(line) == 0 { // Skip blank lines continue @@ -232,11 +243,12 @@ func readConfig(target string) string { // Skip comments continue } - if groups := assignRegex.FindStringSubmatch(line); groups != nil { - key, val := strings.TrimSpace(groups[1]), strings.TrimSpace(groups[2]) - if key == target { - return strings.Trim(val, "\"") - } + fields := bytes.SplitN(line, []byte{'='}, 2) + if len(fields) != 2 { + continue + } + if bytes.Equal(fields[0], []byte(target)) { + return string(bytes.Trim(fields[1], `"`)) } } return "" @@ -250,12 +262,12 @@ func isProcHandle(fh *os.File) error { if err == nil { break } - if err != unix.EINTR { - return errors.Wrapf(err, "statfs(%q) failed", fh.Name()) + if err != unix.EINTR { //nolint:errorlint // unix errors are bare + return &os.PathError{Op: "fstatfs", Path: fh.Name(), Err: err} } } if buf.Type != unix.PROC_SUPER_MAGIC { - return errors.Errorf("file %q is not on procfs", fh.Name()) + return fmt.Errorf("file %q is not on procfs", fh.Name()) } return nil @@ -275,12 +287,15 @@ func readCon(fpath string) (string, error) { if err := isProcHandle(in); err != nil { return "", err } + return readConFd(in) +} - var retval string - if _, err := fmt.Fscanf(in, "%s", &retval); err != nil { +func readConFd(in *os.File) (string, error) { + data, err := ioutil.ReadAll(in) + if err != nil { return "", err } - return strings.Trim(retval, "\x00"), nil + return string(bytes.TrimSuffix(data, []byte{0})), nil } // classIndex returns the int index for an object class in the loaded policy, @@ -301,8 +316,9 @@ func classIndex(class string) (int, error) { return index, nil } -// setFileLabel sets the SELinux label for this path or returns an error. -func setFileLabel(fpath string, label string) error { +// lSetFileLabel sets the SELinux label for this path, not following symlinks, +// or returns an error. +func lSetFileLabel(fpath string, label string) error { if fpath == "" { return ErrEmptyPath } @@ -311,23 +327,61 @@ func setFileLabel(fpath string, label string) error { if err == nil { break } - if err != unix.EINTR { - return errors.Wrapf(err, "failed to set file label on %s", fpath) + if err != unix.EINTR { //nolint:errorlint // unix errors are bare + return &os.PathError{Op: "lsetxattr", Path: fpath, Err: err} + } + } + + return nil +} + +// setFileLabel sets the SELinux label for this path, following symlinks, +// or returns an error. +func setFileLabel(fpath string, label string) error { + if fpath == "" { + return ErrEmptyPath + } + for { + err := unix.Setxattr(fpath, xattrNameSelinux, []byte(label), 0) + if err == nil { + break + } + if err != unix.EINTR { //nolint:errorlint // unix errors are bare + return &os.PathError{Op: "setxattr", Path: fpath, Err: err} } } return nil } -// fileLabel returns the SELinux label for this path or returns an error. +// fileLabel returns the SELinux label for this path, following symlinks, +// or returns an error. func fileLabel(fpath string) (string, error) { if fpath == "" { return "", ErrEmptyPath } + label, err := getxattr(fpath, xattrNameSelinux) + if err != nil { + return "", &os.PathError{Op: "getxattr", Path: fpath, Err: err} + } + // Trim the NUL byte at the end of the byte buffer, if present. + if len(label) > 0 && label[len(label)-1] == '\x00' { + label = label[:len(label)-1] + } + return string(label), nil +} + +// lFileLabel returns the SELinux label for this path, not following symlinks, +// or returns an error. +func lFileLabel(fpath string) (string, error) { + if fpath == "" { + return "", ErrEmptyPath + } + label, err := lgetxattr(fpath, xattrNameSelinux) if err != nil { - return "", err + return "", &os.PathError{Op: "lgetxattr", Path: fpath, Err: err} } // Trim the NUL byte at the end of the byte buffer, if present. if len(label) > 0 && label[len(label)-1] == '\x00' { @@ -390,7 +444,7 @@ func writeCon(fpath, val string) error { _, err = out.Write(nil) } if err != nil { - return errors.Wrapf(err, "failed to set %s on procfs", fpath) + return err } return nil } @@ -440,8 +494,8 @@ func computeCreateContext(source string, target string, class string) (string, e } // catsToBitset stores categories in a bitset. -func catsToBitset(cats string) (*bitset.BitSet, error) { - bitset := &bitset.BitSet{} +func catsToBitset(cats string) (*big.Int, error) { + bitset := new(big.Int) catlist := strings.Split(cats, ",") for _, r := range catlist { @@ -456,14 +510,14 @@ func catsToBitset(cats string) (*bitset.BitSet, error) { return nil, err } for i := catstart; i <= catend; i++ { - bitset.Set(i) + bitset.SetBit(bitset, int(i), 1) } } else { cat, err := parseLevelItem(ranges[0], category) if err != nil { return nil, err } - bitset.Set(cat) + bitset.SetBit(bitset, int(cat), 1) } } @@ -489,13 +543,13 @@ func (l *level) parseLevel(levelStr string) error { lvl := strings.SplitN(levelStr, ":", 2) sens, err := parseLevelItem(lvl[0], sensitivity) if err != nil { - return errors.Wrap(err, "failed to parse sensitivity") + return fmt.Errorf("failed to parse sensitivity: %w", err) } l.sens = sens if len(lvl) > 1 { cats, err := catsToBitset(lvl[1]) if err != nil { - return errors.Wrap(err, "failed to parse categories") + return fmt.Errorf("failed to parse categories: %w", err) } l.cats = cats } @@ -513,14 +567,14 @@ func rangeStrToMLSRange(rangeStr string) (*mlsRange, error) { case 2: mlsRange.high = &level{} if err := mlsRange.high.parseLevel(levelSlice[1]); err != nil { - return nil, errors.Wrapf(err, "failed to parse high level %q", levelSlice[1]) + return nil, fmt.Errorf("failed to parse high level %q: %w", levelSlice[1], err) } fallthrough // rangeStr that is single level, e.g. s6:c0,c3,c5,c30.c1023 case 1: mlsRange.low = &level{} if err := mlsRange.low.parseLevel(levelSlice[0]); err != nil { - return nil, errors.Wrapf(err, "failed to parse low level %q", levelSlice[0]) + return nil, fmt.Errorf("failed to parse low level %q: %w", levelSlice[0], err) } } @@ -533,37 +587,30 @@ func rangeStrToMLSRange(rangeStr string) (*mlsRange, error) { // bitsetToStr takes a category bitset and returns it in the // canonical selinux syntax -func bitsetToStr(c *bitset.BitSet) string { +func bitsetToStr(c *big.Int) string { var str string - i, e := c.NextSet(0) - len := 0 - for e { - if len == 0 { + + length := 0 + for i := int(c.TrailingZeroBits()); i < c.BitLen(); i++ { + if c.Bit(i) == 0 { + continue + } + if length == 0 { if str != "" { str += "," } - str += "c" + strconv.Itoa(int(i)) - } - - next, e := c.NextSet(i + 1) - if e { - // consecutive cats - if next == i+1 { - len++ - i = next - continue - } + str += "c" + strconv.Itoa(i) } - if len == 1 { - str += ",c" + strconv.Itoa(int(i)) - } else if len > 1 { - str += ".c" + strconv.Itoa(int(i)) + if c.Bit(i+1) == 1 { + length++ + continue } - if !e { - break + if length == 1 { + str += ",c" + strconv.Itoa(i) + } else if length > 1 { + str += ".c" + strconv.Itoa(i) } - len = 0 - i = next + length = 0 } return str @@ -576,13 +623,16 @@ func (l1 *level) equal(l2 *level) bool { if l1.sens != l2.sens { return false } - return l1.cats.Equal(l2.cats) + if l2.cats == nil || l1.cats == nil { + return l2.cats == l1.cats + } + return l1.cats.Cmp(l2.cats) == 0 } // String returns an mlsRange as a string. func (m mlsRange) String() string { low := "s" + strconv.Itoa(int(m.low.sens)) - if m.low.cats != nil && m.low.cats.Count() > 0 { + if m.low.cats != nil && m.low.cats.BitLen() > 0 { low += ":" + bitsetToStr(m.low.cats) } @@ -591,7 +641,7 @@ func (m mlsRange) String() string { } high := "s" + strconv.Itoa(int(m.high.sens)) - if m.high.cats != nil && m.high.cats.Count() > 0 { + if m.high.cats != nil && m.high.cats.BitLen() > 0 { high += ":" + bitsetToStr(m.high.cats) } @@ -641,10 +691,12 @@ func calculateGlbLub(sourceRange, targetRange string) (string, error) { /* find the intersecting categories */ if s.low.cats != nil && t.low.cats != nil { - outrange.low.cats = s.low.cats.Intersection(t.low.cats) + outrange.low.cats = new(big.Int) + outrange.low.cats.And(s.low.cats, t.low.cats) } if s.high.cats != nil && t.high.cats != nil { - outrange.high.cats = s.high.cats.Intersection(t.high.cats) + outrange.high.cats = new(big.Int) + outrange.high.cats.And(s.high.cats, t.high.cats) } return outrange.String(), nil @@ -665,11 +717,7 @@ func readWriteCon(fpath string, val string) (string, error) { return "", err } - var retval string - if _, err := fmt.Fscanf(f, "%s", &retval); err != nil { - return "", err - } - return strings.Trim(retval, "\x00"), nil + return readConFd(f) } // setExecLabel sets the SELinux label that the kernel will use for any programs @@ -697,17 +745,21 @@ func socketLabel() (string, error) { // peerLabel retrieves the label of the client on the other side of a socket func peerLabel(fd uintptr) (string, error) { - return unix.GetsockoptString(int(fd), unix.SOL_SOCKET, unix.SO_PEERSEC) + label, err := unix.GetsockoptString(int(fd), unix.SOL_SOCKET, unix.SO_PEERSEC) + if err != nil { + return "", &os.PathError{Op: "getsockopt", Path: "fd " + strconv.Itoa(int(fd)), Err: err} + } + return label, nil } // setKeyLabel takes a process label and tells the kernel to assign the // label to the next kernel keyring that gets created func setKeyLabel(label string) error { err := writeCon("/proc/self/attr/keycreate", label) - if os.IsNotExist(errors.Cause(err)) { + if errors.Is(err, os.ErrNotExist) { return nil } - if label == "" && os.IsPermission(errors.Cause(err)) { + if label == "" && errors.Is(err, os.ErrPermission) { return nil } return err @@ -720,10 +772,10 @@ func keyLabel() (string, error) { // get returns the Context as a string func (c Context) get() string { - if c["level"] != "" { - return fmt.Sprintf("%s:%s:%s:%s", c["user"], c["role"], c["type"], c["level"]) + if level := c["level"]; level != "" { + return c["user"] + ":" + c["role"] + ":" + c["type"] + ":" + level } - return fmt.Sprintf("%s:%s:%s", c["user"], c["role"], c["type"]) + return c["user"] + ":" + c["role"] + ":" + c["type"] } // newContext creates a new Context struct from the specified label @@ -784,7 +836,7 @@ func enforceMode() int { // setEnforceMode sets the current SELinux mode Enforcing, Permissive. // Disabled is not valid, since this needs to be set at boot time. func setEnforceMode(mode int) error { - return ioutil.WriteFile(selinuxEnforcePath(), []byte(strconv.Itoa(mode)), 0644) + return ioutil.WriteFile(selinuxEnforcePath(), []byte(strconv.Itoa(mode)), 0o644) } // defaultEnforceMode returns the systems default SELinux mode Enforcing, @@ -888,24 +940,21 @@ func openContextFile() (*os.File, error) { if f, err := os.Open(contextFile); err == nil { return f, nil } - lxcPath := filepath.Join(policyRoot, "/contexts/lxc_contexts") - return os.Open(lxcPath) + return os.Open(filepath.Join(policyRoot(), "/contexts/lxc_contexts")) } -var labels, privContainerMountLabel = loadLabels() - -func loadLabels() (map[string]string, string) { - labels := make(map[string]string) +func loadLabels() { + labels = make(map[string]string) in, err := openContextFile() if err != nil { - return labels, "" + return } defer in.Close() scanner := bufio.NewScanner(in) for scanner.Scan() { - line := strings.TrimSpace(scanner.Text()) + line := bytes.TrimSpace(scanner.Bytes()) if len(line) == 0 { // Skip blank lines continue @@ -914,38 +963,47 @@ func loadLabels() (map[string]string, string) { // Skip comments continue } - if groups := assignRegex.FindStringSubmatch(line); groups != nil { - key, val := strings.TrimSpace(groups[1]), strings.TrimSpace(groups[2]) - labels[key] = strings.Trim(val, "\"") + fields := bytes.SplitN(line, []byte{'='}, 2) + if len(fields) != 2 { + continue } + key, val := bytes.TrimSpace(fields[0]), bytes.TrimSpace(fields[1]) + labels[string(key)] = string(bytes.Trim(val, `"`)) } con, _ := NewContext(labels["file"]) con["level"] = fmt.Sprintf("s0:c%d,c%d", maxCategory-2, maxCategory-1) - reserveLabel(con.get()) - return labels, con.get() + privContainerMountLabel = con.get() + reserveLabel(privContainerMountLabel) +} + +func label(key string) string { + loadLabelsOnce.Do(func() { + loadLabels() + }) + return labels[key] } // kvmContainerLabels returns the default processLabel and mountLabel to be used // for kvm containers by the calling process. func kvmContainerLabels() (string, string) { - processLabel := labels["kvm_process"] + processLabel := label("kvm_process") if processLabel == "" { - processLabel = labels["process"] + processLabel = label("process") } - return addMcs(processLabel, labels["file"]) + return addMcs(processLabel, label("file")) } // initContainerLabels returns the default processLabel and file labels to be // used for containers running an init system like systemd by the calling process. func initContainerLabels() (string, string) { - processLabel := labels["init_process"] + processLabel := label("init_process") if processLabel == "" { - processLabel = labels["process"] + processLabel = label("process") } - return addMcs(processLabel, labels["file"]) + return addMcs(processLabel, label("file")) } // containerLabels returns an allocated processLabel and fileLabel to be used for @@ -955,9 +1013,9 @@ func containerLabels() (processLabel string, fileLabel string) { return "", "" } - processLabel = labels["process"] - fileLabel = labels["file"] - readOnlyFileLabel = labels["ro_file"] + processLabel = label("process") + fileLabel = label("file") + readOnlyFileLabel = label("ro_file") if processLabel == "" || fileLabel == "" { return "", fileLabel @@ -985,7 +1043,7 @@ func addMcs(processLabel, fileLabel string) (string, string) { // securityCheckContext validates that the SELinux label is understood by the kernel func securityCheckContext(val string) error { - return ioutil.WriteFile(path.Join(getSelinuxMountPoint(), "context"), []byte(val), 0644) + return ioutil.WriteFile(path.Join(getSelinuxMountPoint(), "context"), []byte(val), 0o644) } // copyLevel returns a label with the MLS/MCS level from src label replaced on @@ -1023,7 +1081,7 @@ func badPrefix(fpath string) error { badPrefixes := []string{"/usr"} for _, prefix := range badPrefixes { if strings.HasPrefix(fpath, prefix) { - return errors.Errorf("relabeling content in %s is not allowed", prefix) + return fmt.Errorf("relabeling content in %s is not allowed", prefix) } } return nil @@ -1044,17 +1102,10 @@ func chcon(fpath string, label string, recurse bool) error { } if !recurse { - return SetFileLabel(fpath, label) + return setFileLabel(fpath, label) } - return pwalk.Walk(fpath, func(p string, info os.FileInfo, err error) error { - e := SetFileLabel(p, label) - // Walk a file tree can race with removal, so ignore ENOENT - if os.IsNotExist(errors.Cause(e)) { - return nil - } - return e - }) + return rchcon(fpath, label) } // dupSecOpt takes an SELinux process label and returns security options that @@ -1072,7 +1123,8 @@ func dupSecOpt(src string) ([]string, error) { con["type"] == "" { return nil, nil } - dup := []string{"user:" + con["user"], + dup := []string{ + "user:" + con["user"], "role:" + con["role"], "type:" + con["type"], } @@ -1140,9 +1192,8 @@ func findUserInContext(context Context, r io.Reader, verifier func(string) error return outConn, nil } } - if err := scanner.Err(); err != nil { - return "", errors.Wrap(err, "failed to scan for context") + return "", fmt.Errorf("failed to scan for context: %w", err) } return "", nil @@ -1155,7 +1206,7 @@ func getDefaultContextFromReaders(c *defaultSECtx) (string, error) { context, err := newContext(c.scon) if err != nil { - return "", errors.Wrapf(err, "failed to create label for %s", c.scon) + return "", fmt.Errorf("failed to create label for %s: %w", c.scon, err) } // set so the verifier validates the matched context with the provided user and level. @@ -1180,19 +1231,18 @@ func getDefaultContextFromReaders(c *defaultSECtx) (string, error) { return conn, nil } - return "", errors.Wrapf(ErrContextMissing, "context not found: %q", c.scon) + return "", fmt.Errorf("context %q not found: %w", c.scon, ErrContextMissing) } func getDefaultContextWithLevel(user, level, scon string) (string, error) { - userPath := filepath.Join(policyRoot, selinuxUsersDir, user) - defaultPath := filepath.Join(policyRoot, defaultContexts) - + userPath := filepath.Join(policyRoot(), selinuxUsersDir, user) fu, err := os.Open(userPath) if err != nil { return "", err } defer fu.Close() + defaultPath := filepath.Join(policyRoot(), defaultContexts) fd, err := os.Open(defaultPath) if err != nil { return "", err diff --git a/vendor/github.com/opencontainers/selinux/go-selinux/selinux_stub.go b/vendor/github.com/opencontainers/selinux/go-selinux/selinux_stub.go index b7218a0b6a85c..78743b020c923 100644 --- a/vendor/github.com/opencontainers/selinux/go-selinux/selinux_stub.go +++ b/vendor/github.com/opencontainers/selinux/go-selinux/selinux_stub.go @@ -2,8 +2,6 @@ package selinux -const privContainerMountLabel = "" - func setDisabled() { } @@ -19,10 +17,18 @@ func setFileLabel(fpath string, label string) error { return nil } +func lSetFileLabel(fpath string, label string) error { + return nil +} + func fileLabel(fpath string) (string, error) { return "", nil } +func lFileLabel(fpath string) (string, error) { + return "", nil +} + func setFSCreateLabel(label string) error { return nil } @@ -152,3 +158,7 @@ func disableSecOpt() []string { func getDefaultContextWithLevel(user, level, scon string) (string, error) { return "", nil } + +func label(_ string) string { + return "" +} diff --git a/vendor/github.com/opencontainers/selinux/go-selinux/xattrs_linux.go b/vendor/github.com/opencontainers/selinux/go-selinux/xattrs_linux.go index 117c255be2015..9e473ca168f11 100644 --- a/vendor/github.com/opencontainers/selinux/go-selinux/xattrs_linux.go +++ b/vendor/github.com/opencontainers/selinux/go-selinux/xattrs_linux.go @@ -10,7 +10,7 @@ func lgetxattr(path, attr string) ([]byte, error) { // Start with a 128 length byte array dest := make([]byte, 128) sz, errno := doLgetxattr(path, attr, dest) - for errno == unix.ERANGE { + for errno == unix.ERANGE { //nolint:errorlint // unix errors are bare // Buffer too small, use zero-sized buffer to get the actual size sz, errno = doLgetxattr(path, attr, []byte{}) if errno != nil { @@ -31,7 +31,40 @@ func lgetxattr(path, attr string) ([]byte, error) { func doLgetxattr(path, attr string, dest []byte) (int, error) { for { sz, err := unix.Lgetxattr(path, attr, dest) - if err != unix.EINTR { + if err != unix.EINTR { //nolint:errorlint // unix errors are bare + return sz, err + } + } +} + +// getxattr returns a []byte slice containing the value of +// an extended attribute attr set for path. +func getxattr(path, attr string) ([]byte, error) { + // Start with a 128 length byte array + dest := make([]byte, 128) + sz, errno := dogetxattr(path, attr, dest) + for errno == unix.ERANGE { //nolint:errorlint // unix errors are bare + // Buffer too small, use zero-sized buffer to get the actual size + sz, errno = dogetxattr(path, attr, []byte{}) + if errno != nil { + return nil, errno + } + + dest = make([]byte, sz) + sz, errno = dogetxattr(path, attr, dest) + } + if errno != nil { + return nil, errno + } + + return dest[:sz], nil +} + +// dogetxattr is a wrapper that retries on EINTR +func dogetxattr(path, attr string, dest []byte) (int, error) { + for { + sz, err := unix.Getxattr(path, attr, dest) + if err != unix.EINTR { //nolint:errorlint // unix errors are bare return sz, err } } diff --git a/vendor/github.com/opencontainers/selinux/pkg/pwalk/README.md b/vendor/github.com/opencontainers/selinux/pkg/pwalk/README.md index 16c4dfd3ecc7e..7e78dce0156b2 100644 --- a/vendor/github.com/opencontainers/selinux/pkg/pwalk/README.md +++ b/vendor/github.com/opencontainers/selinux/pkg/pwalk/README.md @@ -8,6 +8,12 @@ By default, it utilizes 2\*runtime.NumCPU() goroutines for callbacks. This can be changed by using WalkN function which has the additional parameter, specifying the number of goroutines (concurrency). +### pwalk vs pwalkdir + +This package is deprecated in favor of +[pwalkdir](https://pkg.go.dev/github.com/opencontainers/selinux/pkg/pwalkdir), +which is faster, but requires at least Go 1.16. + ### Caveats Please note the following limitations of this code: diff --git a/vendor/github.com/opencontainers/selinux/pkg/pwalk/pwalk.go b/vendor/github.com/opencontainers/selinux/pkg/pwalk/pwalk.go index 437b12b3e289c..202c80da59c3b 100644 --- a/vendor/github.com/opencontainers/selinux/pkg/pwalk/pwalk.go +++ b/vendor/github.com/opencontainers/selinux/pkg/pwalk/pwalk.go @@ -1,12 +1,11 @@ package pwalk import ( + "fmt" "os" "path/filepath" "runtime" "sync" - - "github.com/pkg/errors" ) type WalkFunc = filepath.WalkFunc @@ -20,7 +19,7 @@ type WalkFunc = filepath.WalkFunc // // Note that this implementation only supports primitive error handling: // -// - no errors are ever passed to WalkFn; +// - no errors are ever passed to walkFn; // // - once a walkFn returns any error, all further processing stops // and the error is returned to the caller of Walk; @@ -42,7 +41,7 @@ func Walk(root string, walkFn WalkFunc) error { func WalkN(root string, walkFn WalkFunc, num int) error { // make sure limit is sensible if num < 1 { - return errors.Errorf("walk(%q): num must be > 0", root) + return fmt.Errorf("walk(%q): num must be > 0", root) } files := make(chan *walkArgs, 2*num) @@ -52,6 +51,9 @@ func WalkN(root string, walkFn WalkFunc, num int) error { var ( err error wg sync.WaitGroup + + rootLen = len(root) + rootEntry *walkArgs ) wg.Add(1) go func() { @@ -60,6 +62,11 @@ func WalkN(root string, walkFn WalkFunc, num int) error { close(files) return err } + if len(p) == rootLen { + // Root entry is processed separately below. + rootEntry = &walkArgs{path: p, info: &info} + return nil + } // add a file to the queue unless a callback sent an error select { case e := <-errCh: @@ -93,10 +100,14 @@ func WalkN(root string, walkFn WalkFunc, num int) error { wg.Wait() + if err == nil { + err = walkFn(rootEntry.path, *rootEntry.info, nil) + } + return err } -// walkArgs holds the arguments that were passed to the Walk or WalkLimit +// walkArgs holds the arguments that were passed to the Walk or WalkN // functions. type walkArgs struct { path string diff --git a/vendor/github.com/opencontainers/selinux/pkg/pwalkdir/README.md b/vendor/github.com/opencontainers/selinux/pkg/pwalkdir/README.md new file mode 100644 index 0000000000000..068ac400565bc --- /dev/null +++ b/vendor/github.com/opencontainers/selinux/pkg/pwalkdir/README.md @@ -0,0 +1,54 @@ +## pwalkdir: parallel implementation of filepath.WalkDir + +This is a wrapper for [filepath.WalkDir](https://pkg.go.dev/path/filepath#WalkDir) +which may speed it up by calling multiple callback functions (WalkDirFunc) +in parallel, utilizing goroutines. + +By default, it utilizes 2\*runtime.NumCPU() goroutines for callbacks. +This can be changed by using WalkN function which has the additional +parameter, specifying the number of goroutines (concurrency). + +### pwalk vs pwalkdir + +This package is very similar to +[pwalk](https://pkg.go.dev/github.com/opencontainers/selinux/pkg/pwalkdir), +but utilizes `filepath.WalkDir` (added to Go 1.16), which does not call stat(2) +on every entry and is therefore faster (up to 3x, depending on usage scenario). + +Users who are OK with requiring Go 1.16+ should switch to this +implementation. + +### Caveats + +Please note the following limitations of this code: + +* Unlike filepath.WalkDir, the order of calls is non-deterministic; + +* Only primitive error handling is supported: + + * fs.SkipDir is not supported; + + * no errors are ever passed to WalkDirFunc; + + * once any error is returned from any walkDirFunc instance, no more calls + to WalkDirFunc are made, and the error is returned to the caller of WalkDir; + + * if more than one WalkDirFunc instance will return an error, only one + of such errors will be propagated to and returned by WalkDir, others + will be silently discarded. + +### Documentation + +For the official documentation, see +https://pkg.go.dev/github.com/opencontainers/selinux/pkg/pwalkdir + +### Benchmarks + +For a WalkDirFunc that consists solely of the return statement, this +implementation is about 15% slower than the standard library's +filepath.WalkDir. + +Otherwise (if a WalkDirFunc is actually doing something) this is usually +faster, except when the WalkDirN(..., 1) is used. Run `go test -bench .` +to see how different operations can benefit from it, as well as how the +level of paralellism affects the speed. diff --git a/vendor/github.com/opencontainers/selinux/pkg/pwalkdir/pwalkdir.go b/vendor/github.com/opencontainers/selinux/pkg/pwalkdir/pwalkdir.go new file mode 100644 index 0000000000000..a5796b2c4f1c5 --- /dev/null +++ b/vendor/github.com/opencontainers/selinux/pkg/pwalkdir/pwalkdir.go @@ -0,0 +1,116 @@ +//go:build go1.16 +// +build go1.16 + +package pwalkdir + +import ( + "fmt" + "io/fs" + "path/filepath" + "runtime" + "sync" +) + +// Walk is a wrapper for filepath.WalkDir which can call multiple walkFn +// in parallel, allowing to handle each item concurrently. A maximum of +// twice the runtime.NumCPU() walkFn will be called at any one time. +// If you want to change the maximum, use WalkN instead. +// +// The order of calls is non-deterministic. +// +// Note that this implementation only supports primitive error handling: +// +// - no errors are ever passed to walkFn; +// +// - once a walkFn returns any error, all further processing stops +// and the error is returned to the caller of Walk; +// +// - filepath.SkipDir is not supported; +// +// - if more than one walkFn instance will return an error, only one +// of such errors will be propagated and returned by Walk, others +// will be silently discarded. +func Walk(root string, walkFn fs.WalkDirFunc) error { + return WalkN(root, walkFn, runtime.NumCPU()*2) +} + +// WalkN is a wrapper for filepath.WalkDir which can call multiple walkFn +// in parallel, allowing to handle each item concurrently. A maximum of +// num walkFn will be called at any one time. +// +// Please see Walk documentation for caveats of using this function. +func WalkN(root string, walkFn fs.WalkDirFunc, num int) error { + // make sure limit is sensible + if num < 1 { + return fmt.Errorf("walk(%q): num must be > 0", root) + } + + files := make(chan *walkArgs, 2*num) + errCh := make(chan error, 1) // Get the first error, ignore others. + + // Start walking a tree asap. + var ( + err error + wg sync.WaitGroup + + rootLen = len(root) + rootEntry *walkArgs + ) + wg.Add(1) + go func() { + err = filepath.WalkDir(root, func(p string, entry fs.DirEntry, err error) error { + if err != nil { + close(files) + return err + } + if len(p) == rootLen { + // Root entry is processed separately below. + rootEntry = &walkArgs{path: p, entry: entry} + return nil + } + // Add a file to the queue unless a callback sent an error. + select { + case e := <-errCh: + close(files) + return e + default: + files <- &walkArgs{path: p, entry: entry} + return nil + } + }) + if err == nil { + close(files) + } + wg.Done() + }() + + wg.Add(num) + for i := 0; i < num; i++ { + go func() { + for file := range files { + if e := walkFn(file.path, file.entry, nil); e != nil { + select { + case errCh <- e: // sent ok + default: // buffer full + } + } + } + wg.Done() + }() + } + + wg.Wait() + + if err == nil { + err = walkFn(rootEntry.path, rootEntry.entry, nil) + } + + return err +} + +// walkArgs holds the arguments that were passed to the Walk or WalkN +// functions. +type walkArgs struct { + path string + entry fs.DirEntry +} diff --git a/vendor/go.opencensus.io/.travis.yml b/vendor/go.opencensus.io/.travis.yml deleted file mode 100644 index bd6b66ee83d34..0000000000000 --- a/vendor/go.opencensus.io/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -language: go - -go_import_path: go.opencensus.io - -go: - - 1.11.x - -env: - global: - GO111MODULE=on - -before_script: - - make install-tools - -script: - - make travis-ci - - go run internal/check/version.go # TODO move this to makefile diff --git a/vendor/go.opencensus.io/go.mod b/vendor/go.opencensus.io/go.mod index c867df5f5c463..95b2522a7faa2 100644 --- a/vendor/go.opencensus.io/go.mod +++ b/vendor/go.opencensus.io/go.mod @@ -1,15 +1,12 @@ module go.opencensus.io require ( - github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 - github.com/golang/protobuf v1.3.1 - github.com/google/go-cmp v0.3.0 - github.com/stretchr/testify v1.4.0 - golang.org/x/net v0.0.0-20190620200207-3b0461eec859 - golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd // indirect - golang.org/x/text v0.3.2 // indirect - google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb // indirect - google.golang.org/grpc v1.20.1 + github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e + github.com/golang/protobuf v1.4.3 + github.com/google/go-cmp v0.5.3 + github.com/stretchr/testify v1.6.1 + golang.org/x/net v0.0.0-20201110031124-69a78807bb2b + google.golang.org/grpc v1.33.2 ) go 1.13 diff --git a/vendor/go.opencensus.io/go.sum b/vendor/go.opencensus.io/go.sum index 01c02972c7e87..c97cd1b551e7a 100644 --- a/vendor/go.opencensus.io/go.sum +++ b/vendor/go.opencensus.io/go.sum @@ -1,25 +1,47 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 h1:ZgQEtGgCBiWRM39fZuwSd1LwSqqSW0hOdXCYYDX0R3I= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3 h1:x95R7cp+rSeeqAMI2knLtQ0DKlaBhv2NrtrOvafPHRo= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -30,24 +52,25 @@ golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 h1:bjcUS9ztw9kFmmIxJInhon/0Is3p+EHBKNgquIzo1OI= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd h1:r7DufRZuZbWB7j439YfAzP8RPDa9unLkpwQKUYbIMPI= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -55,20 +78,39 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3 golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd h1:/e+gpKk9r3dJobndpTytxS2gOy6m5uvpg+ISQoEcusQ= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb h1:i1Ppqkc3WQXikh8bXiwHqAN5Rv3/qDCcRk0/Otx73BY= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8= google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1 h1:Hz2g2wirWK7H0qIIhGIqRGTuMwTE8HEKFnDZZ7lm9NU= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/vendor/go.opencensus.io/trace/basetypes.go b/vendor/go.opencensus.io/trace/basetypes.go index 0c54492a2b1d0..c8e26ed6355bc 100644 --- a/vendor/go.opencensus.io/trace/basetypes.go +++ b/vendor/go.opencensus.io/trace/basetypes.go @@ -49,6 +49,16 @@ type Attribute struct { value interface{} } +// Key returns the attribute's key +func (a *Attribute) Key() string { + return a.key +} + +// Value returns the attribute's value +func (a *Attribute) Value() interface{} { + return a.value +} + // BoolAttribute returns a bool-valued attribute. func BoolAttribute(key string, value bool) Attribute { return Attribute{key: key, value: value} diff --git a/vendor/go.opencensus.io/trace/spanstore.go b/vendor/go.opencensus.io/trace/spanstore.go index c442d990218a3..e601f76f2c82e 100644 --- a/vendor/go.opencensus.io/trace/spanstore.go +++ b/vendor/go.opencensus.io/trace/spanstore.go @@ -48,8 +48,10 @@ func (i internalOnly) ReportActiveSpans(name string) []*SpanData { var out []*SpanData s.mu.Lock() defer s.mu.Unlock() - for span := range s.active { - out = append(out, span.makeSpanData()) + for activeSpan := range s.active { + if s, ok := activeSpan.(*span); ok { + out = append(out, s.makeSpanData()) + } } return out } @@ -185,7 +187,7 @@ func (i internalOnly) ReportSpansByLatency(name string, minLatency, maxLatency t // bucketed by latency. type spanStore struct { mu sync.Mutex // protects everything below. - active map[*Span]struct{} + active map[SpanInterface]struct{} errors map[int32]*bucket latency []bucket maxSpansPerErrorBucket int @@ -194,7 +196,7 @@ type spanStore struct { // newSpanStore creates a span store. func newSpanStore(name string, latencyBucketSize int, errorBucketSize int) *spanStore { s := &spanStore{ - active: make(map[*Span]struct{}), + active: make(map[SpanInterface]struct{}), latency: make([]bucket, len(defaultLatencies)+1), maxSpansPerErrorBucket: errorBucketSize, } @@ -271,7 +273,7 @@ func (s *spanStore) resize(latencyBucketSize int, errorBucketSize int) { } // add adds a span to the active bucket of the spanStore. -func (s *spanStore) add(span *Span) { +func (s *spanStore) add(span SpanInterface) { s.mu.Lock() s.active[span] = struct{}{} s.mu.Unlock() @@ -279,7 +281,7 @@ func (s *spanStore) add(span *Span) { // finished removes a span from the active set, and adds a corresponding // SpanData to a latency or error bucket. -func (s *spanStore) finished(span *Span, sd *SpanData) { +func (s *spanStore) finished(span SpanInterface, sd *SpanData) { latency := sd.EndTime.Sub(sd.StartTime) if latency < 0 { latency = 0 diff --git a/vendor/go.opencensus.io/trace/trace.go b/vendor/go.opencensus.io/trace/trace.go index 125e2cd901275..861df9d3913db 100644 --- a/vendor/go.opencensus.io/trace/trace.go +++ b/vendor/go.opencensus.io/trace/trace.go @@ -28,12 +28,16 @@ import ( "go.opencensus.io/trace/tracestate" ) +type tracer struct{} + +var _ Tracer = &tracer{} + // Span represents a span of a trace. It has an associated SpanContext, and // stores data accumulated while the span is active. // // Ideally users should interact with Spans by calling the functions in this // package that take a Context parameter. -type Span struct { +type span struct { // data contains information recorded about the span. // // It will be non-nil if we are exporting the span or recording events for it. @@ -66,7 +70,7 @@ type Span struct { // IsRecordingEvents returns true if events are being recorded for this span. // Use this check to avoid computing expensive annotations when they will never // be used. -func (s *Span) IsRecordingEvents() bool { +func (s *span) IsRecordingEvents() bool { if s == nil { return false } @@ -109,13 +113,13 @@ type SpanContext struct { type contextKey struct{} // FromContext returns the Span stored in a context, or nil if there isn't one. -func FromContext(ctx context.Context) *Span { +func (t *tracer) FromContext(ctx context.Context) *Span { s, _ := ctx.Value(contextKey{}).(*Span) return s } // NewContext returns a new context with the given Span attached. -func NewContext(parent context.Context, s *Span) context.Context { +func (t *tracer) NewContext(parent context.Context, s *Span) context.Context { return context.WithValue(parent, contextKey{}, s) } @@ -166,12 +170,14 @@ func WithSampler(sampler Sampler) StartOption { // // Returned context contains the newly created span. You can use it to // propagate the returned span in process. -func StartSpan(ctx context.Context, name string, o ...StartOption) (context.Context, *Span) { +func (t *tracer) StartSpan(ctx context.Context, name string, o ...StartOption) (context.Context, *Span) { var opts StartOptions var parent SpanContext - if p := FromContext(ctx); p != nil { - p.addChild() - parent = p.spanContext + if p := t.FromContext(ctx); p != nil { + if ps, ok := p.internal.(*span); ok { + ps.addChild() + } + parent = p.SpanContext() } for _, op := range o { op(&opts) @@ -180,7 +186,8 @@ func StartSpan(ctx context.Context, name string, o ...StartOption) (context.Cont ctx, end := startExecutionTracerTask(ctx, name) span.executionTracerTaskEnd = end - return NewContext(ctx, span), span + extSpan := NewSpan(span) + return t.NewContext(ctx, extSpan), extSpan } // StartSpanWithRemoteParent starts a new child span of the span from the given parent. @@ -190,7 +197,7 @@ func StartSpan(ctx context.Context, name string, o ...StartOption) (context.Cont // // Returned context contains the newly created span. You can use it to // propagate the returned span in process. -func StartSpanWithRemoteParent(ctx context.Context, name string, parent SpanContext, o ...StartOption) (context.Context, *Span) { +func (t *tracer) StartSpanWithRemoteParent(ctx context.Context, name string, parent SpanContext, o ...StartOption) (context.Context, *Span) { var opts StartOptions for _, op := range o { op(&opts) @@ -198,19 +205,24 @@ func StartSpanWithRemoteParent(ctx context.Context, name string, parent SpanCont span := startSpanInternal(name, parent != SpanContext{}, parent, true, opts) ctx, end := startExecutionTracerTask(ctx, name) span.executionTracerTaskEnd = end - return NewContext(ctx, span), span + extSpan := NewSpan(span) + return t.NewContext(ctx, extSpan), extSpan } -func startSpanInternal(name string, hasParent bool, parent SpanContext, remoteParent bool, o StartOptions) *Span { - span := &Span{} - span.spanContext = parent +func startSpanInternal(name string, hasParent bool, parent SpanContext, remoteParent bool, o StartOptions) *span { + s := &span{} + s.spanContext = parent cfg := config.Load().(*Config) + if gen, ok := cfg.IDGenerator.(*defaultIDGenerator); ok { + // lazy initialization + gen.init() + } if !hasParent { - span.spanContext.TraceID = cfg.IDGenerator.NewTraceID() + s.spanContext.TraceID = cfg.IDGenerator.NewTraceID() } - span.spanContext.SpanID = cfg.IDGenerator.NewSpanID() + s.spanContext.SpanID = cfg.IDGenerator.NewSpanID() sampler := cfg.DefaultSampler if !hasParent || remoteParent || o.Sampler != nil { @@ -222,47 +234,47 @@ func startSpanInternal(name string, hasParent bool, parent SpanContext, remotePa if o.Sampler != nil { sampler = o.Sampler } - span.spanContext.setIsSampled(sampler(SamplingParameters{ + s.spanContext.setIsSampled(sampler(SamplingParameters{ ParentContext: parent, - TraceID: span.spanContext.TraceID, - SpanID: span.spanContext.SpanID, + TraceID: s.spanContext.TraceID, + SpanID: s.spanContext.SpanID, Name: name, HasRemoteParent: remoteParent}).Sample) } - if !internal.LocalSpanStoreEnabled && !span.spanContext.IsSampled() { - return span + if !internal.LocalSpanStoreEnabled && !s.spanContext.IsSampled() { + return s } - span.data = &SpanData{ - SpanContext: span.spanContext, + s.data = &SpanData{ + SpanContext: s.spanContext, StartTime: time.Now(), SpanKind: o.SpanKind, Name: name, HasRemoteParent: remoteParent, } - span.lruAttributes = newLruMap(cfg.MaxAttributesPerSpan) - span.annotations = newEvictedQueue(cfg.MaxAnnotationEventsPerSpan) - span.messageEvents = newEvictedQueue(cfg.MaxMessageEventsPerSpan) - span.links = newEvictedQueue(cfg.MaxLinksPerSpan) + s.lruAttributes = newLruMap(cfg.MaxAttributesPerSpan) + s.annotations = newEvictedQueue(cfg.MaxAnnotationEventsPerSpan) + s.messageEvents = newEvictedQueue(cfg.MaxMessageEventsPerSpan) + s.links = newEvictedQueue(cfg.MaxLinksPerSpan) if hasParent { - span.data.ParentSpanID = parent.SpanID + s.data.ParentSpanID = parent.SpanID } if internal.LocalSpanStoreEnabled { var ss *spanStore ss = spanStoreForNameCreateIfNew(name) if ss != nil { - span.spanStore = ss - ss.add(span) + s.spanStore = ss + ss.add(s) } } - return span + return s } // End ends the span. -func (s *Span) End() { +func (s *span) End() { if s == nil { return } @@ -292,7 +304,7 @@ func (s *Span) End() { // makeSpanData produces a SpanData representing the current state of the Span. // It requires that s.data is non-nil. -func (s *Span) makeSpanData() *SpanData { +func (s *span) makeSpanData() *SpanData { var sd SpanData s.mu.Lock() sd = *s.data @@ -317,7 +329,7 @@ func (s *Span) makeSpanData() *SpanData { } // SpanContext returns the SpanContext of the span. -func (s *Span) SpanContext() SpanContext { +func (s *span) SpanContext() SpanContext { if s == nil { return SpanContext{} } @@ -325,7 +337,7 @@ func (s *Span) SpanContext() SpanContext { } // SetName sets the name of the span, if it is recording events. -func (s *Span) SetName(name string) { +func (s *span) SetName(name string) { if !s.IsRecordingEvents() { return } @@ -335,7 +347,7 @@ func (s *Span) SetName(name string) { } // SetStatus sets the status of the span, if it is recording events. -func (s *Span) SetStatus(status Status) { +func (s *span) SetStatus(status Status) { if !s.IsRecordingEvents() { return } @@ -344,7 +356,7 @@ func (s *Span) SetStatus(status Status) { s.mu.Unlock() } -func (s *Span) interfaceArrayToLinksArray() []Link { +func (s *span) interfaceArrayToLinksArray() []Link { linksArr := make([]Link, 0, len(s.links.queue)) for _, value := range s.links.queue { linksArr = append(linksArr, value.(Link)) @@ -352,7 +364,7 @@ func (s *Span) interfaceArrayToLinksArray() []Link { return linksArr } -func (s *Span) interfaceArrayToMessageEventArray() []MessageEvent { +func (s *span) interfaceArrayToMessageEventArray() []MessageEvent { messageEventArr := make([]MessageEvent, 0, len(s.messageEvents.queue)) for _, value := range s.messageEvents.queue { messageEventArr = append(messageEventArr, value.(MessageEvent)) @@ -360,7 +372,7 @@ func (s *Span) interfaceArrayToMessageEventArray() []MessageEvent { return messageEventArr } -func (s *Span) interfaceArrayToAnnotationArray() []Annotation { +func (s *span) interfaceArrayToAnnotationArray() []Annotation { annotationArr := make([]Annotation, 0, len(s.annotations.queue)) for _, value := range s.annotations.queue { annotationArr = append(annotationArr, value.(Annotation)) @@ -368,7 +380,7 @@ func (s *Span) interfaceArrayToAnnotationArray() []Annotation { return annotationArr } -func (s *Span) lruAttributesToAttributeMap() map[string]interface{} { +func (s *span) lruAttributesToAttributeMap() map[string]interface{} { attributes := make(map[string]interface{}, s.lruAttributes.len()) for _, key := range s.lruAttributes.keys() { value, ok := s.lruAttributes.get(key) @@ -380,13 +392,13 @@ func (s *Span) lruAttributesToAttributeMap() map[string]interface{} { return attributes } -func (s *Span) copyToCappedAttributes(attributes []Attribute) { +func (s *span) copyToCappedAttributes(attributes []Attribute) { for _, a := range attributes { s.lruAttributes.add(a.key, a.value) } } -func (s *Span) addChild() { +func (s *span) addChild() { if !s.IsRecordingEvents() { return } @@ -398,7 +410,7 @@ func (s *Span) addChild() { // AddAttributes sets attributes in the span. // // Existing attributes whose keys appear in the attributes parameter are overwritten. -func (s *Span) AddAttributes(attributes ...Attribute) { +func (s *span) AddAttributes(attributes ...Attribute) { if !s.IsRecordingEvents() { return } @@ -407,49 +419,27 @@ func (s *Span) AddAttributes(attributes ...Attribute) { s.mu.Unlock() } -// copyAttributes copies a slice of Attributes into a map. -func copyAttributes(m map[string]interface{}, attributes []Attribute) { - for _, a := range attributes { - m[a.key] = a.value - } -} - -func (s *Span) lazyPrintfInternal(attributes []Attribute, format string, a ...interface{}) { +func (s *span) printStringInternal(attributes []Attribute, str string) { now := time.Now() - msg := fmt.Sprintf(format, a...) - var m map[string]interface{} - s.mu.Lock() + var am map[string]interface{} if len(attributes) != 0 { - m = make(map[string]interface{}, len(attributes)) - copyAttributes(m, attributes) + am = make(map[string]interface{}, len(attributes)) + for _, attr := range attributes { + am[attr.key] = attr.value + } } - s.annotations.add(Annotation{ - Time: now, - Message: msg, - Attributes: m, - }) - s.mu.Unlock() -} - -func (s *Span) printStringInternal(attributes []Attribute, str string) { - now := time.Now() - var a map[string]interface{} s.mu.Lock() - if len(attributes) != 0 { - a = make(map[string]interface{}, len(attributes)) - copyAttributes(a, attributes) - } s.annotations.add(Annotation{ Time: now, Message: str, - Attributes: a, + Attributes: am, }) s.mu.Unlock() } // Annotate adds an annotation with attributes. // Attributes can be nil. -func (s *Span) Annotate(attributes []Attribute, str string) { +func (s *span) Annotate(attributes []Attribute, str string) { if !s.IsRecordingEvents() { return } @@ -457,11 +447,11 @@ func (s *Span) Annotate(attributes []Attribute, str string) { } // Annotatef adds an annotation with attributes. -func (s *Span) Annotatef(attributes []Attribute, format string, a ...interface{}) { +func (s *span) Annotatef(attributes []Attribute, format string, a ...interface{}) { if !s.IsRecordingEvents() { return } - s.lazyPrintfInternal(attributes, format, a...) + s.printStringInternal(attributes, fmt.Sprintf(format, a...)) } // AddMessageSendEvent adds a message send event to the span. @@ -470,7 +460,7 @@ func (s *Span) Annotatef(attributes []Attribute, format string, a ...interface{} // unique in this span and the same between the send event and the receive // event (this allows to identify a message between the sender and receiver). // For example, this could be a sequence id. -func (s *Span) AddMessageSendEvent(messageID, uncompressedByteSize, compressedByteSize int64) { +func (s *span) AddMessageSendEvent(messageID, uncompressedByteSize, compressedByteSize int64) { if !s.IsRecordingEvents() { return } @@ -492,7 +482,7 @@ func (s *Span) AddMessageSendEvent(messageID, uncompressedByteSize, compressedBy // unique in this span and the same between the send event and the receive // event (this allows to identify a message between the sender and receiver). // For example, this could be a sequence id. -func (s *Span) AddMessageReceiveEvent(messageID, uncompressedByteSize, compressedByteSize int64) { +func (s *span) AddMessageReceiveEvent(messageID, uncompressedByteSize, compressedByteSize int64) { if !s.IsRecordingEvents() { return } @@ -509,7 +499,7 @@ func (s *Span) AddMessageReceiveEvent(messageID, uncompressedByteSize, compresse } // AddLink adds a link to the span. -func (s *Span) AddLink(l Link) { +func (s *span) AddLink(l Link) { if !s.IsRecordingEvents() { return } @@ -518,7 +508,7 @@ func (s *Span) AddLink(l Link) { s.mu.Unlock() } -func (s *Span) String() string { +func (s *span) String() string { if s == nil { return "" } @@ -534,20 +524,9 @@ func (s *Span) String() string { var config atomic.Value // access atomically func init() { - gen := &defaultIDGenerator{} - // initialize traceID and spanID generators. - var rngSeed int64 - for _, p := range []interface{}{ - &rngSeed, &gen.traceIDAdd, &gen.nextSpanID, &gen.spanIDInc, - } { - binary.Read(crand.Reader, binary.LittleEndian, p) - } - gen.traceIDRand = rand.New(rand.NewSource(rngSeed)) - gen.spanIDInc |= 1 - config.Store(&Config{ DefaultSampler: ProbabilitySampler(defaultSamplingProbability), - IDGenerator: gen, + IDGenerator: &defaultIDGenerator{}, MaxAttributesPerSpan: DefaultMaxAttributesPerSpan, MaxAnnotationEventsPerSpan: DefaultMaxAnnotationEventsPerSpan, MaxMessageEventsPerSpan: DefaultMaxMessageEventsPerSpan, @@ -571,6 +550,24 @@ type defaultIDGenerator struct { traceIDAdd [2]uint64 traceIDRand *rand.Rand + + initOnce sync.Once +} + +// init initializes the generator on the first call to avoid consuming entropy +// unnecessarily. +func (gen *defaultIDGenerator) init() { + gen.initOnce.Do(func() { + // initialize traceID and spanID generators. + var rngSeed int64 + for _, p := range []interface{}{ + &rngSeed, &gen.traceIDAdd, &gen.nextSpanID, &gen.spanIDInc, + } { + binary.Read(crand.Reader, binary.LittleEndian, p) + } + gen.traceIDRand = rand.New(rand.NewSource(rngSeed)) + gen.spanIDInc |= 1 + }) } // NewSpanID returns a non-zero span ID from a randomly-chosen sequence. diff --git a/vendor/go.opencensus.io/trace/trace_api.go b/vendor/go.opencensus.io/trace/trace_api.go new file mode 100644 index 0000000000000..9e2c3a999268c --- /dev/null +++ b/vendor/go.opencensus.io/trace/trace_api.go @@ -0,0 +1,265 @@ +// Copyright 2020, OpenCensus 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 trace + +import ( + "context" +) + +// DefaultTracer is the tracer used when package-level exported functions are invoked. +var DefaultTracer Tracer = &tracer{} + +// Tracer can start spans and access context functions. +type Tracer interface { + + // StartSpan starts a new child span of the current span in the context. If + // there is no span in the context, creates a new trace and span. + // + // Returned context contains the newly created span. You can use it to + // propagate the returned span in process. + StartSpan(ctx context.Context, name string, o ...StartOption) (context.Context, *Span) + + // StartSpanWithRemoteParent starts a new child span of the span from the given parent. + // + // If the incoming context contains a parent, it ignores. StartSpanWithRemoteParent is + // preferred for cases where the parent is propagated via an incoming request. + // + // Returned context contains the newly created span. You can use it to + // propagate the returned span in process. + StartSpanWithRemoteParent(ctx context.Context, name string, parent SpanContext, o ...StartOption) (context.Context, *Span) + + // FromContext returns the Span stored in a context, or nil if there isn't one. + FromContext(ctx context.Context) *Span + + // NewContext returns a new context with the given Span attached. + NewContext(parent context.Context, s *Span) context.Context +} + +// StartSpan starts a new child span of the current span in the context. If +// there is no span in the context, creates a new trace and span. +// +// Returned context contains the newly created span. You can use it to +// propagate the returned span in process. +func StartSpan(ctx context.Context, name string, o ...StartOption) (context.Context, *Span) { + return DefaultTracer.StartSpan(ctx, name, o...) +} + +// StartSpanWithRemoteParent starts a new child span of the span from the given parent. +// +// If the incoming context contains a parent, it ignores. StartSpanWithRemoteParent is +// preferred for cases where the parent is propagated via an incoming request. +// +// Returned context contains the newly created span. You can use it to +// propagate the returned span in process. +func StartSpanWithRemoteParent(ctx context.Context, name string, parent SpanContext, o ...StartOption) (context.Context, *Span) { + return DefaultTracer.StartSpanWithRemoteParent(ctx, name, parent, o...) +} + +// FromContext returns the Span stored in a context, or a Span that is not +// recording events if there isn't one. +func FromContext(ctx context.Context) *Span { + return DefaultTracer.FromContext(ctx) +} + +// NewContext returns a new context with the given Span attached. +func NewContext(parent context.Context, s *Span) context.Context { + return DefaultTracer.NewContext(parent, s) +} + +// SpanInterface represents a span of a trace. It has an associated SpanContext, and +// stores data accumulated while the span is active. +// +// Ideally users should interact with Spans by calling the functions in this +// package that take a Context parameter. +type SpanInterface interface { + + // IsRecordingEvents returns true if events are being recorded for this span. + // Use this check to avoid computing expensive annotations when they will never + // be used. + IsRecordingEvents() bool + + // End ends the span. + End() + + // SpanContext returns the SpanContext of the span. + SpanContext() SpanContext + + // SetName sets the name of the span, if it is recording events. + SetName(name string) + + // SetStatus sets the status of the span, if it is recording events. + SetStatus(status Status) + + // AddAttributes sets attributes in the span. + // + // Existing attributes whose keys appear in the attributes parameter are overwritten. + AddAttributes(attributes ...Attribute) + + // Annotate adds an annotation with attributes. + // Attributes can be nil. + Annotate(attributes []Attribute, str string) + + // Annotatef adds an annotation with attributes. + Annotatef(attributes []Attribute, format string, a ...interface{}) + + // AddMessageSendEvent adds a message send event to the span. + // + // messageID is an identifier for the message, which is recommended to be + // unique in this span and the same between the send event and the receive + // event (this allows to identify a message between the sender and receiver). + // For example, this could be a sequence id. + AddMessageSendEvent(messageID, uncompressedByteSize, compressedByteSize int64) + + // AddMessageReceiveEvent adds a message receive event to the span. + // + // messageID is an identifier for the message, which is recommended to be + // unique in this span and the same between the send event and the receive + // event (this allows to identify a message between the sender and receiver). + // For example, this could be a sequence id. + AddMessageReceiveEvent(messageID, uncompressedByteSize, compressedByteSize int64) + + // AddLink adds a link to the span. + AddLink(l Link) + + // String prints a string representation of a span. + String() string +} + +// NewSpan is a convenience function for creating a *Span out of a *span +func NewSpan(s SpanInterface) *Span { + return &Span{internal: s} +} + +// Span is a struct wrapper around the SpanInt interface, which allows correctly handling +// nil spans, while also allowing the SpanInterface implementation to be swapped out. +type Span struct { + internal SpanInterface +} + +// Internal returns the underlying implementation of the Span +func (s *Span) Internal() SpanInterface { + return s.internal +} + +// IsRecordingEvents returns true if events are being recorded for this span. +// Use this check to avoid computing expensive annotations when they will never +// be used. +func (s *Span) IsRecordingEvents() bool { + if s == nil { + return false + } + return s.internal.IsRecordingEvents() +} + +// End ends the span. +func (s *Span) End() { + if s == nil { + return + } + s.internal.End() +} + +// SpanContext returns the SpanContext of the span. +func (s *Span) SpanContext() SpanContext { + if s == nil { + return SpanContext{} + } + return s.internal.SpanContext() +} + +// SetName sets the name of the span, if it is recording events. +func (s *Span) SetName(name string) { + if !s.IsRecordingEvents() { + return + } + s.internal.SetName(name) +} + +// SetStatus sets the status of the span, if it is recording events. +func (s *Span) SetStatus(status Status) { + if !s.IsRecordingEvents() { + return + } + s.internal.SetStatus(status) +} + +// AddAttributes sets attributes in the span. +// +// Existing attributes whose keys appear in the attributes parameter are overwritten. +func (s *Span) AddAttributes(attributes ...Attribute) { + if !s.IsRecordingEvents() { + return + } + s.internal.AddAttributes(attributes...) +} + +// Annotate adds an annotation with attributes. +// Attributes can be nil. +func (s *Span) Annotate(attributes []Attribute, str string) { + if !s.IsRecordingEvents() { + return + } + s.internal.Annotate(attributes, str) +} + +// Annotatef adds an annotation with attributes. +func (s *Span) Annotatef(attributes []Attribute, format string, a ...interface{}) { + if !s.IsRecordingEvents() { + return + } + s.internal.Annotatef(attributes, format, a...) +} + +// AddMessageSendEvent adds a message send event to the span. +// +// messageID is an identifier for the message, which is recommended to be +// unique in this span and the same between the send event and the receive +// event (this allows to identify a message between the sender and receiver). +// For example, this could be a sequence id. +func (s *Span) AddMessageSendEvent(messageID, uncompressedByteSize, compressedByteSize int64) { + if !s.IsRecordingEvents() { + return + } + s.internal.AddMessageSendEvent(messageID, uncompressedByteSize, compressedByteSize) +} + +// AddMessageReceiveEvent adds a message receive event to the span. +// +// messageID is an identifier for the message, which is recommended to be +// unique in this span and the same between the send event and the receive +// event (this allows to identify a message between the sender and receiver). +// For example, this could be a sequence id. +func (s *Span) AddMessageReceiveEvent(messageID, uncompressedByteSize, compressedByteSize int64) { + if !s.IsRecordingEvents() { + return + } + s.internal.AddMessageReceiveEvent(messageID, uncompressedByteSize, compressedByteSize) +} + +// AddLink adds a link to the span. +func (s *Span) AddLink(l Link) { + if !s.IsRecordingEvents() { + return + } + s.internal.AddLink(l) +} + +// String prints a string representation of a span. +func (s *Span) String() string { + if s == nil { + return "" + } + return s.internal.String() +} diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/LICENSE b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/LICENSE new file mode 100644 index 0000000000000..261eeb9e9f8b2 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/LICENSE @@ -0,0 +1,201 @@ + 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/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/client.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/client.go new file mode 100644 index 0000000000000..dbc6c5ba78560 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/client.go @@ -0,0 +1,324 @@ +// Copyright The OpenTelemetry 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 otlptracehttp // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp" + +import ( + "bytes" + "compress/gzip" + "context" + "fmt" + "io" + "io/ioutil" + "net" + "net/http" + "net/url" + "path" + "strconv" + "strings" + "sync" + "time" + + "google.golang.org/protobuf/proto" + + "go.opentelemetry.io/otel/exporters/otlp/internal/retry" + "go.opentelemetry.io/otel/exporters/otlp/otlptrace" + "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/otlpconfig" + coltracepb "go.opentelemetry.io/proto/otlp/collector/trace/v1" + tracepb "go.opentelemetry.io/proto/otlp/trace/v1" +) + +const contentTypeProto = "application/x-protobuf" + +var gzPool = sync.Pool{ + New: func() interface{} { + w := gzip.NewWriter(ioutil.Discard) + return w + }, +} + +// Keep it in sync with golang's DefaultTransport from net/http! We +// have our own copy to avoid handling a situation where the +// DefaultTransport is overwritten with some different implementation +// of http.RoundTripper or it's modified by other package. +var ourTransport = &http.Transport{ + Proxy: http.ProxyFromEnvironment, + DialContext: (&net.Dialer{ + Timeout: 30 * time.Second, + KeepAlive: 30 * time.Second, + }).DialContext, + ForceAttemptHTTP2: true, + MaxIdleConns: 100, + IdleConnTimeout: 90 * time.Second, + TLSHandshakeTimeout: 10 * time.Second, + ExpectContinueTimeout: 1 * time.Second, +} + +type client struct { + name string + cfg otlpconfig.SignalConfig + generalCfg otlpconfig.Config + requestFunc retry.RequestFunc + client *http.Client + stopCh chan struct{} + stopOnce sync.Once +} + +var _ otlptrace.Client = (*client)(nil) + +// NewClient creates a new HTTP trace client. +func NewClient(opts ...Option) otlptrace.Client { + cfg := otlpconfig.NewDefaultConfig() + otlpconfig.ApplyHTTPEnvConfigs(&cfg) + for _, opt := range opts { + opt.applyHTTPOption(&cfg) + } + + for pathPtr, defaultPath := range map[*string]string{ + &cfg.Traces.URLPath: otlpconfig.DefaultTracesPath, + } { + tmp := strings.TrimSpace(*pathPtr) + if tmp == "" { + tmp = defaultPath + } else { + tmp = path.Clean(tmp) + if !path.IsAbs(tmp) { + tmp = fmt.Sprintf("/%s", tmp) + } + } + *pathPtr = tmp + } + + httpClient := &http.Client{ + Transport: ourTransport, + Timeout: cfg.Traces.Timeout, + } + if cfg.Traces.TLSCfg != nil { + transport := ourTransport.Clone() + transport.TLSClientConfig = cfg.Traces.TLSCfg + httpClient.Transport = transport + } + + stopCh := make(chan struct{}) + return &client{ + name: "traces", + cfg: cfg.Traces, + generalCfg: cfg, + requestFunc: cfg.RetryConfig.RequestFunc(evaluate), + stopCh: stopCh, + client: httpClient, + } +} + +// Start does nothing in a HTTP client +func (d *client) Start(ctx context.Context) error { + // nothing to do + select { + case <-ctx.Done(): + return ctx.Err() + default: + } + return nil +} + +// Stop shuts down the client and interrupt any in-flight request. +func (d *client) Stop(ctx context.Context) error { + d.stopOnce.Do(func() { + close(d.stopCh) + }) + select { + case <-ctx.Done(): + return ctx.Err() + default: + } + return nil +} + +// UploadTraces sends a batch of spans to the collector. +func (d *client) UploadTraces(ctx context.Context, protoSpans []*tracepb.ResourceSpans) error { + pbRequest := &coltracepb.ExportTraceServiceRequest{ + ResourceSpans: protoSpans, + } + rawRequest, err := proto.Marshal(pbRequest) + if err != nil { + return err + } + + ctx, cancel := d.contextWithStop(ctx) + defer cancel() + + request, err := d.newRequest(rawRequest) + if err != nil { + return err + } + + return d.requestFunc(ctx, func(ctx context.Context) error { + select { + case <-ctx.Done(): + return ctx.Err() + default: + } + + request.reset(ctx) + resp, err := d.client.Do(request.Request) + if err != nil { + return err + } + + var rErr error + switch resp.StatusCode { + case http.StatusOK: + // Success, do not retry. + case http.StatusTooManyRequests, + http.StatusServiceUnavailable: + // Retry-able failure. + rErr = newResponseError(resp.Header) + + // Going to retry, drain the body to reuse the connection. + if _, err := io.Copy(ioutil.Discard, resp.Body); err != nil { + _ = resp.Body.Close() + return err + } + default: + rErr = fmt.Errorf("failed to send %s to %s: %s", d.name, request.URL, resp.Status) + } + + if err := resp.Body.Close(); err != nil { + return err + } + return rErr + }) +} + +func (d *client) newRequest(body []byte) (request, error) { + u := url.URL{Scheme: d.getScheme(), Host: d.cfg.Endpoint, Path: d.cfg.URLPath} + r, err := http.NewRequest(http.MethodPost, u.String(), nil) + if err != nil { + return request{Request: r}, err + } + + for k, v := range d.cfg.Headers { + r.Header.Set(k, v) + } + r.Header.Set("Content-Type", contentTypeProto) + + req := request{Request: r} + switch Compression(d.cfg.Compression) { + case NoCompression: + r.ContentLength = (int64)(len(body)) + req.bodyReader = bodyReader(body) + case GzipCompression: + // Ensure the content length is not used. + r.ContentLength = -1 + r.Header.Set("Content-Encoding", "gzip") + + gz := gzPool.Get().(*gzip.Writer) + defer gzPool.Put(gz) + + var b bytes.Buffer + gz.Reset(&b) + + if _, err := gz.Write(body); err != nil { + return req, err + } + // Close needs to be called to ensure body if fully written. + if err := gz.Close(); err != nil { + return req, err + } + + req.bodyReader = bodyReader(b.Bytes()) + } + + return req, nil +} + +// bodyReader returns a closure returning a new reader for buf. +func bodyReader(buf []byte) func() io.ReadCloser { + return func() io.ReadCloser { + return ioutil.NopCloser(bytes.NewReader(buf)) + } +} + +// request wraps an http.Request with a resettable body reader. +type request struct { + *http.Request + + // bodyReader allows the same body to be used for multiple requests. + bodyReader func() io.ReadCloser +} + +// reset reinitializes the request Body and uses ctx for the request. +func (r *request) reset(ctx context.Context) { + r.Body = r.bodyReader() + r.Request = r.Request.WithContext(ctx) +} + +// retryableError represents a request failure that can be retried. +type retryableError struct { + throttle int64 +} + +// newResponseError returns a retryableError and will extract any explicit +// throttle delay contained in headers. +func newResponseError(header http.Header) error { + var rErr retryableError + if s, ok := header["Retry-After"]; ok { + if t, err := strconv.ParseInt(s[0], 10, 64); err == nil { + rErr.throttle = t + } + } + return rErr +} + +func (e retryableError) Error() string { + return "retry-able request failure" +} + +// evaluate returns if err is retry-able. If it is and it includes an explicit +// throttling delay, that delay is also returned. +func evaluate(err error) (bool, time.Duration) { + if err == nil { + return false, 0 + } + + rErr, ok := err.(retryableError) + if !ok { + return false, 0 + } + + return true, time.Duration(rErr.throttle) +} + +func (d *client) getScheme() string { + if d.cfg.Insecure { + return "http" + } + return "https" +} + +func (d *client) contextWithStop(ctx context.Context) (context.Context, context.CancelFunc) { + // Unify the parent context Done signal with the client's stop + // channel. + ctx, cancel := context.WithCancel(ctx) + go func(ctx context.Context, cancel context.CancelFunc) { + select { + case <-ctx.Done(): + // Nothing to do, either cancelled or deadline + // happened. + case <-d.stopCh: + cancel() + } + }(ctx, cancel) + return ctx, cancel +} diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/doc.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/doc.go new file mode 100644 index 0000000000000..e7f066b43ce81 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/doc.go @@ -0,0 +1,19 @@ +// Copyright The OpenTelemetry 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 otlptracehttp a client that sends traces to the collector using HTTP +with binary protobuf payloads. +*/ +package otlptracehttp // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp" diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/exporter.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/exporter.go new file mode 100644 index 0000000000000..23b8642040d32 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/exporter.go @@ -0,0 +1,31 @@ +// Copyright The OpenTelemetry 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 otlptracehttp // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp" + +import ( + "context" + + "go.opentelemetry.io/otel/exporters/otlp/otlptrace" +) + +// New constructs a new Exporter and starts it. +func New(ctx context.Context, opts ...Option) (*otlptrace.Exporter, error) { + return otlptrace.New(ctx, NewClient(opts...)) +} + +// NewUnstarted constructs a new Exporter and does not start it. +func NewUnstarted(opts ...Option) *otlptrace.Exporter { + return otlptrace.NewUnstarted(NewClient(opts...)) +} diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/go.mod b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/go.mod new file mode 100644 index 0000000000000..203edcc868c86 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/go.mod @@ -0,0 +1,80 @@ +module go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp + +go 1.16 + +require ( + github.com/stretchr/testify v1.7.0 + go.opentelemetry.io/otel v1.3.0 + go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.3.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.3.0 + go.opentelemetry.io/otel/sdk v1.3.0 + go.opentelemetry.io/otel/trace v1.3.0 + go.opentelemetry.io/proto/otlp v0.11.0 + google.golang.org/protobuf v1.27.1 +) + +replace go.opentelemetry.io/otel/exporters/otlp/otlptrace => ../ + +replace go.opentelemetry.io/otel => ../../../.. + +replace go.opentelemetry.io/otel/bridge/opencensus => ../../../../bridge/opencensus + +replace go.opentelemetry.io/otel/bridge/opentracing => ../../../../bridge/opentracing + +replace go.opentelemetry.io/otel/example/jaeger => ../../../../example/jaeger + +replace go.opentelemetry.io/otel/example/namedtracer => ../../../../example/namedtracer + +replace go.opentelemetry.io/otel/example/opencensus => ../../../../example/opencensus + +replace go.opentelemetry.io/otel/example/otel-collector => ../../../../example/otel-collector + +replace go.opentelemetry.io/otel/example/passthrough => ../../../../example/passthrough + +replace go.opentelemetry.io/otel/example/prom-collector => ../../../../example/prom-collector + +replace go.opentelemetry.io/otel/example/prometheus => ../../../../example/prometheus + +replace go.opentelemetry.io/otel/example/zipkin => ../../../../example/zipkin + +replace go.opentelemetry.io/otel/exporters/prometheus => ../../../prometheus + +replace go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc => ../otlptracegrpc + +replace go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp => ./ + +replace go.opentelemetry.io/otel/exporters/jaeger => ../../../jaeger + +replace go.opentelemetry.io/otel/exporters/zipkin => ../../../zipkin + +replace go.opentelemetry.io/otel/internal/tools => ../../../../internal/tools + +replace go.opentelemetry.io/otel/metric => ../../../../metric + +replace go.opentelemetry.io/otel/sdk => ../../../../sdk + +replace go.opentelemetry.io/otel/sdk/export/metric => ../../../../sdk/export/metric + +replace go.opentelemetry.io/otel/sdk/metric => ../../../../sdk/metric + +replace go.opentelemetry.io/otel/trace => ../../../../trace + +replace go.opentelemetry.io/otel/internal/metric => ../../../../internal/metric + +replace go.opentelemetry.io/otel/exporters/otlp/otlpmetric => ../../otlpmetric + +replace go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc => ../../otlpmetric/otlpmetricgrpc + +replace go.opentelemetry.io/otel/exporters/stdout/stdoutmetric => ../../../stdout/stdoutmetric + +replace go.opentelemetry.io/otel/exporters/stdout/stdouttrace => ../../../stdout/stdouttrace + +replace go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp => ../../otlpmetric/otlpmetrichttp + +replace go.opentelemetry.io/otel/bridge/opencensus/test => ../../../../bridge/opencensus/test + +replace go.opentelemetry.io/otel/example/fib => ../../../../example/fib + +replace go.opentelemetry.io/otel/schema => ../../../../schema + +replace go.opentelemetry.io/otel/exporters/otlp/internal/retry => ../../internal/retry diff --git a/api/go.sum b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/go.sum similarity index 66% rename from api/go.sum rename to vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/go.sum index 4130b63c8265a..154c315443e8d 100644 --- a/api/go.sum +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/go.sum @@ -2,6 +2,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/cenkalti/backoff/v4 v4.1.2 h1:6Yo7N8UP2K6LWZnW94DLVSSrbobcWdVzAYOisuDPIFo= +github.com/cenkalti/backoff/v4 v4.1.2/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= @@ -11,13 +13,8 @@ github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XP github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/containerd/ttrpc v1.1.0 h1:GbtyLRxb0gOLR0TYQWt3O6B0NvT8tMdorEHqIQo/lWI= -github.com/containerd/ttrpc v1.1.0/go.mod h1:XX4ZTnoOId4HklF4edwc4DcqskFZuvXB1Evzy5KFQpQ= -github.com/containerd/typeurl v1.0.2 h1:Chlt8zIieDbzQFzXzAeBEF92KhExuE4p9p92/QmY7aY= -github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -25,11 +22,11 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gogo/googleapis v1.3.2 h1:kX1es4djPJrsDhY7aZKJy7aZasdcB5oSOEphMjSB53c= -github.com/gogo/googleapis v1.3.2/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.1 h1:DX7uPQ4WgAWfoh+NGGlbJQswnYIVvz0SRlLS3rPZQDA= +github.com/go-logr/logr v1.2.1/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/stdr v1.2.0 h1:j4LrlVXgrbIWO83mmQUnK0Hi+YnbD+vzrE1z/EphbFE= +github.com/go-logr/stdr v1.2.0/go.mod h1:YkVgnZu1ZjjL7xTxrfm/LLZBfkhTqSR1ydtm6jTKKwI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -43,98 +40,81 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0 h1:LUVKkCeviFUMKqHa4tXIIij/lbhnMbP7Fn5wKdKkRh4= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= -github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.opentelemetry.io/proto/otlp v0.11.0 h1:cLDgIBTf4lLOlztkhzAEdQsJ4Lj+i5Wc9k6Nn0K1VyU= +go.opentelemetry.io/proto/otlp v0.11.0/go.mod h1:QpEjXPrNQzrFDZgoTo49dgHR9RYRSrg3NAKnUGl9YpQ= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7 h1:iGu644GcxtEcrInvDsQRCwJjtCIOlT2V7IRt6ah2Whw= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63 h1:YzfoEYWbODU5Fbt37+h7X16BWQbad7Q4S6gclTKFXM8= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.43.0 h1:Eeu7bZtDZ2DpRCsLhUlcrLnvYaMK1Gz86a+hMVvELmM= -google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.42.0 h1:XT2/MFpuPFsEX2fWh3YQtHkZ+WYZFQRfaUgLZYj/p6A= +google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -142,13 +122,17 @@ google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miE google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/options.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/options.go new file mode 100644 index 0000000000000..5b52f8fc65cfe --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/options.go @@ -0,0 +1,108 @@ +// Copyright The OpenTelemetry 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 otlptracehttp // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp" + +import ( + "crypto/tls" + "time" + + "go.opentelemetry.io/otel/exporters/otlp/internal/retry" + "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/otlpconfig" +) + +// Compression describes the compression used for payloads sent to the +// collector. +type Compression otlpconfig.Compression + +const ( + // NoCompression tells the driver to send payloads without + // compression. + NoCompression = Compression(otlpconfig.NoCompression) + // GzipCompression tells the driver to send payloads after + // compressing them with gzip. + GzipCompression = Compression(otlpconfig.GzipCompression) +) + +// Option applies an option to the HTTP client. +type Option interface { + applyHTTPOption(*otlpconfig.Config) +} + +// RetryConfig defines configuration for retrying batches in case of export +// failure using an exponential backoff. +type RetryConfig retry.Config + +type wrappedOption struct { + otlpconfig.HTTPOption +} + +func (w wrappedOption) applyHTTPOption(cfg *otlpconfig.Config) { + w.ApplyHTTPOption(cfg) +} + +// WithEndpoint allows one to set the address of the collector +// endpoint that the driver will use to send spans. If +// unset, it will instead try to use +// the default endpoint (localhost:4317). Note that the endpoint +// must not contain any URL path. +func WithEndpoint(endpoint string) Option { + return wrappedOption{otlpconfig.WithEndpoint(endpoint)} +} + +// WithCompression tells the driver to compress the sent data. +func WithCompression(compression Compression) Option { + return wrappedOption{otlpconfig.WithCompression(otlpconfig.Compression(compression))} +} + +// WithURLPath allows one to override the default URL path used +// for sending traces. If unset, default ("/v1/traces") will be used. +func WithURLPath(urlPath string) Option { + return wrappedOption{otlpconfig.WithURLPath(urlPath)} +} + +// WithTLSClientConfig can be used to set up a custom TLS +// configuration for the client used to send payloads to the +// collector. Use it if you want to use a custom certificate. +func WithTLSClientConfig(tlsCfg *tls.Config) Option { + return wrappedOption{otlpconfig.WithTLSClientConfig(tlsCfg)} +} + +// WithInsecure tells the driver to connect to the collector using the +// HTTP scheme, instead of HTTPS. +func WithInsecure() Option { + return wrappedOption{otlpconfig.WithInsecure()} +} + +// WithHeaders allows one to tell the driver to send additional HTTP +// headers with the payloads. Specifying headers like Content-Length, +// Content-Encoding and Content-Type may result in a broken driver. +func WithHeaders(headers map[string]string) Option { + return wrappedOption{otlpconfig.WithHeaders(headers)} +} + +// WithTimeout tells the driver the max waiting time for the backend to process +// each spans batch. If unset, the default will be 10 seconds. +func WithTimeout(duration time.Duration) Option { + return wrappedOption{otlpconfig.WithTimeout(duration)} +} + +// WithRetry configures the retry policy for transient errors that may occurs +// when exporting traces. An exponential back-off algorithm is used to ensure +// endpoints are not overwhelmed with retries. If unset, the default retry +// policy will retry after 5 seconds and increase exponentially after each +// error for a total of 1 minute. +func WithRetry(rc RetryConfig) Option { + return wrappedOption{otlpconfig.WithRetry(retry.Config(rc))} +} diff --git a/vendor/golang.org/x/crypto/openpgp/armor/armor.go b/vendor/golang.org/x/crypto/openpgp/armor/armor.go index 36a6804364ca6..ebc87876e6a50 100644 --- a/vendor/golang.org/x/crypto/openpgp/armor/armor.go +++ b/vendor/golang.org/x/crypto/openpgp/armor/armor.go @@ -4,6 +4,12 @@ // Package armor implements OpenPGP ASCII Armor, see RFC 4880. OpenPGP Armor is // very similar to PEM except that it has an additional CRC checksum. +// +// Deprecated: this package is unmaintained except for security fixes. New +// applications should consider a more focused, modern alternative to OpenPGP +// for their specific task. If you are required to interoperate with OpenPGP +// systems and need a maintained package, consider a community fork. +// See https://golang.org/issue/44226. package armor // import "golang.org/x/crypto/openpgp/armor" import ( diff --git a/vendor/golang.org/x/crypto/openpgp/elgamal/elgamal.go b/vendor/golang.org/x/crypto/openpgp/elgamal/elgamal.go index 72a6a739471ab..84396a0896692 100644 --- a/vendor/golang.org/x/crypto/openpgp/elgamal/elgamal.go +++ b/vendor/golang.org/x/crypto/openpgp/elgamal/elgamal.go @@ -10,6 +10,12 @@ // This form of ElGamal embeds PKCS#1 v1.5 padding, which may make it // unsuitable for other protocols. RSA should be used in preference in any // case. +// +// Deprecated: this package was only provided to support ElGamal encryption in +// OpenPGP. The golang.org/x/crypto/openpgp package is now deprecated (see +// https://golang.org/issue/44226), and ElGamal in the OpenPGP ecosystem has +// compatibility and security issues (see https://eprint.iacr.org/2021/923). +// Moreover, this package doesn't protect against side-channel attacks. package elgamal // import "golang.org/x/crypto/openpgp/elgamal" import ( diff --git a/vendor/golang.org/x/crypto/openpgp/errors/errors.go b/vendor/golang.org/x/crypto/openpgp/errors/errors.go index eb0550b2d04f9..1d7a0ea05adf1 100644 --- a/vendor/golang.org/x/crypto/openpgp/errors/errors.go +++ b/vendor/golang.org/x/crypto/openpgp/errors/errors.go @@ -3,6 +3,12 @@ // license that can be found in the LICENSE file. // Package errors contains common error types for the OpenPGP packages. +// +// Deprecated: this package is unmaintained except for security fixes. New +// applications should consider a more focused, modern alternative to OpenPGP +// for their specific task. If you are required to interoperate with OpenPGP +// systems and need a maintained package, consider a community fork. +// See https://golang.org/issue/44226. package errors // import "golang.org/x/crypto/openpgp/errors" import ( diff --git a/vendor/golang.org/x/crypto/openpgp/packet/packet.go b/vendor/golang.org/x/crypto/openpgp/packet/packet.go index 9728d61d7aa51..0a19794a8e49c 100644 --- a/vendor/golang.org/x/crypto/openpgp/packet/packet.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/packet.go @@ -4,6 +4,12 @@ // Package packet implements parsing and serialization of OpenPGP packets, as // specified in RFC 4880. +// +// Deprecated: this package is unmaintained except for security fixes. New +// applications should consider a more focused, modern alternative to OpenPGP +// for their specific task. If you are required to interoperate with OpenPGP +// systems and need a maintained package, consider a community fork. +// See https://golang.org/issue/44226. package packet // import "golang.org/x/crypto/openpgp/packet" import ( diff --git a/vendor/golang.org/x/crypto/openpgp/read.go b/vendor/golang.org/x/crypto/openpgp/read.go index 6ec664f44a172..48a893146858c 100644 --- a/vendor/golang.org/x/crypto/openpgp/read.go +++ b/vendor/golang.org/x/crypto/openpgp/read.go @@ -3,6 +3,12 @@ // license that can be found in the LICENSE file. // Package openpgp implements high level operations on OpenPGP messages. +// +// Deprecated: this package is unmaintained except for security fixes. New +// applications should consider a more focused, modern alternative to OpenPGP +// for their specific task. If you are required to interoperate with OpenPGP +// systems and need a maintained package, consider a community fork. +// See https://golang.org/issue/44226. package openpgp // import "golang.org/x/crypto/openpgp" import ( diff --git a/vendor/golang.org/x/crypto/openpgp/s2k/s2k.go b/vendor/golang.org/x/crypto/openpgp/s2k/s2k.go index 4b9a44ca26d65..9de04958ead0d 100644 --- a/vendor/golang.org/x/crypto/openpgp/s2k/s2k.go +++ b/vendor/golang.org/x/crypto/openpgp/s2k/s2k.go @@ -4,6 +4,12 @@ // Package s2k implements the various OpenPGP string-to-key transforms as // specified in RFC 4800 section 3.7.1. +// +// Deprecated: this package is unmaintained except for security fixes. New +// applications should consider a more focused, modern alternative to OpenPGP +// for their specific task. If you are required to interoperate with OpenPGP +// systems and need a maintained package, consider a community fork. +// See https://golang.org/issue/44226. package s2k // import "golang.org/x/crypto/openpgp/s2k" import ( diff --git a/vendor/golang.org/x/term/go.mod b/vendor/golang.org/x/term/go.mod index d45f52851ec40..edf0e5b1db4ce 100644 --- a/vendor/golang.org/x/term/go.mod +++ b/vendor/golang.org/x/term/go.mod @@ -1,5 +1,5 @@ module golang.org/x/term -go 1.11 +go 1.17 -require golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 +require golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 diff --git a/vendor/golang.org/x/term/go.sum b/vendor/golang.org/x/term/go.sum index de9e09c6547e7..ff132135ec681 100644 --- a/vendor/golang.org/x/term/go.sum +++ b/vendor/golang.org/x/term/go.sum @@ -1,2 +1,2 @@ -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 h1:SrN+KX8Art/Sf4HNj6Zcz06G7VEz+7w9tdXTPOZ7+l4= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/vendor/golang.org/x/term/term.go b/vendor/golang.org/x/term/term.go index 2a4ccf8012103..1f6a38fad2abe 100644 --- a/vendor/golang.org/x/term/term.go +++ b/vendor/golang.org/x/term/term.go @@ -7,11 +7,11 @@ // // Putting a terminal into raw mode is the most common requirement: // -// oldState, err := term.MakeRaw(0) +// oldState, err := term.MakeRaw(int(os.Stdin.Fd())) // if err != nil { // panic(err) // } -// defer term.Restore(0, oldState) +// defer term.Restore(int(os.Stdin.Fd()), oldState) package term // State contains the state of a terminal. diff --git a/vendor/golang.org/x/term/term_solaris.go b/vendor/golang.org/x/term/term_solaris.go deleted file mode 100644 index b9da29744b7ad..0000000000000 --- a/vendor/golang.org/x/term/term_solaris.go +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package term - -import ( - "io" - "syscall" - - "golang.org/x/sys/unix" -) - -// State contains the state of a terminal. -type state struct { - termios unix.Termios -} - -func isTerminal(fd int) bool { - _, err := unix.IoctlGetTermio(fd, unix.TCGETA) - return err == nil -} - -func readPassword(fd int) ([]byte, error) { - // see also: http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libast/common/uwin/getpass.c - val, err := unix.IoctlGetTermios(fd, unix.TCGETS) - if err != nil { - return nil, err - } - oldState := *val - - newState := oldState - newState.Lflag &^= syscall.ECHO - newState.Lflag |= syscall.ICANON | syscall.ISIG - newState.Iflag |= syscall.ICRNL - err = unix.IoctlSetTermios(fd, unix.TCSETS, &newState) - if err != nil { - return nil, err - } - - defer unix.IoctlSetTermios(fd, unix.TCSETS, &oldState) - - var buf [16]byte - var ret []byte - for { - n, err := syscall.Read(fd, buf[:]) - if err != nil { - return nil, err - } - if n == 0 { - if len(ret) == 0 { - return nil, io.EOF - } - break - } - if buf[n-1] == '\n' { - n-- - } - ret = append(ret, buf[:n]...) - if n < len(buf) { - break - } - } - - return ret, nil -} - -func makeRaw(fd int) (*State, error) { - // see http://cr.illumos.org/~webrev/andy_js/1060/ - termios, err := unix.IoctlGetTermios(fd, unix.TCGETS) - if err != nil { - return nil, err - } - - oldState := State{state{termios: *termios}} - - termios.Iflag &^= unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.ISTRIP | unix.INLCR | unix.IGNCR | unix.ICRNL | unix.IXON - termios.Oflag &^= unix.OPOST - termios.Lflag &^= unix.ECHO | unix.ECHONL | unix.ICANON | unix.ISIG | unix.IEXTEN - termios.Cflag &^= unix.CSIZE | unix.PARENB - termios.Cflag |= unix.CS8 - termios.Cc[unix.VMIN] = 1 - termios.Cc[unix.VTIME] = 0 - - if err := unix.IoctlSetTermios(fd, unix.TCSETS, termios); err != nil { - return nil, err - } - - return &oldState, nil -} - -func restore(fd int, oldState *State) error { - return unix.IoctlSetTermios(fd, unix.TCSETS, &oldState.termios) -} - -func getState(fd int) (*State, error) { - termios, err := unix.IoctlGetTermios(fd, unix.TCGETS) - if err != nil { - return nil, err - } - - return &State{state{termios: *termios}}, nil -} - -func getSize(fd int) (width, height int, err error) { - ws, err := unix.IoctlGetWinsize(fd, unix.TIOCGWINSZ) - if err != nil { - return 0, 0, err - } - return int(ws.Col), int(ws.Row), nil -} diff --git a/vendor/golang.org/x/term/term_unix.go b/vendor/golang.org/x/term/term_unix.go index 6849b6ee5ba14..a4e31ab1b29c3 100644 --- a/vendor/golang.org/x/term/term_unix.go +++ b/vendor/golang.org/x/term/term_unix.go @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || zos -// +build aix darwin dragonfly freebsd linux netbsd openbsd zos +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos package term diff --git a/vendor/golang.org/x/term/term_unix_aix.go b/vendor/golang.org/x/term/term_unix_aix.go deleted file mode 100644 index 2d5efd26ad44a..0000000000000 --- a/vendor/golang.org/x/term/term_unix_aix.go +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package term - -import "golang.org/x/sys/unix" - -const ioctlReadTermios = unix.TCGETS -const ioctlWriteTermios = unix.TCSETS diff --git a/vendor/golang.org/x/term/term_unix_linux.go b/vendor/golang.org/x/term/term_unix_other.go similarity index 63% rename from vendor/golang.org/x/term/term_unix_linux.go rename to vendor/golang.org/x/term/term_unix_other.go index 2d5efd26ad44a..1e8955c934ffe 100644 --- a/vendor/golang.org/x/term/term_unix_linux.go +++ b/vendor/golang.org/x/term/term_unix_other.go @@ -1,7 +1,10 @@ -// Copyright 2019 The Go Authors. All rights reserved. +// Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build aix || linux || solaris || zos +// +build aix linux solaris zos + package term import "golang.org/x/sys/unix" diff --git a/vendor/golang.org/x/term/term_unix_zos.go b/vendor/golang.org/x/term/term_unix_zos.go deleted file mode 100644 index b85ab899893e0..0000000000000 --- a/vendor/golang.org/x/term/term_unix_zos.go +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package term - -import "golang.org/x/sys/unix" - -const ioctlReadTermios = unix.TCGETS -const ioctlWriteTermios = unix.TCSETS diff --git a/vendor/github.com/bits-and-blooms/bitset/LICENSE b/vendor/k8s.io/apimachinery/third_party/forked/golang/LICENSE similarity index 96% rename from vendor/github.com/bits-and-blooms/bitset/LICENSE rename to vendor/k8s.io/apimachinery/third_party/forked/golang/LICENSE index 59cab8a939be7..6a66aea5eafe0 100644 --- a/vendor/github.com/bits-and-blooms/bitset/LICENSE +++ b/vendor/k8s.io/apimachinery/third_party/forked/golang/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2014 Will Fitzgerald. All rights reserved. +Copyright (c) 2009 The Go Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are diff --git a/vendor/k8s.io/apimachinery/third_party/forked/golang/PATENTS b/vendor/k8s.io/apimachinery/third_party/forked/golang/PATENTS new file mode 100644 index 0000000000000..733099041f84f --- /dev/null +++ b/vendor/k8s.io/apimachinery/third_party/forked/golang/PATENTS @@ -0,0 +1,22 @@ +Additional IP Rights Grant (Patents) + +"This implementation" means the copyrightable works distributed by +Google as part of the Go project. + +Google 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, +transfer and otherwise run, modify and propagate the contents of this +implementation of Go, where such license applies only to those patent +claims, both currently owned or controlled by Google and acquired in +the future, licensable by Google that are necessarily infringed by this +implementation of Go. This grant does not include claims that would be +infringed only as a consequence of further modification of this +implementation. If you or your agent or exclusive licensee institute or +order or agree to the institution of patent litigation against any +entity (including a cross-claim or counterclaim in a lawsuit) alleging +that this implementation of Go or any code incorporated within this +implementation of Go constitutes direct or contributory patent +infringement, or inducement of patent infringement, then any patent +rights granted to you under this License for this implementation of Go +shall terminate as of the date such litigation is filed. diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/metrics/metrics.go b/vendor/k8s.io/apiserver/pkg/endpoints/metrics/metrics.go index 7e0715eb5a6f3..5efc0a8347f21 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/metrics/metrics.go +++ b/vendor/k8s.io/apiserver/pkg/endpoints/metrics/metrics.go @@ -370,7 +370,7 @@ func RecordRequestAbort(req *http.Request, requestInfo *request.RequestInfo) { } scope := CleanScope(requestInfo) - reportedVerb := cleanVerb(CanonicalVerb(strings.ToUpper(req.Method), scope), req) + reportedVerb := cleanVerb(CanonicalVerb(strings.ToUpper(req.Method), scope), "", req) resource := requestInfo.Resource subresource := requestInfo.Subresource group := requestInfo.APIGroup @@ -393,7 +393,7 @@ func RecordRequestTermination(req *http.Request, requestInfo *request.RequestInf // InstrumentRouteFunc which is registered in installer.go with predefined // list of verbs (different than those translated to RequestInfo). // However, we need to tweak it e.g. to differentiate GET from LIST. - reportedVerb := cleanVerb(CanonicalVerb(strings.ToUpper(req.Method), scope), req) + reportedVerb := cleanVerb(CanonicalVerb(strings.ToUpper(req.Method), scope), "", req) if requestInfo.IsResourceRequest { requestTerminationsTotal.WithContext(req.Context()).WithLabelValues(reportedVerb, requestInfo.APIGroup, requestInfo.APIVersion, requestInfo.Resource, requestInfo.Subresource, scope, component, codeToString(code)).Inc() @@ -415,7 +415,7 @@ func RecordLongRunning(req *http.Request, requestInfo *request.RequestInfo, comp // InstrumentRouteFunc which is registered in installer.go with predefined // list of verbs (different than those translated to RequestInfo). // However, we need to tweak it e.g. to differentiate GET from LIST. - reportedVerb := cleanVerb(CanonicalVerb(strings.ToUpper(req.Method), scope), req) + reportedVerb := cleanVerb(CanonicalVerb(strings.ToUpper(req.Method), scope), "", req) if requestInfo.IsResourceRequest { g = longRunningRequestGauge.WithContext(req.Context()).WithLabelValues(reportedVerb, requestInfo.APIGroup, requestInfo.APIVersion, requestInfo.Resource, requestInfo.Subresource, scope, component) @@ -434,7 +434,7 @@ func MonitorRequest(req *http.Request, verb, group, version, resource, subresour // InstrumentRouteFunc which is registered in installer.go with predefined // list of verbs (different than those translated to RequestInfo). // However, we need to tweak it e.g. to differentiate GET from LIST. - reportedVerb := cleanVerb(CanonicalVerb(strings.ToUpper(req.Method), scope), req) + reportedVerb := cleanVerb(CanonicalVerb(strings.ToUpper(req.Method), scope), verb, req) dryRun := cleanDryRun(req.URL) elapsedSeconds := elapsed.Seconds() @@ -564,8 +564,15 @@ func CleanVerb(verb string, request *http.Request) string { } // cleanVerb additionally ensures that unknown verbs don't clog up the metrics. -func cleanVerb(verb string, request *http.Request) string { +func cleanVerb(verb, suggestedVerb string, request *http.Request) string { reportedVerb := CleanVerb(verb, request) + // CanonicalVerb (being an input for this function) doesn't handle correctly the + // deprecated path pattern for watch of: + // GET /api/{version}/watch/{resource} + // We correct it manually based on the pass verb from the installer. + if suggestedVerb == "WATCH" || suggestedVerb == "WATCHLIST" { + reportedVerb = "WATCH" + } if validRequestMethods.Has(reportedVerb) { return reportedVerb } diff --git a/vendor/k8s.io/apiserver/pkg/server/httplog/httplog.go b/vendor/k8s.io/apiserver/pkg/server/httplog/httplog.go index 89ba28a9ecc87..4e15fbd8907e5 100644 --- a/vendor/k8s.io/apiserver/pkg/server/httplog/httplog.go +++ b/vendor/k8s.io/apiserver/pkg/server/httplog/httplog.go @@ -24,6 +24,7 @@ import ( "net/http" "runtime" "strings" + "sync" "time" "k8s.io/apiserver/pkg/endpoints/metrics" @@ -54,13 +55,17 @@ type respLogger struct { statusRecorded bool status int statusStack string - addedInfo strings.Builder - startTime time.Time + // mutex is used when accessing addedInfo + // It can be modified by other goroutine when logging happens (in case of request timeout) + mutex sync.Mutex + addedInfo strings.Builder + startTime time.Time captureErrorOutput bool - req *http.Request - w http.ResponseWriter + req *http.Request + userAgent string + w http.ResponseWriter logStacktracePred StacktracePred } @@ -121,6 +126,7 @@ func newLoggedWithStartTime(req *http.Request, w http.ResponseWriter, startTime return &respLogger{ startTime: startTime, req: req, + userAgent: req.UserAgent(), w: w, logStacktracePred: DefaultStacktracePred, } @@ -171,6 +177,8 @@ func StatusIsNot(statuses ...int) StacktracePred { // Addf adds additional data to be logged with this request. func (rl *respLogger) Addf(format string, data ...interface{}) { + rl.mutex.Lock() + defer rl.mutex.Unlock() rl.addedInfo.WriteString("\n") rl.addedInfo.WriteString(fmt.Sprintf(format, data...)) } @@ -200,10 +208,18 @@ func (rl *respLogger) Log() { "verb", verb, "URI", rl.req.RequestURI, "latency", latency, - "userAgent", rl.req.UserAgent(), + // We can't get UserAgent from rl.req.UserAgent() here as it accesses headers map, + // which can be modified in another goroutine when apiserver request times out. + // For example authentication filter modifies request's headers, + // This can cause apiserver to crash with unrecoverable fatal error. + // More info about concurrent read and write for maps: https://golang.org/doc/go1.6#runtime + "userAgent", rl.userAgent, "audit-ID", auditID, "srcIP", rl.req.RemoteAddr, } + // Lock for accessing addedInfo + rl.mutex.Lock() + defer rl.mutex.Unlock() if rl.hijacked { keysAndValues = append(keysAndValues, "hijacked", true) diff --git a/vendor/k8s.io/component-base/metrics/options.go b/vendor/k8s.io/component-base/metrics/options.go index 91a76ba7e51c7..456fe0b0a3023 100644 --- a/vendor/k8s.io/component-base/metrics/options.go +++ b/vendor/k8s.io/component-base/metrics/options.go @@ -58,8 +58,8 @@ func (o *Options) Validate() []error { // AddFlags adds flags for exposing component metrics. func (o *Options) AddFlags(fs *pflag.FlagSet) { - if o != nil { - o = NewOptions() + if o == nil { + return } fs.StringVar(&o.ShowHiddenMetricsForVersion, "show-hidden-metrics-for-version", o.ShowHiddenMetricsForVersion, "The previous version for which you want to show hidden metrics. "+ diff --git a/vendor/k8s.io/cri-api/pkg/apis/runtime/v1/api.pb.go b/vendor/k8s.io/cri-api/pkg/apis/runtime/v1/api.pb.go index 85d48cd6533d4..f8762ae63a005 100644 --- a/vendor/k8s.io/cri-api/pkg/apis/runtime/v1/api.pb.go +++ b/vendor/k8s.io/cri-api/pkg/apis/runtime/v1/api.pb.go @@ -6046,9 +6046,13 @@ type Image struct { // and no user is specified when creating container. Username string `protobuf:"bytes,6,opt,name=username,proto3" json:"username,omitempty"` // ImageSpec for image which includes annotations - Spec *ImageSpec `protobuf:"bytes,7,opt,name=spec,proto3" json:"spec,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_sizecache int32 `json:"-"` + Spec *ImageSpec `protobuf:"bytes,7,opt,name=spec,proto3" json:"spec,omitempty"` + // Recommendation on whether this image should be exempt from garbage collection. + // It must only be treated as a recommendation -- the client can still request that the image be deleted, + // and the runtime must oblige. + Pinned bool `protobuf:"varint,8,opt,name=pinned,proto3" json:"pinned,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Image) Reset() { *m = Image{} } @@ -6132,6 +6136,13 @@ func (m *Image) GetSpec() *ImageSpec { return nil } +func (m *Image) GetPinned() bool { + if m != nil { + return m.Pinned + } + return false +} + type ListImagesResponse struct { // List of images. Images []*Image `protobuf:"bytes,1,rep,name=images,proto3" json:"images,omitempty"` @@ -8052,357 +8063,358 @@ func init() { func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } var fileDescriptor_00212fb1f9d3bf1c = []byte{ - // 5599 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x7c, 0x4d, 0x6c, 0x1c, 0xc9, - 0x75, 0x30, 0x7b, 0x66, 0x48, 0xce, 0xbc, 0xe1, 0x0c, 0x87, 0x25, 0x52, 0x1c, 0x0d, 0x25, 0x2e, - 0xd9, 0xf2, 0xfe, 0x48, 0xda, 0xe5, 0x6a, 0xb9, 0xda, 0xb5, 0x44, 0x6b, 0x57, 0x1a, 0x91, 0x94, - 0xc4, 0xb5, 0x44, 0x8e, 0x7b, 0x48, 0xf9, 0xef, 0x83, 0xfb, 0x6b, 0x4d, 0x17, 0x87, 0xbd, 0x3b, - 0xd3, 0xdd, 0xee, 0xee, 0x91, 0x44, 0x9f, 0x7c, 0x4d, 0x4e, 0x01, 0x0c, 0xc3, 0x80, 0x11, 0x20, - 0xc8, 0x29, 0x07, 0x1f, 0x9c, 0x4b, 0x82, 0x00, 0x81, 0x93, 0x4b, 0x10, 0x38, 0x01, 0x0c, 0xf8, - 0x12, 0xc0, 0x87, 0x00, 0xb1, 0x37, 0xb7, 0x1c, 0x72, 0xf2, 0x21, 0xb7, 0x04, 0xf5, 0xd7, 0xd3, - 0xd5, 0xdd, 0xd3, 0x33, 0xd4, 0xae, 0xbd, 0x7b, 0x9a, 0xee, 0x57, 0xef, 0xbd, 0xaa, 0x7a, 0xf5, - 0xea, 0xd5, 0xab, 0xf7, 0x5e, 0x0f, 0x94, 0x0c, 0xd7, 0xda, 0x70, 0x3d, 0x27, 0x70, 0x10, 0x78, - 0x03, 0x3b, 0xb0, 0xfa, 0x78, 0xe3, 0xd9, 0x3b, 0x8d, 0xb7, 0xba, 0x56, 0x70, 0x32, 0x78, 0xba, - 0xd1, 0x71, 0xfa, 0x6f, 0x77, 0x9d, 0xae, 0xf3, 0x36, 0x45, 0x79, 0x3a, 0x38, 0xa6, 0x6f, 0xf4, - 0x85, 0x3e, 0x31, 0x52, 0xf5, 0x2a, 0x54, 0x9f, 0x60, 0xcf, 0xb7, 0x1c, 0x5b, 0xc3, 0xdf, 0x1f, - 0x60, 0x3f, 0x40, 0x75, 0x98, 0x7d, 0xc6, 0x20, 0x75, 0x65, 0x4d, 0x79, 0xa3, 0xa4, 0x89, 0x57, - 0xf5, 0xaf, 0x14, 0x98, 0x0f, 0x91, 0x7d, 0xd7, 0xb1, 0x7d, 0x3c, 0x1a, 0x1b, 0xad, 0xc3, 0x1c, - 0x1f, 0x96, 0x6e, 0x1b, 0x7d, 0x5c, 0xcf, 0xd1, 0xe6, 0x32, 0x87, 0xed, 0x1b, 0x7d, 0x8c, 0x5e, - 0x87, 0x79, 0x81, 0x22, 0x98, 0xe4, 0x29, 0x56, 0x95, 0x83, 0x79, 0x6f, 0x68, 0x03, 0xce, 0x09, - 0x44, 0xc3, 0xb5, 0x42, 0xe4, 0x02, 0x45, 0x5e, 0xe0, 0x4d, 0x4d, 0xd7, 0xe2, 0xf8, 0xea, 0x77, - 0xa1, 0xb4, 0xb3, 0xdf, 0xde, 0x76, 0xec, 0x63, 0xab, 0x4b, 0x86, 0xe8, 0x63, 0x8f, 0xd0, 0xd4, - 0x95, 0xb5, 0x3c, 0x19, 0x22, 0x7f, 0x45, 0x0d, 0x28, 0xfa, 0xd8, 0xf0, 0x3a, 0x27, 0xd8, 0xaf, - 0xe7, 0x68, 0x53, 0xf8, 0x4e, 0xa8, 0x1c, 0x37, 0xb0, 0x1c, 0xdb, 0xaf, 0xe7, 0x19, 0x15, 0x7f, - 0x55, 0xff, 0x5c, 0x81, 0x72, 0xcb, 0xf1, 0x82, 0xc7, 0x86, 0xeb, 0x5a, 0x76, 0x17, 0x5d, 0x87, - 0x22, 0x95, 0x65, 0xc7, 0xe9, 0x51, 0x19, 0x54, 0x37, 0x17, 0x37, 0x86, 0x0b, 0xb2, 0xd1, 0xe2, - 0x6d, 0x5a, 0x88, 0x85, 0x5e, 0x85, 0x6a, 0xc7, 0xb1, 0x03, 0xc3, 0xb2, 0xb1, 0xa7, 0xbb, 0x8e, - 0x17, 0x50, 0xe1, 0x4c, 0x6b, 0x95, 0x10, 0x4a, 0xf8, 0xa3, 0x15, 0x28, 0x9d, 0x38, 0x7e, 0xc0, - 0x30, 0xf2, 0x14, 0xa3, 0x48, 0x00, 0xb4, 0x71, 0x19, 0x66, 0x69, 0xa3, 0xe5, 0x72, 0x31, 0xcc, - 0x90, 0xd7, 0x3d, 0x57, 0xfd, 0xb5, 0x02, 0xd3, 0x8f, 0x9d, 0x81, 0x1d, 0xc4, 0xba, 0x31, 0x82, - 0x13, 0xbe, 0x44, 0x91, 0x6e, 0x8c, 0xe0, 0x64, 0xd8, 0x0d, 0xc1, 0x60, 0xab, 0xc4, 0xba, 0x21, - 0x8d, 0x0d, 0x28, 0x7a, 0xd8, 0x30, 0x1d, 0xbb, 0x77, 0x4a, 0x87, 0x50, 0xd4, 0xc2, 0x77, 0xb2, - 0x7c, 0x3e, 0xee, 0x59, 0xf6, 0xe0, 0x85, 0xee, 0xe1, 0x9e, 0xf1, 0x14, 0xf7, 0xe8, 0x50, 0x8a, - 0x5a, 0x95, 0x83, 0x35, 0x06, 0x45, 0x1f, 0x42, 0xd9, 0xf5, 0x1c, 0xd7, 0xe8, 0x1a, 0x44, 0x82, - 0xf5, 0x69, 0x2a, 0xa4, 0x8b, 0x51, 0x21, 0xd1, 0x01, 0xb7, 0x86, 0x38, 0x5a, 0x94, 0x40, 0xfd, - 0x85, 0x02, 0xf3, 0x44, 0x61, 0x7c, 0xd7, 0xe8, 0xe0, 0x03, 0xba, 0x0c, 0xe8, 0x5d, 0x98, 0xb5, - 0x71, 0xf0, 0xdc, 0xf1, 0x3e, 0xe1, 0x42, 0xbf, 0x10, 0xe5, 0x17, 0x62, 0x3f, 0x76, 0x4c, 0xac, - 0x09, 0x4c, 0x74, 0x0d, 0xf2, 0xae, 0x65, 0xd2, 0x49, 0x66, 0x12, 0x10, 0x2c, 0x82, 0x6c, 0xb9, - 0x1d, 0x3a, 0xeb, 0x6c, 0x64, 0xcb, 0xed, 0x10, 0x21, 0x06, 0x86, 0xd7, 0xc5, 0x81, 0x6e, 0x99, - 0x7c, 0x41, 0x8a, 0x0c, 0xb0, 0x67, 0xaa, 0x2a, 0xc0, 0x9e, 0x1d, 0xbc, 0x7f, 0xe3, 0x89, 0xd1, - 0x1b, 0x60, 0xb4, 0x08, 0xd3, 0xcf, 0xc8, 0x03, 0x1d, 0x77, 0x5e, 0x63, 0x2f, 0xea, 0x2f, 0x0a, - 0xb0, 0xf2, 0x88, 0x08, 0xad, 0x6d, 0xd8, 0xe6, 0x53, 0xe7, 0x45, 0x1b, 0x77, 0x06, 0x9e, 0x15, - 0x9c, 0x6e, 0x3b, 0x76, 0x80, 0x5f, 0x04, 0xe8, 0x21, 0x2c, 0xd8, 0xa2, 0x5b, 0x5d, 0x68, 0x26, - 0xe1, 0x50, 0xde, 0x5c, 0x49, 0x1d, 0x1b, 0x93, 0x93, 0x56, 0xb3, 0x65, 0x80, 0x8f, 0xee, 0x0d, - 0x97, 0x4d, 0xf0, 0xc9, 0x51, 0x3e, 0xd2, 0x1c, 0xdb, 0xbb, 0x74, 0x34, 0x9c, 0x8b, 0x58, 0x51, - 0xc1, 0xe3, 0x7d, 0x20, 0x1b, 0x59, 0x37, 0x7c, 0x7d, 0xe0, 0x63, 0x8f, 0xca, 0xa8, 0xbc, 0x79, - 0x3e, 0x4a, 0x3f, 0x9c, 0xb0, 0x56, 0xf2, 0x06, 0x76, 0xd3, 0x3f, 0xf2, 0xb1, 0x87, 0x6e, 0x52, - 0xa3, 0x40, 0xe8, 0xba, 0x9e, 0x33, 0x70, 0xeb, 0xc5, 0x4c, 0x42, 0xa0, 0x84, 0x0f, 0x08, 0x26, - 0xb5, 0x15, 0x5c, 0xf1, 0x74, 0xcf, 0x71, 0x82, 0x63, 0x5f, 0x28, 0x9b, 0x00, 0x6b, 0x14, 0x8a, - 0xde, 0x86, 0x73, 0xfe, 0xc0, 0x75, 0x7b, 0xb8, 0x8f, 0xed, 0xc0, 0xe8, 0xb1, 0x8e, 0xfc, 0xfa, - 0xf4, 0x5a, 0xfe, 0x8d, 0xbc, 0x86, 0xa2, 0x4d, 0x94, 0xb1, 0x8f, 0x56, 0x01, 0x5c, 0xcf, 0x7a, - 0x66, 0xf5, 0x70, 0x17, 0x9b, 0xf5, 0x19, 0xca, 0x34, 0x02, 0x41, 0xef, 0x11, 0xfb, 0xd1, 0xe9, - 0x38, 0x7d, 0xb7, 0x5e, 0x4a, 0xca, 0x5b, 0xac, 0x53, 0xcb, 0x73, 0x8e, 0xad, 0x1e, 0xd6, 0x04, - 0x2e, 0xfa, 0x2a, 0x14, 0x0d, 0xd7, 0x35, 0xbc, 0xbe, 0xe3, 0xd5, 0x61, 0x3c, 0x5d, 0x88, 0x8c, - 0x6e, 0xc0, 0x22, 0xe7, 0xa1, 0xbb, 0xac, 0x91, 0x6d, 0xcd, 0x59, 0xa2, 0x55, 0xf7, 0x72, 0x75, - 0x45, 0x43, 0xbc, 0x9d, 0xd3, 0x92, 0x8d, 0xaa, 0xfe, 0x93, 0x02, 0xf3, 0x31, 0x9e, 0xe8, 0x23, - 0x98, 0x13, 0x1c, 0x82, 0x53, 0x17, 0xf3, 0x8d, 0xf2, 0x7a, 0xc6, 0x30, 0x36, 0xf8, 0xef, 0xe1, - 0xa9, 0x8b, 0xe9, 0x1e, 0x14, 0x2f, 0xe8, 0x32, 0x54, 0x7a, 0x4e, 0xc7, 0xe8, 0x51, 0x53, 0xe1, - 0xe1, 0x63, 0x6e, 0x29, 0xe6, 0x42, 0xa0, 0x86, 0x8f, 0xd5, 0xbb, 0x50, 0x8e, 0x30, 0x40, 0x08, - 0xaa, 0x1a, 0xeb, 0x6a, 0x07, 0x1f, 0x1b, 0x83, 0x5e, 0x50, 0x9b, 0x42, 0x55, 0x80, 0x23, 0xbb, - 0x43, 0x2c, 0xb3, 0x8d, 0xcd, 0x9a, 0x82, 0x2a, 0x50, 0x7a, 0x24, 0x58, 0xd4, 0x72, 0xea, 0x4f, - 0xf3, 0xb0, 0x44, 0x15, 0xaf, 0xe5, 0x98, 0x7c, 0x27, 0x70, 0x33, 0x7e, 0x19, 0x2a, 0x1d, 0xba, - 0x96, 0xba, 0x6b, 0x78, 0xd8, 0x0e, 0xb8, 0x31, 0x9b, 0x63, 0xc0, 0x16, 0x85, 0x21, 0x0d, 0x6a, - 0x3e, 0x9f, 0x91, 0xde, 0x61, 0x3b, 0x87, 0x2b, 0xb7, 0x34, 0xeb, 0x8c, 0x8d, 0xa6, 0xcd, 0xfb, - 0x89, 0x9d, 0x37, 0xeb, 0x9f, 0xfa, 0x9d, 0xa0, 0xc7, 0x4e, 0x82, 0xf2, 0xe6, 0x46, 0x82, 0x55, - 0x7c, 0xb0, 0x1b, 0x6d, 0x46, 0xb0, 0x6b, 0x07, 0xde, 0xa9, 0x26, 0xc8, 0xd1, 0x1d, 0x28, 0x3a, - 0xcf, 0xb0, 0x77, 0x82, 0x0d, 0x66, 0x23, 0xca, 0x9b, 0x97, 0x13, 0xac, 0xb6, 0x85, 0x6d, 0xd6, - 0xb0, 0xef, 0x0c, 0xbc, 0x0e, 0xf6, 0xb5, 0x90, 0x08, 0x35, 0xa1, 0xe4, 0x09, 0x30, 0x35, 0xa3, - 0x13, 0x72, 0x18, 0x52, 0x35, 0xb6, 0x60, 0x2e, 0x3a, 0x38, 0x54, 0x83, 0xfc, 0x27, 0xf8, 0x94, - 0x0b, 0x93, 0x3c, 0x0e, 0xed, 0x13, 0x5b, 0x61, 0xf6, 0xb2, 0x95, 0xbb, 0xa9, 0xa8, 0x1e, 0xa0, - 0xe1, 0x4c, 0x1f, 0xe3, 0xc0, 0x30, 0x8d, 0xc0, 0x40, 0x08, 0x0a, 0xf4, 0x80, 0x67, 0x2c, 0xe8, - 0x33, 0xe1, 0x3a, 0xe0, 0x86, 0xb6, 0xa4, 0x91, 0x47, 0x74, 0x11, 0x4a, 0xa1, 0x25, 0xe2, 0xa7, - 0xfc, 0x10, 0x40, 0x4e, 0x5b, 0x23, 0x08, 0x70, 0xdf, 0x0d, 0xa8, 0x60, 0x2a, 0x9a, 0x78, 0x55, - 0xff, 0x64, 0x1a, 0x6a, 0x09, 0x5d, 0xd8, 0x82, 0x62, 0x9f, 0x77, 0xcf, 0x6d, 0xe0, 0xaa, 0x74, - 0xe4, 0x26, 0x06, 0xa9, 0x85, 0xf8, 0xe4, 0x44, 0x23, 0xba, 0x16, 0xf1, 0x49, 0xc2, 0x77, 0xa6, - 0xe4, 0x5d, 0xdd, 0xb4, 0x3c, 0xdc, 0x09, 0x1c, 0xef, 0x94, 0x0f, 0x74, 0xae, 0xe7, 0x74, 0x77, - 0x04, 0x0c, 0xdd, 0x00, 0x30, 0x6d, 0x5f, 0xa7, 0x3a, 0xdc, 0xe5, 0xeb, 0xb8, 0x14, 0xed, 0x3e, - 0x74, 0x3d, 0xb4, 0x92, 0x69, 0xfb, 0x7c, 0xc8, 0xb7, 0xa1, 0x42, 0xce, 0x71, 0xbd, 0xcf, 0xbc, - 0x06, 0x66, 0x90, 0xca, 0x9b, 0xcb, 0xf2, 0xb8, 0x43, 0xaf, 0x42, 0x9b, 0x73, 0x87, 0x2f, 0x3e, - 0xba, 0x0b, 0x33, 0xf4, 0x28, 0xf5, 0xeb, 0x33, 0x94, 0xec, 0x8d, 0xf4, 0xe9, 0x72, 0xed, 0x7b, - 0x44, 0x51, 0x99, 0xf2, 0x71, 0x3a, 0x74, 0x00, 0x65, 0xc3, 0xb6, 0x9d, 0xc0, 0x60, 0x16, 0x7f, - 0x96, 0xb2, 0x79, 0x2b, 0x93, 0x4d, 0x73, 0x88, 0xcf, 0x78, 0x45, 0x39, 0xa0, 0xaf, 0xc2, 0x34, - 0x3d, 0x12, 0xb8, 0x0d, 0x5f, 0x1f, 0xbb, 0x29, 0x34, 0x86, 0x8f, 0x3e, 0x80, 0xd9, 0xe7, 0x96, - 0x6d, 0x3a, 0xcf, 0x7d, 0x6e, 0x4f, 0x25, 0x15, 0xfe, 0x26, 0x6b, 0x4a, 0x10, 0x0b, 0x9a, 0xc6, - 0x2d, 0x28, 0x47, 0xe6, 0x77, 0x16, 0xfd, 0x6d, 0x7c, 0x08, 0xb5, 0xf8, 0x9c, 0xce, 0xa4, 0xff, - 0x03, 0x58, 0xd4, 0x06, 0xf6, 0x70, 0x68, 0xc2, 0x65, 0xbe, 0x01, 0x33, 0x5c, 0x1b, 0x98, 0x32, - 0x5e, 0xcc, 0x12, 0xab, 0xc6, 0x71, 0xa3, 0xde, 0xef, 0x89, 0x61, 0x9b, 0x3d, 0xec, 0xf1, 0x1e, - 0x85, 0xf7, 0xfb, 0x90, 0x41, 0xd5, 0x0f, 0x60, 0x29, 0xd6, 0x2d, 0x77, 0xbe, 0xbf, 0x02, 0x55, - 0xd7, 0x31, 0x75, 0x9f, 0x81, 0x89, 0xe7, 0xc1, 0x6d, 0xa2, 0x1b, 0xe2, 0xee, 0x99, 0x84, 0xbc, - 0x1d, 0x38, 0x6e, 0x72, 0xd8, 0x93, 0x91, 0xd7, 0xe1, 0x7c, 0x9c, 0x9c, 0x75, 0xaf, 0xde, 0x81, - 0x65, 0x0d, 0xf7, 0x9d, 0x67, 0xf8, 0x65, 0x59, 0x37, 0xa0, 0x9e, 0x64, 0xc0, 0x99, 0x7f, 0x1b, - 0x96, 0x87, 0xd0, 0x76, 0x60, 0x04, 0x03, 0xff, 0x4c, 0xcc, 0xf9, 0xcd, 0xe4, 0xa9, 0xe3, 0xb3, - 0x85, 0x2c, 0x6a, 0xe2, 0x55, 0x5d, 0x86, 0xe9, 0x96, 0x63, 0xee, 0xb5, 0x50, 0x15, 0x72, 0x96, - 0xcb, 0x89, 0x73, 0x96, 0xab, 0x76, 0xa2, 0x7d, 0xee, 0x33, 0x9f, 0x91, 0x75, 0x1d, 0x47, 0x45, - 0x37, 0xa1, 0x6a, 0x98, 0xa6, 0x45, 0x14, 0xc9, 0xe8, 0xe9, 0x96, 0xcb, 0x2e, 0x10, 0xe5, 0xcd, - 0x85, 0xd8, 0xd2, 0xef, 0xb5, 0xb4, 0xca, 0x10, 0x71, 0xcf, 0xf5, 0xd5, 0x7b, 0x50, 0x0a, 0x7d, - 0x34, 0xe2, 0x5b, 0xc8, 0x3e, 0x58, 0xa6, 0x2f, 0x17, 0x5e, 0x41, 0xf6, 0x13, 0x87, 0x24, 0x1f, - 0xe6, 0x7b, 0x00, 0xa1, 0x51, 0x15, 0xee, 0xe1, 0x52, 0x2a, 0x4b, 0x2d, 0x82, 0xa8, 0xfe, 0x47, - 0x21, 0x6a, 0x64, 0x23, 0x53, 0x36, 0xc3, 0x29, 0x9b, 0x92, 0xd1, 0xcd, 0x9d, 0xd1, 0xe8, 0xbe, - 0x03, 0xd3, 0x7e, 0x60, 0x04, 0x98, 0x7b, 0xd3, 0x2b, 0xe9, 0x84, 0xa4, 0x63, 0xac, 0x31, 0x4c, - 0x74, 0x09, 0xa0, 0xe3, 0x61, 0x23, 0xc0, 0xa6, 0x6e, 0xb0, 0x53, 0x21, 0xaf, 0x95, 0x38, 0xa4, - 0x19, 0x10, 0x2b, 0x22, 0xfc, 0xff, 0x94, 0x83, 0x70, 0xc4, 0x32, 0x0e, 0x6f, 0x02, 0xa1, 0xf5, - 0x9a, 0x19, 0x6b, 0xbd, 0x38, 0x29, 0xb7, 0x5e, 0x43, 0x4b, 0x3c, 0x9b, 0x65, 0x89, 0x19, 0xd1, - 0x24, 0x96, 0xb8, 0x98, 0x65, 0x89, 0x39, 0x9b, 0x6c, 0x4b, 0x9c, 0x62, 0x48, 0x4a, 0x69, 0x86, - 0xe4, 0x8b, 0x34, 0x9d, 0xbf, 0x52, 0xa0, 0x9e, 0xdc, 0xcf, 0xdc, 0x8e, 0xdd, 0x80, 0x19, 0x9f, - 0x42, 0xb2, 0xed, 0x27, 0xa7, 0xe2, 0xb8, 0xe8, 0x1e, 0x14, 0x2c, 0xfb, 0xd8, 0xe1, 0x1b, 0x6f, - 0x23, 0x93, 0x86, 0xf7, 0xb4, 0xb1, 0x67, 0x1f, 0x3b, 0x4c, 0x82, 0x94, 0xb6, 0xf1, 0x55, 0x28, - 0x85, 0xa0, 0x33, 0xcd, 0x67, 0x0f, 0x16, 0x63, 0x7a, 0xcb, 0x2e, 0x77, 0xa1, 0xa2, 0x2b, 0x93, - 0x2a, 0xba, 0xfa, 0x7b, 0x25, 0xba, 0xf9, 0xee, 0x5b, 0xbd, 0x00, 0x7b, 0x89, 0xcd, 0xf7, 0xbe, - 0xe0, 0xcb, 0x76, 0xde, 0x5a, 0x06, 0x5f, 0x76, 0x77, 0xe2, 0xbb, 0xe8, 0x09, 0x54, 0xa9, 0xda, - 0xe9, 0x3e, 0xee, 0x51, 0xff, 0x85, 0xfb, 0xb0, 0x6f, 0xa7, 0x33, 0x60, 0xbd, 0x33, 0xb5, 0x6d, - 0x73, 0x0a, 0x26, 0xaf, 0x4a, 0x2f, 0x0a, 0x6b, 0xdc, 0x05, 0x94, 0x44, 0x3a, 0x93, 0x04, 0x1f, - 0x13, 0x1b, 0xe6, 0x07, 0xa9, 0xa7, 0xe9, 0x31, 0x1d, 0x46, 0xb6, 0x36, 0xb0, 0xa1, 0x6a, 0x1c, - 0x57, 0xfd, 0xb7, 0x3c, 0xc0, 0xb0, 0xf1, 0x4b, 0x6e, 0xbc, 0xb6, 0x42, 0x23, 0xc2, 0xbc, 0x40, - 0x35, 0x9d, 0x65, 0xaa, 0xf9, 0xd8, 0x93, 0xcd, 0x07, 0xf3, 0x07, 0x5f, 0x1f, 0xc1, 0xe0, 0xcc, - 0x86, 0x63, 0xf6, 0xcb, 0x66, 0x38, 0xee, 0xc3, 0xf9, 0xb8, 0x9a, 0x70, 0xab, 0xf1, 0x26, 0x4c, - 0x5b, 0x01, 0xee, 0xb3, 0xa8, 0x5e, 0x2c, 0x88, 0x10, 0x41, 0x67, 0x48, 0xea, 0x87, 0x70, 0x5e, - 0x5e, 0xab, 0xb3, 0xb9, 0x13, 0xea, 0xa3, 0xb8, 0x3f, 0x32, 0x34, 0x5f, 0x5c, 0x3f, 0x52, 0xc3, - 0x31, 0x71, 0x1a, 0x86, 0xa9, 0xfe, 0xb3, 0x02, 0x4b, 0xb1, 0xa6, 0x11, 0x1b, 0xff, 0xbb, 0x89, - 0x0d, 0xcc, 0xec, 0xdd, 0x8d, 0x8c, 0x5e, 0xfe, 0x88, 0xbb, 0xf8, 0x9b, 0xd0, 0x90, 0x97, 0x47, - 0x12, 0xed, 0xad, 0xd8, 0x56, 0x5e, 0x1f, 0x3b, 0xe8, 0x70, 0x3f, 0xb7, 0x60, 0x25, 0x95, 0x71, - 0x52, 0xe6, 0xf9, 0x09, 0x65, 0xfe, 0x3f, 0xb9, 0xa8, 0xcd, 0x6e, 0x06, 0x81, 0x67, 0x3d, 0x1d, - 0x04, 0xf8, 0xf3, 0x75, 0x74, 0x76, 0xc2, 0x9d, 0xcd, 0xec, 0xec, 0x9b, 0xe9, 0x94, 0xc3, 0xde, - 0x53, 0xf7, 0x78, 0x5b, 0xde, 0xe3, 0x05, 0xca, 0xea, 0x9d, 0xb1, 0xac, 0x32, 0x77, 0xfb, 0x17, - 0xb9, 0x89, 0xff, 0x45, 0x81, 0xf9, 0xd8, 0xaa, 0xa0, 0xbb, 0x00, 0x46, 0x38, 0x74, 0xae, 0x1f, - 0x6b, 0xe3, 0xa6, 0xa8, 0x45, 0x68, 0xc8, 0x99, 0xc8, 0x7c, 0xb8, 0x94, 0x33, 0x31, 0xc5, 0x87, - 0x0b, 0x5d, 0xb8, 0xdb, 0xc3, 0x0b, 0x28, 0x0b, 0x5c, 0xaa, 0x99, 0x17, 0x50, 0x46, 0x2b, 0x48, - 0xd4, 0x1f, 0xe5, 0x60, 0x31, 0x8d, 0x3b, 0x7a, 0x0d, 0xf2, 0x1d, 0x77, 0xc0, 0x67, 0x22, 0xa5, - 0x00, 0xb6, 0xdd, 0xc1, 0x91, 0x6f, 0x74, 0xb1, 0x46, 0x10, 0xd0, 0xdb, 0x30, 0xd3, 0xc7, 0x7d, - 0xc7, 0x3b, 0xe5, 0xe3, 0x96, 0x42, 0x00, 0x8f, 0x69, 0x0b, 0xc3, 0xe6, 0x68, 0x68, 0x73, 0xe8, - 0xea, 0xb2, 0xf1, 0xd6, 0x25, 0x8f, 0x9e, 0x35, 0x31, 0x92, 0xd0, 0xbf, 0xdd, 0x84, 0x59, 0xd7, - 0x73, 0x3a, 0xd8, 0xf7, 0x79, 0x84, 0xa2, 0x1e, 0xcb, 0x49, 0x90, 0x26, 0x4e, 0xc3, 0x11, 0xd1, - 0x16, 0x40, 0x98, 0x19, 0x10, 0x27, 0x53, 0x43, 0x9a, 0x87, 0x68, 0x65, 0x22, 0x89, 0x60, 0x93, - 0x5b, 0x62, 0xba, 0xe0, 0xd4, 0x7f, 0x54, 0x60, 0x2e, 0x3a, 0x46, 0x74, 0x11, 0x4a, 0x84, 0xa1, - 0x1f, 0x18, 0x7d, 0x97, 0xc7, 0xc0, 0x87, 0x00, 0xb4, 0x0f, 0x0b, 0x26, 0x0b, 0x16, 0xea, 0x96, - 0x1d, 0x60, 0xef, 0xd8, 0xe8, 0x08, 0xa7, 0x67, 0x3d, 0x65, 0xda, 0x7b, 0x02, 0x87, 0xcd, 0xa5, - 0xc6, 0x69, 0x43, 0x30, 0x6a, 0x02, 0x84, 0x7c, 0xc4, 0xa6, 0x9c, 0x80, 0x51, 0x84, 0x48, 0xfd, - 0x5f, 0x05, 0x96, 0x52, 0xb1, 0x52, 0x43, 0x5f, 0x9b, 0x50, 0xf4, 0x5e, 0xe8, 0x4f, 0x4f, 0x03, - 0xec, 0xa7, 0x2d, 0xf0, 0x51, 0x24, 0xbe, 0x3d, 0xeb, 0xbd, 0xb8, 0x47, 0xf0, 0xd0, 0x0d, 0x28, - 0x79, 0x2f, 0x74, 0xec, 0x79, 0x8e, 0x27, 0x74, 0x72, 0x24, 0x51, 0xd1, 0x7b, 0xb1, 0x4b, 0x11, - 0x49, 0x4f, 0x81, 0xe8, 0xa9, 0x30, 0xa6, 0xa7, 0x60, 0xd8, 0x53, 0x10, 0xf6, 0x34, 0x3d, 0xa6, - 0xa7, 0x80, 0xf7, 0xa4, 0x7e, 0x0c, 0x73, 0x51, 0x95, 0x19, 0xb3, 0x84, 0xb7, 0xa1, 0xc2, 0x55, - 0x4a, 0xef, 0x38, 0x03, 0x3b, 0x18, 0x27, 0x86, 0x39, 0x8e, 0xbd, 0x4d, 0x90, 0xd5, 0x9f, 0x29, - 0x50, 0xda, 0xeb, 0x1b, 0x5d, 0xdc, 0x76, 0x71, 0x87, 0xd8, 0x14, 0x8b, 0xbc, 0x70, 0x11, 0xb3, - 0x17, 0xf4, 0x50, 0xb6, 0x8f, 0xec, 0x44, 0x7c, 0x4d, 0xca, 0x22, 0x08, 0x0e, 0x63, 0x8c, 0xe2, - 0x67, 0xb5, 0x6c, 0x9b, 0x50, 0xfc, 0x3a, 0x3e, 0x65, 0xbe, 0xff, 0x84, 0x74, 0xea, 0x8f, 0x0b, - 0xb0, 0x3c, 0x22, 0x52, 0x4b, 0x1d, 0x47, 0x77, 0xa0, 0xbb, 0xd8, 0xb3, 0x1c, 0x53, 0x88, 0xb6, - 0xe3, 0x0e, 0x5a, 0x14, 0x80, 0x56, 0x80, 0xbc, 0xe8, 0xdf, 0x1f, 0x38, 0xfc, 0x6c, 0xca, 0x6b, - 0xc5, 0x8e, 0x3b, 0xf8, 0x06, 0x79, 0x17, 0xb4, 0xfe, 0x89, 0xe1, 0x61, 0xa6, 0x46, 0x8c, 0xb6, - 0x4d, 0x01, 0xe8, 0x1d, 0x58, 0x62, 0x06, 0x45, 0xef, 0x59, 0x7d, 0x8b, 0x6c, 0xaf, 0x88, 0xee, - 0xe4, 0x35, 0xc4, 0x1a, 0x1f, 0x91, 0xb6, 0x3d, 0x9b, 0x69, 0x8b, 0x0a, 0x15, 0xc7, 0xe9, 0xeb, - 0x7e, 0xc7, 0xf1, 0xb0, 0x6e, 0x98, 0x1f, 0x53, 0x8d, 0xc9, 0x6b, 0x65, 0xc7, 0xe9, 0xb7, 0x09, - 0xac, 0x69, 0x7e, 0x8c, 0x5e, 0x81, 0x72, 0xc7, 0x1d, 0xf8, 0x38, 0xd0, 0xc9, 0x0f, 0xbd, 0x4f, - 0x97, 0x34, 0x60, 0xa0, 0x6d, 0x77, 0xe0, 0x47, 0x10, 0xfa, 0xc4, 0x5b, 0x9b, 0x8d, 0x22, 0x3c, - 0xc6, 0x7d, 0x9a, 0x90, 0x3a, 0x19, 0x74, 0xb1, 0x6b, 0x74, 0x31, 0x1b, 0x9a, 0xb8, 0x14, 0x4b, - 0x09, 0xa9, 0x87, 0x1c, 0x85, 0x0e, 0x50, 0xab, 0x9e, 0x44, 0x5f, 0x7d, 0xf4, 0x11, 0xcc, 0x0e, - 0x6c, 0xeb, 0xd8, 0xc2, 0x66, 0xbd, 0x44, 0x69, 0xaf, 0x4f, 0x10, 0x17, 0xdf, 0x38, 0x62, 0x24, - 0x3c, 0x4c, 0xcf, 0x19, 0xa0, 0x2d, 0x68, 0x70, 0x41, 0xf9, 0xcf, 0x0d, 0x37, 0x2e, 0x2d, 0xa0, - 0x22, 0x38, 0xcf, 0x30, 0xda, 0xcf, 0x0d, 0x37, 0x2a, 0xb1, 0xc6, 0x16, 0xcc, 0x45, 0x99, 0x9e, - 0x49, 0x97, 0xee, 0x41, 0x45, 0x9a, 0x24, 0x59, 0x6d, 0x2a, 0x14, 0xdf, 0xfa, 0x81, 0xd8, 0x00, - 0x45, 0x02, 0x68, 0x5b, 0x3f, 0xa0, 0x69, 0x44, 0x3a, 0x32, 0xca, 0xa7, 0xa0, 0xb1, 0x17, 0xd5, - 0x80, 0x8a, 0x94, 0xb9, 0x23, 0x26, 0x8a, 0xa6, 0xe8, 0xb8, 0x89, 0x22, 0xcf, 0x04, 0xe6, 0x39, - 0x3d, 0x31, 0x02, 0xfa, 0x4c, 0x60, 0x34, 0x47, 0xc4, 0x22, 0xde, 0xf4, 0x99, 0x76, 0x81, 0x9f, - 0xf1, 0xb4, 0x6e, 0x49, 0x63, 0x2f, 0xaa, 0x09, 0xb0, 0x6d, 0xb8, 0xc6, 0x53, 0xab, 0x67, 0x05, - 0xa7, 0xe8, 0x0a, 0xd4, 0x0c, 0xd3, 0xd4, 0x3b, 0x02, 0x62, 0x61, 0x91, 0x66, 0x9f, 0x37, 0x4c, - 0x73, 0x3b, 0x02, 0x46, 0xd7, 0x60, 0xc1, 0xf4, 0x1c, 0x57, 0xc6, 0x65, 0x79, 0xf7, 0x1a, 0x69, - 0x88, 0x22, 0xab, 0xff, 0x30, 0x03, 0x97, 0xe4, 0x65, 0x8b, 0x67, 0x44, 0xb7, 0x60, 0x2e, 0xd6, - 0x6b, 0x22, 0x97, 0x38, 0x1c, 0xa7, 0x26, 0xe1, 0xc6, 0x72, 0x7e, 0xb9, 0x44, 0xce, 0x2f, 0x35, - 0xdb, 0x9a, 0xff, 0x9c, 0xb2, 0xad, 0x85, 0xcf, 0x98, 0x6d, 0x9d, 0x7e, 0xd9, 0x6c, 0xeb, 0xdc, - 0xc4, 0xd9, 0xd6, 0xd7, 0xe8, 0xcd, 0x50, 0xf4, 0x48, 0xcf, 0x38, 0xb6, 0xb1, 0x2b, 0x21, 0x77, - 0x5b, 0x54, 0x70, 0xc4, 0xb2, 0xb2, 0xb3, 0x67, 0xc9, 0xca, 0x16, 0x47, 0x66, 0x65, 0xd7, 0x60, - 0xce, 0x76, 0x74, 0x1b, 0x3f, 0xd7, 0xc9, 0xb2, 0xf8, 0xf5, 0x32, 0x5b, 0x23, 0xdb, 0xd9, 0xc7, - 0xcf, 0x5b, 0x04, 0x82, 0xd6, 0x61, 0xae, 0x6f, 0xf8, 0x9f, 0x60, 0x93, 0xa6, 0x47, 0xfd, 0x7a, - 0x85, 0x6a, 0x52, 0x99, 0xc1, 0x5a, 0x04, 0x84, 0x5e, 0x85, 0x70, 0x1c, 0x1c, 0xa9, 0x4a, 0x91, - 0x2a, 0x02, 0xca, 0xd0, 0x22, 0x19, 0xde, 0xf9, 0x97, 0xcc, 0xf0, 0xd6, 0xce, 0x92, 0xe1, 0x7d, - 0x0b, 0x6a, 0xe2, 0x59, 0xa4, 0x78, 0x59, 0xc4, 0x8e, 0x66, 0x77, 0xe7, 0x45, 0x9b, 0x48, 0xe3, - 0x8e, 0x4a, 0x08, 0x43, 0x66, 0x42, 0xf8, 0xe7, 0x0a, 0xf7, 0x53, 0xc3, 0x0d, 0xc4, 0x33, 0x51, - 0x52, 0x12, 0x51, 0x79, 0x99, 0x24, 0x22, 0x3a, 0x1c, 0x99, 0x66, 0xbd, 0x32, 0x9a, 0xd3, 0xb8, - 0x44, 0xab, 0xfa, 0x23, 0x05, 0x2e, 0x71, 0x27, 0x72, 0x44, 0x11, 0x44, 0x8a, 0x5a, 0x2a, 0x23, - 0xd4, 0xb2, 0xe3, 0x61, 0x13, 0xdb, 0x81, 0x65, 0xf4, 0x74, 0xdf, 0xc5, 0x1d, 0x91, 0x5a, 0x19, - 0x82, 0xa9, 0x7b, 0xb1, 0x0e, 0x73, 0xac, 0xf6, 0x85, 0xfb, 0xca, 0xac, 0xc4, 0xa5, 0x4c, 0xcb, - 0x5f, 0x18, 0x48, 0x75, 0x60, 0x79, 0x44, 0x4e, 0x2a, 0x55, 0x0c, 0x4a, 0x52, 0x0c, 0x99, 0x73, - 0x4a, 0x8a, 0xe1, 0xc7, 0x0a, 0xbc, 0xc2, 0x49, 0x46, 0xda, 0xbe, 0x2f, 0x42, 0x10, 0x7f, 0xa3, - 0x84, 0x3e, 0x7e, 0x5c, 0xa5, 0xb6, 0x93, 0x2a, 0xf5, 0x6a, 0x8a, 0x04, 0xb2, 0x95, 0xea, 0xc9, - 0x48, 0xa5, 0xba, 0x96, 0xc5, 0x6b, 0xac, 0x3c, 0x7f, 0xa6, 0xc0, 0x85, 0x91, 0x03, 0x88, 0x39, - 0x4d, 0x4a, 0xdc, 0x69, 0xe2, 0x0e, 0xd7, 0xd0, 0x8f, 0x65, 0x0e, 0x17, 0x75, 0x55, 0xb9, 0x67, - 0xa3, 0xf7, 0x8d, 0x17, 0x56, 0x7f, 0xd0, 0xe7, 0x1e, 0x17, 0x61, 0xf7, 0x98, 0x41, 0x5e, 0xc2, - 0xe5, 0x52, 0x9b, 0xb0, 0x10, 0x8e, 0x32, 0x33, 0xc5, 0x1e, 0x49, 0x99, 0xe7, 0xe4, 0x94, 0xb9, - 0x0d, 0x33, 0x3b, 0xf8, 0x99, 0xd5, 0xc1, 0x9f, 0x4b, 0x05, 0xd8, 0x1a, 0x94, 0x5d, 0xec, 0xf5, - 0x2d, 0xdf, 0x0f, 0x0f, 0xc1, 0x92, 0x16, 0x05, 0xa9, 0x3f, 0x9f, 0x81, 0xf9, 0xb8, 0x46, 0xdc, - 0x4a, 0x64, 0xe8, 0x2f, 0xa5, 0xde, 0x24, 0x53, 0x42, 0x28, 0xd7, 0x84, 0xcb, 0x9f, 0x4b, 0xa6, - 0xaf, 0x42, 0xb7, 0x5e, 0xdc, 0x04, 0xea, 0x30, 0xdb, 0x71, 0xfa, 0x7d, 0xc3, 0x36, 0x45, 0x99, - 0x1e, 0x7f, 0x25, 0x32, 0x33, 0xbc, 0x2e, 0x0b, 0x9e, 0x94, 0x34, 0xfa, 0x4c, 0x16, 0x8c, 0xdc, - 0xe2, 0x2c, 0x9b, 0xe6, 0xf8, 0xe9, 0x41, 0x5a, 0xd2, 0x80, 0x83, 0x76, 0x2c, 0x0f, 0xbd, 0x01, - 0x05, 0x6c, 0x3f, 0x13, 0x51, 0x55, 0xe9, 0x12, 0x2f, 0xdc, 0x7c, 0x8d, 0x62, 0xa0, 0x2b, 0x30, - 0xd3, 0x27, 0x4a, 0x20, 0xf2, 0x40, 0x0b, 0x89, 0x72, 0x36, 0x8d, 0x23, 0xa0, 0x37, 0x61, 0xd6, - 0xa4, 0xeb, 0x21, 0xfc, 0x5a, 0x24, 0x55, 0x0b, 0xd0, 0x26, 0x4d, 0xa0, 0xa0, 0x3b, 0x61, 0x04, - 0xa9, 0x94, 0x0c, 0xed, 0xc6, 0xc4, 0x9c, 0x1a, 0x3c, 0xda, 0x97, 0x2f, 0x47, 0x90, 0x8c, 0x43, - 0xc5, 0xb9, 0x64, 0x47, 0x89, 0x2f, 0x40, 0xb1, 0xe7, 0x74, 0x99, 0x72, 0x94, 0x59, 0x8d, 0x67, - 0xcf, 0xe9, 0x52, 0xdd, 0x58, 0x84, 0x69, 0x3f, 0x30, 0x2d, 0x9b, 0x7a, 0x16, 0x45, 0x8d, 0xbd, - 0x90, 0x2d, 0x45, 0x1f, 0x74, 0xc7, 0xee, 0xe0, 0x7a, 0x85, 0x36, 0x95, 0x28, 0xe4, 0xc0, 0xee, - 0xd0, 0x6b, 0x52, 0x10, 0x9c, 0xd6, 0xab, 0x14, 0x4e, 0x1e, 0x87, 0x81, 0x9c, 0xf9, 0x11, 0x81, - 0x9c, 0xd8, 0x80, 0x53, 0x02, 0x39, 0xb5, 0x91, 0x81, 0x9c, 0x38, 0xed, 0x97, 0xa1, 0x90, 0xe0, - 0xef, 0x14, 0x38, 0xbf, 0x4d, 0xb3, 0x01, 0x11, 0x8b, 0x74, 0x96, 0xe4, 0xf6, 0xbb, 0x61, 0xc5, - 0x41, 0x4a, 0xda, 0x38, 0x3e, 0x63, 0x51, 0x70, 0xb0, 0x0d, 0x55, 0xc1, 0x96, 0x13, 0xe7, 0x27, - 0x28, 0x57, 0xa8, 0xf8, 0xd1, 0x57, 0xf5, 0x36, 0x2c, 0x27, 0x46, 0xce, 0x63, 0xb2, 0xeb, 0x30, - 0x37, 0xb4, 0x36, 0xe1, 0xc0, 0xcb, 0x21, 0x6c, 0xcf, 0x54, 0xb7, 0x60, 0xa9, 0x1d, 0x18, 0x5e, - 0x90, 0x98, 0xf6, 0x04, 0xb4, 0xb4, 0x10, 0x41, 0xa6, 0xe5, 0xb5, 0x02, 0x6d, 0x58, 0x6c, 0x07, - 0x8e, 0xfb, 0x12, 0x4c, 0x89, 0xfd, 0x20, 0x33, 0x77, 0x06, 0xc2, 0xba, 0x8b, 0x57, 0x75, 0x99, - 0x95, 0x4d, 0x24, 0x7b, 0xfb, 0x1a, 0x9c, 0x67, 0x55, 0x0b, 0x2f, 0x33, 0x89, 0x0b, 0xa2, 0x66, - 0x22, 0xc9, 0xf7, 0x01, 0x9c, 0x93, 0x02, 0x6c, 0x3c, 0xa3, 0x78, 0x5d, 0xce, 0x28, 0x8e, 0x0e, - 0xc8, 0x85, 0x09, 0xc5, 0x9f, 0xe4, 0x22, 0xf6, 0x78, 0x44, 0x5a, 0xe1, 0x3d, 0x39, 0x9f, 0xf8, - 0xca, 0x68, 0xae, 0x52, 0x3a, 0x31, 0xa9, 0x9d, 0xf9, 0x14, 0xed, 0x3c, 0x4a, 0xe4, 0x2c, 0x0a, - 0xc9, 0x1c, 0x6d, 0x6c, 0x84, 0x7f, 0x94, 0x6c, 0xc5, 0x23, 0x96, 0x73, 0x0c, 0xbb, 0x0e, 0x13, - 0x15, 0xef, 0xc6, 0x12, 0x15, 0x2b, 0x19, 0x23, 0x0d, 0x53, 0x14, 0x3f, 0x29, 0x40, 0x29, 0x6c, - 0x4b, 0x48, 0x38, 0x29, 0xaa, 0x5c, 0x8a, 0xa8, 0xa2, 0xe7, 0x64, 0xfe, 0x25, 0xcf, 0xc9, 0xc2, - 0x04, 0xe7, 0xe4, 0x0a, 0x94, 0xe8, 0x03, 0x2d, 0xdd, 0x64, 0xe7, 0x5e, 0x91, 0x02, 0x34, 0x7c, - 0x3c, 0x54, 0xb1, 0x99, 0x09, 0x55, 0x2c, 0x96, 0xdf, 0x9c, 0x8d, 0xe7, 0x37, 0x6f, 0x85, 0x67, - 0x58, 0x31, 0x19, 0x70, 0x0d, 0x39, 0xa6, 0x9e, 0x5e, 0xb1, 0xd0, 0x5e, 0x29, 0x19, 0xda, 0x1b, - 0xd2, 0x7f, 0x69, 0xf3, 0x1d, 0x07, 0x2c, 0x69, 0x19, 0xd5, 0x33, 0x6e, 0x23, 0xdf, 0x93, 0x62, - 0xec, 0x2c, 0x79, 0xb5, 0x94, 0x3a, 0x3b, 0x29, 0xbc, 0x7e, 0x04, 0xe7, 0xa5, 0x85, 0x18, 0x16, - 0x43, 0x4d, 0x66, 0xe3, 0x46, 0x54, 0x42, 0xfd, 0x66, 0x3a, 0x62, 0x29, 0x46, 0x94, 0xfd, 0xdc, - 0x4a, 0x64, 0xc3, 0x26, 0xd6, 0xd0, 0xeb, 0x72, 0xe2, 0xfc, 0xcc, 0x7a, 0x95, 0xc8, 0x9b, 0x53, - 0xcf, 0xc2, 0xf0, 0x78, 0x33, 0x0b, 0x46, 0x96, 0x38, 0xa4, 0x49, 0xfd, 0xf1, 0x63, 0xcb, 0xb6, - 0xfc, 0x13, 0xd6, 0x3e, 0xc3, 0xfc, 0x71, 0x01, 0x6a, 0xd2, 0x80, 0x1a, 0x7e, 0x61, 0x05, 0x7a, - 0xc7, 0x31, 0x31, 0xd5, 0xda, 0x69, 0xad, 0x48, 0x00, 0xdb, 0x8e, 0x89, 0x87, 0xfb, 0xa9, 0x78, - 0xd6, 0xfd, 0x54, 0x8a, 0xed, 0xa7, 0xf3, 0x30, 0xe3, 0x61, 0xc3, 0x77, 0x6c, 0x76, 0x45, 0xd7, - 0xf8, 0x1b, 0x59, 0x88, 0x3e, 0xf6, 0x7d, 0xd2, 0x07, 0x77, 0xa4, 0xf8, 0x6b, 0xc4, 0xe9, 0x9b, - 0xcb, 0x70, 0xfa, 0x32, 0x8a, 0x8a, 0x62, 0x4e, 0x5f, 0x25, 0xc3, 0xe9, 0x9b, 0xa8, 0xa6, 0x68, - 0xe8, 0xde, 0x56, 0xc7, 0xb9, 0xb7, 0x51, 0xff, 0x70, 0x5e, 0xf2, 0x0f, 0xbf, 0xc8, 0x2d, 0xf8, - 0xaf, 0x0a, 0x2c, 0x27, 0xb6, 0x0c, 0xdf, 0x84, 0xef, 0xc6, 0xea, 0x8d, 0x56, 0x32, 0xe4, 0x14, - 0x96, 0x1b, 0x35, 0xa5, 0x72, 0xa3, 0xb7, 0xb2, 0x48, 0x3e, 0xf7, 0x6a, 0xa3, 0xdf, 0xe6, 0xe0, - 0x95, 0x23, 0xd7, 0x8c, 0x79, 0x5d, 0xfc, 0x0a, 0x3d, 0xb9, 0x21, 0xb8, 0x25, 0x27, 0x4c, 0x27, - 0x8a, 0xfa, 0x70, 0x57, 0xfb, 0x4e, 0x3c, 0x67, 0x3a, 0xe1, 0xfd, 0x5e, 0x50, 0xa1, 0xef, 0xa5, - 0xa5, 0xb4, 0x6f, 0x4b, 0x29, 0xa1, 0xec, 0x09, 0xfe, 0x81, 0x13, 0x39, 0x2a, 0xac, 0x8d, 0x1e, - 0x00, 0xf7, 0xd0, 0xfe, 0x3f, 0xcc, 0xef, 0xbe, 0xc0, 0x9d, 0xf6, 0xa9, 0xdd, 0x39, 0x83, 0xd4, - 0x6b, 0x90, 0xef, 0xf4, 0x4d, 0x1e, 0xe8, 0x26, 0x8f, 0x51, 0xa7, 0x33, 0x2f, 0x3b, 0x9d, 0x3a, - 0xd4, 0x86, 0x3d, 0x70, 0x6d, 0x3d, 0x4f, 0xb4, 0xd5, 0x24, 0xc8, 0x84, 0xf9, 0x9c, 0xc6, 0xdf, - 0x38, 0x1c, 0x7b, 0xac, 0x6c, 0x98, 0xc1, 0xb1, 0xe7, 0xc9, 0x46, 0x2e, 0x2f, 0x1b, 0x39, 0xf5, - 0xa7, 0x0a, 0x94, 0x49, 0x0f, 0x9f, 0x69, 0xfc, 0xfc, 0x06, 0x97, 0x1f, 0xde, 0xe0, 0xc2, 0x8b, - 0x60, 0x21, 0x7a, 0x11, 0x1c, 0x8e, 0x7c, 0x9a, 0x82, 0x93, 0x23, 0x9f, 0x09, 0xe1, 0xd8, 0xf3, - 0xd4, 0x35, 0x98, 0x63, 0x63, 0xe3, 0x33, 0xaf, 0x41, 0x7e, 0xe0, 0xf5, 0xc4, 0xfa, 0x0d, 0xbc, - 0x9e, 0xfa, 0xa7, 0x0a, 0x54, 0x9a, 0x41, 0x60, 0x74, 0x4e, 0xce, 0x30, 0x81, 0x70, 0x70, 0xb9, - 0xe8, 0xe0, 0x92, 0x93, 0x18, 0x0e, 0xb7, 0x30, 0x62, 0xb8, 0xd3, 0xd2, 0x70, 0x55, 0xa8, 0x8a, - 0xb1, 0x8c, 0x1c, 0xf0, 0x3e, 0xa0, 0x96, 0xe3, 0x05, 0xf7, 0x1d, 0xef, 0xb9, 0xe1, 0x99, 0x67, - 0xbb, 0xe4, 0x21, 0x28, 0xf0, 0x8f, 0x03, 0xf3, 0x6f, 0x4c, 0x6b, 0xf4, 0x59, 0x7d, 0x1d, 0xce, - 0x49, 0xfc, 0x46, 0x76, 0xbc, 0x05, 0x65, 0x7a, 0x68, 0x71, 0xff, 0xff, 0x5a, 0x34, 0x8f, 0x3a, - 0xe6, 0x70, 0x53, 0x77, 0x60, 0x81, 0xb8, 0x2f, 0x14, 0x1e, 0xda, 0x97, 0xb7, 0x63, 0x2e, 0xf2, - 0x72, 0x82, 0x45, 0xcc, 0x3d, 0xfe, 0x77, 0x05, 0xa6, 0x29, 0x3c, 0xe1, 0x52, 0xac, 0x40, 0xc9, - 0xc3, 0xae, 0xa3, 0x07, 0x46, 0x37, 0xfc, 0xf0, 0x92, 0x00, 0x0e, 0x8d, 0x2e, 0x0d, 0xeb, 0xd3, - 0x46, 0xd3, 0xea, 0x62, 0x3f, 0x10, 0x5f, 0x5f, 0x96, 0x09, 0x6c, 0x87, 0x81, 0x88, 0x60, 0x68, - 0x4a, 0xac, 0x40, 0x33, 0x5f, 0xf4, 0x19, 0xbd, 0xc1, 0xbe, 0x38, 0xc9, 0xce, 0x8d, 0xd0, 0x2f, - 0x51, 0x1a, 0x50, 0x8c, 0x25, 0x35, 0xc2, 0x77, 0x74, 0x05, 0x0a, 0x34, 0x48, 0x3a, 0x9b, 0x25, - 0x25, 0x8a, 0xa2, 0xde, 0x01, 0x14, 0x15, 0x12, 0x5f, 0x88, 0x2b, 0x30, 0x43, 0x65, 0x28, 0x7c, - 0xbb, 0x85, 0x04, 0x0b, 0x8d, 0x23, 0xa8, 0xdf, 0x05, 0xc4, 0x78, 0x4a, 0xfe, 0xdc, 0x59, 0x16, - 0x2a, 0xc3, 0xb3, 0xfb, 0x5b, 0x05, 0xce, 0x49, 0xdc, 0xf9, 0xf8, 0x5e, 0x97, 0xd9, 0xa7, 0x0c, - 0x8f, 0xb3, 0xfe, 0x40, 0x3a, 0xee, 0xae, 0x24, 0x87, 0xf1, 0x07, 0x3a, 0xea, 0x7e, 0xa5, 0x00, - 0x34, 0x07, 0xc1, 0x09, 0x8f, 0x23, 0x46, 0x17, 0x4b, 0x89, 0x2d, 0x56, 0x03, 0x8a, 0xae, 0xe1, - 0xfb, 0xcf, 0x1d, 0x4f, 0xdc, 0xad, 0xc2, 0x77, 0x1a, 0xfd, 0x1b, 0x04, 0x27, 0x22, 0x9d, 0x49, - 0x9e, 0xd1, 0xab, 0x50, 0x65, 0x5f, 0xfe, 0xea, 0x86, 0x69, 0x7a, 0xa2, 0x34, 0xa6, 0xa4, 0x55, - 0x18, 0xb4, 0xc9, 0x80, 0x04, 0xcd, 0xa2, 0xa1, 0xf1, 0xe0, 0x54, 0x0f, 0x9c, 0x4f, 0xb0, 0xcd, - 0xef, 0x4b, 0x15, 0x01, 0x3d, 0x24, 0x40, 0x96, 0x5b, 0xea, 0x5a, 0x7e, 0xe0, 0x09, 0x34, 0x91, - 0x21, 0xe3, 0x50, 0x8a, 0xa6, 0xfe, 0xb5, 0x02, 0xb5, 0xd6, 0xa0, 0xd7, 0x63, 0xc2, 0x7d, 0x99, - 0x45, 0xbe, 0xca, 0xa7, 0x92, 0x4b, 0xaa, 0xf6, 0x50, 0x50, 0x7c, 0x8a, 0x9f, 0x4b, 0x88, 0xe7, - 0x3a, 0x2c, 0x44, 0x46, 0xcc, 0x15, 0x47, 0x72, 0x78, 0x15, 0xd9, 0xe1, 0x55, 0x9b, 0x80, 0x58, - 0x54, 0xe3, 0xa5, 0x67, 0xa9, 0x2e, 0xc1, 0x39, 0x89, 0x05, 0x3f, 0x72, 0xaf, 0x42, 0x85, 0x97, - 0xde, 0x70, 0x85, 0xb8, 0x00, 0x45, 0x62, 0x3a, 0x3b, 0x96, 0x29, 0x72, 0xda, 0xb3, 0xae, 0x63, - 0x6e, 0x5b, 0xa6, 0xa7, 0x7e, 0x03, 0x2a, 0xfc, 0x73, 0x43, 0x8e, 0x7b, 0x17, 0xaa, 0xbc, 0x1e, - 0x4a, 0x97, 0xbe, 0xcf, 0xb9, 0x90, 0x52, 0xff, 0x23, 0x44, 0x61, 0x47, 0x5f, 0xd5, 0xef, 0x41, - 0x83, 0x79, 0x05, 0x12, 0x63, 0x31, 0xc1, 0xbb, 0x20, 0x0a, 0x65, 0x33, 0xf8, 0xcb, 0x94, 0x15, - 0x2f, 0xfa, 0xaa, 0x5e, 0x82, 0x95, 0x54, 0xfe, 0x7c, 0xf6, 0x2e, 0xd4, 0x86, 0x0d, 0xec, 0x23, - 0x92, 0x30, 0x51, 0xaf, 0x44, 0x12, 0xf5, 0xe7, 0x43, 0x87, 0x36, 0x27, 0x4e, 0x28, 0xea, 0xb3, - 0x0e, 0x2f, 0x22, 0xf9, 0x51, 0x17, 0x91, 0x82, 0x74, 0x11, 0x51, 0x1f, 0x87, 0x32, 0xe4, 0xd7, - 0xc1, 0xdb, 0xf4, 0xc2, 0xca, 0xfa, 0x16, 0x46, 0xed, 0x62, 0xfa, 0xfc, 0x18, 0x92, 0x16, 0xc1, - 0x57, 0xaf, 0x40, 0x45, 0x36, 0x6f, 0x11, 0x8b, 0xa5, 0x24, 0x2c, 0x56, 0x35, 0x66, 0xac, 0xde, - 0x89, 0xf9, 0xe9, 0x69, 0x72, 0x8d, 0x79, 0xe9, 0x37, 0x25, 0xb3, 0xf5, 0x15, 0x29, 0x1f, 0xfb, - 0x07, 0xb2, 0x58, 0x8b, 0xdc, 0x8e, 0xdf, 0xf7, 0x09, 0x3d, 0x9f, 0xa8, 0x7a, 0x19, 0xca, 0x47, - 0xa3, 0x3e, 0xfa, 0x2e, 0x88, 0x4a, 0xa0, 0xf7, 0x61, 0xf1, 0xbe, 0xd5, 0xc3, 0xfe, 0xa9, 0x1f, - 0xe0, 0xfe, 0x1e, 0x35, 0x2f, 0xc7, 0x16, 0xf6, 0xd0, 0x2a, 0x00, 0xbd, 0x5c, 0xb9, 0x8e, 0x15, - 0x7e, 0xe8, 0x1a, 0x81, 0xa8, 0xbf, 0x51, 0x60, 0x7e, 0x48, 0x38, 0x49, 0x4d, 0xd6, 0x7b, 0x30, - 0x7d, 0xec, 0x8b, 0x20, 0x54, 0x2c, 0xc4, 0x9e, 0x36, 0x04, 0xad, 0x70, 0xec, 0xef, 0x99, 0xe8, - 0x7d, 0x80, 0x81, 0x8f, 0x4d, 0x9e, 0xb5, 0x1a, 0x53, 0x99, 0x56, 0x22, 0xa8, 0xac, 0x70, 0xe8, - 0x26, 0x94, 0x2d, 0xdb, 0x31, 0x31, 0xcd, 0x4f, 0x9a, 0xe3, 0xaa, 0xd3, 0x80, 0xe1, 0x1e, 0xf9, - 0xd8, 0x54, 0x75, 0x7e, 0x6e, 0x09, 0x69, 0x72, 0x55, 0x78, 0x08, 0x0b, 0xcc, 0xfc, 0x1c, 0x87, - 0x83, 0x4d, 0xad, 0xfd, 0x8d, 0x49, 0x45, 0xab, 0x59, 0xdc, 0x33, 0x11, 0x44, 0xea, 0x16, 0x2c, - 0xc5, 0xea, 0x18, 0x27, 0x8f, 0xde, 0x7e, 0x14, 0x0b, 0xc3, 0x0c, 0x55, 0xf5, 0xba, 0x5c, 0x03, - 0x9e, 0x55, 0x36, 0xc9, 0xcb, 0x91, 0x8f, 0xe0, 0x82, 0x14, 0x23, 0x92, 0xc6, 0x72, 0x33, 0xe6, - 0x6c, 0xad, 0x8d, 0xe6, 0x17, 0xf3, 0xba, 0xfe, 0x4b, 0x81, 0xc5, 0x34, 0x84, 0x97, 0x8c, 0x4f, - 0x7e, 0x67, 0xc4, 0xf7, 0x23, 0xef, 0x8e, 0x1b, 0xd0, 0x1f, 0x25, 0x9e, 0xbb, 0xcf, 0xaa, 0xcf, - 0xc7, 0xaf, 0x49, 0x7e, 0xb2, 0x35, 0xf9, 0x7d, 0x2e, 0x12, 0x83, 0xcf, 0xa8, 0x10, 0xff, 0x0c, - 0x31, 0xb1, 0xed, 0x58, 0x81, 0xf8, 0xb5, 0x54, 0xc2, 0x31, 0xf5, 0xe1, 0x5a, 0xda, 0x65, 0xfa, - 0xfa, 0x38, 0x4e, 0x5f, 0xda, 0x70, 0xe9, 0x7f, 0x2b, 0x50, 0x95, 0x17, 0x04, 0xdd, 0x49, 0xa9, - 0x0e, 0x7f, 0x65, 0xcc, 0x04, 0xa5, 0xe2, 0x70, 0x5e, 0x8d, 0x9d, 0x9b, 0xbc, 0x1a, 0x3b, 0x3f, - 0x59, 0x35, 0xf6, 0x3d, 0xa8, 0x3e, 0xf7, 0xac, 0xc0, 0x78, 0xda, 0xc3, 0x7a, 0xcf, 0x38, 0xc5, - 0x1e, 0xb7, 0x6e, 0x99, 0x66, 0xa8, 0x22, 0x48, 0x1e, 0x11, 0x0a, 0xf5, 0xef, 0x15, 0x28, 0x8a, - 0x61, 0x8c, 0xad, 0x87, 0x5e, 0x1e, 0x10, 0x34, 0x9d, 0xd6, 0x60, 0xda, 0x86, 0xed, 0xe8, 0x3e, - 0x26, 0x27, 0xec, 0xd8, 0xea, 0xe2, 0x45, 0x4a, 0xb7, 0xed, 0x78, 0x78, 0xdf, 0xb0, 0x9d, 0x36, - 0x23, 0x42, 0x4d, 0xa8, 0x31, 0x7e, 0x94, 0x15, 0x61, 0x3a, 0xd6, 0xae, 0x57, 0x29, 0x01, 0x61, - 0x42, 0x98, 0xf9, 0xea, 0x5f, 0xe6, 0xa1, 0x1c, 0x91, 0xcc, 0x98, 0x09, 0x6c, 0xc3, 0x82, 0xc8, - 0xb9, 0xfb, 0x38, 0x98, 0xac, 0x30, 0x7a, 0x9e, 0x53, 0xb4, 0x71, 0xc0, 0xce, 0x93, 0xbb, 0x30, - 0x6f, 0x3c, 0x33, 0xac, 0x1e, 0x95, 0xfa, 0x44, 0x87, 0x51, 0x35, 0xc4, 0x0f, 0x4f, 0x24, 0x36, - 0xef, 0x89, 0xea, 0xa5, 0x81, 0xe2, 0x0e, 0x8b, 0xb3, 0x7d, 0x9f, 0xd3, 0x8d, 0x2b, 0x99, 0xf6, - 0x7c, 0x3f, 0xec, 0x8f, 0xd6, 0x6e, 0xd2, 0x72, 0x74, 0x9f, 0x7f, 0x66, 0x3a, 0xba, 0x3f, 0x82, - 0x7b, 0x9f, 0xa2, 0x12, 0x81, 0xf5, 0x8d, 0x8f, 0x1d, 0x4f, 0x8f, 0xd2, 0xcf, 0x8e, 0x11, 0x18, - 0xa5, 0x68, 0x85, 0x4c, 0xd4, 0x0f, 0xe1, 0x82, 0x86, 0x1d, 0x17, 0xdb, 0xe1, 0x3e, 0x79, 0xe4, - 0x74, 0xcf, 0x70, 0xd2, 0x5d, 0x84, 0x46, 0x1a, 0x3d, 0xb3, 0xac, 0x57, 0x5f, 0x83, 0xa2, 0xf8, - 0x5b, 0x23, 0x34, 0x0b, 0xf9, 0xc3, 0xed, 0x56, 0x6d, 0x8a, 0x3c, 0x1c, 0xed, 0xb4, 0x6a, 0x0a, - 0x2a, 0x42, 0xa1, 0xbd, 0x7d, 0xd8, 0xaa, 0xe5, 0xae, 0xf6, 0xa1, 0x16, 0xff, 0x67, 0x1f, 0xb4, - 0x0c, 0xe7, 0x5a, 0xda, 0x41, 0xab, 0xf9, 0xa0, 0x79, 0xb8, 0x77, 0xb0, 0xaf, 0xb7, 0xb4, 0xbd, - 0x27, 0xcd, 0xc3, 0xdd, 0xda, 0x14, 0x5a, 0x87, 0x4b, 0xd1, 0x86, 0x87, 0x07, 0xed, 0x43, 0xfd, - 0xf0, 0x40, 0xdf, 0x3e, 0xd8, 0x3f, 0x6c, 0xee, 0xed, 0xef, 0x6a, 0x35, 0x05, 0x5d, 0x82, 0x0b, - 0x51, 0x94, 0x7b, 0x7b, 0x3b, 0x7b, 0xda, 0xee, 0x36, 0x79, 0x6e, 0x3e, 0xaa, 0xe5, 0xae, 0x7e, - 0x00, 0x15, 0xe9, 0xaf, 0x79, 0xc8, 0x90, 0x5a, 0x07, 0x3b, 0xb5, 0x29, 0x54, 0x81, 0x52, 0x94, - 0x4f, 0x11, 0x0a, 0xfb, 0x07, 0x3b, 0xbb, 0xb5, 0x1c, 0x02, 0x98, 0x39, 0x6c, 0x6a, 0x0f, 0x76, - 0x0f, 0x6b, 0xf9, 0xab, 0x5b, 0xf1, 0x8f, 0x54, 0x30, 0x5a, 0x80, 0x4a, 0xbb, 0xb9, 0xbf, 0x73, - 0xef, 0xe0, 0x5b, 0xba, 0xb6, 0xdb, 0xdc, 0xf9, 0x76, 0x6d, 0x0a, 0x2d, 0x42, 0x4d, 0x80, 0xf6, - 0x0f, 0x0e, 0x19, 0x54, 0xb9, 0xfa, 0x49, 0xcc, 0x82, 0x61, 0xb4, 0x04, 0x0b, 0x61, 0x97, 0xfa, - 0xb6, 0xb6, 0xdb, 0x3c, 0xdc, 0x25, 0x23, 0x91, 0xc0, 0xda, 0xd1, 0xfe, 0xfe, 0xde, 0xfe, 0x83, - 0x9a, 0x42, 0xb8, 0x0e, 0xc1, 0xbb, 0xdf, 0xda, 0x23, 0xc8, 0x39, 0x19, 0xf9, 0x68, 0xff, 0xeb, - 0xfb, 0x07, 0xdf, 0xdc, 0xaf, 0xe5, 0x37, 0x7f, 0xb8, 0x10, 0xfe, 0xb1, 0x4a, 0x1b, 0x7b, 0xb4, - 0xd2, 0x67, 0x07, 0x66, 0xc5, 0x9f, 0x65, 0x49, 0xe7, 0x9c, 0xfc, 0xe7, 0x5e, 0x8d, 0x95, 0xd4, - 0x36, 0x7e, 0xdb, 0x98, 0x42, 0x4f, 0xa8, 0xf7, 0x1f, 0xf9, 0x8c, 0x72, 0x2d, 0xe6, 0x71, 0x27, - 0xbe, 0xd6, 0x6c, 0xac, 0x67, 0x60, 0x84, 0x7c, 0xbf, 0x4d, 0x5c, 0xfb, 0xe8, 0x7f, 0x08, 0xa0, - 0x75, 0xd9, 0x33, 0x4f, 0xf9, 0x7b, 0x82, 0x86, 0x9a, 0x85, 0x12, 0xb2, 0xd6, 0xa1, 0x16, 0xff, - 0x0f, 0x01, 0x24, 0x05, 0xb6, 0x47, 0xfc, 0x45, 0x41, 0xe3, 0x2b, 0xd9, 0x48, 0xd1, 0x0e, 0x12, - 0x9f, 0xc6, 0x5f, 0xce, 0xfe, 0xd8, 0x38, 0xa5, 0x83, 0x51, 0x5f, 0x24, 0x33, 0xe1, 0xc8, 0x5f, - 0xba, 0xa1, 0xd8, 0xd7, 0xe8, 0x29, 0x1f, 0xc9, 0xca, 0xc2, 0x49, 0xff, 0x40, 0x52, 0x9d, 0x42, - 0xff, 0x0f, 0xe6, 0x63, 0xc5, 0x1a, 0x48, 0x22, 0x4c, 0xaf, 0x41, 0x69, 0x5c, 0xce, 0xc4, 0x91, - 0x57, 0x35, 0x5a, 0x90, 0x11, 0x5f, 0xd5, 0x94, 0x42, 0x8f, 0xf8, 0xaa, 0xa6, 0xd6, 0x73, 0x50, - 0x45, 0x94, 0x8a, 0x2f, 0x64, 0x45, 0x4c, 0x2b, 0xf6, 0x68, 0xac, 0x67, 0x60, 0x44, 0x05, 0x12, - 0x2b, 0xbf, 0x90, 0x05, 0x92, 0x5e, 0xd8, 0xd1, 0xb8, 0x9c, 0x89, 0x13, 0x5f, 0xc9, 0x61, 0xda, - 0x37, 0xb9, 0x92, 0x89, 0xd2, 0x83, 0xe4, 0x4a, 0x26, 0xb3, 0xc6, 0x7c, 0x25, 0x63, 0x89, 0x5a, - 0x35, 0x33, 0x05, 0x95, 0xb6, 0x92, 0xe9, 0x69, 0x2a, 0x75, 0x0a, 0x3d, 0x87, 0xfa, 0xa8, 0xe4, - 0x07, 0xba, 0x76, 0x86, 0x1c, 0x4d, 0xe3, 0xcd, 0xc9, 0x90, 0xc3, 0x8e, 0x31, 0xa0, 0xe4, 0x31, - 0x83, 0x5e, 0x95, 0xc5, 0x3d, 0xe2, 0x18, 0x6b, 0xbc, 0x36, 0x0e, 0x2d, 0xec, 0xe6, 0x01, 0x14, - 0x45, 0x5a, 0x05, 0x49, 0x26, 0x30, 0x96, 0xce, 0x69, 0x5c, 0x4c, 0x6f, 0x0c, 0x19, 0x7d, 0x0d, - 0x0a, 0x04, 0x8a, 0x96, 0xe3, 0x78, 0x82, 0x41, 0x3d, 0xd9, 0x10, 0x12, 0x37, 0x61, 0x86, 0xe5, - 0x0b, 0x90, 0x14, 0xc8, 0x90, 0xf2, 0x19, 0x8d, 0x46, 0x5a, 0x53, 0xc8, 0xa2, 0xc5, 0xfe, 0x7a, - 0x90, 0x87, 0xff, 0xd1, 0x6a, 0xfc, 0xdf, 0x83, 0xe4, 0x3c, 0x43, 0xe3, 0x95, 0x91, 0xed, 0x51, - 0x9d, 0x8d, 0xb9, 0xde, 0xeb, 0x19, 0xf7, 0xa4, 0x34, 0x9d, 0x4d, 0xbf, 0x7d, 0xb1, 0xc5, 0x4d, - 0xde, 0xce, 0xe4, 0xc5, 0x1d, 0x79, 0x03, 0x96, 0x17, 0x77, 0xf4, 0x25, 0x8f, 0x6d, 0x8d, 0xf8, - 0xa7, 0x98, 0x6a, 0xd6, 0xe7, 0xc0, 0x69, 0x5b, 0x63, 0xc4, 0x67, 0xc6, 0xea, 0x14, 0x3a, 0x81, - 0x73, 0x29, 0xdf, 0x21, 0xa3, 0xd7, 0x46, 0xdb, 0x5f, 0xa9, 0x97, 0xd7, 0xc7, 0xe2, 0x45, 0x7b, - 0x4a, 0x89, 0x05, 0xca, 0x3d, 0x8d, 0x0e, 0x46, 0xca, 0x3d, 0x65, 0x05, 0x15, 0xa9, 0x22, 0x72, - 0x1b, 0x72, 0x21, 0x2d, 0x40, 0x96, 0xa2, 0x88, 0x71, 0x8b, 0xb1, 0xf9, 0x17, 0x79, 0x98, 0x63, - 0x31, 0x5c, 0xee, 0x80, 0x3c, 0x06, 0x18, 0xa6, 0x43, 0xd0, 0xa5, 0xf8, 0xb4, 0xa5, 0x5c, 0x52, - 0x63, 0x75, 0x54, 0x73, 0x54, 0xd1, 0x23, 0x69, 0x06, 0x59, 0xd1, 0x93, 0x59, 0x13, 0x59, 0xd1, - 0x53, 0xf2, 0x13, 0xea, 0x14, 0xfa, 0x08, 0x4a, 0x61, 0x54, 0x1b, 0xc9, 0xf1, 0xf0, 0x58, 0x78, - 0xbe, 0x71, 0x69, 0x44, 0x6b, 0x74, 0x74, 0x91, 0x60, 0xb5, 0x3c, 0xba, 0x64, 0x20, 0x5c, 0x1e, - 0x5d, 0x5a, 0x94, 0x7b, 0x38, 0x5f, 0x16, 0xf6, 0x4a, 0x99, 0xaf, 0x14, 0x5d, 0x4c, 0x99, 0xaf, - 0x1c, 0x2f, 0x53, 0xa7, 0xee, 0xad, 0xfd, 0xf2, 0x77, 0xab, 0xca, 0x6f, 0x7e, 0xb7, 0x3a, 0xf5, - 0xc3, 0x4f, 0x57, 0x95, 0x5f, 0x7e, 0xba, 0xaa, 0xfc, 0xfa, 0xd3, 0x55, 0xe5, 0xb7, 0x9f, 0xae, - 0x2a, 0x7f, 0xf6, 0x9f, 0xab, 0x53, 0xdf, 0xc9, 0x3d, 0x7b, 0xe7, 0xe9, 0x0c, 0xfd, 0x43, 0xd2, - 0x77, 0xff, 0x2f, 0x00, 0x00, 0xff, 0xff, 0xc0, 0xf4, 0x4c, 0x5c, 0x4a, 0x56, 0x00, 0x00, + // 5608 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x3c, 0x4b, 0x70, 0x1b, 0xc9, + 0x75, 0x1c, 0x00, 0x24, 0x81, 0x07, 0x02, 0x04, 0x5b, 0xa4, 0x08, 0x81, 0x12, 0x97, 0x1c, 0x79, + 0x3f, 0x92, 0x76, 0xb9, 0x5a, 0xae, 0x76, 0x2d, 0xd1, 0xda, 0x95, 0x20, 0x92, 0x92, 0xb8, 0x96, + 0x48, 0x78, 0x40, 0xca, 0xbf, 0x94, 0x27, 0x23, 0x4c, 0x13, 0x9c, 0x5d, 0x60, 0x66, 0x3c, 0x33, + 0x90, 0x44, 0x9f, 0x7c, 0x4d, 0x4e, 0xa9, 0x72, 0xb9, 0x5c, 0xe5, 0x4a, 0x55, 0x2a, 0xa7, 0x1c, + 0x7c, 0x70, 0x2e, 0x49, 0xa5, 0x2a, 0xe5, 0xe4, 0x92, 0x4a, 0x39, 0xa9, 0x72, 0x95, 0x2f, 0xa9, + 0xf2, 0x2d, 0xf6, 0xe6, 0x96, 0x43, 0x4e, 0x3e, 0xe4, 0x96, 0x54, 0xff, 0x06, 0xd3, 0x33, 0x83, + 0x01, 0xa8, 0x5d, 0x7b, 0xf7, 0x44, 0xf4, 0xeb, 0xf7, 0x5e, 0x77, 0xbf, 0x7e, 0xfd, 0xfa, 0xf5, + 0x7b, 0x6f, 0x08, 0x25, 0xc3, 0xb5, 0x36, 0x5c, 0xcf, 0x09, 0x1c, 0x04, 0xde, 0xc0, 0x0e, 0xac, + 0x3e, 0xde, 0x78, 0xf6, 0x4e, 0xe3, 0xad, 0xae, 0x15, 0x9c, 0x0c, 0x9e, 0x6e, 0x74, 0x9c, 0xfe, + 0xdb, 0x5d, 0xa7, 0xeb, 0xbc, 0x4d, 0x51, 0x9e, 0x0e, 0x8e, 0x69, 0x8b, 0x36, 0xe8, 0x2f, 0x46, + 0xaa, 0x5e, 0x85, 0xea, 0x13, 0xec, 0xf9, 0x96, 0x63, 0x6b, 0xf8, 0xfb, 0x03, 0xec, 0x07, 0xa8, + 0x0e, 0xb3, 0xcf, 0x18, 0xa4, 0xae, 0xac, 0x29, 0x6f, 0x94, 0x34, 0xd1, 0x54, 0xff, 0x46, 0x81, + 0xf9, 0x10, 0xd9, 0x77, 0x1d, 0xdb, 0xc7, 0xa3, 0xb1, 0xd1, 0x3a, 0xcc, 0xf1, 0x69, 0xe9, 0xb6, + 0xd1, 0xc7, 0xf5, 0x1c, 0xed, 0x2e, 0x73, 0xd8, 0xbe, 0xd1, 0xc7, 0xe8, 0x75, 0x98, 0x17, 0x28, + 0x82, 0x49, 0x9e, 0x62, 0x55, 0x39, 0x98, 0x8f, 0x86, 0x36, 0xe0, 0x9c, 0x40, 0x34, 0x5c, 0x2b, + 0x44, 0x2e, 0x50, 0xe4, 0x05, 0xde, 0xd5, 0x74, 0x2d, 0x8e, 0xaf, 0x7e, 0x17, 0x4a, 0x3b, 0xfb, + 0xed, 0x6d, 0xc7, 0x3e, 0xb6, 0xba, 0x64, 0x8a, 0x3e, 0xf6, 0x08, 0x4d, 0x5d, 0x59, 0xcb, 0x93, + 0x29, 0xf2, 0x26, 0x6a, 0x40, 0xd1, 0xc7, 0x86, 0xd7, 0x39, 0xc1, 0x7e, 0x3d, 0x47, 0xbb, 0xc2, + 0x36, 0xa1, 0x72, 0xdc, 0xc0, 0x72, 0x6c, 0xbf, 0x9e, 0x67, 0x54, 0xbc, 0xa9, 0xfe, 0xa5, 0x02, + 0xe5, 0x96, 0xe3, 0x05, 0x8f, 0x0d, 0xd7, 0xb5, 0xec, 0x2e, 0xba, 0x0e, 0x45, 0x2a, 0xcb, 0x8e, + 0xd3, 0xa3, 0x32, 0xa8, 0x6e, 0x2e, 0x6e, 0x0c, 0x37, 0x64, 0xa3, 0xc5, 0xfb, 0xb4, 0x10, 0x0b, + 0xbd, 0x0a, 0xd5, 0x8e, 0x63, 0x07, 0x86, 0x65, 0x63, 0x4f, 0x77, 0x1d, 0x2f, 0xa0, 0xc2, 0x99, + 0xd6, 0x2a, 0x21, 0x94, 0xf0, 0x47, 0x2b, 0x50, 0x3a, 0x71, 0xfc, 0x80, 0x61, 0xe4, 0x29, 0x46, + 0x91, 0x00, 0x68, 0xe7, 0x32, 0xcc, 0xd2, 0x4e, 0xcb, 0xe5, 0x62, 0x98, 0x21, 0xcd, 0x3d, 0x57, + 0xfd, 0xb5, 0x02, 0xd3, 0x8f, 0x9d, 0x81, 0x1d, 0xc4, 0x86, 0x31, 0x82, 0x13, 0xbe, 0x45, 0x91, + 0x61, 0x8c, 0xe0, 0x64, 0x38, 0x0c, 0xc1, 0x60, 0xbb, 0xc4, 0x86, 0x21, 0x9d, 0x0d, 0x28, 0x7a, + 0xd8, 0x30, 0x1d, 0xbb, 0x77, 0x4a, 0xa7, 0x50, 0xd4, 0xc2, 0x36, 0xd9, 0x3e, 0x1f, 0xf7, 0x2c, + 0x7b, 0xf0, 0x42, 0xf7, 0x70, 0xcf, 0x78, 0x8a, 0x7b, 0x74, 0x2a, 0x45, 0xad, 0xca, 0xc1, 0x1a, + 0x83, 0xa2, 0x0f, 0xa1, 0xec, 0x7a, 0x8e, 0x6b, 0x74, 0x0d, 0x22, 0xc1, 0xfa, 0x34, 0x15, 0xd2, + 0xc5, 0xa8, 0x90, 0xe8, 0x84, 0x5b, 0x43, 0x1c, 0x2d, 0x4a, 0xa0, 0xfe, 0x42, 0x81, 0x79, 0xa2, + 0x30, 0xbe, 0x6b, 0x74, 0xf0, 0x01, 0xdd, 0x06, 0xf4, 0x2e, 0xcc, 0xda, 0x38, 0x78, 0xee, 0x78, + 0x9f, 0x70, 0xa1, 0x5f, 0x88, 0xf2, 0x0b, 0xb1, 0x1f, 0x3b, 0x26, 0xd6, 0x04, 0x26, 0xba, 0x06, + 0x79, 0xd7, 0x32, 0xe9, 0x22, 0x33, 0x09, 0x08, 0x16, 0x41, 0xb6, 0xdc, 0x0e, 0x5d, 0x75, 0x36, + 0xb2, 0xe5, 0x76, 0x88, 0x10, 0x03, 0xc3, 0xeb, 0xe2, 0x40, 0xb7, 0x4c, 0xbe, 0x21, 0x45, 0x06, + 0xd8, 0x33, 0x55, 0x15, 0x60, 0xcf, 0x0e, 0xde, 0xbf, 0xf1, 0xc4, 0xe8, 0x0d, 0x30, 0x5a, 0x84, + 0xe9, 0x67, 0xe4, 0x07, 0x9d, 0x77, 0x5e, 0x63, 0x0d, 0xf5, 0x17, 0x05, 0x58, 0x79, 0x44, 0x84, + 0xd6, 0x36, 0x6c, 0xf3, 0xa9, 0xf3, 0xa2, 0x8d, 0x3b, 0x03, 0xcf, 0x0a, 0x4e, 0xb7, 0x1d, 0x3b, + 0xc0, 0x2f, 0x02, 0xf4, 0x10, 0x16, 0x6c, 0x31, 0xac, 0x2e, 0x34, 0x93, 0x70, 0x28, 0x6f, 0xae, + 0xa4, 0xce, 0x8d, 0xc9, 0x49, 0xab, 0xd9, 0x32, 0xc0, 0x47, 0xf7, 0x86, 0xdb, 0x26, 0xf8, 0xe4, + 0x28, 0x1f, 0x69, 0x8d, 0xed, 0x5d, 0x3a, 0x1b, 0xce, 0x45, 0xec, 0xa8, 0xe0, 0xf1, 0x3e, 0x90, + 0x83, 0xac, 0x1b, 0xbe, 0x3e, 0xf0, 0xb1, 0x47, 0x65, 0x54, 0xde, 0x3c, 0x1f, 0xa5, 0x1f, 0x2e, + 0x58, 0x2b, 0x79, 0x03, 0xbb, 0xe9, 0x1f, 0xf9, 0xd8, 0x43, 0x37, 0xa9, 0x51, 0x20, 0x74, 0x5d, + 0xcf, 0x19, 0xb8, 0xf5, 0x62, 0x26, 0x21, 0x50, 0xc2, 0x07, 0x04, 0x93, 0xda, 0x0a, 0xae, 0x78, + 0xba, 0xe7, 0x38, 0xc1, 0xb1, 0x2f, 0x94, 0x4d, 0x80, 0x35, 0x0a, 0x45, 0x6f, 0xc3, 0x39, 0x7f, + 0xe0, 0xba, 0x3d, 0xdc, 0xc7, 0x76, 0x60, 0xf4, 0xd8, 0x40, 0x7e, 0x7d, 0x7a, 0x2d, 0xff, 0x46, + 0x5e, 0x43, 0xd1, 0x2e, 0xca, 0xd8, 0x47, 0xab, 0x00, 0xae, 0x67, 0x3d, 0xb3, 0x7a, 0xb8, 0x8b, + 0xcd, 0xfa, 0x0c, 0x65, 0x1a, 0x81, 0xa0, 0xf7, 0x88, 0xfd, 0xe8, 0x74, 0x9c, 0xbe, 0x5b, 0x2f, + 0x25, 0xe5, 0x2d, 0xf6, 0xa9, 0xe5, 0x39, 0xc7, 0x56, 0x0f, 0x6b, 0x02, 0x17, 0x7d, 0x15, 0x8a, + 0x86, 0xeb, 0x1a, 0x5e, 0xdf, 0xf1, 0xea, 0x30, 0x9e, 0x2e, 0x44, 0x46, 0x37, 0x60, 0x91, 0xf3, + 0xd0, 0x5d, 0xd6, 0xc9, 0x8e, 0xe6, 0x2c, 0xd1, 0xaa, 0x7b, 0xb9, 0xba, 0xa2, 0x21, 0xde, 0xcf, + 0x69, 0xc9, 0x41, 0x55, 0xff, 0x45, 0x81, 0xf9, 0x18, 0x4f, 0xf4, 0x11, 0xcc, 0x09, 0x0e, 0xc1, + 0xa9, 0x8b, 0xf9, 0x41, 0x79, 0x3d, 0x63, 0x1a, 0x1b, 0xfc, 0xef, 0xe1, 0xa9, 0x8b, 0xe9, 0x19, + 0x14, 0x0d, 0x74, 0x19, 0x2a, 0x3d, 0xa7, 0x63, 0xf4, 0xa8, 0xa9, 0xf0, 0xf0, 0x31, 0xb7, 0x14, + 0x73, 0x21, 0x50, 0xc3, 0xc7, 0xea, 0x5d, 0x28, 0x47, 0x18, 0x20, 0x04, 0x55, 0x8d, 0x0d, 0xb5, + 0x83, 0x8f, 0x8d, 0x41, 0x2f, 0xa8, 0x4d, 0xa1, 0x2a, 0xc0, 0x91, 0xdd, 0x21, 0x96, 0xd9, 0xc6, + 0x66, 0x4d, 0x41, 0x15, 0x28, 0x3d, 0x12, 0x2c, 0x6a, 0x39, 0xf5, 0xa7, 0x79, 0x58, 0xa2, 0x8a, + 0xd7, 0x72, 0x4c, 0x7e, 0x12, 0xb8, 0x19, 0xbf, 0x0c, 0x95, 0x0e, 0xdd, 0x4b, 0xdd, 0x35, 0x3c, + 0x6c, 0x07, 0xdc, 0x98, 0xcd, 0x31, 0x60, 0x8b, 0xc2, 0x90, 0x06, 0x35, 0x9f, 0xaf, 0x48, 0xef, + 0xb0, 0x93, 0xc3, 0x95, 0x5b, 0x5a, 0x75, 0xc6, 0x41, 0xd3, 0xe6, 0xfd, 0xc4, 0xc9, 0x9b, 0xf5, + 0x4f, 0xfd, 0x4e, 0xd0, 0x63, 0x37, 0x41, 0x79, 0x73, 0x23, 0xc1, 0x2a, 0x3e, 0xd9, 0x8d, 0x36, + 0x23, 0xd8, 0xb5, 0x03, 0xef, 0x54, 0x13, 0xe4, 0xe8, 0x0e, 0x14, 0x9d, 0x67, 0xd8, 0x3b, 0xc1, + 0x06, 0xb3, 0x11, 0xe5, 0xcd, 0xcb, 0x09, 0x56, 0xdb, 0xc2, 0x36, 0x6b, 0xd8, 0x77, 0x06, 0x5e, + 0x07, 0xfb, 0x5a, 0x48, 0x84, 0x9a, 0x50, 0xf2, 0x04, 0x98, 0x9a, 0xd1, 0x09, 0x39, 0x0c, 0xa9, + 0x1a, 0x5b, 0x30, 0x17, 0x9d, 0x1c, 0xaa, 0x41, 0xfe, 0x13, 0x7c, 0xca, 0x85, 0x49, 0x7e, 0x0e, + 0xed, 0x13, 0xdb, 0x61, 0xd6, 0xd8, 0xca, 0xdd, 0x54, 0x54, 0x0f, 0xd0, 0x70, 0xa5, 0x8f, 0x71, + 0x60, 0x98, 0x46, 0x60, 0x20, 0x04, 0x05, 0x7a, 0xc1, 0x33, 0x16, 0xf4, 0x37, 0xe1, 0x3a, 0xe0, + 0x86, 0xb6, 0xa4, 0x91, 0x9f, 0xe8, 0x22, 0x94, 0x42, 0x4b, 0xc4, 0x6f, 0xf9, 0x21, 0x80, 0xdc, + 0xb6, 0x46, 0x10, 0xe0, 0xbe, 0x1b, 0x50, 0xc1, 0x54, 0x34, 0xd1, 0x54, 0xff, 0x6c, 0x1a, 0x6a, + 0x09, 0x5d, 0xd8, 0x82, 0x62, 0x9f, 0x0f, 0xcf, 0x6d, 0xe0, 0xaa, 0x74, 0xe5, 0x26, 0x26, 0xa9, + 0x85, 0xf8, 0xe4, 0x46, 0x23, 0xba, 0x16, 0xf1, 0x49, 0xc2, 0x36, 0x53, 0xf2, 0xae, 0x6e, 0x5a, + 0x1e, 0xee, 0x04, 0x8e, 0x77, 0xca, 0x27, 0x3a, 0xd7, 0x73, 0xba, 0x3b, 0x02, 0x86, 0x6e, 0x00, + 0x98, 0xb6, 0xaf, 0x53, 0x1d, 0xee, 0xf2, 0x7d, 0x5c, 0x8a, 0x0e, 0x1f, 0xba, 0x1e, 0x5a, 0xc9, + 0xb4, 0x7d, 0x3e, 0xe5, 0xdb, 0x50, 0x21, 0xf7, 0xb8, 0xde, 0x67, 0x5e, 0x03, 0x33, 0x48, 0xe5, + 0xcd, 0x65, 0x79, 0xde, 0xa1, 0x57, 0xa1, 0xcd, 0xb9, 0xc3, 0x86, 0x8f, 0xee, 0xc2, 0x0c, 0xbd, + 0x4a, 0xfd, 0xfa, 0x0c, 0x25, 0x7b, 0x23, 0x7d, 0xb9, 0x5c, 0xfb, 0x1e, 0x51, 0x54, 0xa6, 0x7c, + 0x9c, 0x0e, 0x1d, 0x40, 0xd9, 0xb0, 0x6d, 0x27, 0x30, 0x98, 0xc5, 0x9f, 0xa5, 0x6c, 0xde, 0xca, + 0x64, 0xd3, 0x1c, 0xe2, 0x33, 0x5e, 0x51, 0x0e, 0xe8, 0xab, 0x30, 0x4d, 0xaf, 0x04, 0x6e, 0xc3, + 0xd7, 0xc7, 0x1e, 0x0a, 0x8d, 0xe1, 0xa3, 0x0f, 0x60, 0xf6, 0xb9, 0x65, 0x9b, 0xce, 0x73, 0x9f, + 0xdb, 0x53, 0x49, 0x85, 0xbf, 0xc9, 0xba, 0x12, 0xc4, 0x82, 0xa6, 0x71, 0x0b, 0xca, 0x91, 0xf5, + 0x9d, 0x45, 0x7f, 0x1b, 0x1f, 0x42, 0x2d, 0xbe, 0xa6, 0x33, 0xe9, 0xff, 0x00, 0x16, 0xb5, 0x81, + 0x3d, 0x9c, 0x9a, 0x70, 0x99, 0x6f, 0xc0, 0x0c, 0xd7, 0x06, 0xa6, 0x8c, 0x17, 0xb3, 0xc4, 0xaa, + 0x71, 0xdc, 0xa8, 0xf7, 0x7b, 0x62, 0xd8, 0x66, 0x0f, 0x7b, 0x7c, 0x44, 0xe1, 0xfd, 0x3e, 0x64, + 0x50, 0xf5, 0x03, 0x58, 0x8a, 0x0d, 0xcb, 0x9d, 0xef, 0xaf, 0x40, 0xd5, 0x75, 0x4c, 0xdd, 0x67, + 0x60, 0xe2, 0x79, 0x70, 0x9b, 0xe8, 0x86, 0xb8, 0x7b, 0x26, 0x21, 0x6f, 0x07, 0x8e, 0x9b, 0x9c, + 0xf6, 0x64, 0xe4, 0x75, 0x38, 0x1f, 0x27, 0x67, 0xc3, 0xab, 0x77, 0x60, 0x59, 0xc3, 0x7d, 0xe7, + 0x19, 0x7e, 0x59, 0xd6, 0x0d, 0xa8, 0x27, 0x19, 0x70, 0xe6, 0xdf, 0x86, 0xe5, 0x21, 0xb4, 0x1d, + 0x18, 0xc1, 0xc0, 0x3f, 0x13, 0x73, 0xfe, 0x32, 0x79, 0xea, 0xf8, 0x6c, 0x23, 0x8b, 0x9a, 0x68, + 0xaa, 0xcb, 0x30, 0xdd, 0x72, 0xcc, 0xbd, 0x16, 0xaa, 0x42, 0xce, 0x72, 0x39, 0x71, 0xce, 0x72, + 0xd5, 0x4e, 0x74, 0xcc, 0x7d, 0xe6, 0x33, 0xb2, 0xa1, 0xe3, 0xa8, 0xe8, 0x26, 0x54, 0x0d, 0xd3, + 0xb4, 0x88, 0x22, 0x19, 0x3d, 0xdd, 0x72, 0xd9, 0x03, 0xa2, 0xbc, 0xb9, 0x10, 0xdb, 0xfa, 0xbd, + 0x96, 0x56, 0x19, 0x22, 0xee, 0xb9, 0xbe, 0x7a, 0x0f, 0x4a, 0xa1, 0x8f, 0x46, 0x7c, 0x0b, 0xd9, + 0x07, 0xcb, 0xf4, 0xe5, 0xc2, 0x27, 0xc8, 0x7e, 0xe2, 0x92, 0xe4, 0xd3, 0x7c, 0x0f, 0x20, 0x34, + 0xaa, 0xc2, 0x3d, 0x5c, 0x4a, 0x65, 0xa9, 0x45, 0x10, 0xd5, 0xff, 0x2c, 0x44, 0x8d, 0x6c, 0x64, + 0xc9, 0x66, 0xb8, 0x64, 0x53, 0x32, 0xba, 0xb9, 0x33, 0x1a, 0xdd, 0x77, 0x60, 0xda, 0x0f, 0x8c, + 0x00, 0x73, 0x6f, 0x7a, 0x25, 0x9d, 0x90, 0x0c, 0x8c, 0x35, 0x86, 0x89, 0x2e, 0x01, 0x74, 0x3c, + 0x6c, 0x04, 0xd8, 0xd4, 0x0d, 0x76, 0x2b, 0xe4, 0xb5, 0x12, 0x87, 0x34, 0x03, 0x62, 0x45, 0x84, + 0xff, 0x9f, 0x72, 0x11, 0x8e, 0xd8, 0xc6, 0xe1, 0x4b, 0x20, 0xb4, 0x5e, 0x33, 0x63, 0xad, 0x17, + 0x27, 0xe5, 0xd6, 0x6b, 0x68, 0x89, 0x67, 0xb3, 0x2c, 0x31, 0x23, 0x9a, 0xc4, 0x12, 0x17, 0xb3, + 0x2c, 0x31, 0x67, 0x93, 0x6d, 0x89, 0x53, 0x0c, 0x49, 0x29, 0xcd, 0x90, 0x7c, 0x91, 0xa6, 0xf3, + 0x57, 0x0a, 0xd4, 0x93, 0xe7, 0x99, 0xdb, 0xb1, 0x1b, 0x30, 0xe3, 0x53, 0x48, 0xb6, 0xfd, 0xe4, + 0x54, 0x1c, 0x17, 0xdd, 0x83, 0x82, 0x65, 0x1f, 0x3b, 0xfc, 0xe0, 0x6d, 0x64, 0xd2, 0xf0, 0x91, + 0x36, 0xf6, 0xec, 0x63, 0x87, 0x49, 0x90, 0xd2, 0x36, 0xbe, 0x0a, 0xa5, 0x10, 0x74, 0xa6, 0xf5, + 0xec, 0xc1, 0x62, 0x4c, 0x6f, 0xd9, 0xe3, 0x2e, 0x54, 0x74, 0x65, 0x52, 0x45, 0x57, 0x7f, 0xaf, + 0x44, 0x0f, 0xdf, 0x7d, 0xab, 0x17, 0x60, 0x2f, 0x71, 0xf8, 0xde, 0x17, 0x7c, 0xd9, 0xc9, 0x5b, + 0xcb, 0xe0, 0xcb, 0xde, 0x4e, 0xfc, 0x14, 0x3d, 0x81, 0x2a, 0x55, 0x3b, 0xdd, 0xc7, 0x3d, 0xea, + 0xbf, 0x70, 0x1f, 0xf6, 0xed, 0x74, 0x06, 0x6c, 0x74, 0xa6, 0xb6, 0x6d, 0x4e, 0xc1, 0xe4, 0x55, + 0xe9, 0x45, 0x61, 0x8d, 0xbb, 0x80, 0x92, 0x48, 0x67, 0x92, 0xe0, 0x63, 0x62, 0xc3, 0xfc, 0x20, + 0xf5, 0x36, 0x3d, 0xa6, 0xd3, 0xc8, 0xd6, 0x06, 0x36, 0x55, 0x8d, 0xe3, 0xaa, 0xff, 0x91, 0x07, + 0x18, 0x76, 0x7e, 0xc9, 0x8d, 0xd7, 0x56, 0x68, 0x44, 0x98, 0x17, 0xa8, 0xa6, 0xb3, 0x4c, 0x35, + 0x1f, 0x7b, 0xb2, 0xf9, 0x60, 0xfe, 0xe0, 0xeb, 0x23, 0x18, 0x9c, 0xd9, 0x70, 0xcc, 0x7e, 0xd9, + 0x0c, 0xc7, 0x7d, 0x38, 0x1f, 0x57, 0x13, 0x6e, 0x35, 0xde, 0x84, 0x69, 0x2b, 0xc0, 0x7d, 0x16, + 0xd5, 0x8b, 0x05, 0x11, 0x22, 0xe8, 0x0c, 0x49, 0xfd, 0x10, 0xce, 0xcb, 0x7b, 0x75, 0x36, 0x77, + 0x42, 0x7d, 0x14, 0xf7, 0x47, 0x86, 0xe6, 0x8b, 0xeb, 0x47, 0x6a, 0x38, 0x26, 0x4e, 0xc3, 0x30, + 0xd5, 0x7f, 0x55, 0x60, 0x29, 0xd6, 0x35, 0xe2, 0xe0, 0x7f, 0x37, 0x71, 0x80, 0x99, 0xbd, 0xbb, + 0x91, 0x31, 0xca, 0x1f, 0xf1, 0x14, 0x7f, 0x13, 0x1a, 0xf2, 0xf6, 0x48, 0xa2, 0xbd, 0x15, 0x3b, + 0xca, 0xeb, 0x63, 0x27, 0x1d, 0x9e, 0xe7, 0x16, 0xac, 0xa4, 0x32, 0x4e, 0xca, 0x3c, 0x3f, 0xa1, + 0xcc, 0xff, 0x37, 0x17, 0xb5, 0xd9, 0xcd, 0x20, 0xf0, 0xac, 0xa7, 0x83, 0x00, 0x7f, 0xbe, 0x8e, + 0xce, 0x4e, 0x78, 0xb2, 0x99, 0x9d, 0x7d, 0x33, 0x9d, 0x72, 0x38, 0x7a, 0xea, 0x19, 0x6f, 0xcb, + 0x67, 0xbc, 0x40, 0x59, 0xbd, 0x33, 0x96, 0x55, 0xe6, 0x69, 0xff, 0x22, 0x0f, 0xf1, 0xbf, 0x29, + 0x30, 0x1f, 0xdb, 0x15, 0x74, 0x17, 0xc0, 0x08, 0xa7, 0xce, 0xf5, 0x63, 0x6d, 0xdc, 0x12, 0xb5, + 0x08, 0x0d, 0xb9, 0x13, 0x99, 0x0f, 0x97, 0x72, 0x27, 0xa6, 0xf8, 0x70, 0xa1, 0x0b, 0x77, 0x7b, + 0xf8, 0x00, 0x65, 0x81, 0x4b, 0x35, 0xf3, 0x01, 0xca, 0x68, 0x05, 0x89, 0xfa, 0xa3, 0x1c, 0x2c, + 0xa6, 0x71, 0x47, 0xaf, 0x41, 0xbe, 0xe3, 0x0e, 0xf8, 0x4a, 0xa4, 0x14, 0xc0, 0xb6, 0x3b, 0x38, + 0xf2, 0x8d, 0x2e, 0xd6, 0x08, 0x02, 0x7a, 0x1b, 0x66, 0xfa, 0xb8, 0xef, 0x78, 0xa7, 0x7c, 0xde, + 0x52, 0x08, 0xe0, 0x31, 0xed, 0x61, 0xd8, 0x1c, 0x0d, 0x6d, 0x0e, 0x5d, 0x5d, 0x36, 0xdf, 0xba, + 0xe4, 0xd1, 0xb3, 0x2e, 0x46, 0x12, 0xfa, 0xb7, 0x9b, 0x30, 0xeb, 0x7a, 0x4e, 0x07, 0xfb, 0x3e, + 0x8f, 0x50, 0xd4, 0x63, 0x39, 0x09, 0xd2, 0xc5, 0x69, 0x38, 0x22, 0xda, 0x02, 0x08, 0x33, 0x03, + 0xe2, 0x66, 0x6a, 0x48, 0xeb, 0x10, 0xbd, 0x4c, 0x24, 0x11, 0x6c, 0xf2, 0x4a, 0x4c, 0x17, 0x9c, + 0xfa, 0xcf, 0x0a, 0xcc, 0x45, 0xe7, 0x88, 0x2e, 0x42, 0x89, 0x30, 0xf4, 0x03, 0xa3, 0xef, 0xf2, + 0x18, 0xf8, 0x10, 0x80, 0xf6, 0x61, 0xc1, 0x64, 0xc1, 0x42, 0xdd, 0xb2, 0x03, 0xec, 0x1d, 0x1b, + 0x1d, 0xe1, 0xf4, 0xac, 0xa7, 0x2c, 0x7b, 0x4f, 0xe0, 0xb0, 0xb5, 0xd4, 0x38, 0x6d, 0x08, 0x46, + 0x4d, 0x80, 0x90, 0x8f, 0x38, 0x94, 0x13, 0x30, 0x8a, 0x10, 0xa9, 0xff, 0xa7, 0xc0, 0x52, 0x2a, + 0x56, 0x6a, 0xe8, 0x6b, 0x13, 0x8a, 0xde, 0x0b, 0xfd, 0xe9, 0x69, 0x80, 0xfd, 0xb4, 0x0d, 0x3e, + 0x8a, 0xc4, 0xb7, 0x67, 0xbd, 0x17, 0xf7, 0x08, 0x1e, 0xba, 0x01, 0x25, 0xef, 0x85, 0x8e, 0x3d, + 0xcf, 0xf1, 0x84, 0x4e, 0x8e, 0x24, 0x2a, 0x7a, 0x2f, 0x76, 0x29, 0x22, 0x19, 0x29, 0x10, 0x23, + 0x15, 0xc6, 0x8c, 0x14, 0x0c, 0x47, 0x0a, 0xc2, 0x91, 0xa6, 0xc7, 0x8c, 0x14, 0xf0, 0x91, 0xd4, + 0x8f, 0x61, 0x2e, 0xaa, 0x32, 0x63, 0xb6, 0xf0, 0x36, 0x54, 0xb8, 0x4a, 0xe9, 0x1d, 0x67, 0x60, + 0x07, 0xe3, 0xc4, 0x30, 0xc7, 0xb1, 0xb7, 0x09, 0xb2, 0xfa, 0x33, 0x05, 0x4a, 0x7b, 0x7d, 0xa3, + 0x8b, 0xdb, 0x2e, 0xee, 0x10, 0x9b, 0x62, 0x91, 0x06, 0x17, 0x31, 0x6b, 0xa0, 0x87, 0xb2, 0x7d, + 0x64, 0x37, 0xe2, 0x6b, 0x52, 0x16, 0x41, 0x70, 0x18, 0x63, 0x14, 0x3f, 0xab, 0x65, 0xdb, 0x84, + 0xe2, 0xd7, 0xf1, 0x29, 0xf3, 0xfd, 0x27, 0xa4, 0x53, 0x7f, 0x5c, 0x80, 0xe5, 0x11, 0x91, 0x5a, + 0xea, 0x38, 0xba, 0x03, 0xdd, 0xc5, 0x9e, 0xe5, 0x98, 0x42, 0xb4, 0x1d, 0x77, 0xd0, 0xa2, 0x00, + 0xb4, 0x02, 0xa4, 0xa1, 0x7f, 0x7f, 0xe0, 0xf0, 0xbb, 0x29, 0xaf, 0x15, 0x3b, 0xee, 0xe0, 0x1b, + 0xa4, 0x2d, 0x68, 0xfd, 0x13, 0xc3, 0xc3, 0x4c, 0x8d, 0x18, 0x6d, 0x9b, 0x02, 0xd0, 0x3b, 0xb0, + 0xc4, 0x0c, 0x8a, 0xde, 0xb3, 0xfa, 0x16, 0x39, 0x5e, 0x11, 0xdd, 0xc9, 0x6b, 0x88, 0x75, 0x3e, + 0x22, 0x7d, 0x7b, 0x36, 0xd3, 0x16, 0x15, 0x2a, 0x8e, 0xd3, 0xd7, 0xfd, 0x8e, 0xe3, 0x61, 0xdd, + 0x30, 0x3f, 0xa6, 0x1a, 0x93, 0xd7, 0xca, 0x8e, 0xd3, 0x6f, 0x13, 0x58, 0xd3, 0xfc, 0x18, 0xbd, + 0x02, 0xe5, 0x8e, 0x3b, 0xf0, 0x71, 0xa0, 0x93, 0x3f, 0xf4, 0x3d, 0x5d, 0xd2, 0x80, 0x81, 0xb6, + 0xdd, 0x81, 0x1f, 0x41, 0xe8, 0x13, 0x6f, 0x6d, 0x36, 0x8a, 0xf0, 0x18, 0xf7, 0x69, 0x42, 0xea, + 0x64, 0xd0, 0xc5, 0xae, 0xd1, 0xc5, 0x6c, 0x6a, 0xe2, 0x51, 0x2c, 0x25, 0xa4, 0x1e, 0x72, 0x14, + 0x3a, 0x41, 0xad, 0x7a, 0x12, 0x6d, 0xfa, 0xe8, 0x23, 0x98, 0x1d, 0xd8, 0xd6, 0xb1, 0x85, 0xcd, + 0x7a, 0x89, 0xd2, 0x5e, 0x9f, 0x20, 0x2e, 0xbe, 0x71, 0xc4, 0x48, 0x78, 0x98, 0x9e, 0x33, 0x40, + 0x5b, 0xd0, 0xe0, 0x82, 0xf2, 0x9f, 0x1b, 0x6e, 0x5c, 0x5a, 0x40, 0x45, 0x70, 0x9e, 0x61, 0xb4, + 0x9f, 0x1b, 0x6e, 0x54, 0x62, 0x8d, 0x2d, 0x98, 0x8b, 0x32, 0x3d, 0x93, 0x2e, 0xdd, 0x83, 0x8a, + 0xb4, 0x48, 0xb2, 0xdb, 0x54, 0x28, 0xbe, 0xf5, 0x03, 0x71, 0x00, 0x8a, 0x04, 0xd0, 0xb6, 0x7e, + 0x40, 0xd3, 0x88, 0x74, 0x66, 0x94, 0x4f, 0x41, 0x63, 0x0d, 0xd5, 0x80, 0x8a, 0x94, 0xb9, 0x23, + 0x26, 0x8a, 0xa6, 0xe8, 0xb8, 0x89, 0x22, 0xbf, 0x09, 0xcc, 0x73, 0x7a, 0x62, 0x06, 0xf4, 0x37, + 0x81, 0xd1, 0x1c, 0x11, 0x8b, 0x78, 0xd3, 0xdf, 0x74, 0x08, 0xfc, 0x8c, 0xa7, 0x75, 0x4b, 0x1a, + 0x6b, 0xa8, 0x26, 0xc0, 0xb6, 0xe1, 0x1a, 0x4f, 0xad, 0x9e, 0x15, 0x9c, 0xa2, 0x2b, 0x50, 0x33, + 0x4c, 0x53, 0xef, 0x08, 0x88, 0x85, 0x45, 0x9a, 0x7d, 0xde, 0x30, 0xcd, 0xed, 0x08, 0x18, 0x5d, + 0x83, 0x05, 0xd3, 0x73, 0x5c, 0x19, 0x97, 0xe5, 0xdd, 0x6b, 0xa4, 0x23, 0x8a, 0xac, 0xfe, 0xd3, + 0x0c, 0x5c, 0x92, 0xb7, 0x2d, 0x9e, 0x11, 0xdd, 0x82, 0xb9, 0xd8, 0xa8, 0x89, 0x5c, 0xe2, 0x70, + 0x9e, 0x9a, 0x84, 0x1b, 0xcb, 0xf9, 0xe5, 0x12, 0x39, 0xbf, 0xd4, 0x6c, 0x6b, 0xfe, 0x73, 0xca, + 0xb6, 0x16, 0x3e, 0x63, 0xb6, 0x75, 0xfa, 0x65, 0xb3, 0xad, 0x73, 0x13, 0x67, 0x5b, 0x5f, 0xa3, + 0x2f, 0x43, 0x31, 0x22, 0xbd, 0xe3, 0xd8, 0xc1, 0xae, 0x84, 0xdc, 0x6d, 0x51, 0xc1, 0x11, 0xcb, + 0xca, 0xce, 0x9e, 0x25, 0x2b, 0x5b, 0x1c, 0x99, 0x95, 0x5d, 0x83, 0x39, 0xdb, 0xd1, 0x6d, 0xfc, + 0x5c, 0x27, 0xdb, 0xe2, 0xd7, 0xcb, 0x6c, 0x8f, 0x6c, 0x67, 0x1f, 0x3f, 0x6f, 0x11, 0x08, 0x5a, + 0x87, 0xb9, 0xbe, 0xe1, 0x7f, 0x82, 0x4d, 0x9a, 0x1e, 0xf5, 0xeb, 0x15, 0xaa, 0x49, 0x65, 0x06, + 0x6b, 0x11, 0x10, 0x7a, 0x15, 0xc2, 0x79, 0x70, 0xa4, 0x2a, 0x45, 0xaa, 0x08, 0x28, 0x43, 0x8b, + 0x64, 0x78, 0xe7, 0x5f, 0x32, 0xc3, 0x5b, 0x3b, 0x4b, 0x86, 0xf7, 0x2d, 0xa8, 0x89, 0xdf, 0x22, + 0xc5, 0xcb, 0x22, 0x76, 0x34, 0xbb, 0x3b, 0x2f, 0xfa, 0x44, 0x1a, 0x77, 0x54, 0x42, 0x18, 0x32, + 0x13, 0xc2, 0x3f, 0x57, 0xb8, 0x9f, 0x1a, 0x1e, 0x20, 0x9e, 0x89, 0x92, 0x92, 0x88, 0xca, 0xcb, + 0x24, 0x11, 0xd1, 0xe1, 0xc8, 0x34, 0xeb, 0x95, 0xd1, 0x9c, 0xc6, 0x25, 0x5a, 0xd5, 0x1f, 0x29, + 0x70, 0x89, 0x3b, 0x91, 0x23, 0x8a, 0x20, 0x52, 0xd4, 0x52, 0x19, 0xa1, 0x96, 0x1d, 0x0f, 0x9b, + 0xd8, 0x0e, 0x2c, 0xa3, 0xa7, 0xfb, 0x2e, 0xee, 0x88, 0xd4, 0xca, 0x10, 0x4c, 0xdd, 0x8b, 0x75, + 0x98, 0x63, 0xb5, 0x2f, 0xdc, 0x57, 0x66, 0x25, 0x2e, 0x65, 0x5a, 0xfe, 0xc2, 0x40, 0xaa, 0x03, + 0xcb, 0x23, 0x72, 0x52, 0xa9, 0x62, 0x50, 0x92, 0x62, 0xc8, 0x5c, 0x53, 0x52, 0x0c, 0x3f, 0x56, + 0xe0, 0x15, 0x4e, 0x32, 0xd2, 0xf6, 0x7d, 0x11, 0x82, 0xf8, 0x3b, 0x25, 0xf4, 0xf1, 0xe3, 0x2a, + 0xb5, 0x9d, 0x54, 0xa9, 0x57, 0x53, 0x24, 0x90, 0xad, 0x54, 0x4f, 0x46, 0x2a, 0xd5, 0xb5, 0x2c, + 0x5e, 0x63, 0xe5, 0xf9, 0x33, 0x05, 0x2e, 0x8c, 0x9c, 0x40, 0xcc, 0x69, 0x52, 0xe2, 0x4e, 0x13, + 0x77, 0xb8, 0x86, 0x7e, 0x2c, 0x73, 0xb8, 0xa8, 0xab, 0xca, 0x3d, 0x1b, 0xbd, 0x6f, 0xbc, 0xb0, + 0xfa, 0x83, 0x3e, 0xf7, 0xb8, 0x08, 0xbb, 0xc7, 0x0c, 0xf2, 0x12, 0x2e, 0x97, 0xda, 0x84, 0x85, + 0x70, 0x96, 0x99, 0x29, 0xf6, 0x48, 0xca, 0x3c, 0x27, 0xa7, 0xcc, 0x6d, 0x98, 0xd9, 0xc1, 0xcf, + 0xac, 0x0e, 0xfe, 0x5c, 0x2a, 0xc0, 0xd6, 0xa0, 0xec, 0x62, 0xaf, 0x6f, 0xf9, 0x7e, 0x78, 0x09, + 0x96, 0xb4, 0x28, 0x48, 0xfd, 0xf9, 0x0c, 0xcc, 0xc7, 0x35, 0xe2, 0x56, 0x22, 0x43, 0x7f, 0x29, + 0xf5, 0x25, 0x99, 0x12, 0x42, 0xb9, 0x26, 0x5c, 0xfe, 0x5c, 0x32, 0x7d, 0x15, 0xba, 0xf5, 0xe2, + 0x25, 0x50, 0x87, 0xd9, 0x8e, 0xd3, 0xef, 0x1b, 0xb6, 0x29, 0xca, 0xf4, 0x78, 0x93, 0xc8, 0xcc, + 0xf0, 0xba, 0x2c, 0x78, 0x52, 0xd2, 0xe8, 0x6f, 0xb2, 0x61, 0xe4, 0x15, 0x67, 0xd9, 0x34, 0xc7, + 0x4f, 0x2f, 0xd2, 0x92, 0x06, 0x1c, 0xb4, 0x63, 0x79, 0xe8, 0x0d, 0x28, 0x60, 0xfb, 0x99, 0x88, + 0xaa, 0x4a, 0x8f, 0x78, 0xe1, 0xe6, 0x6b, 0x14, 0x03, 0x5d, 0x81, 0x99, 0x3e, 0x51, 0x02, 0x91, + 0x07, 0x5a, 0x48, 0x94, 0xb3, 0x69, 0x1c, 0x01, 0xbd, 0x09, 0xb3, 0x26, 0xdd, 0x0f, 0xe1, 0xd7, + 0x22, 0xa9, 0x5a, 0x80, 0x76, 0x69, 0x02, 0x05, 0xdd, 0x09, 0x23, 0x48, 0xa5, 0x64, 0x68, 0x37, + 0x26, 0xe6, 0xd4, 0xe0, 0xd1, 0xbe, 0xfc, 0x38, 0x82, 0x64, 0x1c, 0x2a, 0xce, 0x25, 0x3b, 0x4a, + 0x7c, 0x01, 0x8a, 0x3d, 0xa7, 0xcb, 0x94, 0xa3, 0xcc, 0x6a, 0x3c, 0x7b, 0x4e, 0x97, 0xea, 0xc6, + 0x22, 0x4c, 0xfb, 0x81, 0x69, 0xd9, 0xd4, 0xb3, 0x28, 0x6a, 0xac, 0x41, 0x8e, 0x14, 0xfd, 0xa1, + 0x3b, 0x76, 0x07, 0xd7, 0x2b, 0xb4, 0xab, 0x44, 0x21, 0x07, 0x76, 0x87, 0x3e, 0x93, 0x82, 0xe0, + 0xb4, 0x5e, 0xa5, 0x70, 0xf2, 0x73, 0x18, 0xc8, 0x99, 0x1f, 0x11, 0xc8, 0x89, 0x4d, 0x38, 0x25, + 0x90, 0x53, 0x1b, 0x19, 0xc8, 0x89, 0xd3, 0x7e, 0x19, 0x0a, 0x09, 0xfe, 0x41, 0x81, 0xf3, 0xdb, + 0x34, 0x1b, 0x10, 0xb1, 0x48, 0x67, 0x49, 0x6e, 0xbf, 0x1b, 0x56, 0x1c, 0xa4, 0xa4, 0x8d, 0xe3, + 0x2b, 0x16, 0x05, 0x07, 0xdb, 0x50, 0x15, 0x6c, 0x39, 0x71, 0x7e, 0x82, 0x72, 0x85, 0x8a, 0x1f, + 0x6d, 0xaa, 0xb7, 0x61, 0x39, 0x31, 0x73, 0x1e, 0x93, 0x5d, 0x87, 0xb9, 0xa1, 0xb5, 0x09, 0x27, + 0x5e, 0x0e, 0x61, 0x7b, 0xa6, 0xba, 0x05, 0x4b, 0xed, 0xc0, 0xf0, 0x82, 0xc4, 0xb2, 0x27, 0xa0, + 0xa5, 0x85, 0x08, 0x32, 0x2d, 0xaf, 0x15, 0x68, 0xc3, 0x62, 0x3b, 0x70, 0xdc, 0x97, 0x60, 0x4a, + 0xec, 0x07, 0x59, 0xb9, 0x33, 0x10, 0xd6, 0x5d, 0x34, 0xd5, 0x65, 0x56, 0x36, 0x91, 0x1c, 0xed, + 0x6b, 0x70, 0x9e, 0x55, 0x2d, 0xbc, 0xcc, 0x22, 0x2e, 0x88, 0x9a, 0x89, 0x24, 0xdf, 0x07, 0x70, + 0x4e, 0x0a, 0xb0, 0xf1, 0x8c, 0xe2, 0x75, 0x39, 0xa3, 0x38, 0x3a, 0x20, 0x17, 0x26, 0x14, 0x7f, + 0x92, 0x8b, 0xd8, 0xe3, 0x11, 0x69, 0x85, 0xf7, 0xe4, 0x7c, 0xe2, 0x2b, 0xa3, 0xb9, 0x4a, 0xe9, + 0xc4, 0xa4, 0x76, 0xe6, 0x53, 0xb4, 0xf3, 0x28, 0x91, 0xb3, 0x28, 0x24, 0x73, 0xb4, 0xb1, 0x19, + 0xfe, 0x51, 0xb2, 0x15, 0x8f, 0x58, 0xce, 0x31, 0x1c, 0x3a, 0x4c, 0x54, 0xbc, 0x1b, 0x4b, 0x54, + 0xac, 0x64, 0xcc, 0x34, 0x4c, 0x51, 0xfc, 0xa4, 0x00, 0xa5, 0xb0, 0x2f, 0x21, 0xe1, 0xa4, 0xa8, + 0x72, 0x29, 0xa2, 0x8a, 0xde, 0x93, 0xf9, 0x97, 0xbc, 0x27, 0x0b, 0x13, 0xdc, 0x93, 0x2b, 0x50, + 0xa2, 0x3f, 0x68, 0xe9, 0x26, 0xbb, 0xf7, 0x8a, 0x14, 0xa0, 0xe1, 0xe3, 0xa1, 0x8a, 0xcd, 0x4c, + 0xa8, 0x62, 0xb1, 0xfc, 0xe6, 0x6c, 0x3c, 0xbf, 0x79, 0x2b, 0xbc, 0xc3, 0x8a, 0xc9, 0x80, 0x6b, + 0xc8, 0x31, 0xf5, 0xf6, 0x8a, 0x85, 0xf6, 0x4a, 0xc9, 0xd0, 0xde, 0x90, 0xfe, 0x4b, 0x9b, 0xef, + 0x38, 0x60, 0x49, 0xcb, 0xa8, 0x9e, 0x71, 0x1b, 0xf9, 0x9e, 0x14, 0x63, 0x67, 0xc9, 0xab, 0xa5, + 0xd4, 0xd5, 0x49, 0xe1, 0xf5, 0x23, 0x38, 0x2f, 0x6d, 0xc4, 0xb0, 0x18, 0x6a, 0x32, 0x1b, 0x37, + 0xa2, 0x12, 0xea, 0x37, 0xd3, 0x11, 0x4b, 0x31, 0xa2, 0xec, 0xe7, 0x56, 0x22, 0x1b, 0x36, 0xb1, + 0x86, 0x5e, 0x97, 0x13, 0xe7, 0x67, 0xd6, 0xab, 0x44, 0xde, 0x9c, 0x7a, 0x16, 0x86, 0xc7, 0xbb, + 0x59, 0x30, 0xb2, 0xc4, 0x21, 0x4d, 0xea, 0x8f, 0x1f, 0x5b, 0xb6, 0xe5, 0x9f, 0xb0, 0xfe, 0x19, + 0xe6, 0x8f, 0x0b, 0x50, 0x93, 0x06, 0xd4, 0xf0, 0x0b, 0x2b, 0xd0, 0x3b, 0x8e, 0x89, 0xa9, 0xd6, + 0x4e, 0x6b, 0x45, 0x02, 0xd8, 0x76, 0x4c, 0x3c, 0x3c, 0x4f, 0xc5, 0xb3, 0x9e, 0xa7, 0x52, 0xec, + 0x3c, 0x9d, 0x87, 0x19, 0x0f, 0x1b, 0xbe, 0x63, 0xb3, 0x27, 0xba, 0xc6, 0x5b, 0x64, 0x23, 0xfa, + 0xd8, 0xf7, 0xc9, 0x18, 0xdc, 0x91, 0xe2, 0xcd, 0x88, 0xd3, 0x37, 0x97, 0xe1, 0xf4, 0x65, 0x14, + 0x15, 0xc5, 0x9c, 0xbe, 0x4a, 0x86, 0xd3, 0x37, 0x51, 0x4d, 0xd1, 0xd0, 0xbd, 0xad, 0x8e, 0x73, + 0x6f, 0xa3, 0xfe, 0xe1, 0xbc, 0xe4, 0x1f, 0x7e, 0x91, 0x47, 0xf0, 0xdf, 0x15, 0x58, 0x4e, 0x1c, + 0x19, 0x7e, 0x08, 0xdf, 0x8d, 0xd5, 0x1b, 0xad, 0x64, 0xc8, 0x29, 0x2c, 0x37, 0x6a, 0x4a, 0xe5, + 0x46, 0x6f, 0x65, 0x91, 0x7c, 0xee, 0xd5, 0x46, 0xbf, 0xcd, 0xc1, 0x2b, 0x47, 0xae, 0x19, 0xf3, + 0xba, 0xf8, 0x13, 0x7a, 0x72, 0x43, 0x70, 0x4b, 0x4e, 0x98, 0x4e, 0x14, 0xf5, 0xe1, 0xae, 0xf6, + 0x9d, 0x78, 0xce, 0x74, 0xc2, 0xf7, 0xbd, 0xa0, 0x42, 0xdf, 0x4b, 0x4b, 0x69, 0xdf, 0x96, 0x52, + 0x42, 0xd9, 0x0b, 0xfc, 0x03, 0x27, 0x72, 0x54, 0x58, 0x1b, 0x3d, 0x01, 0xee, 0xa1, 0xfd, 0x29, + 0xcc, 0xef, 0xbe, 0xc0, 0x9d, 0xf6, 0xa9, 0xdd, 0x39, 0x83, 0xd4, 0x6b, 0x90, 0xef, 0xf4, 0x4d, + 0x1e, 0xe8, 0x26, 0x3f, 0xa3, 0x4e, 0x67, 0x5e, 0x76, 0x3a, 0x75, 0xa8, 0x0d, 0x47, 0xe0, 0xda, + 0x7a, 0x9e, 0x68, 0xab, 0x49, 0x90, 0x09, 0xf3, 0x39, 0x8d, 0xb7, 0x38, 0x1c, 0x7b, 0xac, 0x6c, + 0x98, 0xc1, 0xb1, 0xe7, 0xc9, 0x46, 0x2e, 0x2f, 0x1b, 0x39, 0xf5, 0xa7, 0x0a, 0x94, 0xc9, 0x08, + 0x9f, 0x69, 0xfe, 0xfc, 0x05, 0x97, 0x1f, 0xbe, 0xe0, 0xc2, 0x87, 0x60, 0x21, 0xfa, 0x10, 0x1c, + 0xce, 0x7c, 0x9a, 0x82, 0x93, 0x33, 0x9f, 0x09, 0xe1, 0xd8, 0xf3, 0xd4, 0x35, 0x98, 0x63, 0x73, + 0xe3, 0x2b, 0xaf, 0x41, 0x7e, 0xe0, 0xf5, 0xc4, 0xfe, 0x0d, 0xbc, 0x9e, 0xfa, 0xe7, 0x0a, 0x54, + 0x9a, 0x41, 0x60, 0x74, 0x4e, 0xce, 0xb0, 0x80, 0x70, 0x72, 0xb9, 0xe8, 0xe4, 0x92, 0x8b, 0x18, + 0x4e, 0xb7, 0x30, 0x62, 0xba, 0xd3, 0xd2, 0x74, 0x55, 0xa8, 0x8a, 0xb9, 0x8c, 0x9c, 0xf0, 0x3e, + 0xa0, 0x96, 0xe3, 0x05, 0xf7, 0x1d, 0xef, 0xb9, 0xe1, 0x99, 0x67, 0x7b, 0xe4, 0x21, 0x28, 0xf0, + 0x8f, 0x03, 0xf3, 0x6f, 0x4c, 0x6b, 0xf4, 0xb7, 0xfa, 0x3a, 0x9c, 0x93, 0xf8, 0x8d, 0x1c, 0x78, + 0x0b, 0xca, 0xf4, 0xd2, 0xe2, 0xfe, 0xff, 0xb5, 0x68, 0x1e, 0x75, 0xcc, 0xe5, 0xa6, 0xee, 0xc0, + 0x02, 0x71, 0x5f, 0x28, 0x3c, 0xb4, 0x2f, 0x6f, 0xc7, 0x5c, 0xe4, 0xe5, 0x04, 0x8b, 0x98, 0x7b, + 0xfc, 0x7b, 0x05, 0xa6, 0x29, 0x3c, 0xe1, 0x52, 0xac, 0x40, 0xc9, 0xc3, 0xae, 0xa3, 0x07, 0x46, + 0x37, 0xfc, 0xf0, 0x92, 0x00, 0x0e, 0x8d, 0x2e, 0x0d, 0xeb, 0xd3, 0x4e, 0xd3, 0xea, 0x62, 0x3f, + 0x10, 0x5f, 0x5f, 0x96, 0x09, 0x6c, 0x87, 0x81, 0x88, 0x60, 0x68, 0x4a, 0xac, 0x40, 0x33, 0x5f, + 0xf4, 0x37, 0x7a, 0x83, 0x7d, 0x71, 0x92, 0x9d, 0x1b, 0xa1, 0x5f, 0xa2, 0x34, 0xa0, 0x18, 0x4b, + 0x6a, 0x84, 0x6d, 0x74, 0x05, 0x0a, 0x34, 0x48, 0x3a, 0x9b, 0x25, 0x25, 0x8a, 0x42, 0xb4, 0xc2, + 0xb5, 0x6c, 0x1b, 0x9b, 0xd4, 0x5f, 0x28, 0x6a, 0xbc, 0xa5, 0xde, 0x01, 0x14, 0x15, 0x1e, 0xdf, + 0xa0, 0x2b, 0x30, 0x43, 0x65, 0x2b, 0x7c, 0xbe, 0x85, 0x04, 0x6b, 0x8d, 0x23, 0xa8, 0xdf, 0x05, + 0xc4, 0xc6, 0x92, 0xfc, 0xbc, 0xb3, 0x6c, 0x60, 0x86, 0xc7, 0xf7, 0xf7, 0x0a, 0x9c, 0x93, 0xb8, + 0xf3, 0xf9, 0xbd, 0x2e, 0xb3, 0x4f, 0x99, 0x1e, 0x67, 0xfd, 0x81, 0x74, 0x0d, 0x5e, 0x49, 0x4e, + 0xe3, 0x0f, 0x74, 0x05, 0xfe, 0x4a, 0x01, 0x68, 0x0e, 0x82, 0x13, 0x1e, 0x5f, 0x8c, 0x6e, 0xa2, + 0x12, 0xdb, 0xc4, 0x06, 0x14, 0x5d, 0xc3, 0xf7, 0x9f, 0x3b, 0x9e, 0x78, 0x73, 0x85, 0x6d, 0x1a, + 0x15, 0x1c, 0x04, 0x27, 0x22, 0xcd, 0x49, 0x7e, 0xa3, 0x57, 0xa1, 0xca, 0xbe, 0x08, 0xd6, 0x0d, + 0xd3, 0xf4, 0x44, 0xc9, 0x4c, 0x49, 0xab, 0x30, 0x68, 0x93, 0x01, 0x09, 0x9a, 0x45, 0x43, 0xe6, + 0xc1, 0xa9, 0x1e, 0x38, 0x9f, 0x60, 0x9b, 0xbf, 0xa3, 0x2a, 0x02, 0x7a, 0x48, 0x80, 0x2c, 0xe7, + 0xd4, 0xb5, 0xfc, 0xc0, 0x13, 0x68, 0x22, 0x73, 0xc6, 0xa1, 0x14, 0x4d, 0xfd, 0x5b, 0x05, 0x6a, + 0xad, 0x41, 0xaf, 0xc7, 0x84, 0xfb, 0x32, 0x9b, 0x7c, 0x95, 0x2f, 0x25, 0x97, 0x54, 0xf9, 0xa1, + 0xa0, 0xf8, 0x12, 0x3f, 0x97, 0xd0, 0xcf, 0x75, 0x58, 0x88, 0xcc, 0x98, 0x2b, 0x8e, 0xe4, 0x08, + 0x2b, 0xb2, 0x23, 0xac, 0x36, 0x01, 0xb1, 0x68, 0xc7, 0x4b, 0xaf, 0x52, 0x5d, 0x82, 0x73, 0x12, + 0x0b, 0x7e, 0x15, 0x5f, 0x85, 0x0a, 0x2f, 0xc9, 0xe1, 0x0a, 0x71, 0x01, 0x8a, 0xc4, 0xa4, 0x76, + 0x2c, 0x53, 0xe4, 0xba, 0x67, 0x5d, 0xc7, 0xdc, 0xb6, 0x4c, 0x4f, 0xfd, 0x06, 0x54, 0xf8, 0x67, + 0x88, 0x1c, 0xf7, 0x2e, 0x54, 0x79, 0x9d, 0x94, 0x2e, 0x7d, 0xb7, 0x73, 0x21, 0xa5, 0x2e, 0x48, + 0x88, 0xc2, 0x8e, 0x36, 0xd5, 0xef, 0x41, 0x83, 0x79, 0x0b, 0x12, 0x63, 0xb1, 0xc0, 0xbb, 0x20, + 0x0a, 0x68, 0x33, 0xf8, 0xcb, 0x94, 0x15, 0x2f, 0xda, 0x54, 0x2f, 0xc1, 0x4a, 0x2a, 0x7f, 0xbe, + 0x7a, 0x17, 0x6a, 0xc3, 0x0e, 0xf6, 0x71, 0x49, 0x98, 0xc0, 0x57, 0x22, 0x09, 0xfc, 0xf3, 0xa1, + 0xa3, 0x9b, 0x13, 0x37, 0x17, 0xf5, 0x65, 0x87, 0x0f, 0x94, 0xfc, 0xa8, 0x07, 0x4a, 0x41, 0x7a, + 0xa0, 0xa8, 0x8f, 0x43, 0x19, 0xf2, 0x67, 0xe2, 0x6d, 0xfa, 0x90, 0x65, 0x63, 0x0b, 0xa3, 0x76, + 0x31, 0x7d, 0x7d, 0x0c, 0x49, 0x8b, 0xe0, 0xab, 0x57, 0xa0, 0x22, 0x9b, 0xb7, 0x88, 0xc5, 0x52, + 0x12, 0x16, 0xab, 0x1a, 0x33, 0x56, 0xef, 0xc4, 0xfc, 0xf7, 0x34, 0xb9, 0xc6, 0xbc, 0xf7, 0x9b, + 0x92, 0xd9, 0xfa, 0x8a, 0x94, 0xa7, 0xfd, 0x03, 0x59, 0xac, 0x45, 0x6e, 0xc7, 0xef, 0xfb, 0x84, + 0x9e, 0x2f, 0x54, 0xbd, 0x0c, 0xe5, 0xa3, 0x51, 0x1f, 0x83, 0x17, 0x44, 0x85, 0xd0, 0xfb, 0xb0, + 0x78, 0xdf, 0xea, 0x61, 0xff, 0xd4, 0x0f, 0x70, 0x7f, 0x8f, 0x9a, 0x97, 0x63, 0x0b, 0x7b, 0x68, + 0x15, 0x80, 0x3e, 0xba, 0x5c, 0xc7, 0x0a, 0x3f, 0x80, 0x8d, 0x40, 0xd4, 0xdf, 0x28, 0x30, 0x3f, + 0x24, 0x9c, 0xa4, 0x56, 0xeb, 0x3d, 0x98, 0x3e, 0xf6, 0x45, 0x70, 0x2a, 0x16, 0x7a, 0x4f, 0x9b, + 0x82, 0x56, 0x38, 0xf6, 0xf7, 0x4c, 0xf4, 0x3e, 0xc0, 0xc0, 0xc7, 0x26, 0xcf, 0x66, 0x8d, 0xa9, + 0x58, 0x2b, 0x11, 0x54, 0x56, 0x50, 0x74, 0x13, 0xca, 0x96, 0xed, 0x98, 0x98, 0xe6, 0x2d, 0xcd, + 0x71, 0x55, 0x6b, 0xc0, 0x70, 0x8f, 0x7c, 0x6c, 0xaa, 0x3a, 0xbf, 0xb7, 0x84, 0x34, 0xb9, 0x2a, + 0x3c, 0x84, 0x05, 0x66, 0x7e, 0x8e, 0xc3, 0xc9, 0xa6, 0xd6, 0x04, 0xc7, 0xa4, 0xa2, 0xd5, 0x2c, + 0xee, 0xb1, 0x08, 0x22, 0x75, 0x0b, 0x96, 0x62, 0xf5, 0x8d, 0x93, 0x47, 0x75, 0x3f, 0x8a, 0x85, + 0x67, 0x86, 0xaa, 0x7a, 0x5d, 0xae, 0x0d, 0xcf, 0x2a, 0xa7, 0xe4, 0x65, 0xca, 0x47, 0x70, 0x41, + 0x8a, 0x1d, 0x49, 0x73, 0xb9, 0x19, 0x73, 0xc2, 0xd6, 0x46, 0xf3, 0x8b, 0x79, 0x63, 0xff, 0xad, + 0xc0, 0x62, 0x1a, 0xc2, 0x4b, 0xc6, 0x2d, 0xbf, 0x33, 0xe2, 0xbb, 0x92, 0x77, 0xc7, 0x4d, 0xe8, + 0x8f, 0x12, 0xe7, 0xdd, 0x67, 0x55, 0xe9, 0xe3, 0xf7, 0x24, 0x3f, 0xd9, 0x9e, 0xfc, 0x3e, 0x17, + 0x89, 0xcd, 0x67, 0x54, 0x8e, 0x7f, 0x86, 0x58, 0xd9, 0x76, 0xac, 0x70, 0xfc, 0x5a, 0x2a, 0xe1, + 0x98, 0xba, 0x71, 0x2d, 0xed, 0x91, 0x7d, 0x7d, 0x1c, 0xa7, 0x2f, 0x6d, 0x18, 0xf5, 0x7f, 0x14, + 0xa8, 0xca, 0x1b, 0x82, 0xee, 0xa4, 0x54, 0x8d, 0xbf, 0x32, 0x66, 0x81, 0x52, 0xd1, 0x38, 0xaf, + 0xd2, 0xce, 0x4d, 0x5e, 0xa5, 0x9d, 0x9f, 0xac, 0x4a, 0xfb, 0x1e, 0x54, 0x9f, 0x7b, 0x56, 0x60, + 0x3c, 0xed, 0x61, 0xbd, 0x67, 0x9c, 0x62, 0x8f, 0x5b, 0xb7, 0x4c, 0x33, 0x54, 0x11, 0x24, 0x8f, + 0x08, 0x85, 0xfa, 0x8f, 0x0a, 0x14, 0xc5, 0x34, 0xc6, 0xd6, 0x49, 0x2f, 0x0f, 0x08, 0x9a, 0x4e, + 0x6b, 0x33, 0x6d, 0xc3, 0x76, 0x74, 0x1f, 0x93, 0x1b, 0x76, 0x6c, 0xd5, 0xf1, 0x22, 0xa5, 0xdb, + 0x76, 0x3c, 0xbc, 0x6f, 0xd8, 0x4e, 0x9b, 0x11, 0xa1, 0x26, 0xd4, 0x18, 0x3f, 0xca, 0x8a, 0x30, + 0x1d, 0x6b, 0xd7, 0xab, 0x94, 0x80, 0x30, 0x21, 0xcc, 0x7c, 0xf5, 0xaf, 0xf3, 0x50, 0x8e, 0x48, + 0x66, 0xcc, 0x02, 0xb6, 0x61, 0x41, 0xe4, 0xe2, 0x7d, 0x1c, 0x4c, 0x56, 0x30, 0x3d, 0xcf, 0x29, + 0xda, 0x38, 0x60, 0xf7, 0xc9, 0x5d, 0x98, 0x37, 0x9e, 0x19, 0x56, 0x8f, 0x4a, 0x7d, 0xa2, 0xcb, + 0xa8, 0x1a, 0xe2, 0x87, 0x37, 0x12, 0x5b, 0xf7, 0x44, 0x75, 0xd4, 0x40, 0x71, 0x87, 0x45, 0xdb, + 0xbe, 0xcf, 0xe9, 0xc6, 0x95, 0x52, 0x7b, 0xbe, 0x1f, 0x8e, 0x47, 0x6b, 0x3a, 0x69, 0x99, 0xba, + 0xcf, 0x3f, 0x3f, 0x1d, 0x3d, 0x1e, 0xc1, 0xbd, 0x4f, 0x51, 0x89, 0xc0, 0xfa, 0xc6, 0xc7, 0x8e, + 0xa7, 0x47, 0xe9, 0x67, 0xc7, 0x08, 0x8c, 0x52, 0xb4, 0x42, 0x26, 0xea, 0x87, 0x70, 0x41, 0xc3, + 0x8e, 0x8b, 0xed, 0xf0, 0x9c, 0x3c, 0x72, 0xba, 0x67, 0xb8, 0xe9, 0x2e, 0x42, 0x23, 0x8d, 0x9e, + 0x59, 0xd6, 0xab, 0xaf, 0x41, 0x51, 0xfc, 0xbb, 0x23, 0x34, 0x0b, 0xf9, 0xc3, 0xed, 0x56, 0x6d, + 0x8a, 0xfc, 0x38, 0xda, 0x69, 0xd5, 0x14, 0x54, 0x84, 0x42, 0x7b, 0xfb, 0xb0, 0x55, 0xcb, 0x5d, + 0xed, 0x43, 0x2d, 0xfe, 0x1f, 0x7f, 0xd0, 0x32, 0x9c, 0x6b, 0x69, 0x07, 0xad, 0xe6, 0x83, 0xe6, + 0xe1, 0xde, 0xc1, 0xbe, 0xde, 0xd2, 0xf6, 0x9e, 0x34, 0x0f, 0x77, 0x6b, 0x53, 0x68, 0x1d, 0x2e, + 0x45, 0x3b, 0x1e, 0x1e, 0xb4, 0x0f, 0xf5, 0xc3, 0x03, 0x7d, 0xfb, 0x60, 0xff, 0xb0, 0xb9, 0xb7, + 0xbf, 0xab, 0xd5, 0x14, 0x74, 0x09, 0x2e, 0x44, 0x51, 0xee, 0xed, 0xed, 0xec, 0x69, 0xbb, 0xdb, + 0xe4, 0x77, 0xf3, 0x51, 0x2d, 0x77, 0xf5, 0x03, 0xa8, 0x48, 0xff, 0xb2, 0x87, 0x4c, 0xa9, 0x75, + 0xb0, 0x53, 0x9b, 0x42, 0x15, 0x28, 0x45, 0xf9, 0x14, 0xa1, 0xb0, 0x7f, 0xb0, 0xb3, 0x5b, 0xcb, + 0x21, 0x80, 0x99, 0xc3, 0xa6, 0xf6, 0x60, 0xf7, 0xb0, 0x96, 0xbf, 0xba, 0x15, 0xff, 0x78, 0x05, + 0xa3, 0x05, 0xa8, 0xb4, 0x9b, 0xfb, 0x3b, 0xf7, 0x0e, 0xbe, 0xa5, 0x6b, 0xbb, 0xcd, 0x9d, 0x6f, + 0xd7, 0xa6, 0xd0, 0x22, 0xd4, 0x04, 0x68, 0xff, 0xe0, 0x90, 0x41, 0x95, 0xab, 0x9f, 0xc4, 0x2c, + 0x18, 0x46, 0x4b, 0xb0, 0x10, 0x0e, 0xa9, 0x6f, 0x6b, 0xbb, 0xcd, 0xc3, 0x5d, 0x32, 0x13, 0x09, + 0xac, 0x1d, 0xed, 0xef, 0xef, 0xed, 0x3f, 0xa8, 0x29, 0x84, 0xeb, 0x10, 0xbc, 0xfb, 0xad, 0x3d, + 0x82, 0x9c, 0x93, 0x91, 0x8f, 0xf6, 0xbf, 0xbe, 0x7f, 0xf0, 0xcd, 0xfd, 0x5a, 0x7e, 0xf3, 0x87, + 0x0b, 0xe1, 0x3f, 0x5c, 0x69, 0x63, 0x8f, 0x56, 0x00, 0xed, 0xc0, 0xac, 0xf8, 0x27, 0x5a, 0xd2, + 0x3d, 0x27, 0xff, 0xd3, 0xaf, 0xc6, 0x4a, 0x6a, 0x1f, 0x7f, 0x6d, 0x4c, 0xa1, 0x27, 0xd4, 0xfb, + 0x8f, 0x7c, 0x5e, 0xb9, 0x16, 0xf3, 0xb8, 0x13, 0x5f, 0x71, 0x36, 0xd6, 0x33, 0x30, 0x42, 0xbe, + 0xdf, 0x26, 0xae, 0x7d, 0xf4, 0x7f, 0x0b, 0xa0, 0x75, 0xd9, 0x33, 0x4f, 0xf9, 0xb7, 0x05, 0x0d, + 0x35, 0x0b, 0x25, 0x64, 0xad, 0x43, 0x2d, 0xfe, 0xbf, 0x05, 0x90, 0x14, 0xf0, 0x1e, 0xf1, 0xaf, + 0x0b, 0x1a, 0x5f, 0xc9, 0x46, 0x8a, 0x0e, 0x90, 0xf8, 0x64, 0xfe, 0x72, 0xf6, 0x47, 0xc8, 0x29, + 0x03, 0x8c, 0xfa, 0x52, 0x99, 0x09, 0x47, 0xfe, 0x02, 0x0e, 0xc5, 0xbe, 0x52, 0x4f, 0xf9, 0x78, + 0x56, 0x16, 0x4e, 0xfa, 0x87, 0x93, 0xea, 0x14, 0xfa, 0x13, 0x98, 0x8f, 0x15, 0x71, 0x20, 0x89, + 0x30, 0xbd, 0x36, 0xa5, 0x71, 0x39, 0x13, 0x47, 0xde, 0xd5, 0x68, 0xa1, 0x46, 0x7c, 0x57, 0x53, + 0x0a, 0x40, 0xe2, 0xbb, 0x9a, 0x5a, 0xe7, 0x41, 0x15, 0x51, 0x2a, 0xca, 0x90, 0x15, 0x31, 0xad, + 0x08, 0xa4, 0xb1, 0x9e, 0x81, 0x11, 0x15, 0x48, 0xac, 0x2c, 0x43, 0x16, 0x48, 0x7a, 0xc1, 0x47, + 0xe3, 0x72, 0x26, 0x4e, 0x7c, 0x27, 0x87, 0xe9, 0xe0, 0xe4, 0x4e, 0x26, 0x4a, 0x12, 0x92, 0x3b, + 0x99, 0xcc, 0x26, 0xf3, 0x9d, 0x8c, 0x25, 0x70, 0xd5, 0xcc, 0xd4, 0x54, 0xda, 0x4e, 0xa6, 0xa7, + 0xaf, 0xd4, 0x29, 0xf4, 0x1c, 0xea, 0xa3, 0x92, 0x22, 0xe8, 0xda, 0x19, 0x72, 0x37, 0x8d, 0x37, + 0x27, 0x43, 0x0e, 0x07, 0xc6, 0x80, 0x92, 0xd7, 0x0c, 0x7a, 0x55, 0x16, 0xf7, 0x88, 0x6b, 0xac, + 0xf1, 0xda, 0x38, 0xb4, 0x70, 0x98, 0x07, 0x50, 0x14, 0xe9, 0x16, 0x24, 0x99, 0xc0, 0x58, 0x9a, + 0xa7, 0x71, 0x31, 0xbd, 0x33, 0x64, 0xf4, 0x35, 0x28, 0x10, 0x28, 0x5a, 0x8e, 0xe3, 0x09, 0x06, + 0xf5, 0x64, 0x47, 0x48, 0xdc, 0x84, 0x19, 0x96, 0x47, 0x40, 0x52, 0x20, 0x43, 0xca, 0x73, 0x34, + 0x1a, 0x69, 0x5d, 0x21, 0x8b, 0x16, 0xfb, 0x97, 0x84, 0x3c, 0x2d, 0x80, 0x56, 0xe3, 0xff, 0x55, + 0x48, 0xce, 0x3f, 0x34, 0x5e, 0x19, 0xd9, 0x1f, 0xd5, 0xd9, 0x98, 0xeb, 0xbd, 0x9e, 0xf1, 0x4e, + 0x4a, 0xd3, 0xd9, 0xf4, 0xd7, 0x17, 0xdb, 0xdc, 0xe4, 0xeb, 0x4c, 0xde, 0xdc, 0x91, 0x2f, 0x60, + 0x79, 0x73, 0x47, 0x3f, 0xf2, 0xd8, 0xd1, 0x88, 0x7f, 0xa2, 0xa9, 0x66, 0x7d, 0x26, 0x9c, 0x76, + 0x34, 0x46, 0x7c, 0x7e, 0xac, 0x4e, 0xa1, 0x13, 0x38, 0x97, 0xf2, 0x7d, 0x32, 0x7a, 0x6d, 0xb4, + 0xfd, 0x95, 0x46, 0x79, 0x7d, 0x2c, 0x5e, 0x74, 0xa4, 0x94, 0x58, 0xa0, 0x3c, 0xd2, 0xe8, 0x60, + 0xa4, 0x3c, 0x52, 0x56, 0x50, 0x91, 0x2a, 0x22, 0xb7, 0x21, 0x17, 0xd2, 0x02, 0x64, 0x29, 0x8a, + 0x18, 0xb7, 0x18, 0x9b, 0x7f, 0x95, 0x87, 0x39, 0x16, 0xc3, 0xe5, 0x0e, 0xc8, 0x63, 0x80, 0x61, + 0x3a, 0x04, 0x5d, 0x8a, 0x2f, 0x5b, 0xca, 0x31, 0x35, 0x56, 0x47, 0x75, 0x47, 0x15, 0x3d, 0x92, + 0x66, 0x90, 0x15, 0x3d, 0x99, 0x35, 0x91, 0x15, 0x3d, 0x25, 0x3f, 0xa1, 0x4e, 0xa1, 0x8f, 0xa0, + 0x14, 0x46, 0xb5, 0x91, 0x1c, 0x0f, 0x8f, 0x85, 0xe7, 0x1b, 0x97, 0x46, 0xf4, 0x46, 0x67, 0x17, + 0x09, 0x56, 0xcb, 0xb3, 0x4b, 0x06, 0xc2, 0xe5, 0xd9, 0xa5, 0x45, 0xb9, 0x87, 0xeb, 0x65, 0x61, + 0xaf, 0x94, 0xf5, 0x4a, 0xd1, 0xc5, 0x94, 0xf5, 0xca, 0xf1, 0x32, 0x75, 0xea, 0xde, 0xda, 0x2f, + 0x7f, 0xb7, 0xaa, 0xfc, 0xe6, 0x77, 0xab, 0x53, 0x3f, 0xfc, 0x74, 0x55, 0xf9, 0xe5, 0xa7, 0xab, + 0xca, 0xaf, 0x3f, 0x5d, 0x55, 0x7e, 0xfb, 0xe9, 0xaa, 0xf2, 0x17, 0xff, 0xb5, 0x3a, 0xf5, 0x9d, + 0xdc, 0xb3, 0x77, 0x9e, 0xce, 0xd0, 0x7f, 0x54, 0xfa, 0xee, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, + 0xc1, 0x57, 0xc0, 0x5a, 0x62, 0x56, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -14222,6 +14234,16 @@ func (m *Image) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Pinned { + i-- + if m.Pinned { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } if m.Spec != nil { { size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) @@ -17617,6 +17639,9 @@ func (m *Image) Size() (n int) { l = m.Spec.Size() n += 1 + l + sovApi(uint64(l)) } + if m.Pinned { + n += 2 + } return n } @@ -19512,6 +19537,7 @@ func (this *Image) String() string { `Uid:` + strings.Replace(this.Uid.String(), "Int64Value", "Int64Value", 1) + `,`, `Username:` + fmt.Sprintf("%v", this.Username) + `,`, `Spec:` + strings.Replace(this.Spec.String(), "ImageSpec", "ImageSpec", 1) + `,`, + `Pinned:` + fmt.Sprintf("%v", this.Pinned) + `,`, `}`, }, "") return s @@ -34675,6 +34701,26 @@ func (m *Image) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Pinned", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Pinned = bool(v != 0) default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) diff --git a/vendor/k8s.io/cri-api/pkg/apis/runtime/v1/api.proto b/vendor/k8s.io/cri-api/pkg/apis/runtime/v1/api.proto index 673f64ffb31e9..8f96c97ebc6d5 100644 --- a/vendor/k8s.io/cri-api/pkg/apis/runtime/v1/api.proto +++ b/vendor/k8s.io/cri-api/pkg/apis/runtime/v1/api.proto @@ -1247,6 +1247,10 @@ message Image { string username = 6; // ImageSpec for image which includes annotations ImageSpec spec = 7; + // Recommendation on whether this image should be exempt from garbage collection. + // It must only be treated as a recommendation -- the client can still request that the image be deleted, + // and the runtime must oblige. + bool pinned = 8; } message ListImagesResponse { diff --git a/vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.pb.go b/vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.pb.go index f6d2a668e809a..dd1d1d84e933b 100644 --- a/vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.pb.go +++ b/vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.pb.go @@ -6055,9 +6055,13 @@ type Image struct { // and no user is specified when creating container. Username string `protobuf:"bytes,6,opt,name=username,proto3" json:"username,omitempty"` // ImageSpec for image which includes annotations - Spec *ImageSpec `protobuf:"bytes,7,opt,name=spec,proto3" json:"spec,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_sizecache int32 `json:"-"` + Spec *ImageSpec `protobuf:"bytes,7,opt,name=spec,proto3" json:"spec,omitempty"` + // Recommendation on whether this image should be exempt from garbage collection. + // It must only be treated as a recommendation -- the client can still request that the image be deleted, + // and the runtime must oblige. + Pinned bool `protobuf:"varint,8,opt,name=pinned,proto3" json:"pinned,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Image) Reset() { *m = Image{} } @@ -6141,6 +6145,13 @@ func (m *Image) GetSpec() *ImageSpec { return nil } +func (m *Image) GetPinned() bool { + if m != nil { + return m.Pinned + } + return false +} + type ListImagesResponse struct { // List of images. Images []*Image `protobuf:"bytes,1,rep,name=images,proto3" json:"images,omitempty"` @@ -8061,359 +8072,360 @@ func init() { func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } var fileDescriptor_00212fb1f9d3bf1c = []byte{ - // 5632 bytes of a gzipped FileDescriptorProto + // 5644 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x3c, 0x4b, 0x6c, 0x1b, 0x59, 0x72, 0x6a, 0x92, 0x92, 0xc8, 0xa2, 0x48, 0xd1, 0xcf, 0xb2, 0x45, 0xd3, 0x63, 0xd9, 0x6e, 0x8f, 0xbf, 0x33, 0x96, 0xd7, 0x9a, 0x19, 0xcf, 0x58, 0x9e, 0xb1, 0x2d, 0x4b, 0xb2, 0xcd, 0x5d, 0x5b, 0x62, 0x9a, 0xd2, 0x7c, 0x76, 0x26, 0xe8, 0x6d, 0xb1, 0x9f, 0xa8, 0x1e, 0x93, 0xdd, 0x3d, 0xdd, - 0x4d, 0xdb, 0xda, 0x5c, 0x16, 0x58, 0x60, 0x0f, 0x7b, 0x0a, 0x10, 0x04, 0x01, 0x72, 0xdb, 0xe4, + 0x4d, 0xdb, 0xda, 0x5c, 0x06, 0x58, 0x60, 0x0f, 0x7b, 0x0a, 0x10, 0x04, 0x01, 0x72, 0xdb, 0xe4, 0x90, 0x43, 0x4e, 0x9b, 0x20, 0xa7, 0x9c, 0x12, 0x24, 0xc8, 0x22, 0x1f, 0x24, 0xa7, 0x45, 0x82, - 0xbd, 0x64, 0x26, 0x08, 0xb0, 0x08, 0x10, 0x20, 0xc8, 0x39, 0x87, 0xe0, 0xfd, 0xfa, 0xc7, 0x6e, - 0xb2, 0x69, 0xcf, 0x6f, 0x4f, 0xec, 0x57, 0x5d, 0x55, 0xaf, 0x5e, 0xbd, 0x7a, 0xf5, 0xea, 0xbd, - 0xaa, 0x26, 0x94, 0x34, 0xdb, 0x58, 0xb6, 0x1d, 0xcb, 0xb3, 0x50, 0xcd, 0x19, 0x98, 0x9e, 0xd1, - 0xc7, 0xcb, 0x4f, 0xaf, 0x6b, 0x3d, 0xfb, 0x40, 0x5b, 0x69, 0x5c, 0xed, 0x1a, 0xde, 0xc1, 0x60, - 0x6f, 0xb9, 0x63, 0xf5, 0xaf, 0x75, 0xad, 0xae, 0x75, 0x8d, 0x22, 0xee, 0x0d, 0xf6, 0x69, 0x8b, - 0x36, 0xe8, 0x13, 0x63, 0x20, 0x5f, 0x81, 0xea, 0xfb, 0xd8, 0x71, 0x0d, 0xcb, 0x54, 0xf0, 0x67, - 0x03, 0xec, 0x7a, 0xa8, 0x0e, 0xb3, 0x4f, 0x19, 0xa4, 0x2e, 0x9d, 0x91, 0x2e, 0x95, 0x14, 0xd1, - 0x94, 0xff, 0x44, 0x82, 0x79, 0x1f, 0xd9, 0xb5, 0x2d, 0xd3, 0xc5, 0xe9, 0xd8, 0xe8, 0x2c, 0xcc, - 0x71, 0xe1, 0x54, 0x53, 0xeb, 0xe3, 0x7a, 0x8e, 0xbe, 0x2e, 0x73, 0xd8, 0x96, 0xd6, 0xc7, 0xe8, - 0x22, 0xcc, 0x0b, 0x14, 0xc1, 0x24, 0x4f, 0xb1, 0xaa, 0x1c, 0xcc, 0x7b, 0x43, 0xcb, 0x70, 0x54, - 0x20, 0x6a, 0xb6, 0xe1, 0x23, 0x17, 0x28, 0xf2, 0x11, 0xfe, 0x6a, 0xcd, 0x36, 0x38, 0xbe, 0xfc, - 0x31, 0x94, 0x36, 0xb6, 0xda, 0xeb, 0x96, 0xb9, 0x6f, 0x74, 0x89, 0x88, 0x2e, 0x76, 0x08, 0x4d, - 0x5d, 0x3a, 0x93, 0x27, 0x22, 0xf2, 0x26, 0x6a, 0x40, 0xd1, 0xc5, 0x9a, 0xd3, 0x39, 0xc0, 0x6e, - 0x3d, 0x47, 0x5f, 0xf9, 0x6d, 0x42, 0x65, 0xd9, 0x9e, 0x61, 0x99, 0x6e, 0x3d, 0xcf, 0xa8, 0x78, - 0x53, 0xfe, 0x23, 0x09, 0xca, 0x2d, 0xcb, 0xf1, 0x1e, 0x6b, 0xb6, 0x6d, 0x98, 0x5d, 0x74, 0x03, - 0x8a, 0x54, 0x97, 0x1d, 0xab, 0x47, 0x75, 0x50, 0x5d, 0x69, 0x2c, 0xc7, 0xa7, 0x65, 0xb9, 0xc5, - 0x31, 0x14, 0x1f, 0x17, 0x9d, 0x87, 0x6a, 0xc7, 0x32, 0x3d, 0xcd, 0x30, 0xb1, 0xa3, 0xda, 0x96, - 0xe3, 0x51, 0x15, 0x4d, 0x2b, 0x15, 0x1f, 0x4a, 0x7a, 0x41, 0x27, 0xa1, 0x74, 0x60, 0xb9, 0x1e, - 0xc3, 0xc8, 0x53, 0x8c, 0x22, 0x01, 0xd0, 0x97, 0x8b, 0x30, 0x4b, 0x5f, 0x1a, 0x36, 0x57, 0xc6, - 0x0c, 0x69, 0x36, 0x6d, 0xf9, 0x97, 0x12, 0x4c, 0x3f, 0xb6, 0x06, 0xa6, 0x17, 0xeb, 0x46, 0xf3, - 0x0e, 0xf8, 0x44, 0x85, 0xba, 0xd1, 0xbc, 0x83, 0xa0, 0x1b, 0x82, 0xc1, 0xe6, 0x8a, 0x75, 0x43, - 0x5e, 0x36, 0xa0, 0xe8, 0x60, 0x4d, 0xb7, 0xcc, 0xde, 0x21, 0x15, 0xa1, 0xa8, 0xf8, 0x6d, 0x32, - 0x89, 0x2e, 0xee, 0x19, 0xe6, 0xe0, 0xb9, 0xea, 0xe0, 0x9e, 0xb6, 0x87, 0x7b, 0x54, 0x94, 0xa2, - 0x52, 0xe5, 0x60, 0x85, 0x41, 0xd1, 0x06, 0x94, 0x6d, 0xc7, 0xb2, 0xb5, 0xae, 0x46, 0xf4, 0x58, - 0x9f, 0xa6, 0xaa, 0x92, 0x87, 0x55, 0x45, 0xc5, 0x6e, 0x05, 0x98, 0x4a, 0x98, 0x4c, 0xfe, 0x67, - 0x09, 0xe6, 0x89, 0xf1, 0xb8, 0xb6, 0xd6, 0xc1, 0xdb, 0x74, 0x4a, 0xd0, 0x4d, 0x98, 0x35, 0xb1, - 0xf7, 0xcc, 0x72, 0x9e, 0xf0, 0x09, 0x38, 0x3d, 0xcc, 0xd5, 0xa7, 0x79, 0x6c, 0xe9, 0x58, 0x11, - 0xf8, 0xe8, 0x3a, 0xe4, 0x6d, 0x43, 0xa7, 0x03, 0xce, 0x40, 0x46, 0x70, 0x09, 0x89, 0x61, 0x77, - 0xa8, 0x1e, 0xb2, 0x90, 0x18, 0x76, 0x87, 0x28, 0xd7, 0xd3, 0x9c, 0x2e, 0xf6, 0x54, 0x43, 0xe7, - 0x13, 0x55, 0x64, 0x80, 0xa6, 0x2e, 0xcb, 0x00, 0x4d, 0xd3, 0xbb, 0xf1, 0xe6, 0xfb, 0x5a, 0x6f, - 0x80, 0xd1, 0x02, 0x4c, 0x3f, 0x25, 0x0f, 0x74, 0x24, 0x79, 0x85, 0x35, 0xe4, 0xcf, 0x0b, 0x70, - 0xf2, 0x11, 0x51, 0x66, 0x5b, 0x33, 0xf5, 0x3d, 0xeb, 0x79, 0x1b, 0x77, 0x06, 0x8e, 0xe1, 0x1d, - 0xae, 0x5b, 0xa6, 0x87, 0x9f, 0x7b, 0x68, 0x0b, 0x8e, 0x98, 0xa2, 0x5b, 0x55, 0xd8, 0x2d, 0xe1, - 0x50, 0x5e, 0x39, 0x3b, 0x42, 0x42, 0xa6, 0x3f, 0xa5, 0x66, 0x46, 0x01, 0x2e, 0x7a, 0x18, 0x4c, - 0xaa, 0xe0, 0x96, 0xa3, 0xdc, 0x12, 0xc6, 0xdb, 0xde, 0xa4, 0x92, 0x71, 0x5e, 0x62, 0xd6, 0x05, - 0xa7, 0x77, 0x81, 0x2c, 0x79, 0x55, 0x73, 0xd5, 0x81, 0x8b, 0x1d, 0xaa, 0xb5, 0xf2, 0xca, 0x2b, - 0xc3, 0x5c, 0x02, 0x15, 0x28, 0x25, 0x67, 0x60, 0xae, 0xb9, 0xbb, 0x2e, 0x76, 0xd0, 0x6d, 0xea, - 0x44, 0x08, 0x75, 0xd7, 0xb1, 0x06, 0x76, 0xbd, 0x98, 0x81, 0x1c, 0x28, 0xf9, 0x03, 0x82, 0x4f, - 0x3d, 0x0c, 0x37, 0x54, 0xd5, 0xb1, 0x2c, 0x6f, 0xdf, 0x15, 0xc6, 0x29, 0xc0, 0x0a, 0x85, 0xa2, - 0x6b, 0x70, 0xd4, 0x1d, 0xd8, 0x76, 0x0f, 0xf7, 0xb1, 0xe9, 0x69, 0x3d, 0xd6, 0x9d, 0x5b, 0x9f, - 0x3e, 0x93, 0xbf, 0x94, 0x57, 0x50, 0xf8, 0x15, 0x65, 0xec, 0xa2, 0x25, 0x00, 0xdb, 0x31, 0x9e, - 0x1a, 0x3d, 0xdc, 0xc5, 0x7a, 0x7d, 0x86, 0x32, 0x0d, 0x41, 0xd0, 0x2d, 0xe2, 0x75, 0x3a, 0x1d, - 0xab, 0x6f, 0xd7, 0x4b, 0x69, 0xf3, 0x20, 0x66, 0xb1, 0xe5, 0x58, 0xfb, 0x46, 0x0f, 0x2b, 0x82, - 0x02, 0xbd, 0x07, 0x45, 0xcd, 0xb6, 0x35, 0xa7, 0x6f, 0x39, 0x75, 0xc8, 0x4a, 0xed, 0x93, 0xa0, - 0x37, 0x61, 0x81, 0x73, 0x52, 0x6d, 0xf6, 0x92, 0x2d, 0xeb, 0x59, 0x62, 0x79, 0xf7, 0x72, 0x75, - 0x49, 0x41, 0xfc, 0x3d, 0xa7, 0x25, 0x8b, 0x5c, 0xfe, 0x7b, 0x09, 0xe6, 0x63, 0x3c, 0x51, 0x0b, - 0xe6, 0x04, 0x07, 0xef, 0xd0, 0xc6, 0x7c, 0x79, 0x5d, 0x1d, 0x2b, 0xcc, 0x32, 0xff, 0xdd, 0x39, - 0xb4, 0x31, 0x5d, 0xbf, 0xa2, 0x81, 0xce, 0x41, 0xa5, 0x67, 0x75, 0xb4, 0x1e, 0x75, 0x36, 0x0e, - 0xde, 0xe7, 0xbe, 0x66, 0xce, 0x07, 0x2a, 0x78, 0x5f, 0xbe, 0x0b, 0xe5, 0x10, 0x03, 0x84, 0xa0, - 0xaa, 0xb0, 0x0e, 0x37, 0xf0, 0xbe, 0x36, 0xe8, 0x79, 0xb5, 0x29, 0x54, 0x05, 0xd8, 0x35, 0x3b, - 0xc4, 0xc3, 0x9b, 0x58, 0xaf, 0x49, 0xa8, 0x02, 0xa5, 0x47, 0x82, 0x45, 0x2d, 0x27, 0xff, 0x59, - 0x1e, 0x8e, 0x51, 0xb3, 0x6c, 0x59, 0x3a, 0x5f, 0x33, 0x7c, 0x3b, 0x38, 0x07, 0x95, 0x0e, 0x9d, - 0x5d, 0xd5, 0xd6, 0x1c, 0x6c, 0x7a, 0xdc, 0x1d, 0xce, 0x31, 0x60, 0x8b, 0xc2, 0xd0, 0x87, 0x50, - 0x73, 0xf9, 0x88, 0xd4, 0x0e, 0x5b, 0x63, 0x7c, 0x01, 0x24, 0x8c, 0x7d, 0xc4, 0xc2, 0x54, 0xe6, - 0xdd, 0xa1, 0x95, 0x3a, 0xeb, 0x1e, 0xba, 0x1d, 0xaf, 0xc7, 0xf6, 0x95, 0xf2, 0xca, 0x9b, 0x29, - 0x0c, 0xe3, 0x82, 0x2f, 0xb7, 0x19, 0xd9, 0xa6, 0xe9, 0x39, 0x87, 0x8a, 0x60, 0x82, 0x36, 0xa1, - 0x68, 0x3d, 0xc5, 0xce, 0x01, 0xd6, 0x98, 0x67, 0x29, 0xaf, 0x5c, 0x4e, 0x61, 0xb8, 0x2e, 0xfc, - 0xbd, 0x82, 0x5d, 0x6b, 0xe0, 0x74, 0xb0, 0xab, 0xf8, 0xa4, 0xe8, 0x01, 0x94, 0x1c, 0x01, 0xa6, - 0xae, 0x79, 0x22, 0x3e, 0x01, 0x6d, 0x63, 0x15, 0xe6, 0xc2, 0x82, 0xa2, 0x1a, 0xe4, 0x9f, 0xe0, - 0x43, 0xae, 0x64, 0xf2, 0x18, 0x78, 0x38, 0x36, 0xf3, 0xac, 0xb1, 0x9a, 0x7b, 0x47, 0x92, 0x1d, - 0x40, 0xc1, 0xa8, 0x1f, 0x63, 0x4f, 0xd3, 0x35, 0x4f, 0x43, 0x08, 0x0a, 0x34, 0x80, 0x60, 0x2c, - 0xe8, 0x33, 0xe1, 0x3a, 0xe0, 0x6e, 0xbb, 0xa4, 0x90, 0x47, 0xf4, 0x0a, 0x94, 0x7c, 0x2f, 0xc6, - 0xa3, 0x88, 0x00, 0x40, 0x76, 0x73, 0xcd, 0xf3, 0x70, 0xdf, 0xf6, 0xa8, 0x92, 0x2a, 0x8a, 0x68, - 0xca, 0x7f, 0x3e, 0x0d, 0xb5, 0x21, 0x1b, 0xb9, 0x0b, 0xc5, 0x3e, 0xef, 0x9e, 0x7b, 0xd1, 0x57, - 0x13, 0xb6, 0xf4, 0x21, 0x51, 0x15, 0x9f, 0x8a, 0xec, 0x98, 0xc4, 0x12, 0x43, 0x91, 0x8f, 0xdf, - 0x66, 0x4b, 0xa0, 0xab, 0xea, 0x86, 0x83, 0x3b, 0x9e, 0xe5, 0x1c, 0x72, 0x71, 0xe7, 0x7a, 0x56, - 0x77, 0x43, 0xc0, 0xd0, 0x2a, 0x80, 0x6e, 0xba, 0x2a, 0xb5, 0xf0, 0x2e, 0x9f, 0xd9, 0x93, 0xc3, - 0x42, 0xf8, 0x61, 0x8e, 0x52, 0xd2, 0x4d, 0x97, 0x8b, 0x7f, 0x0f, 0x2a, 0x24, 0x5a, 0x50, 0xfb, - 0x2c, 0x42, 0x61, 0x6e, 0xac, 0xbc, 0x72, 0x2a, 0x69, 0x0c, 0x7e, 0x1c, 0xa3, 0xcc, 0xd9, 0x41, - 0xc3, 0x45, 0xf7, 0x61, 0x86, 0x6e, 0xdb, 0x6e, 0x7d, 0x86, 0x12, 0x2f, 0x8f, 0x52, 0x00, 0xb7, - 0xd0, 0x47, 0x94, 0x80, 0x19, 0x28, 0xa7, 0x46, 0xbb, 0x50, 0xd6, 0x4c, 0xd3, 0xf2, 0x34, 0xb6, - 0x8b, 0xcc, 0x52, 0x66, 0x6f, 0x64, 0x60, 0xb6, 0x16, 0x50, 0x31, 0x8e, 0x61, 0x3e, 0xe8, 0x3d, - 0x98, 0xa6, 0xdb, 0x0c, 0xdf, 0x11, 0x2e, 0x66, 0x5c, 0x44, 0x0a, 0xa3, 0x42, 0xeb, 0x30, 0xfb, - 0xcc, 0x30, 0x75, 0xeb, 0x99, 0xcb, 0xbd, 0x73, 0x82, 0xb1, 0x7f, 0xc0, 0x10, 0x86, 0x58, 0x08, - 0xca, 0xc6, 0x4d, 0x28, 0x87, 0x46, 0x3c, 0x89, 0xa5, 0x37, 0x6e, 0x43, 0x2d, 0x3e, 0xbe, 0x89, - 0x56, 0xca, 0xef, 0xc0, 0x82, 0x32, 0x30, 0x03, 0xd1, 0x44, 0xf0, 0xbe, 0x0a, 0x33, 0xdc, 0x62, - 0x98, 0xd9, 0xca, 0xe3, 0x15, 0xad, 0x70, 0x8a, 0x70, 0x34, 0x7e, 0xa0, 0x99, 0x7a, 0x0f, 0x3b, - 0xbc, 0x5f, 0x11, 0x8d, 0x3f, 0x64, 0x50, 0xf9, 0x3d, 0x38, 0x16, 0xeb, 0x9c, 0x1f, 0x06, 0x5e, - 0x85, 0xaa, 0x6d, 0xe9, 0xaa, 0xcb, 0xc0, 0x24, 0xd6, 0xe1, 0xbe, 0xd5, 0xf6, 0x71, 0x9b, 0x3a, - 0x21, 0x6f, 0x7b, 0x96, 0x3d, 0x2c, 0x7c, 0x36, 0xf2, 0x3a, 0x1c, 0x8f, 0x93, 0xb3, 0xee, 0xe5, - 0x3b, 0xb0, 0xa8, 0xe0, 0xbe, 0xf5, 0x14, 0xbf, 0x28, 0xeb, 0x06, 0xd4, 0x87, 0x19, 0x70, 0xe6, - 0x1f, 0xc1, 0x62, 0x00, 0x6d, 0x7b, 0x9a, 0x37, 0x70, 0x27, 0x62, 0xce, 0x4f, 0x4a, 0x7b, 0x96, - 0xcb, 0xa6, 0xb3, 0xa8, 0x88, 0xa6, 0xbc, 0x08, 0xd3, 0x2d, 0x4b, 0x6f, 0xb6, 0x50, 0x15, 0x72, - 0x86, 0xcd, 0x89, 0x73, 0x86, 0x2d, 0x1b, 0xe1, 0x3e, 0xb7, 0x58, 0xc4, 0xca, 0xba, 0x8e, 0xa3, - 0xa2, 0xdb, 0x50, 0xd5, 0x74, 0xdd, 0x20, 0xe6, 0xa4, 0xf5, 0x54, 0xc3, 0x66, 0x07, 0x9a, 0xf2, - 0xca, 0x62, 0xa2, 0x01, 0x34, 0x5b, 0x4a, 0x25, 0x40, 0x6f, 0xda, 0xae, 0xfc, 0x10, 0x4a, 0x7e, - 0x54, 0x48, 0x62, 0x97, 0x68, 0xd4, 0x97, 0x21, 0x86, 0xf4, 0x8f, 0x47, 0x3b, 0x43, 0x1b, 0x2f, - 0x17, 0xf9, 0x16, 0x80, 0xef, 0x90, 0x45, 0x70, 0x7a, 0x72, 0x04, 0x63, 0x25, 0x84, 0x2e, 0xff, - 0x38, 0xe2, 0xa6, 0x43, 0x4a, 0xd0, 0x7d, 0x25, 0xe8, 0x11, 0xb7, 0x9d, 0x7b, 0x21, 0xb7, 0xfd, - 0x36, 0x4c, 0xbb, 0x9e, 0xe6, 0x61, 0x1e, 0xdd, 0x9f, 0x1d, 0x45, 0x4e, 0x84, 0xc0, 0x0a, 0xc3, - 0x47, 0xa7, 0x00, 0x3a, 0x0e, 0xd6, 0x3c, 0xac, 0xab, 0x1a, 0xdb, 0x63, 0xf2, 0x4a, 0x89, 0x43, - 0xd6, 0x3c, 0xe2, 0x6f, 0xc4, 0x09, 0x25, 0x75, 0x73, 0x4d, 0x99, 0xea, 0xe0, 0xac, 0xe2, 0xfb, - 0xbc, 0x99, 0x8c, 0x3e, 0x8f, 0x33, 0xe0, 0x3e, 0x2f, 0xf0, 0xe8, 0xb3, 0xe3, 0x3d, 0x3a, 0x23, - 0xcd, 0xe2, 0xd1, 0x8b, 0xe3, 0x3d, 0x3a, 0x67, 0x36, 0xda, 0xa3, 0x27, 0xb8, 0x9f, 0x52, 0x92, - 0xfb, 0xf9, 0x26, 0xdd, 0xee, 0xbf, 0x49, 0x50, 0x1f, 0xf6, 0x02, 0xdc, 0xfb, 0xad, 0xc2, 0x8c, - 0x4b, 0x21, 0x59, 0x7c, 0x2f, 0xa7, 0xe5, 0x14, 0xe8, 0x21, 0x14, 0x0c, 0x73, 0xdf, 0xe2, 0x8b, - 0xf6, 0xcd, 0x0c, 0x94, 0xbc, 0xd7, 0xe5, 0xa6, 0xb9, 0x6f, 0x31, 0x6d, 0x52, 0x0e, 0x8d, 0xb7, - 0xa1, 0xe4, 0x83, 0x26, 0x1a, 0xdb, 0x36, 0x2c, 0xc4, 0x6c, 0x9b, 0x1d, 0x48, 0xfd, 0x25, 0x21, - 0x4d, 0xb6, 0x24, 0xe4, 0x1f, 0xe5, 0xc2, 0x4b, 0xf6, 0xbe, 0xd1, 0xf3, 0xb0, 0x33, 0xb4, 0x64, - 0xdf, 0x15, 0xdc, 0xd9, 0x7a, 0xbd, 0x30, 0x96, 0x3b, 0x3b, 0xe3, 0xf1, 0x55, 0xf7, 0x09, 0x54, - 0xa9, 0x51, 0xaa, 0x2e, 0xee, 0xd1, 0xb8, 0x89, 0xc7, 0xd4, 0x6f, 0x8d, 0x62, 0xc3, 0x24, 0x61, - 0xa6, 0xdd, 0xe6, 0x74, 0x4c, 0x83, 0x95, 0x5e, 0x18, 0xd6, 0xb8, 0x0b, 0x68, 0x18, 0x69, 0x22, - 0x9d, 0xb6, 0x89, 0x2f, 0x74, 0xbd, 0xc4, 0x7d, 0x7a, 0x9f, 0x8a, 0x91, 0xc5, 0x56, 0x98, 0xc0, - 0x0a, 0xa7, 0x90, 0xff, 0x3b, 0x0f, 0x10, 0xbc, 0xfc, 0x0d, 0x72, 0x82, 0x77, 0x7d, 0x07, 0xc4, - 0xe2, 0xd1, 0x4b, 0xa3, 0x18, 0x27, 0xba, 0x9e, 0xed, 0xa8, 0xeb, 0x61, 0x91, 0xe9, 0xd5, 0x91, - 0x6c, 0x26, 0x76, 0x3a, 0xb3, 0xdf, 0x36, 0xa7, 0xf3, 0x08, 0x8e, 0xc7, 0x8d, 0x88, 0x7b, 0x9c, - 0x15, 0x98, 0x36, 0x3c, 0xdc, 0x67, 0xf7, 0x9a, 0x89, 0xd7, 0x22, 0x21, 0x22, 0x86, 0x2a, 0xdf, - 0x86, 0xe3, 0xd1, 0xd9, 0x9b, 0x2c, 0x8c, 0x91, 0x95, 0x78, 0x1c, 0x14, 0x38, 0x40, 0x6e, 0x37, - 0x23, 0x2e, 0x9e, 0xe2, 0x94, 0x0c, 0x5f, 0xfe, 0x47, 0x09, 0x8e, 0xc5, 0x5e, 0xa5, 0xb8, 0x0b, - 0x6d, 0x68, 0xc1, 0x33, 0x8f, 0xb9, 0x3a, 0xb6, 0xaf, 0xaf, 0x71, 0xd5, 0xff, 0x36, 0x34, 0xa2, - 0x13, 0x16, 0x51, 0xf3, 0x9d, 0xd8, 0xd2, 0xbf, 0x98, 0x51, 0x74, 0x7f, 0xfd, 0xbf, 0x0f, 0x27, - 0x13, 0xd9, 0x0f, 0xcf, 0x42, 0x7e, 0xa2, 0x59, 0xf8, 0x69, 0x3e, 0xbc, 0x03, 0xac, 0x79, 0x9e, - 0x63, 0xec, 0x0d, 0x3c, 0xfc, 0x55, 0x84, 0x59, 0xdf, 0xf5, 0x3d, 0x01, 0xf3, 0xd7, 0x2b, 0xa3, - 0xe8, 0x03, 0x49, 0x12, 0x7d, 0xc2, 0x47, 0x51, 0x9f, 0x50, 0xa0, 0x0c, 0xdf, 0xce, 0xc8, 0x70, - 0xa4, 0x77, 0xf8, 0x26, 0x17, 0xfd, 0xaf, 0x24, 0x98, 0x8f, 0xcd, 0x13, 0xba, 0x0f, 0xa0, 0xf9, - 0xa2, 0x73, 0xeb, 0xb9, 0x90, 0x6d, 0xa0, 0x4a, 0x88, 0x92, 0xec, 0xb9, 0x2c, 0x8e, 0x4c, 0xdd, - 0x73, 0x13, 0xe2, 0x48, 0x3f, 0x8c, 0xbc, 0x17, 0x1c, 0x9d, 0xd9, 0x65, 0xee, 0xa5, 0x0c, 0x47, - 0x67, 0xc6, 0x41, 0x10, 0xca, 0x3f, 0xcf, 0xc1, 0x42, 0x52, 0x1f, 0xe8, 0x75, 0xc8, 0x77, 0xec, - 0x01, 0x1f, 0x5b, 0x42, 0x1a, 0x65, 0xdd, 0x1e, 0xec, 0xba, 0x5a, 0x17, 0x2b, 0x04, 0x0d, 0xbd, - 0x05, 0x33, 0x7d, 0xdc, 0xb7, 0x9c, 0x43, 0x3e, 0x92, 0x84, 0x0b, 0x8e, 0xc7, 0xf4, 0x3d, 0xa3, - 0xe1, 0xc8, 0xe8, 0x9d, 0x20, 0x18, 0x67, 0x23, 0x58, 0x4a, 0x38, 0x85, 0x30, 0x04, 0x46, 0xe8, - 0x47, 0xe0, 0xef, 0xc0, 0xac, 0xed, 0x58, 0x1d, 0xec, 0xba, 0xfc, 0x46, 0x66, 0x29, 0x31, 0xd3, - 0x43, 0x10, 0x38, 0x25, 0x47, 0x47, 0x77, 0x01, 0xfc, 0x7c, 0x8b, 0xd8, 0xff, 0xce, 0x24, 0x8c, - 0x4f, 0xe0, 0x30, 0x85, 0x85, 0x68, 0xc8, 0xb9, 0x37, 0x59, 0xad, 0xf2, 0x3f, 0x48, 0x30, 0x17, - 0x96, 0x17, 0xbd, 0x02, 0x25, 0xc2, 0xd6, 0xf5, 0xb4, 0xbe, 0xcd, 0xf3, 0x08, 0x01, 0x00, 0xed, - 0xc0, 0x11, 0x9d, 0x5d, 0xa3, 0xaa, 0x86, 0xe9, 0x61, 0x67, 0x5f, 0xeb, 0x88, 0xf0, 0xeb, 0x62, - 0xaa, 0x22, 0x9a, 0x02, 0x93, 0x8d, 0xab, 0xc6, 0x39, 0xf8, 0x60, 0xf4, 0x00, 0xc0, 0xe7, 0x26, - 0x96, 0x75, 0x66, 0x76, 0x21, 0x52, 0xf9, 0x0f, 0x72, 0x70, 0x2c, 0x11, 0x2b, 0xf1, 0x22, 0xf0, - 0x1d, 0x28, 0x3a, 0xcf, 0xd5, 0xbd, 0x43, 0x0f, 0xbb, 0xe9, 0x46, 0xb0, 0x1b, 0xca, 0x0e, 0xcc, - 0x3a, 0xcf, 0xef, 0x11, 0x6c, 0xb4, 0x0a, 0x25, 0xe7, 0xb9, 0x8a, 0x1d, 0xc7, 0x72, 0x84, 0x25, - 0x8f, 0x21, 0x2d, 0x3a, 0xcf, 0x37, 0x29, 0x3a, 0xe9, 0xd5, 0x13, 0xbd, 0x16, 0x32, 0xf5, 0xea, - 0x05, 0xbd, 0x7a, 0x7e, 0xaf, 0xd3, 0x99, 0x7a, 0xf5, 0x78, 0xaf, 0xb2, 0x0d, 0x73, 0x61, 0xe3, - 0x1a, 0x33, 0xcd, 0xf7, 0xa0, 0xc2, 0x8d, 0x4f, 0xed, 0x58, 0x03, 0xd3, 0xcb, 0xa6, 0x9e, 0x39, - 0x4e, 0xb3, 0x4e, 0x48, 0xe4, 0x9f, 0x4b, 0x50, 0x6a, 0xf6, 0xb5, 0x2e, 0x6e, 0xdb, 0xb8, 0x43, - 0xbc, 0x95, 0x41, 0x1a, 0x7c, 0x02, 0x58, 0x03, 0x6d, 0x45, 0xfd, 0x2f, 0xdb, 0x8f, 0x5f, 0x4f, - 0xc8, 0xd0, 0x08, 0x3e, 0x63, 0x9c, 0xee, 0xcb, 0x7a, 0xce, 0x15, 0x28, 0x7e, 0x0f, 0x1f, 0xb2, - 0xb3, 0x4b, 0x46, 0x3a, 0xf9, 0x67, 0x05, 0x58, 0x4c, 0xb9, 0xdb, 0xa6, 0x41, 0xad, 0x3d, 0x50, - 0x6d, 0xec, 0x18, 0x96, 0x2e, 0xd4, 0xdc, 0xb1, 0x07, 0x2d, 0x0a, 0x40, 0x27, 0x81, 0x34, 0xd4, - 0xcf, 0x06, 0x16, 0xdf, 0x0d, 0xf3, 0x4a, 0xb1, 0x63, 0x0f, 0x7e, 0x8b, 0xb4, 0x05, 0xad, 0x7b, - 0xa0, 0x39, 0x98, 0x19, 0x19, 0xa3, 0x6d, 0x53, 0x00, 0xba, 0x0e, 0xc7, 0x98, 0x4b, 0x52, 0x7b, - 0x46, 0xdf, 0x20, 0xcb, 0x31, 0x64, 0x53, 0x79, 0x05, 0xb1, 0x97, 0x8f, 0xc8, 0xbb, 0xa6, 0xc9, - 0xec, 0x47, 0x86, 0x8a, 0x65, 0xf5, 0x55, 0xb7, 0x63, 0x39, 0x58, 0xd5, 0xf4, 0x4f, 0xa9, 0x0d, - 0xe5, 0x95, 0xb2, 0x65, 0xf5, 0xdb, 0x04, 0xb6, 0xa6, 0x7f, 0x8a, 0x4e, 0x43, 0xb9, 0x63, 0x0f, - 0x5c, 0xec, 0xa9, 0xe4, 0x87, 0xde, 0x16, 0x94, 0x14, 0x60, 0xa0, 0x75, 0x7b, 0xe0, 0x86, 0x10, - 0xfa, 0x24, 0x7a, 0x9c, 0x0d, 0x23, 0x3c, 0xc6, 0x7d, 0x9a, 0xfe, 0x3b, 0x18, 0x74, 0xb1, 0xad, - 0x75, 0x31, 0x13, 0x4d, 0x1c, 0xf3, 0x13, 0xd2, 0x7f, 0x0f, 0x39, 0x22, 0x15, 0x53, 0xa9, 0x1e, - 0x84, 0x9b, 0x2e, 0x6a, 0xc1, 0xec, 0xc0, 0x34, 0xf6, 0x0d, 0xac, 0xd7, 0x4b, 0x94, 0xc3, 0x8d, - 0xcc, 0x59, 0x85, 0xe5, 0x5d, 0x46, 0xc8, 0x13, 0x1e, 0x9c, 0x0d, 0x5a, 0x85, 0x06, 0x57, 0x9a, - 0xfb, 0x4c, 0xb3, 0xe3, 0x9a, 0x03, 0xaa, 0x8e, 0xe3, 0x0c, 0xa3, 0xfd, 0x4c, 0xb3, 0xc3, 0xda, - 0x6b, 0xac, 0xc2, 0x5c, 0x98, 0xe9, 0x44, 0x76, 0x75, 0x0f, 0x2a, 0x91, 0xa1, 0x92, 0x99, 0xa7, - 0x0a, 0x72, 0x8d, 0x1f, 0x8a, 0x25, 0x51, 0x24, 0x80, 0xb6, 0xf1, 0x43, 0x9a, 0xc6, 0xa5, 0x92, - 0x51, 0x3e, 0x05, 0x85, 0x35, 0x64, 0x0d, 0x2a, 0x91, 0x6c, 0x29, 0x71, 0x69, 0x34, 0x2d, 0xca, - 0x5d, 0x1a, 0x79, 0x26, 0x30, 0xc7, 0xea, 0x09, 0x09, 0xe8, 0x33, 0x81, 0xd1, 0xfc, 0x1b, 0xcb, - 0x14, 0xd0, 0x67, 0xda, 0x05, 0x7e, 0xca, 0xd3, 0xed, 0x25, 0x85, 0x35, 0x64, 0x1d, 0x60, 0x5d, - 0xb3, 0xb5, 0x3d, 0xa3, 0x67, 0x78, 0x87, 0xe8, 0x32, 0xd4, 0x34, 0x5d, 0x57, 0x3b, 0x02, 0x62, - 0x60, 0x51, 0x04, 0x31, 0xaf, 0xe9, 0xfa, 0x7a, 0x08, 0x8c, 0x5e, 0x83, 0x23, 0xba, 0x63, 0xd9, - 0x51, 0x5c, 0x56, 0x15, 0x51, 0x23, 0x2f, 0xc2, 0xc8, 0xf2, 0xaf, 0x67, 0xe0, 0x54, 0x74, 0xda, - 0xe2, 0x19, 0xe9, 0xbb, 0x30, 0x17, 0xeb, 0x35, 0x25, 0x73, 0x1b, 0x48, 0xab, 0x44, 0x28, 0x62, - 0x19, 0xd6, 0xdc, 0x50, 0x86, 0x35, 0x31, 0xe7, 0x9d, 0xff, 0x52, 0x73, 0xde, 0x85, 0x2f, 0x25, - 0xe7, 0x3d, 0xfd, 0x72, 0x39, 0xef, 0xb9, 0x09, 0x73, 0xde, 0x17, 0xe8, 0x99, 0x56, 0xf4, 0x4e, - 0x77, 0x4c, 0xe6, 0x02, 0x2a, 0x7e, 0x1f, 0xa6, 0xa8, 0xbe, 0x89, 0xe5, 0xc6, 0x67, 0x27, 0xc9, - 0x8d, 0x17, 0x53, 0x73, 0xe3, 0x67, 0x60, 0xce, 0xb4, 0x54, 0x13, 0x3f, 0x53, 0xc9, 0x74, 0xb9, - 0xf5, 0x32, 0x9b, 0x3b, 0xd3, 0xda, 0xc2, 0xcf, 0x5a, 0x04, 0x82, 0xce, 0xc2, 0x5c, 0x5f, 0x73, - 0x9f, 0x60, 0x9d, 0x26, 0xa6, 0xdd, 0x7a, 0x85, 0xda, 0x59, 0x99, 0xc1, 0x5a, 0x04, 0x84, 0xce, - 0x83, 0x2f, 0x07, 0x47, 0xaa, 0x52, 0xa4, 0x8a, 0x80, 0x32, 0xb4, 0x50, 0x9e, 0x7d, 0xfe, 0xa5, - 0xf2, 0xec, 0xb5, 0xc9, 0xf3, 0xec, 0x57, 0xa1, 0x26, 0x9e, 0x45, 0xa2, 0x9d, 0xdd, 0x59, 0xd2, - 0x1c, 0xfb, 0xbc, 0x78, 0x27, 0x92, 0xe9, 0x69, 0x69, 0x79, 0x18, 0x99, 0x96, 0xff, 0x4b, 0x89, - 0xc7, 0xca, 0xfe, 0x52, 0xe3, 0x59, 0xbe, 0x48, 0xca, 0x56, 0x7a, 0xf1, 0x94, 0x2d, 0xfa, 0x7e, - 0x6a, 0xb2, 0xfb, 0xda, 0x38, 0x7e, 0xe3, 0xd2, 0xdd, 0xf2, 0xef, 0x49, 0x70, 0x8a, 0x87, 0xad, - 0x29, 0xa5, 0x2b, 0x09, 0xe6, 0x2a, 0xa5, 0x98, 0x6b, 0xc7, 0xc1, 0x3a, 0x36, 0x3d, 0x43, 0xeb, - 0xa9, 0xae, 0x8d, 0x3b, 0x22, 0x3d, 0x15, 0x80, 0x69, 0x98, 0x72, 0x16, 0xe6, 0x58, 0x25, 0x13, - 0x8f, 0xd4, 0x59, 0xc1, 0x52, 0x99, 0x16, 0x33, 0x31, 0x90, 0x3c, 0x80, 0xc5, 0x94, 0xec, 0x5e, - 0xa2, 0x32, 0xa4, 0x34, 0x65, 0x8c, 0x1c, 0xd9, 0xb0, 0x32, 0x7e, 0x5f, 0x82, 0xd3, 0x9c, 0x24, - 0xd5, 0x6f, 0x7e, 0x13, 0xea, 0xf8, 0x2b, 0xc9, 0x3f, 0x5b, 0xc4, 0x8d, 0xac, 0x39, 0x6c, 0x64, - 0xaf, 0xa5, 0xea, 0x61, 0xb4, 0x99, 0x7d, 0x92, 0x6a, 0x66, 0xd7, 0xc7, 0x73, 0x1c, 0xab, 0xdb, - 0x3f, 0x95, 0xe0, 0x44, 0xaa, 0x18, 0xb1, 0x40, 0x4c, 0x8a, 0x07, 0x62, 0x3c, 0x88, 0x0b, 0xe2, - 0x64, 0x16, 0xc4, 0xd1, 0x20, 0x98, 0x47, 0x4b, 0x6a, 0x5f, 0x7b, 0x6e, 0xf4, 0x07, 0x7d, 0x1e, - 0xc5, 0x11, 0x76, 0x8f, 0x19, 0xe4, 0x05, 0xc2, 0x38, 0x79, 0x0d, 0x8e, 0xf8, 0x52, 0x8e, 0x2c, - 0x74, 0x08, 0x15, 0x2e, 0xe4, 0xa2, 0x85, 0x0b, 0x26, 0xcc, 0x6c, 0xe0, 0xa7, 0x46, 0x07, 0x7f, - 0x29, 0x15, 0x7e, 0x67, 0xa0, 0x6c, 0x63, 0xa7, 0x6f, 0xb8, 0xae, 0xbf, 0x8d, 0x96, 0x94, 0x30, - 0x48, 0xfe, 0xcf, 0x19, 0x98, 0x8f, 0x5b, 0xc7, 0x9d, 0xa1, 0x3a, 0x89, 0x73, 0x23, 0xce, 0xb4, - 0x09, 0x17, 0x41, 0xd7, 0xc5, 0x91, 0x22, 0x97, 0x96, 0x0e, 0xf4, 0x8f, 0x0d, 0xe2, 0xbc, 0x51, - 0x87, 0xd9, 0x8e, 0xd5, 0xef, 0x6b, 0xa6, 0x2e, 0x0a, 0x33, 0x79, 0x93, 0xe8, 0x4f, 0x73, 0xba, - 0xec, 0x0a, 0xa8, 0xa4, 0xd0, 0x67, 0x32, 0x79, 0xe4, 0x24, 0x69, 0x98, 0xb4, 0xde, 0x82, 0x6e, - 0xc5, 0x25, 0x05, 0x38, 0x68, 0xc3, 0x70, 0xd0, 0x32, 0x14, 0xb0, 0xf9, 0x54, 0xdc, 0x25, 0x27, - 0x5c, 0x39, 0x88, 0xc3, 0x84, 0x42, 0xf1, 0xd0, 0x35, 0x98, 0xe9, 0x13, 0xb3, 0x10, 0x59, 0xb4, - 0xc5, 0x94, 0x02, 0x46, 0x85, 0xa3, 0xa1, 0x15, 0x98, 0xd5, 0xe9, 0x3c, 0x89, 0x18, 0xba, 0x9e, - 0x50, 0xc5, 0x41, 0x11, 0x14, 0x81, 0x88, 0x36, 0xfd, 0xfb, 0xb1, 0x52, 0xda, 0x15, 0x77, 0x6c, - 0x2a, 0x12, 0xaf, 0xc6, 0x76, 0xa2, 0x47, 0x33, 0x48, 0xbb, 0x6b, 0x8b, 0xf3, 0x1a, 0x7d, 0x67, - 0x7e, 0x02, 0x8a, 0x3d, 0xab, 0xcb, 0xcc, 0xa8, 0xcc, 0x6a, 0x7e, 0x7b, 0x56, 0x97, 0x5a, 0xd1, - 0x02, 0x4c, 0xbb, 0x9e, 0x6e, 0x98, 0x34, 0x66, 0x29, 0x2a, 0xac, 0x41, 0x16, 0x1f, 0x7d, 0x50, - 0x2d, 0xb3, 0x83, 0xeb, 0x15, 0xfa, 0xaa, 0x44, 0x21, 0xdb, 0x66, 0x87, 0x1e, 0xd2, 0x3c, 0xef, - 0xb0, 0x5e, 0xa5, 0x70, 0xf2, 0x18, 0x5c, 0x50, 0xcd, 0x8f, 0xbc, 0xa0, 0x8a, 0x89, 0x9d, 0x70, - 0x41, 0x55, 0x1b, 0x73, 0x41, 0x15, 0xe7, 0xf0, 0x6d, 0x28, 0xed, 0xf8, 0x1b, 0x09, 0x8e, 0xaf, - 0xd3, 0x9c, 0x49, 0xc8, 0x8f, 0x4d, 0x52, 0x68, 0x70, 0xd3, 0xaf, 0x01, 0x49, 0x4d, 0xde, 0xc7, - 0xc7, 0x2d, 0x4a, 0x40, 0x9a, 0x50, 0x15, 0xcc, 0x39, 0x8b, 0x7c, 0xe6, 0x32, 0x92, 0x8a, 0x1b, - 0x6e, 0xca, 0xef, 0xc2, 0xe2, 0xd0, 0x28, 0xf8, 0x0d, 0xf5, 0x59, 0x98, 0x0b, 0xfc, 0x95, 0x3f, - 0x88, 0xb2, 0x0f, 0x6b, 0xea, 0xf2, 0x2a, 0x1c, 0x6b, 0x7b, 0x9a, 0xe3, 0x0d, 0xa9, 0x20, 0x03, - 0x2d, 0x2d, 0x10, 0x89, 0xd2, 0xf2, 0x1a, 0x8e, 0x36, 0x2c, 0xb4, 0x3d, 0xcb, 0x7e, 0x01, 0xa6, - 0xc4, 0xeb, 0x90, 0xf1, 0x5b, 0x03, 0xb1, 0x3f, 0x88, 0xa6, 0xbc, 0xc8, 0xca, 0x59, 0x86, 0x7b, - 0xbb, 0x05, 0xc7, 0x59, 0x35, 0xc9, 0x8b, 0x0c, 0xe2, 0x84, 0xa8, 0x65, 0x19, 0xe6, 0xfb, 0x18, - 0x8e, 0x46, 0xae, 0x09, 0x79, 0x9e, 0xf6, 0x46, 0x34, 0x4f, 0x3b, 0xee, 0x72, 0xd1, 0x4f, 0xd3, - 0xfe, 0x71, 0x2e, 0xe4, 0xd7, 0x53, 0xd2, 0x2e, 0xb7, 0xa2, 0x59, 0xda, 0xf3, 0xe3, 0x78, 0x47, - 0x92, 0xb4, 0xc3, 0x56, 0x9b, 0x4f, 0xb0, 0xda, 0x8f, 0x87, 0x32, 0x3b, 0x85, 0xb4, 0x5c, 0x78, - 0x4c, 0xda, 0xaf, 0x25, 0xa7, 0xa3, 0xb0, 0x4c, 0xae, 0xdf, 0xb5, 0x9f, 0xce, 0xb9, 0x19, 0x4b, - 0xe7, 0x9c, 0x1d, 0x2b, 0xaf, 0x9f, 0xc8, 0xf9, 0x8b, 0x02, 0x94, 0xfc, 0x77, 0x43, 0x3a, 0x1f, - 0x56, 0x5b, 0x2e, 0x41, 0x6d, 0xe1, 0x1d, 0x38, 0xff, 0x52, 0x3b, 0x70, 0x21, 0xf3, 0x0e, 0x7c, - 0x12, 0x4a, 0xf4, 0x81, 0x96, 0xef, 0xb2, 0x1d, 0xb5, 0x48, 0x01, 0x0a, 0xde, 0x0f, 0xcc, 0x70, - 0x66, 0x22, 0x33, 0x8c, 0xe5, 0x8e, 0x67, 0xe3, 0xb9, 0xe3, 0x3b, 0xfe, 0x8e, 0x58, 0x4c, 0xbb, - 0x5a, 0xf6, 0xf9, 0x26, 0xee, 0x85, 0xb1, 0x6b, 0xca, 0x52, 0xda, 0x35, 0x65, 0xc0, 0xe5, 0x5b, - 0x9b, 0x1b, 0xda, 0x65, 0x09, 0xe1, 0xb0, 0x2d, 0x72, 0xcf, 0x7a, 0x2b, 0x92, 0x65, 0x60, 0x09, - 0xc0, 0x93, 0x23, 0xc6, 0x18, 0x49, 0x30, 0xec, 0xc2, 0xf1, 0xc8, 0xd4, 0x04, 0x05, 0x6e, 0xd9, - 0xfc, 0x63, 0x4a, 0x75, 0xdb, 0xff, 0x4d, 0x87, 0xfc, 0x4b, 0x4a, 0xe1, 0xd6, 0x9d, 0xa1, 0x8c, - 0xe2, 0x84, 0x56, 0x7c, 0x23, 0x5a, 0xb2, 0xf0, 0x82, 0x56, 0x37, 0x54, 0xb1, 0x40, 0x23, 0x17, - 0xcd, 0xe1, 0xaf, 0xd9, 0x55, 0x6b, 0x89, 0x43, 0xd6, 0xe8, 0xc9, 0x60, 0xdf, 0x30, 0x0d, 0xf7, - 0x80, 0xbd, 0x9f, 0x61, 0x27, 0x03, 0x01, 0x5a, 0xa3, 0x57, 0x84, 0xf8, 0xb9, 0xe1, 0xa9, 0x1d, - 0x4b, 0xc7, 0xd4, 0xa6, 0xa7, 0x95, 0x22, 0x01, 0xac, 0x5b, 0x3a, 0x0e, 0x56, 0x5e, 0xf1, 0xc5, - 0x56, 0x5e, 0x29, 0xb6, 0xf2, 0x8e, 0xc3, 0x8c, 0x83, 0x35, 0xd7, 0x32, 0xd9, 0x85, 0x82, 0xc2, - 0x5b, 0x64, 0x6a, 0xfa, 0xd8, 0x75, 0x49, 0x4f, 0x3c, 0x5c, 0xe3, 0xcd, 0x50, 0x98, 0x39, 0x37, - 0x36, 0xcc, 0x1c, 0x51, 0x10, 0x16, 0x0b, 0x33, 0x2b, 0x63, 0xc3, 0xcc, 0x4c, 0xf5, 0x60, 0x41, - 0xa0, 0x5d, 0xcd, 0x16, 0x68, 0x87, 0xe3, 0xd2, 0xf9, 0x48, 0x5c, 0xfa, 0x4d, 0x2e, 0xd6, 0x5f, - 0x4a, 0xb0, 0x38, 0xb4, 0xac, 0xf8, 0x72, 0xbd, 0x19, 0xab, 0x18, 0x3b, 0x3b, 0x56, 0x67, 0x7e, - 0xc1, 0xd8, 0x83, 0x48, 0xc1, 0xd8, 0x1b, 0xe3, 0x09, 0xbf, 0xf4, 0x7a, 0xb1, 0xff, 0xcd, 0xc1, - 0xe9, 0x5d, 0x5b, 0x8f, 0x45, 0x78, 0xfc, 0xd8, 0x9f, 0xdd, 0x71, 0xdc, 0x89, 0x26, 0xa3, 0x27, - 0xb8, 0xc1, 0xe2, 0xe1, 0xfe, 0x66, 0x3c, 0x1f, 0x3d, 0xd1, 0xfd, 0x84, 0xa0, 0x45, 0x7a, 0x52, - 0x19, 0xc1, 0xbd, 0x84, 0x64, 0xd9, 0xe8, 0x21, 0x7f, 0xc5, 0xc9, 0x2d, 0x19, 0xce, 0xa4, 0x0b, - 0xc0, 0xe3, 0xc3, 0x1f, 0xc0, 0xfc, 0xe6, 0x73, 0xdc, 0x69, 0x1f, 0x9a, 0x9d, 0x09, 0xe6, 0xa1, - 0x06, 0xf9, 0x4e, 0x5f, 0xe7, 0x17, 0xfe, 0xe4, 0x31, 0x1c, 0xf2, 0xe6, 0xa3, 0x21, 0xaf, 0x0a, - 0xb5, 0xa0, 0x07, 0x6e, 0xcb, 0xc7, 0x89, 0x2d, 0xeb, 0x04, 0x99, 0x30, 0x9f, 0x53, 0x78, 0x8b, - 0xc3, 0xb1, 0xc3, 0x8a, 0xc9, 0x19, 0x1c, 0x3b, 0x4e, 0xd4, 0x35, 0xe6, 0xa3, 0xae, 0x51, 0xfe, - 0x43, 0x09, 0xca, 0xa4, 0x87, 0x97, 0x92, 0x9f, 0x9f, 0x2b, 0xf3, 0xc1, 0xb9, 0xd2, 0x3f, 0x9e, - 0x16, 0xc2, 0xc7, 0xd3, 0x40, 0xf2, 0x69, 0x0a, 0x1e, 0x96, 0x7c, 0xc6, 0x87, 0x63, 0xc7, 0x91, - 0xcf, 0xc0, 0x1c, 0x93, 0x8d, 0x8f, 0xbc, 0x06, 0xf9, 0x81, 0xd3, 0x13, 0xf3, 0x37, 0x70, 0x7a, - 0xf2, 0x4f, 0x25, 0xa8, 0xac, 0x79, 0x9e, 0xd6, 0x39, 0x98, 0x60, 0x00, 0xbe, 0x70, 0xb9, 0xb0, - 0x70, 0xc3, 0x83, 0x08, 0xc4, 0x2d, 0xa4, 0x88, 0x3b, 0x1d, 0x11, 0x57, 0x86, 0xaa, 0x90, 0x25, - 0x55, 0xe0, 0x2d, 0x40, 0x2d, 0xcb, 0xf1, 0xee, 0x5b, 0xce, 0x33, 0xcd, 0xd1, 0x27, 0x3b, 0x6e, - 0x22, 0x28, 0xf0, 0x8f, 0x57, 0xf3, 0x97, 0xa6, 0x15, 0xfa, 0x2c, 0x5f, 0x84, 0xa3, 0x11, 0x7e, - 0xa9, 0x1d, 0xdf, 0x85, 0x32, 0xdd, 0xe4, 0xf8, 0xb9, 0xe3, 0x7a, 0x38, 0xc3, 0x9c, 0x69, 0x4b, - 0x94, 0xbf, 0x0b, 0x47, 0x48, 0x30, 0x44, 0xe1, 0xbe, 0xdf, 0x79, 0x2b, 0x16, 0x94, 0x9f, 0x4a, - 0x61, 0x14, 0x0b, 0xc8, 0x7f, 0x2d, 0xc1, 0x34, 0x85, 0x0f, 0x05, 0x28, 0x27, 0xa1, 0xe4, 0x60, - 0xdb, 0x52, 0x3d, 0xad, 0xeb, 0x7f, 0x2a, 0x4c, 0x00, 0x3b, 0x5a, 0x97, 0x26, 0x33, 0xe8, 0x4b, - 0xdd, 0xe8, 0x62, 0xd7, 0x13, 0xdf, 0x0b, 0x97, 0x09, 0x6c, 0x83, 0x81, 0x88, 0x92, 0x68, 0x9a, - 0xb0, 0x40, 0xb3, 0x81, 0xf4, 0x19, 0x2d, 0xb3, 0x6f, 0x98, 0xb2, 0x64, 0x87, 0xe8, 0x17, 0x4e, - 0x0d, 0x28, 0xc6, 0x12, 0x3a, 0x7e, 0x1b, 0x5d, 0x83, 0x02, 0xbd, 0x02, 0x9e, 0x1d, 0xaf, 0x37, - 0x8a, 0x28, 0x6f, 0x02, 0x0a, 0xab, 0x8d, 0x4f, 0xd0, 0x35, 0x98, 0xa1, 0x5a, 0x15, 0xb1, 0xe3, - 0x62, 0x0a, 0x23, 0x85, 0xa3, 0xc9, 0x1a, 0x20, 0xc6, 0x39, 0x12, 0x2f, 0x4e, 0x3e, 0x8d, 0x23, - 0xe2, 0xc7, 0xbf, 0x96, 0xe0, 0x68, 0xa4, 0x0f, 0x2e, 0xeb, 0xd5, 0x68, 0x27, 0xa9, 0xa2, 0xf2, - 0x0e, 0xd6, 0x23, 0x1b, 0xe6, 0xb5, 0x34, 0x91, 0xbe, 0xa2, 0xcd, 0xf2, 0x9f, 0x24, 0x80, 0xb5, - 0x81, 0x77, 0xc0, 0xef, 0x4d, 0xc3, 0x53, 0x29, 0xc5, 0xa6, 0xb2, 0x01, 0x45, 0x5b, 0x73, 0xdd, - 0x67, 0x96, 0x23, 0x4e, 0x7c, 0x7e, 0x9b, 0xde, 0x70, 0x0e, 0xbc, 0x03, 0x91, 0x06, 0x26, 0xcf, - 0xe8, 0x3c, 0x54, 0xd9, 0xf7, 0xec, 0xaa, 0xa6, 0xeb, 0x8e, 0x28, 0x4d, 0x2a, 0x29, 0x15, 0x06, - 0x5d, 0x63, 0x40, 0x82, 0x66, 0xd0, 0xb4, 0x80, 0x77, 0xa8, 0x7a, 0xd6, 0x13, 0x6c, 0xf2, 0x93, - 0x5b, 0x45, 0x40, 0x77, 0x08, 0x90, 0x65, 0xdd, 0xba, 0x86, 0xeb, 0x39, 0x02, 0x4d, 0xe4, 0x0e, - 0x39, 0x94, 0xa2, 0x91, 0x49, 0xa9, 0xb5, 0x06, 0xbd, 0x1e, 0x53, 0xf1, 0x8b, 0x4f, 0xfb, 0x77, - 0xf8, 0x80, 0x72, 0x69, 0x8b, 0x20, 0x50, 0x1a, 0x1f, 0xee, 0x97, 0x78, 0x45, 0xf5, 0x1d, 0x38, - 0x12, 0x1a, 0x03, 0x37, 0xab, 0x48, 0x88, 0x2d, 0x45, 0x43, 0x6c, 0xf9, 0x01, 0x20, 0x76, 0x2b, - 0xf3, 0x92, 0xe3, 0x96, 0x8f, 0xc1, 0xd1, 0x08, 0x23, 0xbe, 0x75, 0x5f, 0x81, 0x0a, 0x2f, 0x7d, - 0xe2, 0x86, 0x72, 0x02, 0x8a, 0xc4, 0x05, 0x77, 0x0c, 0x5d, 0xd4, 0x08, 0xcc, 0xda, 0x96, 0xbe, - 0x6e, 0xe8, 0x8e, 0xfc, 0x01, 0x54, 0xf8, 0x47, 0xb1, 0x1c, 0xf7, 0x3e, 0x54, 0x79, 0x9d, 0x9a, - 0x1a, 0xf9, 0x06, 0xec, 0x74, 0x6a, 0x15, 0x96, 0x50, 0x8b, 0x19, 0x6e, 0xca, 0x3a, 0x34, 0x58, - 0x8c, 0x11, 0x61, 0x2f, 0x06, 0x7b, 0x1f, 0x44, 0x69, 0xf4, 0xd8, 0x5e, 0xa2, 0xf4, 0x15, 0x27, - 0xdc, 0x94, 0x4f, 0xc1, 0xc9, 0xc4, 0x5e, 0xb8, 0x26, 0x6c, 0xa8, 0x05, 0x2f, 0xd8, 0x87, 0x4a, - 0x7e, 0x11, 0x84, 0x14, 0x2a, 0x82, 0x38, 0xee, 0x87, 0xd0, 0x39, 0xb1, 0xeb, 0xd1, 0xf8, 0x38, - 0x38, 0x0c, 0xe5, 0xd3, 0x0e, 0x43, 0x85, 0xc8, 0x61, 0x48, 0x6e, 0xfb, 0xfa, 0xe4, 0x87, 0xd4, - 0x7b, 0xf4, 0x30, 0xcd, 0xfa, 0x16, 0x0e, 0x51, 0x1e, 0x35, 0x4a, 0x86, 0xaa, 0x84, 0xa8, 0xe4, - 0xcb, 0x50, 0x89, 0xba, 0xc6, 0x90, 0x9f, 0x93, 0x86, 0xfc, 0x5c, 0x35, 0xe6, 0xe2, 0xde, 0x8e, - 0x9d, 0x0f, 0xd2, 0x75, 0x1c, 0x3b, 0x1d, 0xdc, 0x8e, 0x38, 0xbb, 0x2b, 0x09, 0x39, 0xed, 0xaf, - 0xc8, 0xcf, 0x2d, 0xf0, 0xfd, 0xe0, 0xbe, 0x4b, 0xe8, 0xf9, 0xa0, 0xe5, 0x73, 0x50, 0xde, 0x4d, - 0xfb, 0x8b, 0x83, 0x82, 0xa8, 0xc1, 0xba, 0x01, 0x0b, 0xf7, 0x8d, 0x1e, 0x76, 0x0f, 0x5d, 0x0f, - 0xf7, 0x9b, 0xd4, 0x29, 0xed, 0x1b, 0xd8, 0x41, 0x4b, 0x00, 0xf4, 0x80, 0x67, 0x5b, 0x86, 0xff, - 0xb1, 0x76, 0x08, 0x22, 0xff, 0x97, 0x04, 0xf3, 0x01, 0x61, 0x96, 0xca, 0xb8, 0x5b, 0x30, 0xbd, - 0xef, 0x8a, 0x0b, 0xb5, 0xc4, 0xf4, 0x42, 0x92, 0x20, 0x4a, 0x61, 0xdf, 0x6d, 0xea, 0xe8, 0x5d, - 0x80, 0x81, 0x8b, 0x75, 0x9e, 0xe1, 0xcb, 0x54, 0x37, 0x58, 0x22, 0x04, 0xac, 0x7c, 0xeb, 0x36, - 0x94, 0x0d, 0xd3, 0xd2, 0x31, 0xcd, 0xee, 0xea, 0xd9, 0x6a, 0x07, 0x81, 0x51, 0xec, 0xba, 0x58, - 0x97, 0x31, 0xdf, 0x0b, 0x85, 0x7e, 0xb9, 0xa1, 0x6c, 0xc1, 0x11, 0xe6, 0xb4, 0xf6, 0x7d, 0xc1, - 0x47, 0xd4, 0x7f, 0xc7, 0xb4, 0xa5, 0xd4, 0x0c, 0x1e, 0x0b, 0x09, 0x52, 0x79, 0x15, 0x8e, 0xc5, - 0x2a, 0x51, 0xb3, 0xdf, 0x5c, 0xb7, 0x62, 0xd7, 0x48, 0x81, 0x39, 0xdf, 0x88, 0x7e, 0x1f, 0x30, - 0xbe, 0xfc, 0x95, 0x17, 0xa6, 0x7f, 0x0c, 0x27, 0x22, 0xf7, 0x5d, 0x11, 0x89, 0x6e, 0xc7, 0x42, - 0xbd, 0x0b, 0xe3, 0xb8, 0xc6, 0x62, 0xbe, 0xff, 0x91, 0x60, 0x21, 0x09, 0xe1, 0x05, 0xef, 0x63, - 0x7f, 0x90, 0xf2, 0x45, 0xd2, 0xcd, 0x6c, 0x62, 0x7d, 0x2d, 0x77, 0xd9, 0x3b, 0xec, 0xfb, 0x84, - 0xf1, 0xb3, 0x94, 0x9f, 0x64, 0x96, 0x7e, 0x92, 0x0f, 0xe5, 0x25, 0x46, 0x7c, 0x3d, 0xf0, 0xd2, - 0x77, 0x7d, 0xcd, 0xd8, 0xc7, 0x03, 0xd7, 0x47, 0x90, 0x8f, 0xf9, 0x76, 0xe0, 0xc3, 0xa4, 0x43, - 0xff, 0x8d, 0x6c, 0xfc, 0xbe, 0xb5, 0xd7, 0xc3, 0x3f, 0xc9, 0x41, 0x35, 0x3a, 0x45, 0x68, 0x33, - 0xe1, 0xcb, 0x81, 0xf3, 0x99, 0x86, 0x19, 0xf9, 0x70, 0x80, 0x57, 0xe7, 0xe7, 0x26, 0xad, 0xce, - 0xcf, 0x4f, 0x52, 0x9d, 0xff, 0x10, 0xaa, 0xcf, 0x1c, 0xc3, 0xd3, 0xf6, 0x7a, 0x58, 0xed, 0x69, - 0x87, 0xd8, 0xe1, 0x5e, 0x32, 0x83, 0x23, 0xab, 0x08, 0xc2, 0x47, 0x84, 0x4e, 0xfe, 0x3b, 0x09, - 0x8a, 0x42, 0xa4, 0xb1, 0x35, 0xf1, 0x8b, 0x03, 0x82, 0xa6, 0xd2, 0xba, 0x5a, 0x53, 0x33, 0x2d, - 0xd5, 0xc5, 0x64, 0x1f, 0xcf, 0x58, 0x55, 0xbe, 0x40, 0xa9, 0xd7, 0x2d, 0x07, 0x6f, 0x69, 0xa6, - 0xd5, 0x66, 0xa4, 0xe8, 0x01, 0xd4, 0x18, 0x57, 0xca, 0x90, 0xb0, 0xce, 0xb8, 0x63, 0x54, 0x29, - 0x19, 0x61, 0x45, 0x58, 0xba, 0xf2, 0xdf, 0xe6, 0xa1, 0x1c, 0xd2, 0xd5, 0x98, 0xc1, 0x34, 0xe1, - 0x88, 0xa8, 0x79, 0x70, 0xb1, 0x37, 0x49, 0x71, 0xfc, 0x3c, 0xa7, 0x6b, 0x63, 0x8f, 0xed, 0x57, - 0xf7, 0x61, 0x5e, 0x7b, 0xaa, 0x19, 0x3d, 0x3a, 0x1b, 0x13, 0x6c, 0x79, 0x55, 0x9f, 0xca, 0xdf, - 0xf7, 0x98, 0x26, 0x26, 0xa8, 0x99, 0x07, 0x4a, 0x11, 0x14, 0xeb, 0xbb, 0x2e, 0xa7, 0xce, 0x56, - 0x36, 0xef, 0xb8, 0xae, 0xdf, 0x37, 0xad, 0xd3, 0xa5, 0x1f, 0x2c, 0xb8, 0xfc, 0xe3, 0xe9, 0x71, - 0x7d, 0x13, 0x8a, 0xfb, 0x94, 0x80, 0xa8, 0xb3, 0xaf, 0x7d, 0x6a, 0x39, 0x6a, 0x98, 0xcb, 0x6c, - 0x26, 0x75, 0x52, 0xba, 0x96, 0xcf, 0x4a, 0xbe, 0x0d, 0x27, 0x14, 0x6c, 0xd9, 0xd8, 0xf4, 0x57, - 0xda, 0x23, 0xab, 0x3b, 0xc1, 0xde, 0xfa, 0x0a, 0x34, 0x92, 0xe8, 0x99, 0xe7, 0xbe, 0x72, 0x01, - 0x8a, 0xe2, 0x6f, 0xc6, 0xd0, 0x2c, 0xe4, 0x77, 0xd6, 0x5b, 0xb5, 0x29, 0xf2, 0xb0, 0xbb, 0xd1, - 0xaa, 0x49, 0xa8, 0x08, 0x85, 0xf6, 0xfa, 0x4e, 0xab, 0x96, 0xbb, 0xd2, 0x87, 0x5a, 0xfc, 0x3f, - 0xb6, 0xd0, 0x22, 0x1c, 0x6d, 0x29, 0xdb, 0xad, 0xb5, 0x07, 0x6b, 0x3b, 0xcd, 0xed, 0x2d, 0xb5, - 0xa5, 0x34, 0xdf, 0x5f, 0xdb, 0xd9, 0xac, 0x4d, 0xa1, 0xb3, 0x70, 0x2a, 0xfc, 0xe2, 0xe1, 0x76, - 0x7b, 0x47, 0xdd, 0xd9, 0x56, 0xd7, 0xb7, 0xb7, 0x76, 0xd6, 0x9a, 0x5b, 0x9b, 0x4a, 0x4d, 0x42, - 0xa7, 0xe0, 0x44, 0x18, 0xe5, 0x5e, 0x73, 0xa3, 0xa9, 0x6c, 0xae, 0x93, 0xe7, 0xb5, 0x47, 0xb5, - 0xdc, 0x95, 0xf7, 0xa0, 0x12, 0xf9, 0x4b, 0x2c, 0x22, 0x52, 0x6b, 0x7b, 0xa3, 0x36, 0x85, 0x2a, - 0x50, 0x0a, 0xf3, 0x29, 0x42, 0x61, 0x6b, 0x7b, 0x63, 0xb3, 0x96, 0x43, 0x00, 0x33, 0x3b, 0x6b, - 0xca, 0x83, 0xcd, 0x9d, 0x5a, 0xfe, 0xca, 0x6a, 0xfc, 0x43, 0x28, 0x8c, 0x8e, 0x40, 0xa5, 0xbd, - 0xb6, 0xb5, 0x71, 0x6f, 0xfb, 0x43, 0x55, 0xd9, 0x5c, 0xdb, 0xf8, 0xa8, 0x36, 0x85, 0x16, 0xa0, - 0x26, 0x40, 0x5b, 0xdb, 0x3b, 0x0c, 0x2a, 0x5d, 0x79, 0x12, 0xf3, 0x84, 0x18, 0x1d, 0x83, 0x23, - 0x7e, 0x97, 0xea, 0xba, 0xb2, 0xb9, 0xb6, 0xb3, 0x49, 0x24, 0x89, 0x80, 0x95, 0xdd, 0xad, 0xad, - 0xe6, 0xd6, 0x83, 0x9a, 0x44, 0xb8, 0x06, 0xe0, 0xcd, 0x0f, 0x9b, 0x04, 0x39, 0x17, 0x45, 0xde, - 0xdd, 0xfa, 0xde, 0xd6, 0xf6, 0x07, 0x5b, 0xb5, 0xfc, 0xca, 0xcf, 0x8e, 0xfa, 0x7f, 0x53, 0xd4, - 0xc6, 0x0e, 0xad, 0xcc, 0x6a, 0xc1, 0xac, 0xf8, 0x0b, 0xbb, 0x84, 0x7d, 0x34, 0xfa, 0xc7, 0x7b, - 0x8d, 0xb3, 0x23, 0x30, 0xf8, 0xa9, 0x68, 0x0a, 0xed, 0xd1, 0x53, 0x4a, 0xe8, 0xf3, 0xdf, 0x0b, - 0x89, 0x67, 0x82, 0xa1, 0x2f, 0x8e, 0x1b, 0x17, 0xc7, 0xe2, 0xf9, 0x7d, 0x60, 0x72, 0x10, 0x09, - 0xff, 0xc3, 0x06, 0xba, 0x98, 0x74, 0x82, 0x48, 0xf8, 0x0b, 0x8f, 0xc6, 0xa5, 0xf1, 0x88, 0x7e, - 0x37, 0x4f, 0xa0, 0x16, 0xff, 0xb7, 0x0d, 0x94, 0x70, 0xfd, 0x9f, 0xf2, 0x97, 0x1e, 0x8d, 0x2b, - 0x59, 0x50, 0xc3, 0x9d, 0x0d, 0xfd, 0x7d, 0xc4, 0xe5, 0x2c, 0x9f, 0xd9, 0xa7, 0x76, 0x96, 0xf6, - 0x45, 0x3e, 0x53, 0x60, 0xf4, 0x0b, 0x4d, 0x94, 0xf8, 0x5f, 0x0d, 0x09, 0x1f, 0x86, 0x27, 0x29, - 0x30, 0xf9, 0xe3, 0x5f, 0x79, 0x0a, 0x1d, 0xc0, 0x7c, 0xac, 0xc4, 0x06, 0x25, 0x90, 0x27, 0xd7, - 0x12, 0x35, 0x2e, 0x67, 0xc0, 0x8c, 0x5a, 0x44, 0xb8, 0xa4, 0x26, 0xd9, 0x22, 0x12, 0x0a, 0x76, - 0x92, 0x2d, 0x22, 0xb1, 0x3a, 0x87, 0x1a, 0x77, 0xa4, 0x94, 0x26, 0xc9, 0xb8, 0x93, 0x0a, 0x78, - 0x1a, 0x17, 0xc7, 0xe2, 0x85, 0x95, 0x16, 0x2b, 0xac, 0x49, 0x52, 0x5a, 0x72, 0xe1, 0x4e, 0xe3, - 0x72, 0x06, 0xcc, 0xb8, 0x15, 0x04, 0x69, 0xfa, 0x34, 0x2b, 0x18, 0x2a, 0x2a, 0x49, 0xb3, 0x82, - 0xe1, 0x8c, 0x3f, 0xb7, 0x82, 0x58, 0x7a, 0xfd, 0x52, 0x86, 0x74, 0x60, 0xba, 0x15, 0x24, 0x27, - 0x0e, 0xe5, 0x29, 0xf4, 0x63, 0x09, 0xea, 0x69, 0xd9, 0x27, 0x74, 0x7d, 0xe2, 0x54, 0x59, 0x63, - 0x65, 0x12, 0x12, 0x5f, 0x8a, 0xcf, 0x00, 0x0d, 0xef, 0x81, 0xe8, 0xb5, 0xa4, 0x99, 0x49, 0xd9, - 0x69, 0x1b, 0xaf, 0x67, 0x43, 0xf6, 0xbb, 0x6c, 0x43, 0x51, 0xe4, 0xbb, 0x50, 0x82, 0x97, 0x8e, - 0x65, 0xdb, 0x1a, 0xf2, 0x28, 0x14, 0x9f, 0xe9, 0x03, 0x28, 0x10, 0x28, 0x3a, 0x95, 0x8c, 0x2d, - 0x98, 0x2d, 0xa5, 0xbd, 0xf6, 0x19, 0x3d, 0x86, 0x19, 0x96, 0xe0, 0x41, 0x09, 0xf7, 0x43, 0x91, - 0x34, 0x54, 0xe3, 0x4c, 0x3a, 0x82, 0xcf, 0xee, 0x13, 0xf6, 0xef, 0xa6, 0x3c, 0x77, 0x83, 0x5e, - 0x4d, 0xfe, 0xd3, 0xb0, 0x68, 0xaa, 0xa8, 0x71, 0x7e, 0x0c, 0x56, 0x78, 0x51, 0xc4, 0xce, 0x26, - 0x17, 0xc7, 0x1e, 0x30, 0xd3, 0x17, 0x45, 0xf2, 0x11, 0x96, 0x19, 0xc9, 0xf0, 0x11, 0x37, 0xc9, - 0x48, 0x52, 0x2f, 0x16, 0x92, 0x8c, 0x24, 0xfd, 0xd4, 0xcc, 0xd6, 0x61, 0xfc, 0x6b, 0xe6, 0x4b, - 0xe3, 0xbf, 0xbd, 0x4f, 0x5f, 0x87, 0x29, 0xdf, 0xf7, 0xcb, 0x53, 0xc8, 0x83, 0xa3, 0x09, 0x7f, - 0x00, 0x80, 0x5e, 0x1f, 0xb7, 0x75, 0x44, 0x7a, 0xbc, 0x9a, 0x11, 0x3b, 0xdc, 0x6b, 0xc2, 0x85, - 0x6d, 0x52, 0xaf, 0xe9, 0xb7, 0xc7, 0x49, 0xbd, 0x8e, 0xba, 0x05, 0xa6, 0xc6, 0xcd, 0x9d, 0xda, - 0xe9, 0xf4, 0x5b, 0xcc, 0x54, 0xe3, 0x8e, 0xbb, 0xb0, 0x95, 0x5f, 0xe5, 0x61, 0x8e, 0x5d, 0xc6, - 0xf3, 0x08, 0xed, 0x23, 0x80, 0x20, 0x0f, 0x86, 0xce, 0x25, 0x2b, 0x25, 0x92, 0x5c, 0x6c, 0xbc, - 0x3a, 0x1a, 0x29, 0xbc, 0x90, 0x42, 0x39, 0xa5, 0xa4, 0x85, 0x34, 0x9c, 0x3a, 0x4b, 0x5a, 0x48, - 0x09, 0x89, 0x29, 0x79, 0x0a, 0xbd, 0x0f, 0x25, 0x3f, 0x79, 0x81, 0x92, 0x92, 0x1f, 0xb1, 0xec, - 0x4c, 0xe3, 0xdc, 0x48, 0x9c, 0xb0, 0xd4, 0xa1, 0xcc, 0x44, 0x92, 0xd4, 0xc3, 0x19, 0x90, 0x24, - 0xa9, 0x93, 0xd2, 0x1b, 0x81, 0x4e, 0xd8, 0xfd, 0x65, 0xaa, 0x4e, 0x22, 0xd7, 0xc7, 0xa9, 0x3a, - 0x89, 0x5e, 0x82, 0xca, 0x53, 0xf7, 0x2e, 0xfc, 0xe2, 0xf3, 0x25, 0xe9, 0x5f, 0x3f, 0x5f, 0x9a, - 0xfa, 0xd1, 0x17, 0x4b, 0xd2, 0x2f, 0xbe, 0x58, 0x92, 0xfe, 0xe5, 0x8b, 0x25, 0xe9, 0xdf, 0xbf, - 0x58, 0x92, 0x7e, 0xf7, 0x3f, 0x96, 0xa6, 0xbe, 0x5f, 0x14, 0xd4, 0x7b, 0x33, 0xf4, 0x3f, 0x98, - 0xdf, 0xf8, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2a, 0xb2, 0xfb, 0xb6, 0x49, 0x5b, 0x00, 0x00, + 0xbd, 0x64, 0x26, 0x08, 0x10, 0x04, 0x08, 0x10, 0xe4, 0x9c, 0x43, 0xf0, 0x7e, 0xfd, 0x63, 0x37, + 0xd9, 0xb4, 0xe7, 0x97, 0x13, 0xfb, 0x55, 0x57, 0xd5, 0xab, 0x57, 0xaf, 0x5e, 0xbd, 0x7a, 0xaf, + 0xaa, 0x09, 0x25, 0xcd, 0x36, 0x96, 0x6d, 0xc7, 0xf2, 0x2c, 0x54, 0x73, 0x06, 0xa6, 0x67, 0xf4, + 0xf1, 0xf2, 0xd3, 0xeb, 0x5a, 0xcf, 0x3e, 0xd0, 0x56, 0x1a, 0x57, 0xbb, 0x86, 0x77, 0x30, 0xd8, + 0x5b, 0xee, 0x58, 0xfd, 0x6b, 0x5d, 0xab, 0x6b, 0x5d, 0xa3, 0x88, 0x7b, 0x83, 0x7d, 0xda, 0xa2, + 0x0d, 0xfa, 0xc4, 0x18, 0xc8, 0x57, 0xa0, 0xfa, 0x3e, 0x76, 0x5c, 0xc3, 0x32, 0x15, 0xfc, 0xd9, + 0x00, 0xbb, 0x1e, 0xaa, 0xc3, 0xec, 0x53, 0x06, 0xa9, 0x4b, 0x67, 0xa4, 0x4b, 0x25, 0x45, 0x34, + 0xe5, 0x3f, 0x92, 0x60, 0xde, 0x47, 0x76, 0x6d, 0xcb, 0x74, 0x71, 0x3a, 0x36, 0x3a, 0x0b, 0x73, + 0x5c, 0x38, 0xd5, 0xd4, 0xfa, 0xb8, 0x9e, 0xa3, 0xaf, 0xcb, 0x1c, 0xb6, 0xa5, 0xf5, 0x31, 0xba, + 0x08, 0xf3, 0x02, 0x45, 0x30, 0xc9, 0x53, 0xac, 0x2a, 0x07, 0xf3, 0xde, 0xd0, 0x32, 0x1c, 0x15, + 0x88, 0x9a, 0x6d, 0xf8, 0xc8, 0x05, 0x8a, 0x7c, 0x84, 0xbf, 0x5a, 0xb3, 0x0d, 0x8e, 0x2f, 0x7f, + 0x0c, 0xa5, 0x8d, 0xad, 0xf6, 0xba, 0x65, 0xee, 0x1b, 0x5d, 0x22, 0xa2, 0x8b, 0x1d, 0x42, 0x53, + 0x97, 0xce, 0xe4, 0x89, 0x88, 0xbc, 0x89, 0x1a, 0x50, 0x74, 0xb1, 0xe6, 0x74, 0x0e, 0xb0, 0x5b, + 0xcf, 0xd1, 0x57, 0x7e, 0x9b, 0x50, 0x59, 0xb6, 0x67, 0x58, 0xa6, 0x5b, 0xcf, 0x33, 0x2a, 0xde, + 0x94, 0xff, 0x40, 0x82, 0x72, 0xcb, 0x72, 0xbc, 0xc7, 0x9a, 0x6d, 0x1b, 0x66, 0x17, 0xdd, 0x80, + 0x22, 0xd5, 0x65, 0xc7, 0xea, 0x51, 0x1d, 0x54, 0x57, 0x1a, 0xcb, 0xf1, 0x69, 0x59, 0x6e, 0x71, + 0x0c, 0xc5, 0xc7, 0x45, 0xe7, 0xa1, 0xda, 0xb1, 0x4c, 0x4f, 0x33, 0x4c, 0xec, 0xa8, 0xb6, 0xe5, + 0x78, 0x54, 0x45, 0xd3, 0x4a, 0xc5, 0x87, 0x92, 0x5e, 0xd0, 0x49, 0x28, 0x1d, 0x58, 0xae, 0xc7, + 0x30, 0xf2, 0x14, 0xa3, 0x48, 0x00, 0xf4, 0xe5, 0x22, 0xcc, 0xd2, 0x97, 0x86, 0xcd, 0x95, 0x31, + 0x43, 0x9a, 0x4d, 0x5b, 0xfe, 0x95, 0x04, 0xd3, 0x8f, 0xad, 0x81, 0xe9, 0xc5, 0xba, 0xd1, 0xbc, + 0x03, 0x3e, 0x51, 0xa1, 0x6e, 0x34, 0xef, 0x20, 0xe8, 0x86, 0x60, 0xb0, 0xb9, 0x62, 0xdd, 0x90, + 0x97, 0x0d, 0x28, 0x3a, 0x58, 0xd3, 0x2d, 0xb3, 0x77, 0x48, 0x45, 0x28, 0x2a, 0x7e, 0x9b, 0x4c, + 0xa2, 0x8b, 0x7b, 0x86, 0x39, 0x78, 0xae, 0x3a, 0xb8, 0xa7, 0xed, 0xe1, 0x1e, 0x15, 0xa5, 0xa8, + 0x54, 0x39, 0x58, 0x61, 0x50, 0xb4, 0x01, 0x65, 0xdb, 0xb1, 0x6c, 0xad, 0xab, 0x11, 0x3d, 0xd6, + 0xa7, 0xa9, 0xaa, 0xe4, 0x61, 0x55, 0x51, 0xb1, 0x5b, 0x01, 0xa6, 0x12, 0x26, 0x93, 0xff, 0x51, + 0x82, 0x79, 0x62, 0x3c, 0xae, 0xad, 0x75, 0xf0, 0x36, 0x9d, 0x12, 0x74, 0x13, 0x66, 0x4d, 0xec, + 0x3d, 0xb3, 0x9c, 0x27, 0x7c, 0x02, 0x4e, 0x0f, 0x73, 0xf5, 0x69, 0x1e, 0x5b, 0x3a, 0x56, 0x04, + 0x3e, 0xba, 0x0e, 0x79, 0xdb, 0xd0, 0xe9, 0x80, 0x33, 0x90, 0x11, 0x5c, 0x42, 0x62, 0xd8, 0x1d, + 0xaa, 0x87, 0x2c, 0x24, 0x86, 0xdd, 0x21, 0xca, 0xf5, 0x34, 0xa7, 0x8b, 0x3d, 0xd5, 0xd0, 0xf9, + 0x44, 0x15, 0x19, 0xa0, 0xa9, 0xcb, 0x32, 0x40, 0xd3, 0xf4, 0x6e, 0xbc, 0xf9, 0xbe, 0xd6, 0x1b, + 0x60, 0xb4, 0x00, 0xd3, 0x4f, 0xc9, 0x03, 0x1d, 0x49, 0x5e, 0x61, 0x0d, 0xf9, 0x8b, 0x02, 0x9c, + 0x7c, 0x44, 0x94, 0xd9, 0xd6, 0x4c, 0x7d, 0xcf, 0x7a, 0xde, 0xc6, 0x9d, 0x81, 0x63, 0x78, 0x87, + 0xeb, 0x96, 0xe9, 0xe1, 0xe7, 0x1e, 0xda, 0x82, 0x23, 0xa6, 0xe8, 0x56, 0x15, 0x76, 0x4b, 0x38, + 0x94, 0x57, 0xce, 0x8e, 0x90, 0x90, 0xe9, 0x4f, 0xa9, 0x99, 0x51, 0x80, 0x8b, 0x1e, 0x06, 0x93, + 0x2a, 0xb8, 0xe5, 0x28, 0xb7, 0x84, 0xf1, 0xb6, 0x37, 0xa9, 0x64, 0x9c, 0x97, 0x98, 0x75, 0xc1, + 0xe9, 0x5d, 0x20, 0x4b, 0x5e, 0xd5, 0x5c, 0x75, 0xe0, 0x62, 0x87, 0x6a, 0xad, 0xbc, 0xf2, 0xca, + 0x30, 0x97, 0x40, 0x05, 0x4a, 0xc9, 0x19, 0x98, 0x6b, 0xee, 0xae, 0x8b, 0x1d, 0x74, 0x9b, 0x3a, + 0x11, 0x42, 0xdd, 0x75, 0xac, 0x81, 0x5d, 0x2f, 0x66, 0x20, 0x07, 0x4a, 0xfe, 0x80, 0xe0, 0x53, + 0x0f, 0xc3, 0x0d, 0x55, 0x75, 0x2c, 0xcb, 0xdb, 0x77, 0x85, 0x71, 0x0a, 0xb0, 0x42, 0xa1, 0xe8, + 0x1a, 0x1c, 0x75, 0x07, 0xb6, 0xdd, 0xc3, 0x7d, 0x6c, 0x7a, 0x5a, 0x8f, 0x75, 0xe7, 0xd6, 0xa7, + 0xcf, 0xe4, 0x2f, 0xe5, 0x15, 0x14, 0x7e, 0x45, 0x19, 0xbb, 0x68, 0x09, 0xc0, 0x76, 0x8c, 0xa7, + 0x46, 0x0f, 0x77, 0xb1, 0x5e, 0x9f, 0xa1, 0x4c, 0x43, 0x10, 0x74, 0x8b, 0x78, 0x9d, 0x4e, 0xc7, + 0xea, 0xdb, 0xf5, 0x52, 0xda, 0x3c, 0x88, 0x59, 0x6c, 0x39, 0xd6, 0xbe, 0xd1, 0xc3, 0x8a, 0xa0, + 0x40, 0xef, 0x41, 0x51, 0xb3, 0x6d, 0xcd, 0xe9, 0x5b, 0x4e, 0x1d, 0xb2, 0x52, 0xfb, 0x24, 0xe8, + 0x4d, 0x58, 0xe0, 0x9c, 0x54, 0x9b, 0xbd, 0x64, 0xcb, 0x7a, 0x96, 0x58, 0xde, 0xbd, 0x5c, 0x5d, + 0x52, 0x10, 0x7f, 0xcf, 0x69, 0xc9, 0x22, 0x97, 0xff, 0x56, 0x82, 0xf9, 0x18, 0x4f, 0xd4, 0x82, + 0x39, 0xc1, 0xc1, 0x3b, 0xb4, 0x31, 0x5f, 0x5e, 0x57, 0xc7, 0x0a, 0xb3, 0xcc, 0x7f, 0x77, 0x0e, + 0x6d, 0x4c, 0xd7, 0xaf, 0x68, 0xa0, 0x73, 0x50, 0xe9, 0x59, 0x1d, 0xad, 0x47, 0x9d, 0x8d, 0x83, + 0xf7, 0xb9, 0xaf, 0x99, 0xf3, 0x81, 0x0a, 0xde, 0x97, 0xef, 0x42, 0x39, 0xc4, 0x00, 0x21, 0xa8, + 0x2a, 0xac, 0xc3, 0x0d, 0xbc, 0xaf, 0x0d, 0x7a, 0x5e, 0x6d, 0x0a, 0x55, 0x01, 0x76, 0xcd, 0x0e, + 0xf1, 0xf0, 0x26, 0xd6, 0x6b, 0x12, 0xaa, 0x40, 0xe9, 0x91, 0x60, 0x51, 0xcb, 0xc9, 0x7f, 0x92, + 0x87, 0x63, 0xd4, 0x2c, 0x5b, 0x96, 0xce, 0xd7, 0x0c, 0xdf, 0x0e, 0xce, 0x41, 0xa5, 0x43, 0x67, + 0x57, 0xb5, 0x35, 0x07, 0x9b, 0x1e, 0x77, 0x87, 0x73, 0x0c, 0xd8, 0xa2, 0x30, 0xf4, 0x21, 0xd4, + 0x5c, 0x3e, 0x22, 0xb5, 0xc3, 0xd6, 0x18, 0x5f, 0x00, 0x09, 0x63, 0x1f, 0xb1, 0x30, 0x95, 0x79, + 0x77, 0x68, 0xa5, 0xce, 0xba, 0x87, 0x6e, 0xc7, 0xeb, 0xb1, 0x7d, 0xa5, 0xbc, 0xf2, 0x66, 0x0a, + 0xc3, 0xb8, 0xe0, 0xcb, 0x6d, 0x46, 0xb6, 0x69, 0x7a, 0xce, 0xa1, 0x22, 0x98, 0xa0, 0x4d, 0x28, + 0x5a, 0x4f, 0xb1, 0x73, 0x80, 0x35, 0xe6, 0x59, 0xca, 0x2b, 0x97, 0x53, 0x18, 0xae, 0x0b, 0x7f, + 0xaf, 0x60, 0xd7, 0x1a, 0x38, 0x1d, 0xec, 0x2a, 0x3e, 0x29, 0x7a, 0x00, 0x25, 0x47, 0x80, 0xa9, + 0x6b, 0x9e, 0x88, 0x4f, 0x40, 0xdb, 0x58, 0x85, 0xb9, 0xb0, 0xa0, 0xa8, 0x06, 0xf9, 0x27, 0xf8, + 0x90, 0x2b, 0x99, 0x3c, 0x06, 0x1e, 0x8e, 0xcd, 0x3c, 0x6b, 0xac, 0xe6, 0xde, 0x91, 0x64, 0x07, + 0x50, 0x30, 0xea, 0xc7, 0xd8, 0xd3, 0x74, 0xcd, 0xd3, 0x10, 0x82, 0x02, 0x0d, 0x20, 0x18, 0x0b, + 0xfa, 0x4c, 0xb8, 0x0e, 0xb8, 0xdb, 0x2e, 0x29, 0xe4, 0x11, 0xbd, 0x02, 0x25, 0xdf, 0x8b, 0xf1, + 0x28, 0x22, 0x00, 0x90, 0xdd, 0x5c, 0xf3, 0x3c, 0xdc, 0xb7, 0x3d, 0xaa, 0xa4, 0x8a, 0x22, 0x9a, + 0xf2, 0x9f, 0x4e, 0x43, 0x6d, 0xc8, 0x46, 0xee, 0x42, 0xb1, 0xcf, 0xbb, 0xe7, 0x5e, 0xf4, 0xd5, + 0x84, 0x2d, 0x7d, 0x48, 0x54, 0xc5, 0xa7, 0x22, 0x3b, 0x26, 0xb1, 0xc4, 0x50, 0xe4, 0xe3, 0xb7, + 0xd9, 0x12, 0xe8, 0xaa, 0xba, 0xe1, 0xe0, 0x8e, 0x67, 0x39, 0x87, 0x5c, 0xdc, 0xb9, 0x9e, 0xd5, + 0xdd, 0x10, 0x30, 0xb4, 0x0a, 0xa0, 0x9b, 0xae, 0x4a, 0x2d, 0xbc, 0xcb, 0x67, 0xf6, 0xe4, 0xb0, + 0x10, 0x7e, 0x98, 0xa3, 0x94, 0x74, 0xd3, 0xe5, 0xe2, 0xdf, 0x83, 0x0a, 0x89, 0x16, 0xd4, 0x3e, + 0x8b, 0x50, 0x98, 0x1b, 0x2b, 0xaf, 0x9c, 0x4a, 0x1a, 0x83, 0x1f, 0xc7, 0x28, 0x73, 0x76, 0xd0, + 0x70, 0xd1, 0x7d, 0x98, 0xa1, 0xdb, 0xb6, 0x5b, 0x9f, 0xa1, 0xc4, 0xcb, 0xa3, 0x14, 0xc0, 0x2d, + 0xf4, 0x11, 0x25, 0x60, 0x06, 0xca, 0xa9, 0xd1, 0x2e, 0x94, 0x35, 0xd3, 0xb4, 0x3c, 0x8d, 0xed, + 0x22, 0xb3, 0x94, 0xd9, 0x1b, 0x19, 0x98, 0xad, 0x05, 0x54, 0x8c, 0x63, 0x98, 0x0f, 0x7a, 0x0f, + 0xa6, 0xe9, 0x36, 0xc3, 0x77, 0x84, 0x8b, 0x19, 0x17, 0x91, 0xc2, 0xa8, 0xd0, 0x3a, 0xcc, 0x3e, + 0x33, 0x4c, 0xdd, 0x7a, 0xe6, 0x72, 0xef, 0x9c, 0x60, 0xec, 0x1f, 0x30, 0x84, 0x21, 0x16, 0x82, + 0xb2, 0x71, 0x13, 0xca, 0xa1, 0x11, 0x4f, 0x62, 0xe9, 0x8d, 0xdb, 0x50, 0x8b, 0x8f, 0x6f, 0xa2, + 0x95, 0xf2, 0x5b, 0xb0, 0xa0, 0x0c, 0xcc, 0x40, 0x34, 0x11, 0xbc, 0xaf, 0xc2, 0x0c, 0xb7, 0x18, + 0x66, 0xb6, 0xf2, 0x78, 0x45, 0x2b, 0x9c, 0x22, 0x1c, 0x8d, 0x1f, 0x68, 0xa6, 0xde, 0xc3, 0x0e, + 0xef, 0x57, 0x44, 0xe3, 0x0f, 0x19, 0x54, 0x7e, 0x0f, 0x8e, 0xc5, 0x3a, 0xe7, 0x87, 0x81, 0x57, + 0xa1, 0x6a, 0x5b, 0xba, 0xea, 0x32, 0x30, 0x89, 0x75, 0xb8, 0x6f, 0xb5, 0x7d, 0xdc, 0xa6, 0x4e, + 0xc8, 0xdb, 0x9e, 0x65, 0x0f, 0x0b, 0x9f, 0x8d, 0xbc, 0x0e, 0xc7, 0xe3, 0xe4, 0xac, 0x7b, 0xf9, + 0x0e, 0x2c, 0x2a, 0xb8, 0x6f, 0x3d, 0xc5, 0x2f, 0xca, 0xba, 0x01, 0xf5, 0x61, 0x06, 0x9c, 0xf9, + 0x47, 0xb0, 0x18, 0x40, 0xdb, 0x9e, 0xe6, 0x0d, 0xdc, 0x89, 0x98, 0xf3, 0x93, 0xd2, 0x9e, 0xe5, + 0xb2, 0xe9, 0x2c, 0x2a, 0xa2, 0x29, 0x2f, 0xc2, 0x74, 0xcb, 0xd2, 0x9b, 0x2d, 0x54, 0x85, 0x9c, + 0x61, 0x73, 0xe2, 0x9c, 0x61, 0xcb, 0x46, 0xb8, 0xcf, 0x2d, 0x16, 0xb1, 0xb2, 0xae, 0xe3, 0xa8, + 0xe8, 0x36, 0x54, 0x35, 0x5d, 0x37, 0x88, 0x39, 0x69, 0x3d, 0xd5, 0xb0, 0xd9, 0x81, 0xa6, 0xbc, + 0xb2, 0x98, 0x68, 0x00, 0xcd, 0x96, 0x52, 0x09, 0xd0, 0x9b, 0xb6, 0x2b, 0x3f, 0x84, 0x92, 0x1f, + 0x15, 0x92, 0xd8, 0x25, 0x1a, 0xf5, 0x65, 0x88, 0x21, 0xfd, 0xe3, 0xd1, 0xce, 0xd0, 0xc6, 0xcb, + 0x45, 0xbe, 0x05, 0xe0, 0x3b, 0x64, 0x11, 0x9c, 0x9e, 0x1c, 0xc1, 0x58, 0x09, 0xa1, 0xcb, 0x3f, + 0x89, 0xb8, 0xe9, 0x90, 0x12, 0x74, 0x5f, 0x09, 0x7a, 0xc4, 0x6d, 0xe7, 0x5e, 0xc8, 0x6d, 0xbf, + 0x0d, 0xd3, 0xae, 0xa7, 0x79, 0x98, 0x47, 0xf7, 0x67, 0x47, 0x91, 0x13, 0x21, 0xb0, 0xc2, 0xf0, + 0xd1, 0x29, 0x80, 0x8e, 0x83, 0x35, 0x0f, 0xeb, 0xaa, 0xc6, 0xf6, 0x98, 0xbc, 0x52, 0xe2, 0x90, + 0x35, 0x8f, 0xf8, 0x1b, 0x71, 0x42, 0x49, 0xdd, 0x5c, 0x53, 0xa6, 0x3a, 0x38, 0xab, 0xf8, 0x3e, + 0x6f, 0x26, 0xa3, 0xcf, 0xe3, 0x0c, 0xb8, 0xcf, 0x0b, 0x3c, 0xfa, 0xec, 0x78, 0x8f, 0xce, 0x48, + 0xb3, 0x78, 0xf4, 0xe2, 0x78, 0x8f, 0xce, 0x99, 0x8d, 0xf6, 0xe8, 0x09, 0xee, 0xa7, 0x94, 0xe4, + 0x7e, 0xbe, 0x4d, 0xb7, 0xfb, 0x2f, 0x12, 0xd4, 0x87, 0xbd, 0x00, 0xf7, 0x7e, 0xab, 0x30, 0xe3, + 0x52, 0x48, 0x16, 0xdf, 0xcb, 0x69, 0x39, 0x05, 0x7a, 0x08, 0x05, 0xc3, 0xdc, 0xb7, 0xf8, 0xa2, + 0x7d, 0x33, 0x03, 0x25, 0xef, 0x75, 0xb9, 0x69, 0xee, 0x5b, 0x4c, 0x9b, 0x94, 0x43, 0xe3, 0x6d, + 0x28, 0xf9, 0xa0, 0x89, 0xc6, 0xb6, 0x0d, 0x0b, 0x31, 0xdb, 0x66, 0x07, 0x52, 0x7f, 0x49, 0x48, + 0x93, 0x2d, 0x09, 0xf9, 0xf3, 0x5c, 0x78, 0xc9, 0xde, 0x37, 0x7a, 0x1e, 0x76, 0x86, 0x96, 0xec, + 0xbb, 0x82, 0x3b, 0x5b, 0xaf, 0x17, 0xc6, 0x72, 0x67, 0x67, 0x3c, 0xbe, 0xea, 0x3e, 0x81, 0x2a, + 0x35, 0x4a, 0xd5, 0xc5, 0x3d, 0x1a, 0x37, 0xf1, 0x98, 0xfa, 0xad, 0x51, 0x6c, 0x98, 0x24, 0xcc, + 0xb4, 0xdb, 0x9c, 0x8e, 0x69, 0xb0, 0xd2, 0x0b, 0xc3, 0x1a, 0x77, 0x01, 0x0d, 0x23, 0x4d, 0xa4, + 0xd3, 0x36, 0xf1, 0x85, 0xae, 0x97, 0xb8, 0x4f, 0xef, 0x53, 0x31, 0xb2, 0xd8, 0x0a, 0x13, 0x58, + 0xe1, 0x14, 0xf2, 0x7f, 0xe5, 0x01, 0x82, 0x97, 0xff, 0x8f, 0x9c, 0xe0, 0x5d, 0xdf, 0x01, 0xb1, + 0x78, 0xf4, 0xd2, 0x28, 0xc6, 0x89, 0xae, 0x67, 0x3b, 0xea, 0x7a, 0x58, 0x64, 0x7a, 0x75, 0x24, + 0x9b, 0x89, 0x9d, 0xce, 0xec, 0x77, 0xcd, 0xe9, 0x3c, 0x82, 0xe3, 0x71, 0x23, 0xe2, 0x1e, 0x67, + 0x05, 0xa6, 0x0d, 0x0f, 0xf7, 0xd9, 0xbd, 0x66, 0xe2, 0xb5, 0x48, 0x88, 0x88, 0xa1, 0xca, 0xb7, + 0xe1, 0x78, 0x74, 0xf6, 0x26, 0x0b, 0x63, 0x64, 0x25, 0x1e, 0x07, 0x05, 0x0e, 0x90, 0xdb, 0xcd, + 0x88, 0x8b, 0xa7, 0x38, 0x25, 0xc3, 0x97, 0xff, 0x5e, 0x82, 0x63, 0xb1, 0x57, 0x29, 0xee, 0x42, + 0x1b, 0x5a, 0xf0, 0xcc, 0x63, 0xae, 0x8e, 0xed, 0xeb, 0x1b, 0x5c, 0xf5, 0xbf, 0x09, 0x8d, 0xe8, + 0x84, 0x45, 0xd4, 0x7c, 0x27, 0xb6, 0xf4, 0x2f, 0x66, 0x14, 0xdd, 0x5f, 0xff, 0xef, 0xc3, 0xc9, + 0x44, 0xf6, 0xc3, 0xb3, 0x90, 0x9f, 0x68, 0x16, 0x7e, 0x96, 0x0f, 0xef, 0x00, 0x6b, 0x9e, 0xe7, + 0x18, 0x7b, 0x03, 0x0f, 0x7f, 0x1d, 0x61, 0xd6, 0xf7, 0x7d, 0x4f, 0xc0, 0xfc, 0xf5, 0xca, 0x28, + 0xfa, 0x40, 0x92, 0x44, 0x9f, 0xf0, 0x51, 0xd4, 0x27, 0x14, 0x28, 0xc3, 0xb7, 0x33, 0x32, 0x1c, + 0xe9, 0x1d, 0xbe, 0xcd, 0x45, 0xff, 0x6b, 0x09, 0xe6, 0x63, 0xf3, 0x84, 0xee, 0x03, 0x68, 0xbe, + 0xe8, 0xdc, 0x7a, 0x2e, 0x64, 0x1b, 0xa8, 0x12, 0xa2, 0x24, 0x7b, 0x2e, 0x8b, 0x23, 0x53, 0xf7, + 0xdc, 0x84, 0x38, 0xd2, 0x0f, 0x23, 0xef, 0x05, 0x47, 0x67, 0x76, 0x99, 0x7b, 0x29, 0xc3, 0xd1, + 0x99, 0x71, 0x10, 0x84, 0xf2, 0x2f, 0x72, 0xb0, 0x90, 0xd4, 0x07, 0x7a, 0x1d, 0xf2, 0x1d, 0x7b, + 0xc0, 0xc7, 0x96, 0x90, 0x46, 0x59, 0xb7, 0x07, 0xbb, 0xae, 0xd6, 0xc5, 0x0a, 0x41, 0x43, 0x6f, + 0xc1, 0x4c, 0x1f, 0xf7, 0x2d, 0xe7, 0x90, 0x8f, 0x24, 0xe1, 0x82, 0xe3, 0x31, 0x7d, 0xcf, 0x68, + 0x38, 0x32, 0x7a, 0x27, 0x08, 0xc6, 0xd9, 0x08, 0x96, 0x12, 0x4e, 0x21, 0x0c, 0x81, 0x11, 0xfa, + 0x11, 0xf8, 0x3b, 0x30, 0x6b, 0x3b, 0x56, 0x07, 0xbb, 0x2e, 0xbf, 0x91, 0x59, 0x4a, 0xcc, 0xf4, + 0x10, 0x04, 0x4e, 0xc9, 0xd1, 0xd1, 0x5d, 0x00, 0x3f, 0xdf, 0x22, 0xf6, 0xbf, 0x33, 0x09, 0xe3, + 0x13, 0x38, 0x4c, 0x61, 0x21, 0x1a, 0x72, 0xee, 0x4d, 0x56, 0xab, 0xfc, 0x77, 0x12, 0xcc, 0x85, + 0xe5, 0x45, 0xaf, 0x40, 0x89, 0xb0, 0x75, 0x3d, 0xad, 0x6f, 0xf3, 0x3c, 0x42, 0x00, 0x40, 0x3b, + 0x70, 0x44, 0x67, 0xd7, 0xa8, 0xaa, 0x61, 0x7a, 0xd8, 0xd9, 0xd7, 0x3a, 0x22, 0xfc, 0xba, 0x98, + 0xaa, 0x88, 0xa6, 0xc0, 0x64, 0xe3, 0xaa, 0x71, 0x0e, 0x3e, 0x18, 0x3d, 0x00, 0xf0, 0xb9, 0x89, + 0x65, 0x9d, 0x99, 0x5d, 0x88, 0x54, 0xfe, 0xbd, 0x1c, 0x1c, 0x4b, 0xc4, 0x4a, 0xbc, 0x08, 0x7c, + 0x07, 0x8a, 0xce, 0x73, 0x75, 0xef, 0xd0, 0xc3, 0x6e, 0xba, 0x11, 0xec, 0x86, 0xb2, 0x03, 0xb3, + 0xce, 0xf3, 0x7b, 0x04, 0x1b, 0xad, 0x42, 0xc9, 0x79, 0xae, 0x62, 0xc7, 0xb1, 0x1c, 0x61, 0xc9, + 0x63, 0x48, 0x8b, 0xce, 0xf3, 0x4d, 0x8a, 0x4e, 0x7a, 0xf5, 0x44, 0xaf, 0x85, 0x4c, 0xbd, 0x7a, + 0x41, 0xaf, 0x9e, 0xdf, 0xeb, 0x74, 0xa6, 0x5e, 0x3d, 0xde, 0xab, 0x6c, 0xc3, 0x5c, 0xd8, 0xb8, + 0xc6, 0x4c, 0xf3, 0x3d, 0xa8, 0x70, 0xe3, 0x53, 0x3b, 0xd6, 0xc0, 0xf4, 0xb2, 0xa9, 0x67, 0x8e, + 0xd3, 0xac, 0x13, 0x12, 0xf9, 0x17, 0x12, 0x94, 0x9a, 0x7d, 0xad, 0x8b, 0xdb, 0x36, 0xee, 0x10, + 0x6f, 0x65, 0x90, 0x06, 0x9f, 0x00, 0xd6, 0x40, 0x5b, 0x51, 0xff, 0xcb, 0xf6, 0xe3, 0xd7, 0x13, + 0x32, 0x34, 0x82, 0xcf, 0x18, 0xa7, 0xfb, 0xb2, 0x9e, 0x73, 0x05, 0x8a, 0x3f, 0xc0, 0x87, 0xec, + 0xec, 0x92, 0x91, 0x4e, 0xfe, 0x79, 0x01, 0x16, 0x53, 0xee, 0xb6, 0x69, 0x50, 0x6b, 0x0f, 0x54, + 0x1b, 0x3b, 0x86, 0xa5, 0x0b, 0x35, 0x77, 0xec, 0x41, 0x8b, 0x02, 0xd0, 0x49, 0x20, 0x0d, 0xf5, + 0xb3, 0x81, 0xc5, 0x77, 0xc3, 0xbc, 0x52, 0xec, 0xd8, 0x83, 0xdf, 0x20, 0x6d, 0x41, 0xeb, 0x1e, + 0x68, 0x0e, 0x66, 0x46, 0xc6, 0x68, 0xdb, 0x14, 0x80, 0xae, 0xc3, 0x31, 0xe6, 0x92, 0xd4, 0x9e, + 0xd1, 0x37, 0xc8, 0x72, 0x0c, 0xd9, 0x54, 0x5e, 0x41, 0xec, 0xe5, 0x23, 0xf2, 0xae, 0x69, 0x32, + 0xfb, 0x91, 0xa1, 0x62, 0x59, 0x7d, 0xd5, 0xed, 0x58, 0x0e, 0x56, 0x35, 0xfd, 0x53, 0x6a, 0x43, + 0x79, 0xa5, 0x6c, 0x59, 0xfd, 0x36, 0x81, 0xad, 0xe9, 0x9f, 0xa2, 0xd3, 0x50, 0xee, 0xd8, 0x03, + 0x17, 0x7b, 0x2a, 0xf9, 0xa1, 0xb7, 0x05, 0x25, 0x05, 0x18, 0x68, 0xdd, 0x1e, 0xb8, 0x21, 0x84, + 0x3e, 0x89, 0x1e, 0x67, 0xc3, 0x08, 0x8f, 0x71, 0x9f, 0xa6, 0xff, 0x0e, 0x06, 0x5d, 0x6c, 0x6b, + 0x5d, 0xcc, 0x44, 0x13, 0xc7, 0xfc, 0x84, 0xf4, 0xdf, 0x43, 0x8e, 0x48, 0xc5, 0x54, 0xaa, 0x07, + 0xe1, 0xa6, 0x8b, 0x5a, 0x30, 0x3b, 0x30, 0x8d, 0x7d, 0x03, 0xeb, 0xf5, 0x12, 0xe5, 0x70, 0x23, + 0x73, 0x56, 0x61, 0x79, 0x97, 0x11, 0xf2, 0x84, 0x07, 0x67, 0x83, 0x56, 0xa1, 0xc1, 0x95, 0xe6, + 0x3e, 0xd3, 0xec, 0xb8, 0xe6, 0x80, 0xaa, 0xe3, 0x38, 0xc3, 0x68, 0x3f, 0xd3, 0xec, 0xb0, 0xf6, + 0x1a, 0xab, 0x30, 0x17, 0x66, 0x3a, 0x91, 0x5d, 0xdd, 0x83, 0x4a, 0x64, 0xa8, 0x64, 0xe6, 0xa9, + 0x82, 0x5c, 0xe3, 0xc7, 0x62, 0x49, 0x14, 0x09, 0xa0, 0x6d, 0xfc, 0x98, 0xa6, 0x71, 0xa9, 0x64, + 0x94, 0x4f, 0x41, 0x61, 0x0d, 0x59, 0x83, 0x4a, 0x24, 0x5b, 0x4a, 0x5c, 0x1a, 0x4d, 0x8b, 0x72, + 0x97, 0x46, 0x9e, 0x09, 0xcc, 0xb1, 0x7a, 0x42, 0x02, 0xfa, 0x4c, 0x60, 0x34, 0xff, 0xc6, 0x32, + 0x05, 0xf4, 0x99, 0x76, 0x81, 0x9f, 0xf2, 0x74, 0x7b, 0x49, 0x61, 0x0d, 0x59, 0x07, 0x58, 0xd7, + 0x6c, 0x6d, 0xcf, 0xe8, 0x19, 0xde, 0x21, 0xba, 0x0c, 0x35, 0x4d, 0xd7, 0xd5, 0x8e, 0x80, 0x18, + 0x58, 0x14, 0x41, 0xcc, 0x6b, 0xba, 0xbe, 0x1e, 0x02, 0xa3, 0xd7, 0xe0, 0x88, 0xee, 0x58, 0x76, + 0x14, 0x97, 0x55, 0x45, 0xd4, 0xc8, 0x8b, 0x30, 0xb2, 0xfc, 0x1f, 0x33, 0x70, 0x2a, 0x3a, 0x6d, + 0xf1, 0x8c, 0xf4, 0x5d, 0x98, 0x8b, 0xf5, 0x9a, 0x92, 0xb9, 0x0d, 0xa4, 0x55, 0x22, 0x14, 0xb1, + 0x0c, 0x6b, 0x6e, 0x28, 0xc3, 0x9a, 0x98, 0xf3, 0xce, 0x7f, 0xa5, 0x39, 0xef, 0xc2, 0x57, 0x92, + 0xf3, 0x9e, 0x7e, 0xb9, 0x9c, 0xf7, 0xdc, 0x84, 0x39, 0xef, 0x0b, 0xf4, 0x4c, 0x2b, 0x7a, 0xa7, + 0x3b, 0x26, 0x73, 0x01, 0x15, 0xbf, 0x0f, 0x53, 0x54, 0xdf, 0xc4, 0x72, 0xe3, 0xb3, 0x93, 0xe4, + 0xc6, 0x8b, 0xa9, 0xb9, 0xf1, 0x33, 0x30, 0x67, 0x5a, 0xaa, 0x89, 0x9f, 0xa9, 0x64, 0xba, 0xdc, + 0x7a, 0x99, 0xcd, 0x9d, 0x69, 0x6d, 0xe1, 0x67, 0x2d, 0x02, 0x41, 0x67, 0x61, 0xae, 0xaf, 0xb9, + 0x4f, 0xb0, 0x4e, 0x13, 0xd3, 0x6e, 0xbd, 0x42, 0xed, 0xac, 0xcc, 0x60, 0x2d, 0x02, 0x42, 0xe7, + 0xc1, 0x97, 0x83, 0x23, 0x55, 0x29, 0x52, 0x45, 0x40, 0x19, 0x5a, 0x28, 0xcf, 0x3e, 0xff, 0x52, + 0x79, 0xf6, 0xda, 0xe4, 0x79, 0xf6, 0xab, 0x50, 0x13, 0xcf, 0x22, 0xd1, 0xce, 0xee, 0x2c, 0x69, + 0x8e, 0x7d, 0x5e, 0xbc, 0x13, 0xc9, 0xf4, 0xb4, 0xb4, 0x3c, 0x8c, 0x4c, 0xcb, 0xff, 0xb9, 0xc4, + 0x63, 0x65, 0x7f, 0xa9, 0xf1, 0x2c, 0x5f, 0x24, 0x65, 0x2b, 0xbd, 0x78, 0xca, 0x16, 0xfd, 0x30, + 0x35, 0xd9, 0x7d, 0x6d, 0x1c, 0xbf, 0x71, 0xe9, 0x6e, 0xf9, 0x77, 0x24, 0x38, 0xc5, 0xc3, 0xd6, + 0x94, 0xd2, 0x95, 0x04, 0x73, 0x95, 0x52, 0xcc, 0xb5, 0xe3, 0x60, 0x1d, 0x9b, 0x9e, 0xa1, 0xf5, + 0x54, 0xd7, 0xc6, 0x1d, 0x91, 0x9e, 0x0a, 0xc0, 0x34, 0x4c, 0x39, 0x0b, 0x73, 0xac, 0x92, 0x89, + 0x47, 0xea, 0xac, 0x60, 0xa9, 0x4c, 0x8b, 0x99, 0x18, 0x48, 0x1e, 0xc0, 0x62, 0x4a, 0x76, 0x2f, + 0x51, 0x19, 0x52, 0x9a, 0x32, 0x46, 0x8e, 0x6c, 0x58, 0x19, 0xbf, 0x2b, 0xc1, 0x69, 0x4e, 0x92, + 0xea, 0x37, 0xbf, 0x0d, 0x75, 0xfc, 0x85, 0xe4, 0x9f, 0x2d, 0xe2, 0x46, 0xd6, 0x1c, 0x36, 0xb2, + 0xd7, 0x52, 0xf5, 0x30, 0xda, 0xcc, 0x3e, 0x49, 0x35, 0xb3, 0xeb, 0xe3, 0x39, 0x8e, 0xd5, 0xed, + 0x1f, 0x4b, 0x70, 0x22, 0x55, 0x8c, 0x58, 0x20, 0x26, 0xc5, 0x03, 0x31, 0x1e, 0xc4, 0x05, 0x71, + 0x32, 0x0b, 0xe2, 0x68, 0x10, 0xcc, 0xa3, 0x25, 0xb5, 0xaf, 0x3d, 0x37, 0xfa, 0x83, 0x3e, 0x8f, + 0xe2, 0x08, 0xbb, 0xc7, 0x0c, 0xf2, 0x02, 0x61, 0x9c, 0xbc, 0x06, 0x47, 0x7c, 0x29, 0x47, 0x16, + 0x3a, 0x84, 0x0a, 0x17, 0x72, 0xd1, 0xc2, 0x05, 0x13, 0x66, 0x36, 0xf0, 0x53, 0xa3, 0x83, 0xbf, + 0x92, 0x0a, 0xbf, 0x33, 0x50, 0xb6, 0xb1, 0xd3, 0x37, 0x5c, 0xd7, 0xdf, 0x46, 0x4b, 0x4a, 0x18, + 0x24, 0xff, 0xfb, 0x0c, 0xcc, 0xc7, 0xad, 0xe3, 0xce, 0x50, 0x9d, 0xc4, 0xb9, 0x11, 0x67, 0xda, + 0x84, 0x8b, 0xa0, 0xeb, 0xe2, 0x48, 0x91, 0x4b, 0x4b, 0x07, 0xfa, 0xc7, 0x06, 0x71, 0xde, 0xa8, + 0xc3, 0x6c, 0xc7, 0xea, 0xf7, 0x35, 0x53, 0x17, 0x85, 0x99, 0xbc, 0x49, 0xf4, 0xa7, 0x39, 0x5d, + 0x76, 0x05, 0x54, 0x52, 0xe8, 0x33, 0x99, 0x3c, 0x72, 0x92, 0x34, 0x4c, 0x5a, 0x6f, 0x41, 0xb7, + 0xe2, 0x92, 0x02, 0x1c, 0xb4, 0x61, 0x38, 0x68, 0x19, 0x0a, 0xd8, 0x7c, 0x2a, 0xee, 0x92, 0x13, + 0xae, 0x1c, 0xc4, 0x61, 0x42, 0xa1, 0x78, 0xe8, 0x1a, 0xcc, 0xf4, 0x89, 0x59, 0x88, 0x2c, 0xda, + 0x62, 0x4a, 0x01, 0xa3, 0xc2, 0xd1, 0xd0, 0x0a, 0xcc, 0xea, 0x74, 0x9e, 0x44, 0x0c, 0x5d, 0x4f, + 0xa8, 0xe2, 0xa0, 0x08, 0x8a, 0x40, 0x44, 0x9b, 0xfe, 0xfd, 0x58, 0x29, 0xed, 0x8a, 0x3b, 0x36, + 0x15, 0x89, 0x57, 0x63, 0x3b, 0xd1, 0xa3, 0x19, 0xa4, 0xdd, 0xb5, 0xc5, 0x79, 0x8d, 0xbe, 0x33, + 0x3f, 0x01, 0xc5, 0x9e, 0xd5, 0x65, 0x66, 0x54, 0x66, 0x35, 0xbf, 0x3d, 0xab, 0x4b, 0xad, 0x68, + 0x01, 0xa6, 0x5d, 0x4f, 0x37, 0x4c, 0x1a, 0xb3, 0x14, 0x15, 0xd6, 0x20, 0x8b, 0x8f, 0x3e, 0xa8, + 0x96, 0xd9, 0xc1, 0xf5, 0x0a, 0x7d, 0x55, 0xa2, 0x90, 0x6d, 0xb3, 0x43, 0x0f, 0x69, 0x9e, 0x77, + 0x58, 0xaf, 0x52, 0x38, 0x79, 0x0c, 0x2e, 0xa8, 0xe6, 0x47, 0x5e, 0x50, 0xc5, 0xc4, 0x4e, 0xb8, + 0xa0, 0xaa, 0x8d, 0xb9, 0xa0, 0x8a, 0x73, 0xf8, 0x2e, 0x94, 0x76, 0xfc, 0x95, 0x04, 0xc7, 0xd7, + 0x69, 0xce, 0x24, 0xe4, 0xc7, 0x26, 0x29, 0x34, 0xb8, 0xe9, 0xd7, 0x80, 0xa4, 0x26, 0xef, 0xe3, + 0xe3, 0x16, 0x25, 0x20, 0x4d, 0xa8, 0x0a, 0xe6, 0x9c, 0x45, 0x3e, 0x73, 0x19, 0x49, 0xc5, 0x0d, + 0x37, 0xe5, 0x77, 0x61, 0x71, 0x68, 0x14, 0xfc, 0x86, 0xfa, 0x2c, 0xcc, 0x05, 0xfe, 0xca, 0x1f, + 0x44, 0xd9, 0x87, 0x35, 0x75, 0x79, 0x15, 0x8e, 0xb5, 0x3d, 0xcd, 0xf1, 0x86, 0x54, 0x90, 0x81, + 0x96, 0x16, 0x88, 0x44, 0x69, 0x79, 0x0d, 0x47, 0x1b, 0x16, 0xda, 0x9e, 0x65, 0xbf, 0x00, 0x53, + 0xe2, 0x75, 0xc8, 0xf8, 0xad, 0x81, 0xd8, 0x1f, 0x44, 0x53, 0x5e, 0x64, 0xe5, 0x2c, 0xc3, 0xbd, + 0xdd, 0x82, 0xe3, 0xac, 0x9a, 0xe4, 0x45, 0x06, 0x71, 0x42, 0xd4, 0xb2, 0x0c, 0xf3, 0x7d, 0x0c, + 0x47, 0x23, 0xd7, 0x84, 0x3c, 0x4f, 0x7b, 0x23, 0x9a, 0xa7, 0x1d, 0x77, 0xb9, 0xe8, 0xa7, 0x69, + 0xff, 0x30, 0x17, 0xf2, 0xeb, 0x29, 0x69, 0x97, 0x5b, 0xd1, 0x2c, 0xed, 0xf9, 0x71, 0xbc, 0x23, + 0x49, 0xda, 0x61, 0xab, 0xcd, 0x27, 0x58, 0xed, 0xc7, 0x43, 0x99, 0x9d, 0x42, 0x5a, 0x2e, 0x3c, + 0x26, 0xed, 0x37, 0x92, 0xd3, 0x51, 0x58, 0x26, 0xd7, 0xef, 0xda, 0x4f, 0xe7, 0xdc, 0x8c, 0xa5, + 0x73, 0xce, 0x8e, 0x95, 0xd7, 0x4f, 0xe4, 0xfc, 0x59, 0x01, 0x4a, 0xfe, 0xbb, 0x21, 0x9d, 0x0f, + 0xab, 0x2d, 0x97, 0xa0, 0xb6, 0xf0, 0x0e, 0x9c, 0x7f, 0xa9, 0x1d, 0xb8, 0x90, 0x79, 0x07, 0x3e, + 0x09, 0x25, 0xfa, 0x40, 0xcb, 0x77, 0xd9, 0x8e, 0x5a, 0xa4, 0x00, 0x05, 0xef, 0x07, 0x66, 0x38, + 0x33, 0x91, 0x19, 0xc6, 0x72, 0xc7, 0xb3, 0xf1, 0xdc, 0xf1, 0x1d, 0x7f, 0x47, 0x2c, 0xa6, 0x5d, + 0x2d, 0xfb, 0x7c, 0x13, 0xf7, 0xc2, 0xd8, 0x35, 0x65, 0x29, 0xed, 0x9a, 0x32, 0xe0, 0xf2, 0x9d, + 0xcd, 0x0d, 0xed, 0xb2, 0x84, 0x70, 0xd8, 0x16, 0xb9, 0x67, 0xbd, 0x15, 0xc9, 0x32, 0xb0, 0x04, + 0xe0, 0xc9, 0x11, 0x63, 0x8c, 0x24, 0x18, 0x76, 0xe1, 0x78, 0x64, 0x6a, 0x82, 0x02, 0xb7, 0x6c, + 0xfe, 0x31, 0xa5, 0xba, 0xed, 0x7f, 0xa7, 0x43, 0xfe, 0x25, 0xa5, 0x70, 0xeb, 0xce, 0x50, 0x46, + 0x71, 0x42, 0x2b, 0xbe, 0x11, 0x2d, 0x59, 0x78, 0x41, 0xab, 0x1b, 0xaa, 0x58, 0xa0, 0x91, 0x8b, + 0xe6, 0xf0, 0xd7, 0xec, 0xaa, 0xb5, 0xc4, 0x21, 0x6b, 0xf4, 0x64, 0xb0, 0x6f, 0x98, 0x86, 0x7b, + 0xc0, 0xde, 0xcf, 0xb0, 0x93, 0x81, 0x00, 0xad, 0xd1, 0x2b, 0x42, 0xfc, 0xdc, 0xf0, 0xd4, 0x8e, + 0xa5, 0x63, 0x6a, 0xd3, 0xd3, 0x4a, 0x91, 0x00, 0xd6, 0x2d, 0x1d, 0x07, 0x2b, 0xaf, 0xf8, 0x62, + 0x2b, 0xaf, 0x14, 0x5b, 0x79, 0xc7, 0x61, 0xc6, 0xc1, 0x9a, 0x6b, 0x99, 0xec, 0x42, 0x41, 0xe1, + 0x2d, 0x32, 0x35, 0x7d, 0xec, 0xba, 0xa4, 0x27, 0x1e, 0xae, 0xf1, 0x66, 0x28, 0xcc, 0x9c, 0x1b, + 0x1b, 0x66, 0x8e, 0x28, 0x08, 0x8b, 0x85, 0x99, 0x95, 0xb1, 0x61, 0x66, 0xa6, 0x7a, 0xb0, 0x20, + 0xd0, 0xae, 0x66, 0x0b, 0xb4, 0xc3, 0x71, 0xe9, 0x7c, 0x24, 0x2e, 0xfd, 0x36, 0x17, 0xeb, 0xaf, + 0x24, 0x58, 0x1c, 0x5a, 0x56, 0x7c, 0xb9, 0xde, 0x8c, 0x55, 0x8c, 0x9d, 0x1d, 0xab, 0x33, 0xbf, + 0x60, 0xec, 0x41, 0xa4, 0x60, 0xec, 0x8d, 0xf1, 0x84, 0x5f, 0x79, 0xbd, 0xd8, 0xff, 0xe4, 0xe0, + 0xf4, 0xae, 0xad, 0xc7, 0x22, 0x3c, 0x7e, 0xec, 0xcf, 0xee, 0x38, 0xee, 0x44, 0x93, 0xd1, 0x13, + 0xdc, 0x60, 0xf1, 0x70, 0x7f, 0x33, 0x9e, 0x8f, 0x9e, 0xe8, 0x7e, 0x42, 0xd0, 0x22, 0x3d, 0xa9, + 0x8c, 0xe0, 0x5e, 0x42, 0xb2, 0x6c, 0xf4, 0x90, 0xbf, 0xe6, 0xe4, 0x96, 0x0c, 0x67, 0xd2, 0x05, + 0xe0, 0xf1, 0xe1, 0x8f, 0x60, 0x7e, 0xf3, 0x39, 0xee, 0xb4, 0x0f, 0xcd, 0xce, 0x04, 0xf3, 0x50, + 0x83, 0x7c, 0xa7, 0xaf, 0xf3, 0x0b, 0x7f, 0xf2, 0x18, 0x0e, 0x79, 0xf3, 0xd1, 0x90, 0x57, 0x85, + 0x5a, 0xd0, 0x03, 0xb7, 0xe5, 0xe3, 0xc4, 0x96, 0x75, 0x82, 0x4c, 0x98, 0xcf, 0x29, 0xbc, 0xc5, + 0xe1, 0xd8, 0x61, 0xc5, 0xe4, 0x0c, 0x8e, 0x1d, 0x27, 0xea, 0x1a, 0xf3, 0x51, 0xd7, 0x28, 0xff, + 0xbe, 0x04, 0x65, 0xd2, 0xc3, 0x4b, 0xc9, 0xcf, 0xcf, 0x95, 0xf9, 0xe0, 0x5c, 0xe9, 0x1f, 0x4f, + 0x0b, 0xe1, 0xe3, 0x69, 0x20, 0xf9, 0x34, 0x05, 0x0f, 0x4b, 0x3e, 0xe3, 0xc3, 0xb1, 0xe3, 0xc8, + 0x67, 0x60, 0x8e, 0xc9, 0xc6, 0x47, 0x5e, 0x83, 0xfc, 0xc0, 0xe9, 0x89, 0xf9, 0x1b, 0x38, 0x3d, + 0xf9, 0x67, 0x12, 0x54, 0xd6, 0x3c, 0x4f, 0xeb, 0x1c, 0x4c, 0x30, 0x00, 0x5f, 0xb8, 0x5c, 0x58, + 0xb8, 0xe1, 0x41, 0x04, 0xe2, 0x16, 0x52, 0xc4, 0x9d, 0x8e, 0x88, 0x2b, 0x43, 0x55, 0xc8, 0x92, + 0x2a, 0xf0, 0x16, 0xa0, 0x96, 0xe5, 0x78, 0xf7, 0x2d, 0xe7, 0x99, 0xe6, 0xe8, 0x93, 0x1d, 0x37, + 0x11, 0x14, 0xf8, 0xc7, 0xab, 0xf9, 0x4b, 0xd3, 0x0a, 0x7d, 0x96, 0x2f, 0xc2, 0xd1, 0x08, 0xbf, + 0xd4, 0x8e, 0xef, 0x42, 0x99, 0x6e, 0x72, 0xfc, 0xdc, 0x71, 0x3d, 0x9c, 0x61, 0xce, 0xb4, 0x25, + 0xca, 0xdf, 0x87, 0x23, 0x24, 0x18, 0xa2, 0x70, 0xdf, 0xef, 0xbc, 0x15, 0x0b, 0xca, 0x4f, 0xa5, + 0x30, 0x8a, 0x05, 0xe4, 0x9f, 0xe7, 0x60, 0x9a, 0xc2, 0x87, 0x02, 0x94, 0x93, 0x50, 0x72, 0xb0, + 0x6d, 0xa9, 0x9e, 0xd6, 0xf5, 0x3f, 0x15, 0x26, 0x80, 0x1d, 0xad, 0x4b, 0x93, 0x19, 0xf4, 0xa5, + 0x6e, 0x74, 0xb1, 0xeb, 0x89, 0xef, 0x85, 0xcb, 0x04, 0xb6, 0xc1, 0x40, 0x44, 0x49, 0x34, 0x4d, + 0x58, 0xa0, 0xd9, 0x40, 0xfa, 0x8c, 0x96, 0xd9, 0x37, 0x4c, 0x59, 0xb2, 0x43, 0xf4, 0x0b, 0xa7, + 0x06, 0x14, 0x63, 0x09, 0x1d, 0xbf, 0x8d, 0xae, 0x41, 0x81, 0x5e, 0x01, 0xcf, 0x8e, 0xd7, 0x1b, + 0x45, 0x24, 0xd6, 0x62, 0x1b, 0xa6, 0x89, 0x75, 0x1a, 0x7d, 0x14, 0x15, 0xde, 0x92, 0x37, 0x01, + 0x85, 0xd5, 0xc9, 0x27, 0xee, 0x1a, 0xcc, 0x50, 0x6d, 0x8b, 0x98, 0x72, 0x31, 0xa5, 0x03, 0x85, + 0xa3, 0xc9, 0x1a, 0x20, 0xd6, 0x63, 0x24, 0x8e, 0x9c, 0x7c, 0x7a, 0x47, 0xc4, 0x95, 0x7f, 0x29, + 0xc1, 0xd1, 0x48, 0x1f, 0x5c, 0xd6, 0xab, 0xd1, 0x4e, 0x52, 0x45, 0xe5, 0x1d, 0xac, 0x47, 0x36, + 0xd2, 0x6b, 0x69, 0x22, 0x7d, 0x4d, 0x9b, 0xe8, 0x3f, 0x48, 0x00, 0x6b, 0x03, 0xef, 0x80, 0xdf, + 0xa7, 0x86, 0xa7, 0x58, 0x8a, 0x4d, 0x71, 0x03, 0x8a, 0xb6, 0xe6, 0xba, 0xcf, 0x2c, 0x47, 0x9c, + 0x04, 0xfd, 0x36, 0xbd, 0xf9, 0x1c, 0x78, 0x07, 0x22, 0x3d, 0x4c, 0x9e, 0xd1, 0x79, 0xa8, 0xb2, + 0xef, 0xdc, 0x55, 0x4d, 0xd7, 0x1d, 0x51, 0xb2, 0x54, 0x52, 0x2a, 0x0c, 0xba, 0xc6, 0x80, 0x04, + 0xcd, 0xa0, 0xe9, 0x02, 0xef, 0x50, 0xf5, 0xac, 0x27, 0xd8, 0xe4, 0x27, 0xba, 0x8a, 0x80, 0xee, + 0x10, 0x20, 0xcb, 0xc6, 0x75, 0x0d, 0xd7, 0x73, 0x04, 0x9a, 0xc8, 0x29, 0x72, 0x28, 0x45, 0x23, + 0x93, 0x52, 0x6b, 0x0d, 0x7a, 0x3d, 0xa6, 0xe2, 0x17, 0x9f, 0xf6, 0xef, 0xf1, 0x01, 0xe5, 0xd2, + 0x16, 0x47, 0xa0, 0x34, 0x3e, 0xdc, 0xaf, 0xf0, 0xea, 0xea, 0x7b, 0x70, 0x24, 0x34, 0x06, 0x6e, + 0x56, 0x91, 0xd0, 0x5b, 0x8a, 0x86, 0xde, 0xf2, 0x03, 0x40, 0xec, 0xb6, 0xe6, 0x25, 0xc7, 0x2d, + 0x1f, 0x83, 0xa3, 0x11, 0x46, 0x7c, 0x4b, 0xbf, 0x02, 0x15, 0x5e, 0x12, 0xc5, 0x0d, 0xe5, 0x04, + 0x14, 0x89, 0x6b, 0xee, 0x18, 0xba, 0xa8, 0x1d, 0x98, 0xb5, 0x2d, 0x7d, 0xdd, 0xd0, 0x1d, 0xf9, + 0x03, 0xa8, 0xf0, 0x8f, 0x65, 0x39, 0xee, 0x7d, 0xa8, 0xf2, 0xfa, 0x35, 0x35, 0xf2, 0x6d, 0xd8, + 0xe9, 0xd4, 0xea, 0x2c, 0xa1, 0x16, 0x33, 0xdc, 0x94, 0x75, 0x68, 0xb0, 0xd8, 0x23, 0xc2, 0x5e, + 0x0c, 0xf6, 0x3e, 0x88, 0x92, 0xe9, 0xb1, 0xbd, 0x44, 0xe9, 0x2b, 0x4e, 0xb8, 0x29, 0x9f, 0x82, + 0x93, 0x89, 0xbd, 0x70, 0x4d, 0xd8, 0x50, 0x0b, 0x5e, 0xb0, 0x0f, 0x98, 0xfc, 0xe2, 0x08, 0x29, + 0x54, 0x1c, 0x71, 0xdc, 0x0f, 0xad, 0x73, 0x62, 0x37, 0xa4, 0x71, 0x73, 0x70, 0x48, 0xca, 0xa7, + 0x1d, 0x92, 0x0a, 0x91, 0x43, 0x92, 0xdc, 0xf6, 0xf5, 0xc9, 0x0f, 0xaf, 0xf7, 0xe8, 0x21, 0x9b, + 0xf5, 0x2d, 0x1c, 0xa2, 0x3c, 0x6a, 0x94, 0x0c, 0x55, 0x09, 0x51, 0xc9, 0x97, 0xa1, 0x12, 0x75, + 0x8d, 0x21, 0x3f, 0x27, 0x0d, 0xf9, 0xb9, 0x6a, 0xcc, 0xc5, 0xbd, 0x1d, 0x3b, 0x37, 0xa4, 0xeb, + 0x38, 0x76, 0x6a, 0xb8, 0x1d, 0x71, 0x76, 0x57, 0x12, 0x72, 0xdd, 0x5f, 0x93, 0x9f, 0x5b, 0xe0, + 0xfb, 0xc1, 0x7d, 0x97, 0xd0, 0xf3, 0x41, 0xcb, 0xe7, 0xa0, 0xbc, 0x9b, 0xf6, 0xd7, 0x07, 0x05, + 0x51, 0x9b, 0x75, 0x03, 0x16, 0xee, 0x1b, 0x3d, 0xec, 0x1e, 0xba, 0x1e, 0xee, 0x37, 0xa9, 0x53, + 0xda, 0x37, 0xb0, 0x83, 0x96, 0x00, 0xe8, 0xc1, 0xcf, 0xb6, 0x0c, 0xff, 0x23, 0xee, 0x10, 0x44, + 0xfe, 0x4f, 0x09, 0xe6, 0x03, 0xc2, 0x2c, 0x15, 0x73, 0xb7, 0x60, 0x7a, 0xdf, 0x15, 0x17, 0x6d, + 0x89, 0x69, 0x87, 0x24, 0x41, 0x94, 0xc2, 0xbe, 0xdb, 0xd4, 0xd1, 0xbb, 0x00, 0x03, 0x17, 0xeb, + 0x3c, 0xf3, 0x97, 0xa9, 0x9e, 0xb0, 0x44, 0x08, 0x58, 0x59, 0xd7, 0x6d, 0x28, 0x1b, 0xa6, 0xa5, + 0x63, 0x9a, 0xf5, 0xd5, 0xb3, 0xd5, 0x14, 0x02, 0xa3, 0xd8, 0x75, 0xb1, 0x2e, 0x63, 0xbe, 0x17, + 0x0a, 0xfd, 0x72, 0x43, 0xd9, 0x82, 0x23, 0xcc, 0x69, 0xed, 0xfb, 0x82, 0x8f, 0xa8, 0x0b, 0x8f, + 0x69, 0x4b, 0xa9, 0x19, 0x3c, 0x46, 0x12, 0xa4, 0xf2, 0x2a, 0x1c, 0x8b, 0x55, 0xa8, 0x66, 0xbf, + 0xd1, 0x6e, 0xc5, 0xae, 0x97, 0x02, 0x73, 0xbe, 0x11, 0xfd, 0x6e, 0x60, 0x7c, 0x59, 0x2c, 0x2f, + 0x58, 0xff, 0x18, 0x4e, 0x44, 0xee, 0xc1, 0x22, 0x12, 0xdd, 0x8e, 0x85, 0x80, 0x17, 0xc6, 0x71, + 0x8d, 0xc5, 0x82, 0xff, 0x2d, 0xc1, 0x42, 0x12, 0xc2, 0x0b, 0xde, 0xd3, 0xfe, 0x28, 0xe5, 0x4b, + 0xa5, 0x9b, 0xd9, 0xc4, 0xfa, 0x46, 0xee, 0xb8, 0x77, 0xd8, 0x77, 0x0b, 0xe3, 0x67, 0x29, 0x3f, + 0xc9, 0x2c, 0xfd, 0x34, 0x1f, 0xca, 0x57, 0x8c, 0xf8, 0xaa, 0xe0, 0xa5, 0xef, 0x00, 0x9b, 0xb1, + 0x8f, 0x0a, 0xae, 0x8f, 0x20, 0x1f, 0xf3, 0x4d, 0xc1, 0x87, 0x49, 0x97, 0x01, 0x37, 0xb2, 0xf1, + 0xfb, 0xce, 0x5e, 0x1b, 0xff, 0x34, 0x07, 0xd5, 0xe8, 0x14, 0xa1, 0xcd, 0x84, 0x2f, 0x0a, 0xce, + 0x67, 0x1a, 0x66, 0xe4, 0x83, 0x02, 0x5e, 0xb5, 0x9f, 0x9b, 0xb4, 0x6a, 0x3f, 0x3f, 0x49, 0xd5, + 0xfe, 0x43, 0xa8, 0x3e, 0x73, 0x0c, 0x4f, 0xdb, 0xeb, 0x61, 0xb5, 0xa7, 0x1d, 0x62, 0x87, 0x7b, + 0xc9, 0x0c, 0x8e, 0xac, 0x22, 0x08, 0x1f, 0x11, 0x3a, 0xf9, 0x6f, 0x24, 0x28, 0x0a, 0x91, 0xc6, + 0xd6, 0xca, 0x2f, 0x0e, 0x08, 0x9a, 0x4a, 0xeb, 0x6d, 0x4d, 0xcd, 0xb4, 0x54, 0x17, 0x93, 0x7d, + 0x3c, 0x63, 0xb5, 0xf9, 0x02, 0xa5, 0x5e, 0xb7, 0x1c, 0xbc, 0xa5, 0x99, 0x56, 0x9b, 0x91, 0xa2, + 0x07, 0x50, 0x63, 0x5c, 0x29, 0x43, 0xc2, 0x3a, 0xe3, 0x8e, 0x51, 0xa5, 0x64, 0x84, 0x15, 0x61, + 0xe9, 0xca, 0x7f, 0x9d, 0x87, 0x72, 0x48, 0x57, 0x63, 0x06, 0xd3, 0x84, 0x23, 0xa2, 0x16, 0xc2, + 0xc5, 0xde, 0x24, 0x45, 0xf3, 0xf3, 0x9c, 0xae, 0x8d, 0x3d, 0xb6, 0x5f, 0xdd, 0x87, 0x79, 0xed, + 0xa9, 0x66, 0xf4, 0xe8, 0x6c, 0x4c, 0xb0, 0xe5, 0x55, 0x7d, 0x2a, 0x7f, 0xdf, 0x63, 0x9a, 0x98, + 0xa0, 0x96, 0x1e, 0x28, 0x45, 0x50, 0xc4, 0xef, 0xba, 0x9c, 0x3a, 0x5b, 0x39, 0xbd, 0xe3, 0xba, + 0x7e, 0xdf, 0xb4, 0x7e, 0x97, 0x7e, 0xc8, 0xe0, 0xf2, 0x8f, 0xaa, 0xc7, 0xf5, 0x4d, 0x28, 0xee, + 0x53, 0x02, 0xa2, 0xce, 0xbe, 0xf6, 0xa9, 0xe5, 0xa8, 0x61, 0x2e, 0xb3, 0x99, 0xd4, 0x49, 0xe9, + 0x5a, 0x3e, 0x2b, 0xf9, 0x36, 0x9c, 0x50, 0xb0, 0x65, 0x63, 0xd3, 0x5f, 0x69, 0x8f, 0xac, 0xee, + 0x04, 0x7b, 0xeb, 0x2b, 0xd0, 0x48, 0xa2, 0x67, 0x9e, 0xfb, 0xca, 0x05, 0x28, 0x8a, 0xbf, 0x1f, + 0x43, 0xb3, 0x90, 0xdf, 0x59, 0x6f, 0xd5, 0xa6, 0xc8, 0xc3, 0xee, 0x46, 0xab, 0x26, 0xa1, 0x22, + 0x14, 0xda, 0xeb, 0x3b, 0xad, 0x5a, 0xee, 0x4a, 0x1f, 0x6a, 0xf1, 0xff, 0xde, 0x42, 0x8b, 0x70, + 0xb4, 0xa5, 0x6c, 0xb7, 0xd6, 0x1e, 0xac, 0xed, 0x34, 0xb7, 0xb7, 0xd4, 0x96, 0xd2, 0x7c, 0x7f, + 0x6d, 0x67, 0xb3, 0x36, 0x85, 0xce, 0xc2, 0xa9, 0xf0, 0x8b, 0x87, 0xdb, 0xed, 0x1d, 0x75, 0x67, + 0x5b, 0x5d, 0xdf, 0xde, 0xda, 0x59, 0x6b, 0x6e, 0x6d, 0x2a, 0x35, 0x09, 0x9d, 0x82, 0x13, 0x61, + 0x94, 0x7b, 0xcd, 0x8d, 0xa6, 0xb2, 0xb9, 0x4e, 0x9e, 0xd7, 0x1e, 0xd5, 0x72, 0x57, 0xde, 0x83, + 0x4a, 0xe4, 0xaf, 0xb2, 0x88, 0x48, 0xad, 0xed, 0x8d, 0xda, 0x14, 0xaa, 0x40, 0x29, 0xcc, 0xa7, + 0x08, 0x85, 0xad, 0xed, 0x8d, 0xcd, 0x5a, 0x0e, 0x01, 0xcc, 0xec, 0xac, 0x29, 0x0f, 0x36, 0x77, + 0x6a, 0xf9, 0x2b, 0xab, 0xf1, 0x0f, 0xa4, 0x30, 0x3a, 0x02, 0x95, 0xf6, 0xda, 0xd6, 0xc6, 0xbd, + 0xed, 0x0f, 0x55, 0x65, 0x73, 0x6d, 0xe3, 0xa3, 0xda, 0x14, 0x5a, 0x80, 0x9a, 0x00, 0x6d, 0x6d, + 0xef, 0x30, 0xa8, 0x74, 0xe5, 0x49, 0xcc, 0x13, 0x62, 0x74, 0x0c, 0x8e, 0xf8, 0x5d, 0xaa, 0xeb, + 0xca, 0xe6, 0xda, 0xce, 0x26, 0x91, 0x24, 0x02, 0x56, 0x76, 0xb7, 0xb6, 0x9a, 0x5b, 0x0f, 0x6a, + 0x12, 0xe1, 0x1a, 0x80, 0x37, 0x3f, 0x6c, 0x12, 0xe4, 0x5c, 0x14, 0x79, 0x77, 0xeb, 0x07, 0x5b, + 0xdb, 0x1f, 0x6c, 0xd5, 0xf2, 0x2b, 0x3f, 0x3f, 0xea, 0xff, 0x7d, 0x51, 0x1b, 0x3b, 0xb4, 0x62, + 0xab, 0x05, 0xb3, 0xe2, 0xaf, 0xed, 0x12, 0xf6, 0xd1, 0xe8, 0x1f, 0xf2, 0x35, 0xce, 0x8e, 0xc0, + 0xe0, 0xa7, 0xa2, 0x29, 0xb4, 0x47, 0x4f, 0x29, 0xa1, 0xcf, 0x82, 0x2f, 0x24, 0x9e, 0x09, 0x86, + 0xbe, 0x44, 0x6e, 0x5c, 0x1c, 0x8b, 0xe7, 0xf7, 0x81, 0xc9, 0x41, 0x24, 0xfc, 0xcf, 0x1b, 0xe8, + 0x62, 0xd2, 0x09, 0x22, 0xe1, 0xaf, 0x3d, 0x1a, 0x97, 0xc6, 0x23, 0xfa, 0xdd, 0x3c, 0x81, 0x5a, + 0xfc, 0x5f, 0x38, 0x50, 0x42, 0x5a, 0x20, 0xe5, 0xaf, 0x3e, 0x1a, 0x57, 0xb2, 0xa0, 0x86, 0x3b, + 0x1b, 0xfa, 0x5b, 0x89, 0xcb, 0x59, 0x3e, 0xbf, 0x4f, 0xed, 0x2c, 0xed, 0x4b, 0x7d, 0xa6, 0xc0, + 0xe8, 0x97, 0x9b, 0x28, 0xf1, 0x3f, 0x1c, 0x12, 0x3e, 0x18, 0x4f, 0x52, 0x60, 0xf2, 0x47, 0xc1, + 0xf2, 0x14, 0x3a, 0x80, 0xf9, 0x58, 0xe9, 0x0d, 0x4a, 0x20, 0x4f, 0xae, 0x31, 0x6a, 0x5c, 0xce, + 0x80, 0x19, 0xb5, 0x88, 0x70, 0xa9, 0x4d, 0xb2, 0x45, 0x24, 0x14, 0xf2, 0x24, 0x5b, 0x44, 0x62, + 0xd5, 0x0e, 0x35, 0xee, 0x48, 0x89, 0x4d, 0x92, 0x71, 0x27, 0x15, 0xf6, 0x34, 0x2e, 0x8e, 0xc5, + 0x0b, 0x2b, 0x2d, 0x56, 0x70, 0x93, 0xa4, 0xb4, 0xe4, 0x82, 0x9e, 0xc6, 0xe5, 0x0c, 0x98, 0x71, + 0x2b, 0x08, 0xd2, 0xf7, 0x69, 0x56, 0x30, 0x54, 0x6c, 0x92, 0x66, 0x05, 0xc3, 0x95, 0x00, 0xdc, + 0x0a, 0x62, 0x69, 0xf7, 0x4b, 0x19, 0xd2, 0x84, 0xe9, 0x56, 0x90, 0x9c, 0x50, 0x94, 0xa7, 0xd0, + 0x4f, 0x24, 0xa8, 0xa7, 0x65, 0xa5, 0xd0, 0xf5, 0x89, 0x53, 0x68, 0x8d, 0x95, 0x49, 0x48, 0x7c, + 0x29, 0x3e, 0x03, 0x34, 0xbc, 0x07, 0xa2, 0xd7, 0x92, 0x66, 0x26, 0x65, 0xa7, 0x6d, 0xbc, 0x9e, + 0x0d, 0xd9, 0xef, 0xb2, 0x0d, 0x45, 0x91, 0x07, 0x43, 0x09, 0x5e, 0x3a, 0x96, 0x85, 0x6b, 0xc8, + 0xa3, 0x50, 0x7c, 0xa6, 0x0f, 0xa0, 0x40, 0xa0, 0xe8, 0x54, 0x32, 0xb6, 0x60, 0xb6, 0x94, 0xf6, + 0xda, 0x67, 0xf4, 0x18, 0x66, 0x58, 0xe2, 0x07, 0x25, 0xdc, 0x0f, 0x45, 0xd2, 0x53, 0x8d, 0x33, + 0xe9, 0x08, 0x3e, 0xbb, 0x4f, 0xd8, 0xbf, 0x9e, 0xf2, 0x9c, 0x0e, 0x7a, 0x35, 0xf9, 0xcf, 0xc4, + 0xa2, 0x29, 0xa4, 0xc6, 0xf9, 0x31, 0x58, 0xe1, 0x45, 0x11, 0x3b, 0x9b, 0x5c, 0x1c, 0x7b, 0xc0, + 0x4c, 0x5f, 0x14, 0xc9, 0x47, 0x58, 0x66, 0x24, 0xc3, 0x47, 0xdc, 0x24, 0x23, 0x49, 0xbd, 0x58, + 0x48, 0x32, 0x92, 0xf4, 0x53, 0x33, 0x5b, 0x87, 0xf1, 0xaf, 0x9c, 0x2f, 0x8d, 0xff, 0x26, 0x3f, + 0x7d, 0x1d, 0xa6, 0x7c, 0xf7, 0x2f, 0x4f, 0x21, 0x0f, 0x8e, 0x26, 0xfc, 0x31, 0x00, 0x7a, 0x7d, + 0xdc, 0xd6, 0x11, 0xe9, 0xf1, 0x6a, 0x46, 0xec, 0x70, 0xaf, 0x09, 0x17, 0xb6, 0x49, 0xbd, 0xa6, + 0xdf, 0x1e, 0x27, 0xf5, 0x3a, 0xea, 0x16, 0x98, 0x1a, 0x37, 0x77, 0x6a, 0xa7, 0xd3, 0x6f, 0x31, + 0x53, 0x8d, 0x3b, 0xee, 0xc2, 0x56, 0x7e, 0x9d, 0x87, 0x39, 0x76, 0x19, 0xcf, 0x23, 0xb4, 0x8f, + 0x00, 0x82, 0x3c, 0x18, 0x3a, 0x97, 0xac, 0x94, 0x48, 0xd2, 0xb1, 0xf1, 0xea, 0x68, 0xa4, 0xf0, + 0x42, 0x0a, 0xe5, 0x94, 0x92, 0x16, 0xd2, 0x70, 0xea, 0x2c, 0x69, 0x21, 0x25, 0x24, 0xa6, 0xe4, + 0x29, 0xf4, 0x3e, 0x94, 0xfc, 0xe4, 0x05, 0x4a, 0x4a, 0x7e, 0xc4, 0xb2, 0x33, 0x8d, 0x73, 0x23, + 0x71, 0xc2, 0x52, 0x87, 0x32, 0x13, 0x49, 0x52, 0x0f, 0x67, 0x40, 0x92, 0xa4, 0x4e, 0x4a, 0x6f, + 0x04, 0x3a, 0x61, 0xf7, 0x97, 0xa9, 0x3a, 0x89, 0x5c, 0x1f, 0xa7, 0xea, 0x24, 0x7a, 0x09, 0x2a, + 0x4f, 0xdd, 0xbb, 0xf0, 0xcb, 0x2f, 0x96, 0xa4, 0x7f, 0xfe, 0x62, 0x69, 0xea, 0xf3, 0x2f, 0x97, + 0xa4, 0x5f, 0x7e, 0xb9, 0x24, 0xfd, 0xd3, 0x97, 0x4b, 0xd2, 0xbf, 0x7e, 0xb9, 0x24, 0xfd, 0xf6, + 0xbf, 0x2d, 0x4d, 0xfd, 0xb0, 0x28, 0xa8, 0xf7, 0x66, 0xe8, 0x7f, 0x33, 0xbf, 0xf1, 0x7f, 0x01, + 0x00, 0x00, 0xff, 0xff, 0x86, 0xde, 0xb4, 0x0e, 0x61, 0x5b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -14231,6 +14243,16 @@ func (m *Image) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Pinned { + i-- + if m.Pinned { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } if m.Spec != nil { { size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) @@ -17626,6 +17648,9 @@ func (m *Image) Size() (n int) { l = m.Spec.Size() n += 1 + l + sovApi(uint64(l)) } + if m.Pinned { + n += 2 + } return n } @@ -19521,6 +19546,7 @@ func (this *Image) String() string { `Uid:` + strings.Replace(this.Uid.String(), "Int64Value", "Int64Value", 1) + `,`, `Username:` + fmt.Sprintf("%v", this.Username) + `,`, `Spec:` + strings.Replace(this.Spec.String(), "ImageSpec", "ImageSpec", 1) + `,`, + `Pinned:` + fmt.Sprintf("%v", this.Pinned) + `,`, `}`, }, "") return s @@ -34684,6 +34710,26 @@ func (m *Image) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Pinned", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Pinned = bool(v != 0) default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) diff --git a/vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.proto b/vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.proto index 22194efb63b6e..ba3230d183b9b 100644 --- a/vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.proto +++ b/vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.proto @@ -1255,6 +1255,10 @@ message Image { string username = 6; // ImageSpec for image which includes annotations ImageSpec spec = 7; + // Recommendation on whether this image should be exempt from garbage collection. + // It must only be treated as a recommendation -- the client can still request that the image be deleted, + // and the runtime must oblige. + bool pinned = 8; } message ListImagesResponse { diff --git a/vendor/k8s.io/klog/v2/go.mod b/vendor/k8s.io/klog/v2/go.mod index 08a2d0f31772f..31aefba74a712 100644 --- a/vendor/k8s.io/klog/v2/go.mod +++ b/vendor/k8s.io/klog/v2/go.mod @@ -2,4 +2,4 @@ module k8s.io/klog/v2 go 1.13 -require github.com/go-logr/logr v1.0.0 +require github.com/go-logr/logr v1.2.0 diff --git a/vendor/k8s.io/klog/v2/go.sum b/vendor/k8s.io/klog/v2/go.sum index a1b90e4bc1cb6..919fbadbc0d02 100644 --- a/vendor/k8s.io/klog/v2/go.sum +++ b/vendor/k8s.io/klog/v2/go.sum @@ -1,4 +1,2 @@ -github.com/go-logr/logr v1.0.0-rc1 h1:+ul9F74rBkPajeP8m4o3o0tiglmzNFsPnuhYyBCQ0Sc= -github.com/go-logr/logr v1.0.0-rc1/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v1.0.0 h1:kH951GinvFVaQgy/ki/B3YYmQtRpExGigSJg6O8z5jo= -github.com/go-logr/logr v1.0.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.0 h1:QK40JKJyMdUDz+h+xvCsru/bJhvG0UxvePV0ufL/AcE= +github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= diff --git a/vendor/k8s.io/klog/v2/klog.go b/vendor/k8s.io/klog/v2/klog.go index 60c88d3c3b40f..45efbb0755dae 100644 --- a/vendor/k8s.io/klog/v2/klog.go +++ b/vendor/k8s.io/klog/v2/klog.go @@ -1591,6 +1591,15 @@ func (ref ObjectRef) String() string { return ref.Name } +// MarshalLog ensures that loggers with support for structured output will log +// as a struct by removing the String method via a custom type. +func (ref ObjectRef) MarshalLog() interface{} { + type or ObjectRef + return or(ref) +} + +var _ logr.Marshaler = ObjectRef{} + // KMetadata is a subset of the kubernetes k8s.io/apimachinery/pkg/apis/meta/v1.Object interface // this interface may expand in the future, but will always be a subset of the // kubernetes k8s.io/apimachinery/pkg/apis/meta/v1.Object interface diff --git a/vendor/modules.txt b/vendor/modules.txt index 82355e18bad8d..d18fce3e59e1d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,3 +1,5 @@ +# cloud.google.com/go v0.81.0 +## explicit # github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8 ## explicit github.com/AdaLogics/go-fuzz-headers @@ -11,7 +13,7 @@ github.com/Microsoft/go-winio/pkg/fs github.com/Microsoft/go-winio/pkg/guid github.com/Microsoft/go-winio/pkg/security github.com/Microsoft/go-winio/vhd -# github.com/Microsoft/hcsshim v0.9.1 +# github.com/Microsoft/hcsshim v0.9.2 ## explicit github.com/Microsoft/hcsshim github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options @@ -48,15 +50,13 @@ github.com/Microsoft/hcsshim/pkg/ociwclayer github.com/Microsoft/hcsshim/pkg/octtrpc # github.com/beorn7/perks v1.0.1 github.com/beorn7/perks/quantile -# github.com/bits-and-blooms/bitset v1.2.0 -github.com/bits-and-blooms/bitset # github.com/blang/semver v3.5.1+incompatible github.com/blang/semver # github.com/cenkalti/backoff/v4 v4.1.2 github.com/cenkalti/backoff/v4 # github.com/cespare/xxhash/v2 v2.1.2 github.com/cespare/xxhash/v2 -# github.com/cilium/ebpf v0.6.2 +# github.com/cilium/ebpf v0.7.0 github.com/cilium/ebpf github.com/cilium/ebpf/asm github.com/cilium/ebpf/internal @@ -70,7 +70,7 @@ github.com/containerd/aufs/plugin # github.com/containerd/btrfs v1.0.0 ## explicit github.com/containerd/btrfs -# github.com/containerd/cgroups v1.0.2 +# github.com/containerd/cgroups v1.0.3 ## explicit github.com/containerd/cgroups github.com/containerd/cgroups/stats/v1 @@ -79,24 +79,7 @@ github.com/containerd/cgroups/v2/stats # github.com/containerd/console v1.0.3 ## explicit github.com/containerd/console -# github.com/containerd/containerd/api v1.6.0-beta.3 => ./api -## explicit -github.com/containerd/containerd/api/events -github.com/containerd/containerd/api/services/containers/v1 -github.com/containerd/containerd/api/services/content/v1 -github.com/containerd/containerd/api/services/diff/v1 -github.com/containerd/containerd/api/services/events/v1 -github.com/containerd/containerd/api/services/images/v1 -github.com/containerd/containerd/api/services/introspection/v1 -github.com/containerd/containerd/api/services/leases/v1 -github.com/containerd/containerd/api/services/namespaces/v1 -github.com/containerd/containerd/api/services/snapshots/v1 -github.com/containerd/containerd/api/services/tasks/v1 -github.com/containerd/containerd/api/services/ttrpc/events/v1 -github.com/containerd/containerd/api/services/version/v1 -github.com/containerd/containerd/api/types -github.com/containerd/containerd/api/types/task -# github.com/containerd/continuity v0.2.2-0.20211201162329-8e53e7cac79d +# github.com/containerd/continuity v0.2.2 ## explicit github.com/containerd/continuity github.com/containerd/continuity/devices @@ -111,13 +94,13 @@ github.com/containerd/continuity/testutil/loopback # github.com/containerd/fifo v1.0.0 ## explicit github.com/containerd/fifo -# github.com/containerd/go-cni v1.1.1-0.20211026134925-aa8bf14323a5 +# github.com/containerd/go-cni v1.1.3 ## explicit github.com/containerd/go-cni # github.com/containerd/go-runc v1.0.0 ## explicit github.com/containerd/go-runc -# github.com/containerd/imgcrypt v1.1.1 +# github.com/containerd/imgcrypt v1.1.3 ## explicit github.com/containerd/imgcrypt github.com/containerd/imgcrypt/images/encryption @@ -150,7 +133,7 @@ github.com/containernetworking/cni/pkg/version # github.com/containernetworking/plugins v1.0.1 ## explicit github.com/containernetworking/plugins/pkg/ns -# github.com/containers/ocicrypt v1.1.1 +# github.com/containers/ocicrypt v1.1.2 github.com/containers/ocicrypt github.com/containers/ocicrypt/blockcipher github.com/containers/ocicrypt/config @@ -196,7 +179,7 @@ github.com/go-logr/logr/funcr # github.com/go-logr/stdr v1.2.2 ## explicit github.com/go-logr/stdr -# github.com/godbus/dbus/v5 v5.0.4 +# github.com/godbus/dbus/v5 v5.0.6 github.com/godbus/dbus/v5 # github.com/gogo/googleapis v1.4.0 => github.com/gogo/googleapis v1.3.2 ## explicit @@ -280,7 +263,8 @@ github.com/intel/goresctrl/pkg/kubernetes github.com/intel/goresctrl/pkg/log github.com/intel/goresctrl/pkg/rdt github.com/intel/goresctrl/pkg/utils -# github.com/json-iterator/go v1.1.11 +# github.com/json-iterator/go v1.1.12 +## explicit github.com/json-iterator/go # github.com/klauspost/compress v1.11.13 ## explicit @@ -312,7 +296,7 @@ github.com/moby/sys/signal github.com/moby/sys/symlink # github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd github.com/modern-go/concurrent -# github.com/modern-go/reflect2 v1.0.1 +# github.com/modern-go/reflect2 v1.0.2 github.com/modern-go/reflect2 # github.com/opencontainers/go-digest v1.0.0 ## explicit @@ -323,17 +307,18 @@ github.com/opencontainers/go-digest/digestset github.com/opencontainers/image-spec/identity github.com/opencontainers/image-spec/specs-go github.com/opencontainers/image-spec/specs-go/v1 -# github.com/opencontainers/runc v1.0.3 +# github.com/opencontainers/runc v1.1.0 ## explicit github.com/opencontainers/runc/libcontainer/user # github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 ## explicit github.com/opencontainers/runtime-spec/specs-go -# github.com/opencontainers/selinux v1.8.2 +# github.com/opencontainers/selinux v1.10.0 ## explicit github.com/opencontainers/selinux/go-selinux github.com/opencontainers/selinux/go-selinux/label github.com/opencontainers/selinux/pkg/pwalk +github.com/opencontainers/selinux/pkg/pwalkdir # github.com/pelletier/go-toml v1.9.3 ## explicit github.com/pelletier/go-toml @@ -391,7 +376,7 @@ github.com/vishvananda/netns go.etcd.io/bbolt # go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1 go.mozilla.org/pkcs7 -# go.opencensus.io v0.22.4 +# go.opencensus.io v0.23.0 ## explicit go.opencensus.io go.opencensus.io/internal @@ -418,12 +403,16 @@ go.opentelemetry.io/otel/semconv/v1.7.0 # go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.3.0 go.opentelemetry.io/otel/exporters/otlp/internal/retry # go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.3.0 +## explicit go.opentelemetry.io/otel/exporters/otlp/otlptrace go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/otlpconfig go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform # go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.3.0 ## explicit go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc +# go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.3.0 +## explicit +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp # go.opentelemetry.io/otel/sdk v1.3.0 ## explicit go.opentelemetry.io/otel/sdk/instrumentation @@ -438,7 +427,8 @@ go.opentelemetry.io/proto/otlp/collector/trace/v1 go.opentelemetry.io/proto/otlp/common/v1 go.opentelemetry.io/proto/otlp/resource/v1 go.opentelemetry.io/proto/otlp/trace/v1 -# golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 +# golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 +## explicit golang.org/x/crypto/cast5 golang.org/x/crypto/ed25519 golang.org/x/crypto/ed25519/internal/edwards25519 @@ -460,7 +450,8 @@ golang.org/x/net/idna golang.org/x/net/internal/timeseries golang.org/x/net/trace golang.org/x/net/websocket -# golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c +# golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f +## explicit golang.org/x/oauth2 golang.org/x/oauth2/internal # golang.org/x/sync v0.0.0-20210220032951-036812b2e83c @@ -478,10 +469,10 @@ golang.org/x/sys/windows/registry golang.org/x/sys/windows/svc golang.org/x/sys/windows/svc/debug golang.org/x/sys/windows/svc/mgr -# golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d +# golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b +## explicit golang.org/x/term # golang.org/x/text v0.3.7 -## explicit golang.org/x/text/secure/bidirule golang.org/x/text/transform golang.org/x/text/unicode/bidi @@ -491,7 +482,7 @@ golang.org/x/time/rate # golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 golang.org/x/xerrors golang.org/x/xerrors/internal -# google.golang.org/appengine v1.6.6 +# google.golang.org/appengine v1.6.7 google.golang.org/appengine/internal google.golang.org/appengine/internal/base google.golang.org/appengine/internal/datastore @@ -608,11 +599,11 @@ gotest.tools/v3/internal/assert gotest.tools/v3/internal/difflib gotest.tools/v3/internal/format gotest.tools/v3/internal/source -# k8s.io/api v0.22.0 +# k8s.io/api v0.22.5 ## explicit k8s.io/api/authentication/v1 k8s.io/api/core/v1 -# k8s.io/apimachinery v0.22.1 +# k8s.io/apimachinery v0.22.5 ## explicit k8s.io/apimachinery/pkg/api/errors k8s.io/apimachinery/pkg/api/meta @@ -658,7 +649,7 @@ k8s.io/apimachinery/pkg/version k8s.io/apimachinery/pkg/watch k8s.io/apimachinery/third_party/forked/golang/netutil k8s.io/apimachinery/third_party/forked/golang/reflect -# k8s.io/apiserver v0.22.0 +# k8s.io/apiserver v0.22.5 ## explicit k8s.io/apiserver/pkg/apis/audit k8s.io/apiserver/pkg/apis/audit/v1 @@ -673,7 +664,7 @@ k8s.io/apiserver/pkg/features k8s.io/apiserver/pkg/server/httplog k8s.io/apiserver/pkg/util/feature k8s.io/apiserver/pkg/util/wsstream -# k8s.io/client-go v0.22.0 +# k8s.io/client-go v0.22.5 ## explicit k8s.io/client-go/pkg/apis/clientauthentication k8s.io/client-go/pkg/apis/clientauthentication/install @@ -695,18 +686,18 @@ k8s.io/client-go/util/exec k8s.io/client-go/util/flowcontrol k8s.io/client-go/util/keyutil k8s.io/client-go/util/workqueue -# k8s.io/component-base v0.22.0 +# k8s.io/component-base v0.22.5 ## explicit k8s.io/component-base/featuregate k8s.io/component-base/logs/logreduction k8s.io/component-base/metrics k8s.io/component-base/metrics/legacyregistry k8s.io/component-base/version -# k8s.io/cri-api v0.23.0-alpha.4 +# k8s.io/cri-api v0.23.1 ## explicit k8s.io/cri-api/pkg/apis/runtime/v1 k8s.io/cri-api/pkg/apis/runtime/v1alpha2 -# k8s.io/klog/v2 v2.20.0 +# k8s.io/klog/v2 v2.30.0 ## explicit k8s.io/klog/v2 # k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b @@ -720,7 +711,6 @@ sigs.k8s.io/structured-merge-diff/v4/value # sigs.k8s.io/yaml v1.2.0 sigs.k8s.io/yaml # github.com/containerd/containerd => ./.empty-mod/ -# github.com/containerd/containerd/api => ./api # github.com/gogo/googleapis => github.com/gogo/googleapis v1.3.2 # github.com/urfave/cli => github.com/urfave/cli v1.22.1 # google.golang.org/genproto => google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63 diff --git a/version/version.go b/version/version.go index 17ada168f6579..4470b128f3eab 100644 --- a/version/version.go +++ b/version/version.go @@ -23,7 +23,7 @@ var ( Package = "github.com/containerd/containerd" // Version holds the complete version number. Filled in at linking time. - Version = "1.6.0-beta.5+unknown" + Version = "1.6.0+unknown" // Revision is filled with the VCS (e.g. git) revision being used to build // the program at linking time.