diff --git a/vendor.mod b/vendor.mod index 6ef70c2d30..548e07771a 100644 --- a/vendor.mod +++ b/vendor.mod @@ -16,7 +16,7 @@ require ( github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c github.com/Graylog2/go-gelf v0.0.0-20191017102106-1550ee647df0 github.com/Microsoft/go-winio v0.6.2 - github.com/Microsoft/hcsshim v0.12.9 + github.com/Microsoft/hcsshim v0.13.0 github.com/RackSec/srslog v0.0.0-20180709174129-a4725f04ec91 github.com/aws/aws-sdk-go-v2 v1.30.3 github.com/aws/aws-sdk-go-v2/config v1.27.27 @@ -27,7 +27,7 @@ require ( github.com/cloudflare/cfssl v1.6.4 github.com/containerd/cgroups/v3 v3.0.5 github.com/containerd/containerd/api v1.9.0 - github.com/containerd/containerd/v2 v2.0.5 + github.com/containerd/containerd/v2 v2.1.1 github.com/containerd/continuity v0.4.5 github.com/containerd/errdefs v1.0.0 github.com/containerd/errdefs/pkg v0.3.0 @@ -62,7 +62,7 @@ require ( github.com/miekg/dns v1.1.66 github.com/mistifyio/go-zfs/v3 v3.0.1 github.com/mitchellh/copystructure v1.2.0 - github.com/moby/buildkit v0.22.0 + github.com/moby/buildkit v0.23.0-rc1 github.com/moby/docker-image-spec v1.3.1 github.com/moby/go-archive v0.1.0 github.com/moby/ipvs v1.1.0 @@ -122,7 +122,6 @@ require ( require ( cloud.google.com/go v0.112.0 // indirect cloud.google.com/go/longrunning v0.5.5 // indirect - github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20231105174938-2b5cbb29f3e2 // indirect github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.5.0 // indirect @@ -154,8 +153,8 @@ require ( github.com/containerd/plugin v1.0.0 // indirect github.com/containerd/stargz-snapshotter/estargz v0.16.3 // indirect github.com/containerd/ttrpc v1.2.7 // indirect - github.com/containernetworking/cni v1.2.3 // indirect - github.com/containernetworking/plugins v1.6.2 // indirect + github.com/containernetworking/cni v1.3.0 // indirect + github.com/containernetworking/plugins v1.7.1 // indirect github.com/cyphar/filepath-securejoin v0.4.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dimchansky/utfbom v1.1.1 // indirect @@ -183,7 +182,7 @@ require ( github.com/hashicorp/go-sockaddr v1.0.2 // indirect github.com/hashicorp/golang-lru v0.5.4 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect - github.com/in-toto/in-toto-golang v0.5.0 // indirect + github.com/in-toto/in-toto-golang v0.9.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmoiron/sqlx v1.3.3 // indirect github.com/klauspost/compress v1.18.0 // indirect @@ -202,16 +201,16 @@ require ( github.com/prometheus/procfs v0.15.1 // indirect github.com/sasha-s/go-deadlock v0.3.5 // indirect github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect - github.com/secure-systems-lab/go-securesystemslib v0.4.0 // indirect + github.com/secure-systems-lab/go-securesystemslib v0.6.0 // indirect github.com/shibumi/go-pathspec v1.3.0 // indirect - github.com/spdx/tools-golang v0.5.3 // indirect + github.com/spdx/tools-golang v0.5.5 // indirect github.com/stretchr/testify v1.10.0 // indirect github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect github.com/tinylib/msgp v1.1.8 // indirect github.com/tonistiigi/dchapes-mode v0.0.0-20250318174251-73d941a28323 // indirect - github.com/tonistiigi/fsutil v0.0.0-20250417144416-3f76f8130144 // indirect - github.com/tonistiigi/go-actions-cache v0.0.0-20250228231703-3e9a6642607f // indirect - github.com/tonistiigi/go-csvvalue v0.0.0-20240710180619-ddb21b71c0b4 // indirect + github.com/tonistiigi/fsutil v0.0.0-20250605211040-586307ad452f // indirect + github.com/tonistiigi/go-actions-cache v0.0.0-20250611155157-388a2ec8cdf8 // indirect + github.com/tonistiigi/go-csvvalue v0.0.0-20240814133006-030d3b2625d0 // indirect github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea // indirect github.com/tonistiigi/vt100 v0.0.0-20240514184818-90bafcd6abab // indirect github.com/weppos/publicsuffix-go v0.15.1-0.20210511084619-b1f36a2d6c0b // indirect @@ -238,7 +237,7 @@ require ( golang.org/x/oauth2 v0.29.0 // indirect golang.org/x/tools v0.32.0 // indirect google.golang.org/api v0.160.0 // indirect - google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 // indirect; TODO(thaJeztah): should we keep this one aligned with the other google.golang.org/genproto/xxx modules? + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect; TODO(thaJeztah): should we keep this one aligned with the other google.golang.org/genproto/xxx modules? google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/klog/v2 v2.130.1 // indirect diff --git a/vendor.sum b/vendor.sum index e1b36b1a42..b9d7153c1c 100644 --- a/vendor.sum +++ b/vendor.sum @@ -3,8 +3,8 @@ cloud.google.com/go v0.112.0 h1:tpFCD7hpHFlQ8yPwT3x+QeXqc2T6+n6T+hmABHfDUSM= cloud.google.com/go v0.112.0/go.mod h1:3jEEVwZ/MHU4djK5t5RHuKOA/GbLddgTdVubX1qnPD4= cloud.google.com/go/compute/metadata v0.6.0 h1:A6hENjEsCDtC1k8byVsgwvVcioamEHvZ4j01OwKxG9I= cloud.google.com/go/compute/metadata v0.6.0/go.mod h1:FjyFAW1MW0C203CEOMDTu3Dk1FlqW3Rga40jzHL4hfg= -cloud.google.com/go/iam v1.1.5 h1:1jTsCu4bcsNsE4iiqNT5SHwrDRCfRmIaaaVFhRveTJI= -cloud.google.com/go/iam v1.1.5/go.mod h1:rB6P/Ic3mykPbFio+vo7403drjlgvoWfYpJhMXEbzv8= +cloud.google.com/go/iam v1.1.6 h1:bEa06k05IO4f4uJonbB5iAgKTPpABy1ayxaIZV/GHVc= +cloud.google.com/go/iam v1.1.6/go.mod h1:O0zxdPeGBoFdWW3HWmBxJsk0pfvNM/p/qa82rWOGTwI= cloud.google.com/go/logging v1.9.0 h1:iEIOXFO9EmSiTjDmfpbRjOxECO7R8C7b8IXUGOj7xZw= cloud.google.com/go/logging v1.9.0/go.mod h1:1Io0vnZv4onoUnsVUQY3HZ3Igb1nBchky0A0y7BBBhE= cloud.google.com/go/longrunning v0.5.5 h1:GOE6pZFdSrTb4KAiKnXsJBtlE6mEyaW44oKyMILWnOg= @@ -15,8 +15,6 @@ dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s= dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 h1:He8afgbRMd7mFxO99hRNu+6tazq8nFF9lIwo9JFroBk= github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= -github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20231105174938-2b5cbb29f3e2 h1:dIScnXFlF784X79oi7MzVT6GWqr/W1uUt0pB5CsDs9M= -github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20231105174938-2b5cbb29f3e2/go.mod h1:gCLVsLfv1egrcZu+GoJATN5ts75F2s62ih/457eWzOw= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0 h1:JZg6HRh6W6U4OLl6lk7BZ7BLisIzM9dG1R50zUk9C/M= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0/go.mod h1:YL1xnZ6QejvQHWJrX/AvhFl4WW4rqHVoKspWNVwFk0M= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 h1:B/dfvscEQtew9dVuoxqxrUKKv8Ih2f55PydknDamU+g= @@ -37,8 +35,8 @@ github.com/Graylog2/go-gelf v0.0.0-20191017102106-1550ee647df0 h1:cOjLyhBhe91glg github.com/Graylog2/go-gelf v0.0.0-20191017102106-1550ee647df0/go.mod h1:fBaQWrftOD5CrVCUfoYGHs4X4VViTuGOXA8WloCjTY0= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= -github.com/Microsoft/hcsshim v0.12.9 h1:2zJy5KA+l0loz1HzEGqyNnjd3fyZA31ZBCGKacp6lLg= -github.com/Microsoft/hcsshim v0.12.9/go.mod h1:fJ0gkFAna6ukt0bLdKB8djt4XIJhF/vEPuoIWYVvZ8Y= +github.com/Microsoft/hcsshim v0.13.0 h1:/BcXOiS6Qi7N9XqUcv27vkIuVOkBEcWstd2pMlWSeaA= +github.com/Microsoft/hcsshim v0.13.0/go.mod h1:9KWJ/8DgU+QzYGupX4tzMhRQE8h6w90lH6HAaclpEok= github.com/RackSec/srslog v0.0.0-20180709174129-a4725f04ec91 h1:vX+gnvBc56EbWYrmlhYbFYRaeikAke1GL84N4BEYOFE= github.com/RackSec/srslog v0.0.0-20180709174129-a4725f04ec91/go.mod h1:cDLGBht23g0XQdLjzn6xOGXDkLK182YfINAaZEQLCHQ= github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= @@ -127,8 +125,8 @@ github.com/containerd/console v1.0.5 h1:R0ymNeydRqH2DmakFNdmjR2k0t7UPuiOV/N/27/q github.com/containerd/console v1.0.5/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk= github.com/containerd/containerd/api v1.9.0 h1:HZ/licowTRazus+wt9fM6r/9BQO7S0vD5lMcWspGIg0= github.com/containerd/containerd/api v1.9.0/go.mod h1:GhghKFmTR3hNtyznBoQ0EMWr9ju5AqHjcZPsSpTKutI= -github.com/containerd/containerd/v2 v2.0.5 h1:2vg/TjUXnaohAxiHnthQg8K06L9I4gdYEMcOLiMc8BQ= -github.com/containerd/containerd/v2 v2.0.5/go.mod h1:Qqo0UN43i2fX1FLkrSTCg6zcHNfjN7gEnx3NPRZI+N0= +github.com/containerd/containerd/v2 v2.1.1 h1:znnkm7Ajz8lg8BcIPMhc/9yjBRN3B+OkNKqKisKfwwM= +github.com/containerd/containerd/v2 v2.1.1/go.mod h1:zIfkQj4RIodclYQkX7GSSswSwgP8d/XxDOtOAoSDIGU= github.com/containerd/continuity v0.4.5 h1:ZRoN1sXq9u7V6QoHMcVWGhOwDFqZ4B9i5H6un1Wh0x4= github.com/containerd/continuity v0.4.5/go.mod h1:/lNJvtJKUQStBzpVQ1+rasXO1LAWtUQssk28EZvJ3nE= github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI= @@ -155,10 +153,10 @@ github.com/containerd/ttrpc v1.2.7 h1:qIrroQvuOL9HQ1X6KHe2ohc7p+HP/0VE6XPU7elJRq github.com/containerd/ttrpc v1.2.7/go.mod h1:YCXHsb32f+Sq5/72xHubdiJRQY9inL4a4ZQrAbN1q9o= github.com/containerd/typeurl/v2 v2.2.3 h1:yNA/94zxWdvYACdYO8zofhrTVuQY73fFU1y++dYSw40= github.com/containerd/typeurl/v2 v2.2.3/go.mod h1:95ljDnPfD3bAbDJRugOiShd/DlAAsxGtUBhJxIn7SCk= -github.com/containernetworking/cni v1.2.3 h1:hhOcjNVUQTnzdRJ6alC5XF+wd9mfGIUaj8FuJbEslXM= -github.com/containernetworking/cni v1.2.3/go.mod h1:DuLgF+aPd3DzcTQTtp/Nvl1Kim23oFKdm2okJzBQA5M= -github.com/containernetworking/plugins v1.6.2 h1:pqP8Mq923TLyef5g97XfJ/xpDeVek4yF8A4mzy9Tc4U= -github.com/containernetworking/plugins v1.6.2/go.mod h1:SP5UG3jDO9LtmfbBJdP+nl3A1atOtbj2MBOYsnaxy64= +github.com/containernetworking/cni v1.3.0 h1:v6EpN8RznAZj9765HhXQrtXgX+ECGebEYEmnuFjskwo= +github.com/containernetworking/cni v1.3.0/go.mod h1:Bs8glZjjFfGPHMw6hQu82RUgEPNGEaBb9KS5KtNMnJ4= +github.com/containernetworking/plugins v1.7.1 h1:CNAR0jviDj6FS5Vg85NTgKWLDzZPfi/lj+VJfhMDTIs= +github.com/containernetworking/plugins v1.7.1/go.mod h1:xuMdjuio+a1oVQsHKjr/mgzuZ24leAsqUYRnzGoXHy0= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= @@ -177,8 +175,8 @@ github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/docker/cli v28.1.1+incompatible h1:eyUemzeI45DY7eDPuwUcmDyDj1pM98oD5MdSpiItp8k= -github.com/docker/cli v28.1.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v28.2.2+incompatible h1:qzx5BNUDFqlvyq4AHzdNB7gSyVTmU4cgsyN9SdInc1A= +github.com/docker/cli v28.2.2+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker-credential-helpers v0.9.3 h1:gAm/VtF9wgqJMoxzT3Gj5p4AqIjCBS4wrsOh9yRqcz8= @@ -265,11 +263,12 @@ 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.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db h1:097atOisP2aRj7vFgYQBbFN4U4JNXUNYpxael3UzMyo= -github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= +github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 h1:BHT72Gu3keYf3ZEu2J0b1vyeLSOYI8bm5wbJM/8yDe8= +github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA= github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= @@ -329,8 +328,8 @@ github.com/hashicorp/memberlist v0.4.0 h1:k3uda5gZcltmafuFF+UFqNEl5PrH+yPZ4zkjp1 github.com/hashicorp/memberlist v0.4.0/go.mod h1:yvyXLpo0QaGE59Y7hDTsTzDD25JYBZ4mHgHUZ8lrOI0= github.com/hashicorp/serf v0.8.5 h1:ZynDUIQiA8usmRgPdGPHFdPnb1wgGI9tK3mO9hcAJjc= github.com/hashicorp/serf v0.8.5/go.mod h1:UpNcs7fFbpKIyZaUuSW6EPiH+eZC7OuyFD+wc1oal+k= -github.com/in-toto/in-toto-golang v0.5.0 h1:hb8bgwr0M2hGdDsLjkJ3ZqJ8JFLL/tgYdAxF/XEFBbY= -github.com/in-toto/in-toto-golang v0.5.0/go.mod h1:/Rq0IZHLV7Ku5gielPT4wPHJfH1GdHMCq8+WPxw8/BE= +github.com/in-toto/in-toto-golang v0.9.0 h1:tHny7ac4KgtsfrG6ybU8gVOZux2H8jN05AXJ9EBM1XU= +github.com/in-toto/in-toto-golang v0.9.0/go.mod h1:xsBVrVsHNsB61++S6Dy2vWosKhuA3lUTQd+eF9HdeMo= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/ishidawataru/sctp v0.0.0-20230406120618-7ff4192f6ff2 h1:i2fYnDurfLlJH8AyyMOnkLHnHeP8Ff/DDpuZA/D3bPo= @@ -385,8 +384,8 @@ github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:F github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mndrix/tap-go v0.0.0-20171203230836-629fa407e90b/go.mod h1:pzzDgJWZ34fGzaAZGFW22KVZDfyrYW+QABMrWnJBnSs= -github.com/moby/buildkit v0.22.0 h1:aWN06w1YGSVN1XfeZbj2ZbgY+zi5xDAjEFI8Cy9fTjA= -github.com/moby/buildkit v0.22.0/go.mod h1:j4pP5hxiTWcz7xuTK2cyxQislHl/N2WWHzOy43DlLJw= +github.com/moby/buildkit v0.23.0-rc1 h1:RIAEITsycLbXUt//rEPEfZUFnKUcm1cvpuWOfOidiWU= +github.com/moby/buildkit v0.23.0-rc1/go.mod h1:v5jMDvQgUyidk3wu3NvVAAd5JJo83nfet9Gf/o0+EAQ= github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= github.com/moby/go-archive v0.1.0 h1:Kk/5rdW/g+H8NHdJW2gsXyZ7UnzvJNOy6VKJqueWdcQ= @@ -436,10 +435,10 @@ github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.22.0 h1:Yed107/8DjTr0lKCNt7Dn8yQ6ybuDRQoMGrNFKzMfHg= -github.com/onsi/ginkgo/v2 v2.22.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo= -github.com/onsi/gomega v1.36.0 h1:Pb12RlruUtj4XUuPUqeEWc6j5DkVVVA49Uf6YLfC95Y= -github.com/onsi/gomega v1.36.0/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog= +github.com/onsi/ginkgo/v2 v2.23.4 h1:ktYTpKJAVZnDT4VjxSbiBenUjmlL/5QkBEocaWXiQus= +github.com/onsi/ginkgo/v2 v2.23.4/go.mod h1:Bt66ApGPBFzHyR+JO10Zbt0Gsp4uWxu5mIOTusL46e8= +github.com/onsi/gomega v1.37.0 h1:CdEG8g0S133B4OswTDC/5XPSzE1OeP29QOioj2PID2Y= +github.com/onsi/gomega v1.37.0/go.mod h1:8D9+Txp43QWKhM24yyOBEdpkzN8FvJyAwecBgsU4KU0= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/cgroups v0.0.2 h1:A+mAPPMfgKNCEZUUtibESFx06uvhAmvo8sSz3Abwk7o= github.com/opencontainers/cgroups v0.0.2/go.mod h1:s8lktyhlGUqM7OSRL5P7eAW6Wb+kWPNvt4qvVfzA5vs= @@ -515,8 +514,8 @@ github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/secure-systems-lab/go-securesystemslib v0.4.0 h1:b23VGrQhTA8cN2CbBw7/FulN9fTtqYUdS5+Oxzt+DUE= -github.com/secure-systems-lab/go-securesystemslib v0.4.0/go.mod h1:FGBZgq2tXWICsxWQW1msNf49F0Pf2Op5Htayx335Qbs= +github.com/secure-systems-lab/go-securesystemslib v0.6.0 h1:T65atpAVCJQK14UA57LMdZGpHi4QYSH/9FZyNGqMYIA= +github.com/secure-systems-lab/go-securesystemslib v0.6.0/go.mod h1:8Mtpo9JKks/qhPG4HGZ2LGMvrPbzuxwfz/f/zLfEWkk= github.com/shibumi/go-pathspec v1.3.0 h1:QUyMZhFo0Md5B8zV8x2tesohbb5kfbpTi9rBnKh5dkI= github.com/shibumi/go-pathspec v1.3.0/go.mod h1:Xutfslp817l2I1cZvgcfeMQJG5QnU2lh5tVaaMCl3jE= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -527,8 +526,8 @@ github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spdx/gordf v0.0.0-20201111095634-7098f93598fb/go.mod h1:uKWaldnbMnjsSAXRurWqqrdyZen1R7kxl8TkmWk2OyM= -github.com/spdx/tools-golang v0.5.3 h1:ialnHeEYUC4+hkm5vJm4qz2x+oEJbS0mAMFrNXdQraY= -github.com/spdx/tools-golang v0.5.3/go.mod h1:/ETOahiAo96Ob0/RAIBmFZw6XN0yTnyr/uFZm2NTMhI= +github.com/spdx/tools-golang v0.5.5 h1:61c0KLfAcNqAjlg6UNMdkwpMernhw3zVRwDZ2x9XOmk= +github.com/spdx/tools-golang v0.5.5/go.mod h1:MVIsXx8ZZzaRWNQpUDhC4Dud34edUYJYecciXgrw5vE= github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= @@ -547,6 +546,7 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI= @@ -557,14 +557,14 @@ github.com/tinylib/msgp v1.1.8 h1:FCXC1xanKO4I8plpHGH2P7koL/RzZs12l/+r7vakfm0= github.com/tinylib/msgp v1.1.8/go.mod h1:qkpG+2ldGg4xRFmx+jfTvZPxfGFhi64BcnL9vkCm/Tw= github.com/tonistiigi/dchapes-mode v0.0.0-20250318174251-73d941a28323 h1:r0p7fK56l8WPequOaR3i9LBqfPtEdXIQbUTzT55iqT4= github.com/tonistiigi/dchapes-mode v0.0.0-20250318174251-73d941a28323/go.mod h1:3Iuxbr0P7D3zUzBMAZB+ois3h/et0shEz0qApgHYGpY= -github.com/tonistiigi/fsutil v0.0.0-20250417144416-3f76f8130144 h1:k9tdF32oJYwtjzMx+D26M6eYiCaAPdJ7tyN7tF1oU5Q= -github.com/tonistiigi/fsutil v0.0.0-20250417144416-3f76f8130144/go.mod h1:BKdcez7BiVtBvIcef90ZPc6ebqIWr4JWD7+EvLm6J98= -github.com/tonistiigi/go-actions-cache v0.0.0-20250228231703-3e9a6642607f h1:q/SWz3Bz0KtAsqaBo73CHVXjaz5O8PDnmD2JHVhgYnE= -github.com/tonistiigi/go-actions-cache v0.0.0-20250228231703-3e9a6642607f/go.mod h1:h0oRlVs3NoFIHysRQ4rU1+RG4QmU0M2JVSwTYrB4igk= +github.com/tonistiigi/fsutil v0.0.0-20250605211040-586307ad452f h1:MoxeMfHAe5Qj/ySSBfL8A7l1V+hxuluj8owsIEEZipI= +github.com/tonistiigi/fsutil v0.0.0-20250605211040-586307ad452f/go.mod h1:BKdcez7BiVtBvIcef90ZPc6ebqIWr4JWD7+EvLm6J98= +github.com/tonistiigi/go-actions-cache v0.0.0-20250611155157-388a2ec8cdf8 h1:KbACff2cR+ip6/Kmt8zCzieMlKYyypArQT1ZweFxewQ= +github.com/tonistiigi/go-actions-cache v0.0.0-20250611155157-388a2ec8cdf8/go.mod h1:gJlfrsY8U+1n9RGKSgWryNFfzHRl/b1a99RUVL1L4Qw= github.com/tonistiigi/go-archvariant v1.0.0 h1:5LC1eDWiBNflnTF1prCiX09yfNHIxDC/aukdhCdTyb0= github.com/tonistiigi/go-archvariant v1.0.0/go.mod h1:TxFmO5VS6vMq2kvs3ht04iPXtu2rUT/erOnGFYfk5Ho= -github.com/tonistiigi/go-csvvalue v0.0.0-20240710180619-ddb21b71c0b4 h1:7I5c2Ig/5FgqkYOh/N87NzoyI9U15qUPXhDD8uCupv8= -github.com/tonistiigi/go-csvvalue v0.0.0-20240710180619-ddb21b71c0b4/go.mod h1:278M4p8WsNh3n4a1eqiFcV2FGk7wE5fwUpUom9mK9lE= +github.com/tonistiigi/go-csvvalue v0.0.0-20240814133006-030d3b2625d0 h1:2f304B10LaZdB8kkVEaoXvAMVan2tl9AiK4G0odjQtE= +github.com/tonistiigi/go-csvvalue v0.0.0-20240814133006-030d3b2625d0/go.mod h1:278M4p8WsNh3n4a1eqiFcV2FGk7wE5fwUpUom9mK9lE= github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea h1:SXhTLE6pb6eld/v/cCndK0AMpt1wiVFb/YYmqB3/QG0= github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea/go.mod h1:WPnis/6cRcDZSUvVmezrxJPkiO87ThFYsoUiMwWNDJk= github.com/tonistiigi/vt100 v0.0.0-20240514184818-90bafcd6abab h1:H6aJ0yKQ0gF49Qb2z5hI1UHxSQt4JMyxebFR15KnApw= @@ -645,6 +645,8 @@ go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs= +go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= @@ -784,8 +786,8 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 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-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 h1:KAeGQVN3M9nD0/bQXnr/ClcEMJ968gUXJQ9pwfSynuQ= -google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80/go.mod h1:cc8bqMqtv9gMOr0zHg2Vzff5ULhhL2IXP4sbcn32Dro= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a h1:nwKuGPlUAt+aR+pcrkfFRrTU1BVrSmYyYMxYbUIVHr0= google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a/go.mod h1:3kWAYMk1I75K4vykHtKt2ycnOgpA6974V7bREqbsenU= google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a h1:51aaUVRocpvUOSQKM6Q7VuoaktNIaMCLuhZB6DKksq4= @@ -835,13 +837,12 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -kernel.org/pub/linux/libs/security/libcap/cap v1.2.73 h1:Th2b8jljYqkyZKS3aD3N9VpYsQpHuXLgea+SZUIfODA= -kernel.org/pub/linux/libs/security/libcap/cap v1.2.73/go.mod h1:hbeKwKcboEsxARYmcy/AdPVN11wmT/Wnpgv4k4ftyqY= -kernel.org/pub/linux/libs/security/libcap/psx v1.2.73 h1:SEAEUiPVylTD4vqqi+vtGkSnXeP2FcRO3FoZB1MklMw= -kernel.org/pub/linux/libs/security/libcap/psx v1.2.73/go.mod h1:+l6Ee2F59XiJ2I6WR5ObpC1utCQJZ/VLsEbQCD8RG24= +kernel.org/pub/linux/libs/security/libcap/cap v1.2.76 h1:mrdLPj8ujM6eIKGtd1PkkuCIodpFFDM42Cfm0YODkIM= +kernel.org/pub/linux/libs/security/libcap/cap v1.2.76/go.mod h1:7V2BQeHnVAQwhCnCPJ977giCeGDiywVewWF+8vkpPlc= +kernel.org/pub/linux/libs/security/libcap/psx v1.2.76 h1:3DyzQ30OHt3wiOZVL1se2g1PAPJIU7+tMUyvfMUj1dY= +kernel.org/pub/linux/libs/security/libcap/psx v1.2.76/go.mod h1:+l6Ee2F59XiJ2I6WR5ObpC1utCQJZ/VLsEbQCD8RG24= resenje.org/singleflight v0.4.3 h1:l7foFYg8X/VEHPxWs1K/Pw77807RMVzvXgWGb0J1sdM= resenje.org/singleflight v0.4.3/go.mod h1:lAgQK7VfjG6/pgredbQfmV0RvG/uVhKo6vSuZ0vCWfk= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= tags.cncf.io/container-device-interface v1.0.1 h1:KqQDr4vIlxwfYh0Ed/uJGVgX+CHAkahrgabg6Q8GYxc= diff --git a/vendor/github.com/AdamKorcz/go-118-fuzz-build/LICENSE b/vendor/github.com/AdamKorcz/go-118-fuzz-build/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/vendor/github.com/AdamKorcz/go-118-fuzz-build/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/AdamKorcz/go-118-fuzz-build/testing/f.go b/vendor/github.com/AdamKorcz/go-118-fuzz-build/testing/f.go deleted file mode 100644 index 7d83a515af..0000000000 --- a/vendor/github.com/AdamKorcz/go-118-fuzz-build/testing/f.go +++ /dev/null @@ -1,179 +0,0 @@ -package testing - -import ( - "fmt" - fuzz "github.com/AdaLogics/go-fuzz-headers" - "os" - "reflect" -) - -type F struct { - Data []byte - T *T - FuzzFunc func(*T, any) -} - -func (f *F) CleanupTempDirs() { - f.T.CleanupTempDirs() -} - -func (f *F) Add(args ...any) {} -func (c *F) Cleanup(f func()) {} -func (c *F) Error(args ...any) {} -func (c *F) Errorf(format string, args ...any) {} -func (f *F) Fail() {} -func (c *F) FailNow() {} -func (c *F) Failed() bool { return false } -func (c *F) Fatal(args ...any) {} -func (c *F) Fatalf(format string, args ...any) {} -func (f *F) Fuzz(ff any) { - // we are assuming that ff is a func. - // TODO: Add a check for UX purposes - - fn := reflect.ValueOf(ff) - fnType := fn.Type() - var types []reflect.Type - for i := 1; i < fnType.NumIn(); i++ { - t := fnType.In(i) - - types = append(types, t) - } - args := []reflect.Value{reflect.ValueOf(f.T)} - fuzzConsumer := fuzz.NewConsumer(f.Data) - for _, v := range types { - //fmt.Printf("arg %v\n", v) - newElem := reflect.New(v).Elem() - switch v.String() { - case "[]uint8": - b, err := fuzzConsumer.GetBytes() - if err != nil { - return - } - newElem.SetBytes(b) - case "string": - s, err := fuzzConsumer.GetString() - if err != nil { - return - } - newElem.SetString(s) - case "int": - randInt, err := fuzzConsumer.GetUint64() - if err != nil { - return - } - newElem.SetInt(int64(int(randInt))) - case "int8": - randInt, err := fuzzConsumer.GetByte() - if err != nil { - return - } - newElem.SetInt(int64(randInt)) - case "int16": - randInt, err := fuzzConsumer.GetUint16() - if err != nil { - return - } - newElem.SetInt(int64(randInt)) - case "int32": - randInt, err := fuzzConsumer.GetUint32() - if err != nil { - return - } - newElem.SetInt(int64(int32(randInt))) - case "int64": - randInt, err := fuzzConsumer.GetUint64() - if err != nil { - return - } - newElem.SetInt(int64(randInt)) - case "uint": - randInt, err := fuzzConsumer.GetUint64() - if err != nil { - return - } - newElem.SetUint(uint64(uint(randInt))) - case "uint8": - randInt, err := fuzzConsumer.GetByte() - if err != nil { - return - } - newElem.SetUint(uint64(randInt)) - case "uint16": - randInt, err := fuzzConsumer.GetUint16() - if err != nil { - return - } - newElem.SetUint(uint64(randInt)) - case "uint32": - randInt, err := fuzzConsumer.GetUint32() - if err != nil { - return - } - newElem.SetUint(uint64(randInt)) - case "uint64": - randInt, err := fuzzConsumer.GetUint64() - if err != nil { - return - } - newElem.SetUint(uint64(randInt)) - case "rune": - randRune, err := fuzzConsumer.GetRune() - if err != nil { - return - } - newElem.Set(reflect.ValueOf(randRune)) - case "float32": - randFloat, err := fuzzConsumer.GetFloat32() - if err != nil { - return - } - newElem.Set(reflect.ValueOf(randFloat)) - case "float64": - randFloat, err := fuzzConsumer.GetFloat64() - if err != nil { - return - } - newElem.Set(reflect.ValueOf(randFloat)) - case "bool": - randBool, err := fuzzConsumer.GetBool() - if err != nil { - return - } - newElem.Set(reflect.ValueOf(randBool)) - default: - panic(fmt.Sprintf("unsupported type: %s", v.String())) - } - args = append(args, newElem) - - } - fn.Call(args) -} -func (f *F) Helper() {} -func (c *F) Log(args ...any) { - fmt.Print(args...) -} -func (c *F) Logf(format string, args ...any) { - fmt.Println(fmt.Sprintf(format, args...)) -} -func (c *F) Name() string { return "libFuzzer" } -func (c *F) Setenv(key, value string) {} -func (c *F) Skip(args ...any) { - panic("GO-FUZZ-BUILD-PANIC") -} -func (c *F) SkipNow() { - panic("GO-FUZZ-BUILD-PANIC") -} -func (c *F) Skipf(format string, args ...any) { - panic("GO-FUZZ-BUILD-PANIC") -} -func (f *F) Skipped() bool { return false } - -func (f *F) TempDir() string { - dir, err := os.MkdirTemp("", "fuzzdir-") - if err != nil { - panic(err) - } - f.T.TempDirs = append(f.T.TempDirs, dir) - - return dir -} diff --git a/vendor/github.com/AdamKorcz/go-118-fuzz-build/testing/t.go b/vendor/github.com/AdamKorcz/go-118-fuzz-build/testing/t.go deleted file mode 100644 index 885fdb3be6..0000000000 --- a/vendor/github.com/AdamKorcz/go-118-fuzz-build/testing/t.go +++ /dev/null @@ -1,129 +0,0 @@ -package testing - -import ( - "fmt" - "os" - "strings" - "time" -) - -// T can be used to terminate the current fuzz iteration -// without terminating the whole fuzz run. To do so, simply -// panic with the text "GO-FUZZ-BUILD-PANIC" and the fuzzer -// will recover. -type T struct { - TempDirs []string -} - -func NewT() *T { - tempDirs := make([]string, 0) - return &T{TempDirs: tempDirs} -} - -func unsupportedApi(name string) string { - plsOpenIss := "Please open an issue https://github.com/AdamKorcz/go-118-fuzz-build if you need this feature." - var b strings.Builder - b.WriteString(fmt.Sprintf("%s is not supported when fuzzing in libFuzzer mode\n.", name)) - b.WriteString(plsOpenIss) - return b.String() -} - -func (t *T) Cleanup(f func()) { - f() -} - -func (t *T) Deadline() (deadline time.Time, ok bool) { - panic(unsupportedApi("t.Deadline()")) -} - -func (t *T) Error(args ...any) { - fmt.Println(args...) - panic("error") -} - -func (t *T) Errorf(format string, args ...any) { - fmt.Printf(format+"\n", args...) - panic("errorf") -} - -func (t *T) Fail() { - panic("Called T.Fail()") -} - -func (t *T) FailNow() { - panic("Called T.Fail()") - panic(unsupportedApi("t.FailNow()")) -} - -func (t *T) Failed() bool { - panic(unsupportedApi("t.Failed()")) -} - -func (t *T) Fatal(args ...any) { - fmt.Println(args...) - panic("fatal") -} -func (t *T) Fatalf(format string, args ...any) { - fmt.Printf(format+"\n", args...) - panic("fatal") -} -func (t *T) Helper() { - // We can't support it, but it also just impacts how failures are reported, so we can ignore it -} -func (t *T) Log(args ...any) { - fmt.Println(args...) -} - -func (t *T) Logf(format string, args ...any) { - fmt.Println(format) - fmt.Println(args...) -} - -func (t *T) Name() string { - return "libFuzzer" -} - -func (t *T) Parallel() { - panic(unsupportedApi("t.Parallel()")) -} -func (t *T) Run(name string, f func(t *T)) bool { - panic(unsupportedApi("t.Run()")) -} - -func (t *T) Setenv(key, value string) { - -} - -func (t *T) Skip(args ...any) { - panic("GO-FUZZ-BUILD-PANIC") -} -func (t *T) SkipNow() { - panic("GO-FUZZ-BUILD-PANIC") -} - -// Is not really supported. We just skip instead -// of printing any message. A log message can be -// added if need be. -func (t *T) Skipf(format string, args ...any) { - panic("GO-FUZZ-BUILD-PANIC") -} -func (t *T) Skipped() bool { - panic(unsupportedApi("t.Skipped()")) -} -func (t *T) TempDir() string { - dir, err := os.MkdirTemp("", "fuzzdir-") - if err != nil { - panic(err) - } - t.TempDirs = append(t.TempDirs, dir) - - return dir -} - -func (t *T) CleanupTempDirs() { - if len(t.TempDirs) > 0 { - for _, tempDir := range t.TempDirs { - os.RemoveAll(tempDir) - } - } -} diff --git a/vendor/github.com/AdamKorcz/go-118-fuzz-build/testing/unsupported_funcs.go b/vendor/github.com/AdamKorcz/go-118-fuzz-build/testing/unsupported_funcs.go deleted file mode 100644 index 310c22893c..0000000000 --- a/vendor/github.com/AdamKorcz/go-118-fuzz-build/testing/unsupported_funcs.go +++ /dev/null @@ -1,42 +0,0 @@ -package testing - -import ( - "testing" -) - -func AllocsPerRun(runs int, f func()) (avg float64) { - panic(unsupportedApi("testing.AllocsPerRun")) -} -func CoverMode() string { - panic(unsupportedApi("testing.CoverMode")) -} -func Coverage() float64 { - panic(unsupportedApi("testing.Coverage")) -} -func Init() { - panic(unsupportedApi("testing.Init")) - -} -func RegisterCover(c testing.Cover) { - panic(unsupportedApi("testing.RegisterCover")) -} -func RunExamples(matchString func(pat, str string) (bool, error), examples []testing.InternalExample) (ok bool) { - panic(unsupportedApi("testing.RunExamples")) -} - -func RunTests(matchString func(pat, str string) (bool, error), tests []testing.InternalTest) (ok bool) { - panic(unsupportedApi("testing.RunTests")) -} - -func Short() bool { - return false -} - -func Verbose() bool { - panic(unsupportedApi("testing.Verbose")) -} - -type M struct {} -func (m *M) Run() (code int) { - panic("testing.M is not support in libFuzzer Mode") -} diff --git a/vendor/github.com/Microsoft/hcsshim/.clang-format b/vendor/github.com/Microsoft/hcsshim/.clang-format new file mode 100644 index 0000000000..fd843ce399 --- /dev/null +++ b/vendor/github.com/Microsoft/hcsshim/.clang-format @@ -0,0 +1,12 @@ +Language: Cpp +BasedOnStyle: Microsoft +BreakBeforeBraces: Attach +PointerAlignment: Left +AllowShortFunctionsOnASingleLine: All +# match Go style +IndentCaseLabels: false +# don't break comments over line limit (needed for CodeQL exceptions) +ReflowComments: false +InsertNewlineAtEOF: true +KeepEmptyLines: + AtEndOfFile: true diff --git a/vendor/github.com/Microsoft/hcsshim/.golangci.yml b/vendor/github.com/Microsoft/hcsshim/.golangci.yml index 7d38a2fb9e..113e6f07ac 100644 --- a/vendor/github.com/Microsoft/hcsshim/.golangci.yml +++ b/vendor/github.com/Microsoft/hcsshim/.golangci.yml @@ -5,9 +5,6 @@ run: - admin - functional - integration - skip-dirs: - # paths are relative to module root - - cri-containerd/test-images linters: enable: @@ -34,13 +31,15 @@ linters-settings: # struct order is often for Win32 compat # also, ignore pointer bytes/GC issues for now until performance becomes an issue - fieldalignment - check-shadowing: true stylecheck: # https://staticcheck.io/docs/checks checks: ["all"] issues: + exclude-dirs: + # paths are relative to module root + - cri-containerd/test-images exclude-rules: # err is very often shadowed in nested scopes - linters: @@ -70,22 +69,22 @@ issues: - path: layer.go linters: - stylecheck - Text: "ST1003:" + text: "ST1003:" - path: hcsshim.go linters: - stylecheck - Text: "ST1003:" + text: "ST1003:" - path: cmd\\ncproxy\\nodenetsvc\\ linters: - stylecheck - Text: "ST1003:" + text: "ST1003:" - path: cmd\\ncproxy_mock\\ linters: - stylecheck - Text: "ST1003:" + text: "ST1003:" - path: internal\\hcs\\schema2\\ linters: @@ -95,67 +94,67 @@ issues: - path: internal\\wclayer\\ linters: - stylecheck - Text: "ST1003:" + text: "ST1003:" - path: hcn\\ linters: - stylecheck - Text: "ST1003:" + text: "ST1003:" - path: internal\\hcs\\schema1\\ linters: - stylecheck - Text: "ST1003:" + text: "ST1003:" - path: internal\\hns\\ linters: - stylecheck - Text: "ST1003:" + text: "ST1003:" - path: ext4\\internal\\compactext4\\ linters: - stylecheck - Text: "ST1003:" + text: "ST1003:" - path: ext4\\internal\\format\\ linters: - stylecheck - Text: "ST1003:" + text: "ST1003:" - path: internal\\guestrequest\\ linters: - stylecheck - Text: "ST1003:" + text: "ST1003:" - path: internal\\guest\\prot\\ linters: - stylecheck - Text: "ST1003:" + text: "ST1003:" - path: internal\\windevice\\ linters: - stylecheck - Text: "ST1003:" + text: "ST1003:" - path: internal\\winapi\\ linters: - stylecheck - Text: "ST1003:" + text: "ST1003:" - path: internal\\vmcompute\\ linters: - stylecheck - Text: "ST1003:" + text: "ST1003:" - path: internal\\regstate\\ linters: - stylecheck - Text: "ST1003:" + text: "ST1003:" - path: internal\\hcserror\\ linters: - stylecheck - Text: "ST1003:" + text: "ST1003:" # v0 APIs are deprecated, but still retained for backwards compatability - path: cmd\\ncproxy\\ @@ -171,4 +170,4 @@ issues: - path: internal\\vhdx\\info linters: - stylecheck - Text: "ST1003:" + text: "ST1003:" diff --git a/vendor/github.com/Microsoft/hcsshim/Makefile b/vendor/github.com/Microsoft/hcsshim/Makefile index de64358948..9a9f5b4014 100644 --- a/vendor/github.com/Microsoft/hcsshim/Makefile +++ b/vendor/github.com/Microsoft/hcsshim/Makefile @@ -1,13 +1,20 @@ -BASE:=base.tar.gz -DEV_BUILD:=0 +include Makefile.bootfiles GO:=go GO_FLAGS:=-ldflags "-s -w" # strip Go binaries CGO_ENABLED:=0 GOMODVENDOR:= +KMOD:=0 CFLAGS:=-O2 -Wall -LDFLAGS:=-static -s # strip C binaries +LDFLAGS:=-static -s #strip C binaries +LDLIBS:= +PREPROCESSORFLAGS:= +ifeq "$(KMOD)" "1" +LDFLAGS:= -s +LDLIBS:= -lkmod +PREPROCESSORFLAGS:=-DMODULES=1 +endif GO_FLAGS_EXTRA:= ifeq "$(GOMODVENDOR)" "1" @@ -23,108 +30,14 @@ SRCROOT=$(dir $(abspath $(firstword $(MAKEFILE_LIST)))) # additional directories to search for rule prerequisites and targets VPATH=$(SRCROOT) -DELTA_TARGET=out/delta.tar.gz - -ifeq "$(DEV_BUILD)" "1" -DELTA_TARGET=out/delta-dev.tar.gz -endif - -ifeq "$(SNP_BUILD)" "1" -DELTA_TARGET=out/delta-snp.tar.gz -endif - # The link aliases for gcstools GCS_TOOLS=\ generichook \ install-drivers -# Common path prefix. -PATH_PREFIX:= -# These have PATH_PREFIX prepended to obtain the full path in recipies e.g. $(PATH_PREFIX)/$(VMGS_TOOL) -VMGS_TOOL:= -IGVM_TOOL:= -KERNEL_PATH:= - -.PHONY: all always rootfs test snp simple - -.DEFAULT_GOAL := all - -all: out/initrd.img out/rootfs.tar.gz - -clean: - find -name '*.o' -print0 | xargs -0 -r rm - rm -rf bin deps rootfs out - test: cd $(SRCROOT) && $(GO) test -v ./internal/guest/... -rootfs: out/rootfs.vhd - -snp: out/kernelinitrd.vmgs out/rootfs.hash.vhd out/rootfs.vhd out/v2056.vmgs - -simple: out/simple.vmgs snp - -%.vmgs: %.bin - rm -f $@ - # du -BM returns the size of the bin file in M, eg 7M. The sed command replaces the M with *1024*1024 and then bc does the math to convert to bytes - $(PATH_PREFIX)/$(VMGS_TOOL) create --filepath $@ --filesize `du -BM $< | sed "s/M.*/*1024*1024/" | bc` - $(PATH_PREFIX)/$(VMGS_TOOL) write --filepath $@ --datapath $< -i=8 - -# Simplest debug UVM used to test changes to the linux kernel. No dmverity protection. Boots an initramdisk rather than directly booting a vhd disk. -out/simple.bin: out/initrd.img $(PATH_PREFIX)/$(KERNEL_PATH) boot/startup_simple.sh - rm -f $@ - python3 $(PATH_PREFIX)/$(IGVM_TOOL) -o $@ -kernel $(PATH_PREFIX)/$(KERNEL_PATH) -append "8250_core.nr_uarts=0 panic=-1 debug loglevel=7 rdinit=/startup_simple.sh" -rdinit out/initrd.img -vtl 0 - -ROOTFS_DEVICE:=/dev/sda -VERITY_DEVICE:=/dev/sdb -# Debug build for use with uvmtester. UVM with dm-verity protected vhd disk mounted directly via the kernel command line. Ignores corruption in dm-verity protected disk. (Use dmesg to see if dm-verity is ignoring data corruption.) -out/v2056.bin: out/rootfs.vhd out/rootfs.hash.vhd $(PATH_PREFIX)/$(KERNEL_PATH) out/rootfs.hash.datasectors out/rootfs.hash.datablocksize out/rootfs.hash.hashblocksize out/rootfs.hash.datablocks out/rootfs.hash.rootdigest out/rootfs.hash.salt boot/startup_v2056.sh - rm -f $@ - python3 $(PATH_PREFIX)/$(IGVM_TOOL) -o $@ -kernel $(PATH_PREFIX)/$(KERNEL_PATH) -append "8250_core.nr_uarts=0 panic=-1 debug loglevel=7 root=/dev/dm-0 dm-mod.create=\"dmverity,,,ro,0 $(shell cat out/rootfs.hash.datasectors) verity 1 $(ROOTFS_DEVICE) $(VERITY_DEVICE) $(shell cat out/rootfs.hash.datablocksize) $(shell cat out/rootfs.hash.hashblocksize) $(shell cat out/rootfs.hash.datablocks) 0 sha256 $(shell cat out/rootfs.hash.rootdigest) $(shell cat out/rootfs.hash.salt) 1 ignore_corruption\" init=/startup_v2056.sh" -vtl 0 - -# Full UVM with dm-verity protected vhd disk mounted directly via the kernel command line. -out/kernelinitrd.bin: out/rootfs.vhd out/rootfs.hash.vhd out/rootfs.hash.datasectors out/rootfs.hash.datablocksize out/rootfs.hash.hashblocksize out/rootfs.hash.datablocks out/rootfs.hash.rootdigest out/rootfs.hash.salt $(PATH_PREFIX)/$(KERNEL_PATH) boot/startup.sh - rm -f $@ - python3 $(PATH_PREFIX)/$(IGVM_TOOL) -o $@ -kernel $(PATH_PREFIX)/$(KERNEL_PATH) -append "8250_core.nr_uarts=0 panic=-1 debug loglevel=7 root=/dev/dm-0 dm-mod.create=\"dmverity,,,ro,0 $(shell cat out/rootfs.hash.datasectors) verity 1 $(ROOTFS_DEVICE) $(VERITY_DEVICE) $(shell cat out/rootfs.hash.datablocksize) $(shell cat out/rootfs.hash.hashblocksize) $(shell cat out/rootfs.hash.datablocks) 0 sha256 $(shell cat out/rootfs.hash.rootdigest) $(shell cat out/rootfs.hash.salt)\" init=/startup.sh" -vtl 0 - -# Rule to make a vhd from a file. This is used to create the rootfs.hash.vhd from rootfs.hash. -%.vhd: % bin/cmd/tar2ext4 - ./bin/cmd/tar2ext4 -only-vhd -i $< -o $@ - -# Rule to make a vhd from an ext4 file. This is used to create the rootfs.vhd from rootfs.ext4. -%.vhd: %.ext4 bin/cmd/tar2ext4 - ./bin/cmd/tar2ext4 -only-vhd -i $< -o $@ - -%.hash %.hash.info %.hash.datablocks %.hash.rootdigest %hash.datablocksize %.hash.datasectors %.hash.hashblocksize: %.ext4 %.hash.salt - veritysetup format --no-superblock --salt $(shell cat out/rootfs.hash.salt) $< $*.hash > $*.hash.info - # Retrieve info required by dm-verity at boot time - # Get the blocksize of rootfs - cat $*.hash.info | awk '/^Root hash:/{ print $$3 }' > $*.hash.rootdigest - cat $*.hash.info | awk '/^Salt:/{ print $$2 }' > $*.hash.salt - cat $*.hash.info | awk '/^Data block size:/{ print $$4 }' > $*.hash.datablocksize - cat $*.hash.info | awk '/^Hash block size:/{ print $$4 }' > $*.hash.hashblocksize - cat $*.hash.info | awk '/^Data blocks:/{ print $$3 }' > $*.hash.datablocks - echo $$(( $$(cat $*.hash.datablocks) * $$(cat $*.hash.datablocksize) / 512 )) > $*.hash.datasectors - -out/rootfs.hash.salt: - hexdump -vn32 -e'8/4 "%08X" 1 "\n"' /dev/random > $@ - -out/rootfs.ext4: out/rootfs.tar.gz bin/cmd/tar2ext4 - gzip -f -d ./out/rootfs.tar.gz - ./bin/cmd/tar2ext4 -i ./out/rootfs.tar -o $@ - -out/rootfs.tar.gz: out/initrd.img - rm -rf rootfs-conv - mkdir rootfs-conv - gunzip -c out/initrd.img | (cd rootfs-conv && cpio -imd) - tar -zcf $@ -C rootfs-conv . - rm -rf rootfs-conv - -out/initrd.img: $(BASE) $(DELTA_TARGET) $(SRCROOT)/hack/catcpio.sh - $(SRCROOT)/hack/catcpio.sh "$(BASE)" $(DELTA_TARGET) > out/initrd.img.uncompressed - gzip -c out/initrd.img.uncompressed > $@ - rm out/initrd.img.uncompressed - # This target includes utilities which may be useful for testing purposes. out/delta-dev.tar.gz: out/delta.tar.gz bin/internal/tools/snp-report rm -rf rootfs-dev @@ -168,10 +81,7 @@ out/delta.tar.gz: bin/init bin/vsockexec bin/cmd/gcs bin/cmd/gcstools bin/cmd/ho tar -zcf $@ -C rootfs . rm -rf rootfs -out/containerd-shim-runhcs-v1.exe: - GOOS=windows $(GO_BUILD) -o $@ $(SRCROOT)/cmd/containerd-shim-runhcs-v1 - -bin/cmd/gcs bin/cmd/gcstools bin/cmd/hooks/wait-paths bin/cmd/tar2ext4 bin/internal/tools/snp-report bin/cmd/dmverity-vhd: +bin/cmd/gcs bin/cmd/gcstools bin/cmd/hooks/wait-paths bin/cmd/tar2ext4 bin/internal/tools/snp-report: @mkdir -p $(dir $@) GOOS=linux $(GO_BUILD) -o $@ $(SRCROOT)/$(@:bin/%=%) @@ -181,8 +91,8 @@ bin/vsockexec: vsockexec/vsockexec.o vsockexec/vsock.o bin/init: init/init.o vsockexec/vsock.o @mkdir -p bin - $(CC) $(LDFLAGS) -o $@ $^ + $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) %.o: %.c @mkdir -p $(dir $@) - $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< \ No newline at end of file + $(CC) $(PREPROCESSORFLAGS) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< diff --git a/vendor/github.com/Microsoft/hcsshim/Makefile.bootfiles b/vendor/github.com/Microsoft/hcsshim/Makefile.bootfiles new file mode 100644 index 0000000000..e6f06d4916 --- /dev/null +++ b/vendor/github.com/Microsoft/hcsshim/Makefile.bootfiles @@ -0,0 +1,197 @@ +BASE:=base.tar.gz +DEV_BUILD:=0 + +DELTA_TARGET=out/delta.tar.gz + +ifeq "$(DEV_BUILD)" "1" +DELTA_TARGET=out/delta-dev.tar.gz +endif + +ifeq "$(SNP_BUILD)" "1" +DELTA_TARGET=out/delta-snp.tar.gz +endif + +SRCROOT=$(dir $(abspath $(firstword $(MAKEFILE_LIST)))) + +PATH_PREFIX:= +# These have PATH_PREFIX prepended to obtain the full path in recipies e.g. $(PATH_PREFIX)/$(VMGS_TOOL) +VMGS_TOOL:= +IGVM_TOOL:= +KERNEL_PATH:= +TAR2EXT4_TOOL:=bin/cmd/tar2ext4 + +ROOTFS_DEVICE:=/dev/sda +HASH_DEVICE:=/dev/sdb + +.PHONY: all always rootfs test snp simple + +.DEFAULT_GOAL := all + +all: out/initrd.img out/rootfs.tar.gz + +clean: + find -name '*.o' -print0 | xargs -0 -r rm + rm -rf bin rootfs out + +rootfs: out/rootfs.vhd + +snp: out/kernel.vmgs out/rootfs-verity.vhd out/v2056.vmgs out/v2056combined.vmgs + +simple: out/simple.vmgs snp + +%.vmgs: %.bin + rm -f $@ + # du -BM returns the size of the bin file in M, eg 7M. The sed command replaces the M with *1024*1024 and then bc does the math to convert to bytes + $(PATH_PREFIX)/$(VMGS_TOOL) create --filepath $@ --filesize `du -BM $< | sed "s/M.*/*1024*1024/" | bc` + $(PATH_PREFIX)/$(VMGS_TOOL) write --filepath $@ --datapath $< -i=8 + +# Simplest debug UVM used to test changes to the linux kernel. No dmverity protection. Boots an initramdisk rather than directly booting a vhd disk. +out/simple.bin: out/initrd.img $(PATH_PREFIX)/$(KERNEL_PATH) boot/startup_simple.sh + rm -f $@ + python3 $(PATH_PREFIX)/$(IGVM_TOOL) \ + -o $@ \ + -kernel $(PATH_PREFIX)/$(KERNEL_PATH) \ + -append "8250_core.nr_uarts=0 panic=-1 debug loglevel=7 rdinit=/startup_simple.sh" \ + -rdinit out/initrd.img \ + -vtl 0 + +# The boot performance is optimized by supplying rootfs as a SCSI attachment. In this case the kernel boots with +# dm-verity to ensure the integrity. Similar to layer VHDs the verity Merkle tree is appended to ext4 filesystem. +# It transpires that the /dev/sd* order is not deterministic wrt the scsi device order. Thus build a single userland +# fs + merkle tree device and boot that. +# +# From https://www.kernel.org/doc/html/latest/admin-guide/device-mapper/dm-init.html +# +# dm-mod.create=,,,,[,
+][;,,,,
[,
+]+] +# +# where: +# ::= The device name. +# ::= xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | "" +# ::= The device minor number | "" +# ::= "ro" | "rw" +#
::= +# ::= "verity" | "linear" | ... (see list below) +# +# From https://docs.kernel.org/admin-guide/device-mapper/verity.html +# +# +# +# +# [<#opt_params> ] +# +# typical igvm tool line once all the macros are expanded +# python3 /home/user/igvmfile.py -o out/v2056.bin -kernel /hose/user/bzImage -append "8250_core.nr_uarts=0 panic=-1 debug loglevel=9 ignore_loglevel dev.scsi.logging_level=9411 root=/dev/dm-0 dm-mod.create=\"dmverity,,,ro,0 196744 verity 1 /dev/sda /dev/sdb 4096 4096 24593 0 sha256 6d625a306aafdf73125a84388b7bfdd2c3a154bd8d698955f4adffc736bdfd66 b9065c23231f0d8901cc3a68e1d3b8d624213e76d6f9f6d3ccbcb829f9c710ba 1 ignore_corruption\" init=/startup_v2056.sh" -vtl 0 +# +# so a kernel command line of: +# 8250_core.nr_uarts=0 panic=-1 debug loglevel=9 ignore_loglevel dev.scsi.logging_level=9411 root=/dev/dm-0 dm-mod.create=\"dmverity,,,ro,0 196744 verity 1 /dev/sda /dev/sdb 4096 4096 24593 0 sha256 6d625a306aafdf73125a84388b7bfdd2c3a154bd8d698955f4adffc736bdfd66 b9065c23231f0d8901cc3a68e1d3b8d624213e76d6f9f6d3ccbcb829f9c710ba 1 ignore_corruption\" init=/startup_v2056.sh +# +# and a dm-mod.create of: +# dmverity,,,ro,0 196744 verity 1 /dev/sda /dev/sdb 4096 4096 24593 0 sha256 6d625a306aafdf73125a84388b7bfdd2c3a154bd8d698955f4adffc736bdfd66 b9065c23231f0d8901cc3a68e1d3b8d624213e76d6f9f6d3ccbcb829f9c710ba 1 ignore_corruption +# +# which breaks down to: +# +# name = "dmverity" +# uuid = "" +# minor = "" +# flags = "ro" +# table = 0 196744 verity "args" +# start_sector = 0 +# num_sectors = 196744 +# target_type = verity +# target_args = 1 /dev/sda /dev/sdb 4096 4096 24593 0 sha256 6d625a306aafdf73125a84388b7bfdd2c3a154bd8d698955f4adffc736bdfd66 b9065c23231f0d8901cc3a68e1d3b8d624213e76d6f9f6d3ccbcb829f9c710ba 1 ignore_corruption +# args: +# version 1 +# dev /dev/sda +# hash_dev /dev/sdb +# data_block_size 4096 +# hash_block_size 4096 +# num_data_blocks 24593 +# hash_start_block 0 +# algorithm sha256 +# digest 6d625a306aafdf73125a84388b7bfdd2c3a154bd8d698955f4adffc736bdfd66 +# salt b9065c23231f0d8901cc3a68e1d3b8d624213e76d6f9f6d3ccbcb829f9c710ba +# opt_params +# count = 1 +# ignore_corruption +# +# combined typical (not bigger count of sectors for the whole device) +# dmverity,,,ro,0 199672 verity 1 /dev/sda /dev/sda 4096 4096 24959 24959 sha256 4aa6e79866ee946ddbd9cddd6554bc6449272942fcc65934326817785a3bd374 adc4956274489c936395bab046a2d476f21ef436e571ba53da2fdf3aee59bf0a +# +# A few notes: +# - num_sectors is the size of the final (aka target) verity device, i.e. the size of our rootfs excluding the Merkle +# tree. +# - We don't add verity superblock, so the will be exactly at the end of ext4 filesystem and equal +# to its size. In the case when verity superblock is present an extra block should be added to the offset value, +# i.e. 24959 becomes 24960. + + +# Debug build for use with uvmtester. UVM with dm-verity protected vhd disk mounted directly via the kernel command line. +# Ignores corruption in dm-verity protected disk. (Use dmesg to see if dm-verity is ignoring data corruption.) +out/v2056.bin: out/rootfs.vhd out/rootfs.hash.vhd $(PATH_PREFIX)/$(KERNEL_PATH) out/rootfs.hash.datasectors out/rootfs.hash.datablocksize out/rootfs.hash.hashblocksize out/rootfs.hash.datablocks out/rootfs.hash.rootdigest out/rootfs.hash.salt boot/startup_v2056.sh + rm -f $@ + python3 $(PATH_PREFIX)/$(IGVM_TOOL) \ + -o $@ \ + -kernel $(PATH_PREFIX)/$(KERNEL_PATH) \ + -append "8250_core.nr_uarts=0 panic=-1 debug loglevel=9 root=/dev/dm-0 dm-mod.create=\"dmverity,,,ro,0 $(shell cat out/rootfs.hash.datasectors) verity 1 $(ROOTFS_DEVICE) $(HASH_DEVICE) $(shell cat out/rootfs.hash.datablocksize) $(shell cat out/rootfs.hash.hashblocksize) $(shell cat out/rootfs.hash.datablocks) $(shell cat out/rootfs.hash.datablocks) sha256 $(shell cat out/rootfs.hash.rootdigest) $(shell cat out/rootfs.hash.salt) 1 ignore_corruption\" init=/startup_v2056.sh" \ + -vtl 0 + +out/v2056combined.bin: out/rootfs-verity.vhd $(PATH_PREFIX)/$(KERNEL_PATH) out/rootfs.hash.datablocksize out/rootfs.hash.hashblocksize out/rootfs.hash.datablocks out/rootfs.hash.rootdigest out/rootfs.hash.salt boot/startup_v2056.sh + rm -f $@ + echo root=/dev/dm-0 dm-mod.create=\"dmverity,,,ro,0 $(shell cat out/rootfs.hash.datasectors) verity 1 $(ROOTFS_DEVICE) $(ROOTFS_DEVICE) $(shell cat out/rootfs.hash.datablocksize) $(shell cat out/rootfs.hash.hashblocksize) $(shell cat out/rootfs.hash.datablocks) $(shell cat out/rootfs.hash.datablocks) sha256 $(shell cat out/rootfs.hash.rootdigest) $(shell cat out/rootfs.hash.salt) 1 ignore_corruption\" + python3 $(PATH_PREFIX)/$(IGVM_TOOL) \ + -o $@ \ + -kernel $(PATH_PREFIX)/$(KERNEL_PATH) \ + -append "8250_core.nr_uarts=0 panic=-1 debug loglevel=9 ignore_loglevel dev.scsi.logging_level=9411 root=/dev/dm-0 dm-mod.create=\"dmverity,,,ro,0 $(shell cat out/rootfs.hash.datasectors) verity 1 $(ROOTFS_DEVICE) $(ROOTFS_DEVICE) $(shell cat out/rootfs.hash.datablocksize) $(shell cat out/rootfs.hash.hashblocksize) $(shell cat out/rootfs.hash.datablocks) $(shell cat out/rootfs.hash.datablocks) sha256 $(shell cat out/rootfs.hash.rootdigest) $(shell cat out/rootfs.hash.salt) 1 ignore_corruption\" init=/startup_v2056.sh" \ + -vtl 0 + +# Full UVM with dm-verity protected vhd disk mounted directly via the kernel command line. +out/kernel.bin: out/rootfs-verity.vhd $(PATH_PREFIX)/$(KERNEL_PATH) out/rootfs.hash.datasectors out/rootfs.hash.datablocksize out/rootfs.hash.hashblocksize out/rootfs.hash.datablocks out/rootfs.hash.rootdigest out/rootfs.hash.salt boot/startup.sh + rm -f $@ + echo root=/dev/dm-0 dm-mod.create=\"dmverity,,,ro,0 $(shell cat out/rootfs.hash.datasectors) verity 1 $(ROOTFS_DEVICE) $(ROOTFS_DEVICE) $(shell cat out/rootfs.hash.datablocksize) $(shell cat out/rootfs.hash.hashblocksize) $(shell cat out/rootfs.hash.datablocks) $(shell cat out/rootfs.hash.datablocks) sha256 $(shell cat out/rootfs.hash.rootdigest) $(shell cat out/rootfs.hash.salt)\" + python3 $(PATH_PREFIX)/$(IGVM_TOOL) \ + -o $@ \ + -kernel $(PATH_PREFIX)/$(KERNEL_PATH) \ + -append "8250_core.nr_uarts=0 panic=-1 debug loglevel=7 root=/dev/dm-0 dm-mod.create=\"dmverity,,,ro,0 $(shell cat out/rootfs.hash.datasectors) verity 1 $(ROOTFS_DEVICE) $(ROOTFS_DEVICE) $(shell cat out/rootfs.hash.datablocksize) $(shell cat out/rootfs.hash.hashblocksize) $(shell cat out/rootfs.hash.datablocks) $(shell cat out/rootfs.hash.datablocks) sha256 $(shell cat out/rootfs.hash.rootdigest) $(shell cat out/rootfs.hash.salt)\" init=/startup.sh" \ + -vtl 0 + +# Rule to make a vhd from a file. This is used to create the rootfs.hash.vhd from rootfs.hash. +%.vhd: % $(TAR2EXT4_TOOL) + $(TAR2EXT4_TOOL) -only-vhd -i $< -o $@ + +# Rule to make a vhd from an ext4 file. This is used to create the rootfs.vhd from rootfs.ext4. +%.vhd: %.ext4 $(TAR2EXT4_TOOL) + $(TAR2EXT4_TOOL) -only-vhd -i $< -o $@ + +%.hash %.hash.info %.hash.datablocks %.hash.rootdigest %hash.datablocksize %.hash.datasectors %.hash.hashblocksize: %.ext4 %.hash.salt + veritysetup format --no-superblock --salt $(shell cat out/rootfs.hash.salt) $< $*.hash > $*.hash.info + # Retrieve info required by dm-verity at boot time + # Get the blocksize of rootfs + cat $*.hash.info | awk '/^Root hash:/{ print $$3 }' > $*.hash.rootdigest + cat $*.hash.info | awk '/^Salt:/{ print $$2 }' > $*.hash.salt + cat $*.hash.info | awk '/^Data block size:/{ print $$4 }' > $*.hash.datablocksize + cat $*.hash.info | awk '/^Hash block size:/{ print $$4 }' > $*.hash.hashblocksize + cat $*.hash.info | awk '/^Data blocks:/{ print $$3 }' > $*.hash.datablocks + echo $$(( $$(cat $*.hash.datablocks) * $$(cat $*.hash.datablocksize) / 512 )) > $*.hash.datasectors + +out/rootfs.hash.salt: + hexdump -vn32 -e'8/4 "%08X" 1 "\n"' /dev/random > $@ + +out/rootfs.ext4: out/rootfs.tar.gz $(TAR2EXT4_TOOL) + gzip -f -d ./out/rootfs.tar.gz + $(TAR2EXT4_TOOL) -i ./out/rootfs.tar -o $@ + +out/rootfs-verity.ext4: out/rootfs.ext4 out/rootfs.hash + cp out/rootfs.ext4 $@ + cat out/rootfs.hash >> $@ + +out/rootfs.tar.gz: out/initrd.img + rm -rf rootfs-conv + mkdir rootfs-conv + gunzip -c out/initrd.img | (cd rootfs-conv && cpio -imd) + tar -zcf $@ -C rootfs-conv . + rm -rf rootfs-conv + +out/initrd.img: $(BASE) $(DELTA_TARGET) $(SRCROOT)/hack/catcpio.sh + $(SRCROOT)/hack/catcpio.sh "$(BASE)" $(DELTA_TARGET) > out/initrd.img.uncompressed + gzip -c out/initrd.img.uncompressed > $@ + rm out/initrd.img.uncompressed diff --git a/vendor/github.com/Microsoft/hcsshim/README.md b/vendor/github.com/Microsoft/hcsshim/README.md index 3204380484..ae66682637 100644 --- a/vendor/github.com/Microsoft/hcsshim/README.md +++ b/vendor/github.com/Microsoft/hcsshim/README.md @@ -44,7 +44,7 @@ delta.tar.gz initrd.img rootfs.tar.gz ### Containerd Shim -For info on the [Runtime V2 API](https://github.com/containerd/containerd/blob/master/runtime/v2/README.md). +For info on the [Runtime V2 API](https://github.com/containerd/containerd/blob/main/core/runtime/v2/README.md). Contrary to the typical Linux architecture of shim -> runc, the runhcs shim is used both to launch and manage the lifetime of containers. diff --git a/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go b/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go index db7f9fb227..dfcd9b543d 100644 --- a/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go +++ b/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.35.2 // protoc v5.26.0 // source: github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.proto @@ -195,11 +195,9 @@ type Options struct { func (x *Options) Reset() { *x = Options{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Options) String() string { @@ -210,7 +208,7 @@ func (*Options) ProtoMessage() {} func (x *Options) ProtoReflect() protoreflect.Message { mi := &file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -385,11 +383,9 @@ type ProcessDetails struct { func (x *ProcessDetails) Reset() { *x = ProcessDetails{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ProcessDetails) String() string { @@ -400,7 +396,7 @@ func (*ProcessDetails) ProtoMessage() {} func (x *ProcessDetails) ProtoReflect() protoreflect.Message { mi := &file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -643,32 +639,6 @@ func file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_run if File_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Options); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_Microsoft_hcsshim_cmd_containerd_shim_runhcs_v1_options_runhcs_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*ProcessDetails); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/vendor/github.com/Microsoft/hcsshim/hcn/hcnerrors.go b/vendor/github.com/Microsoft/hcsshim/hcn/hcnerrors.go index c043adf396..5272896d5a 100644 --- a/vendor/github.com/Microsoft/hcsshim/hcn/hcnerrors.go +++ b/vendor/github.com/Microsoft/hcsshim/hcn/hcnerrors.go @@ -39,7 +39,7 @@ func checkForErrors(methodName string, hr error, resultBuffer *uint16) error { if errorFound { returnError := new(hr, methodName, result) - logrus.Debugf(returnError.Error()) // HCN errors logged for debugging. + logrus.Debug(returnError.Error()) // HCN errors logged for debugging. return returnError } diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/process.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/process.go index 8ef611d6a0..fef2bf546c 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/hcs/process.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/hcs/process.go @@ -63,10 +63,10 @@ func (process *Process) SystemID() string { } func (process *Process) processSignalResult(ctx context.Context, err error) (bool, error) { - switch err { //nolint:errorlint - case nil: + if err == nil { return true, nil - case ErrVmcomputeOperationInvalidState, ErrComputeSystemDoesNotExist, ErrElementNotFound: + } + if errors.Is(err, ErrVmcomputeOperationInvalidState) || errors.Is(err, ErrComputeSystemDoesNotExist) || errors.Is(err, ErrElementNotFound) { if !process.stopped() { // The process should be gone, but we have not received the notification. // After a second, force unblock the process wait to work around a possible @@ -82,9 +82,8 @@ func (process *Process) processSignalResult(ctx context.Context, err error) (boo }() } return false, nil - default: - return false, err } + return false, nil } // Signal signals the process with `options`. diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/chipset.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/chipset.go index ca75277a3f..93857da69f 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/chipset.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/chipset.go @@ -24,4 +24,6 @@ type Chipset struct { // LinuxKernelDirect - Added in v2.2 Builds >=181117 LinuxKernelDirect *LinuxKernelDirect `json:"LinuxKernelDirect,omitempty"` + + FirmwareFile *FirmwareFile `json:"FirmwareFile,omitempty"` } diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/cim_mount.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/cimfs.go similarity index 70% rename from vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/cim_mount.go rename to vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/cimfs.go index 81865e7ea4..52fb62a829 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/cim_mount.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/cimfs.go @@ -9,14 +9,6 @@ package hcsschema -const ( - CimMountFlagNone uint32 = 0x0 - CimMountFlagChildOnly uint32 = 0x1 - CimMountFlagEnableDax uint32 = 0x2 - CimMountFlagCacheFiles uint32 = 0x4 - CimMountFlagCacheRegions uint32 = 0x8 -) - type CimMount struct { ImagePath string `json:"ImagePath,omitempty"` FileSystemName string `json:"FileSystemName,omitempty"` diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/firmware.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/firmware.go new file mode 100644 index 0000000000..c27a132006 --- /dev/null +++ b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/firmware.go @@ -0,0 +1,8 @@ +package hcsschema + +type FirmwareFile struct { + // Parameters is an experimental/pre-release field. The field itself or its + // behavior can change in future iterations of the schema. Avoid taking a hard + // dependency on this field. + Parameters []byte `json:"Parameters,omitempty"` +} diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/memory_2.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/memory_2.go deleted file mode 100644 index 71224c75b9..0000000000 --- a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/memory_2.go +++ /dev/null @@ -1,49 +0,0 @@ -/* - * HCS API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 2.1 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package hcsschema - -type Memory2 struct { - SizeInMB uint64 `json:"SizeInMB,omitempty"` - - AllowOvercommit bool `json:"AllowOvercommit,omitempty"` - - EnableHotHint bool `json:"EnableHotHint,omitempty"` - - EnableColdHint bool `json:"EnableColdHint,omitempty"` - - EnableEpf bool `json:"EnableEpf,omitempty"` - - // EnableDeferredCommit is private in the schema. If regenerated need to add back. - EnableDeferredCommit bool `json:"EnableDeferredCommit,omitempty"` - - // EnableColdDiscardHint if enabled, then the memory cold discard hint feature is exposed - // to the VM, allowing it to trim non-zeroed pages from the working set (if supported by - // the guest operating system). - EnableColdDiscardHint bool `json:"EnableColdDiscardHint,omitempty"` - - // LowMmioGapInMB is the low MMIO region allocated below 4GB. - // - // TODO: This is pre-release support in schema 2.3. Need to add build number - // docs when a public build with this is out. - LowMMIOGapInMB uint64 `json:"LowMmioGapInMB,omitempty"` - - // HighMmioBaseInMB is the high MMIO region allocated above 4GB (base and - // size). - // - // TODO: This is pre-release support in schema 2.3. Need to add build number - // docs when a public build with this is out. - HighMMIOBaseInMB uint64 `json:"HighMmioBaseInMB,omitempty"` - - // HighMmioGapInMB is the high MMIO region. - // - // TODO: This is pre-release support in schema 2.3. Need to add build number - // docs when a public build with this is out. - HighMMIOGapInMB uint64 `json:"HighMmioGapInMB,omitempty"` -} diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/memory_backing_type.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/memory_backing_type.go new file mode 100644 index 0000000000..41837416ca --- /dev/null +++ b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/memory_backing_type.go @@ -0,0 +1,21 @@ +// Autogenerated code; DO NOT EDIT. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swaggerapi/swaggercodegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swaggerapi/swaggercodegen.git) + */ + +package hcsschema + +type MemoryBackingType string + +// List of MemoryBackingType +const ( + MemoryBackingType_PHYSICAL MemoryBackingType = "Physical" + MemoryBackingType_VIRTUAL MemoryBackingType = "Virtual" + MemoryBackingType_HYBRID MemoryBackingType = "Hybrid" +) diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/numa.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/numa.go new file mode 100644 index 0000000000..70a1395198 --- /dev/null +++ b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/numa.go @@ -0,0 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type Numa struct { + VirtualNodeCount uint8 `json:"VirtualNodeCount,omitempty"` + PreferredPhysicalNodes []int64 `json:"PreferredPhysicalNodes,omitempty"` + Settings []NumaSetting `json:"Settings,omitempty"` + MaxSizePerNode uint64 `json:"MaxSizePerNode,omitempty"` +} diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/numa_node.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/numa_node.go new file mode 100644 index 0000000000..5984bdecd7 --- /dev/null +++ b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/numa_node.go @@ -0,0 +1,17 @@ +// Autogenerated code; DO NOT EDIT. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type NumaNode struct { + VirtualNodeIndex uint32 `json:"VirtualNodeIndex,omitempty"` + PhysicalNodeIndex uint32 `json:"PhysicalNodeIndex,omitempty"` +} diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/numa_node_memory.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/numa_node_memory.go new file mode 100644 index 0000000000..88567f0f6d --- /dev/null +++ b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/numa_node_memory.go @@ -0,0 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type NumaNodeMemory struct { + // Total physical memory on on this physical NUMA node that is consumable by the VMs. + TotalConsumableMemoryInPages uint64 `json:"TotalConsumableMemoryInPages,omitempty"` + // Currently available physical memory on this physical NUMA node for the VMs. + AvailableMemoryInPages uint64 `json:"AvailableMemoryInPages,omitempty"` +} diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/numa_node_processor.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/numa_node_processor.go new file mode 100644 index 0000000000..4b6795bb90 --- /dev/null +++ b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/numa_node_processor.go @@ -0,0 +1,17 @@ +// Autogenerated code; DO NOT EDIT. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type NumaNodeProcessor struct { + TotalAssignedProcessors uint32 `json:"TotalAssignedProcessors,omitempty"` + TotalAvailableProcessors uint32 `json:"TotalAvailableProcessors,omitempty"` +} diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/numa_processors.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/numa_processors.go new file mode 100644 index 0000000000..bc3fba37a5 --- /dev/null +++ b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/numa_processors.go @@ -0,0 +1,21 @@ +// Autogenerated code; DO NOT EDIT. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type NumaProcessors struct { + CountPerNode Range `json:"count_per_node,omitempty"` + NodePerSocket uint32 `json:"node_per_socket,omitempty"` +} + +type Range struct { + Max uint32 `json:"max,omitempty"` +} diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/numa_setting.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/numa_setting.go new file mode 100644 index 0000000000..3f27b2ca01 --- /dev/null +++ b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/numa_setting.go @@ -0,0 +1,21 @@ +// Autogenerated code; DO NOT EDIT. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type NumaSetting struct { + VirtualNodeNumber uint32 `json:"VirtualNodeNumber,omitempty"` + PhysicalNodeNumber uint32 `json:"PhysicalNodeNumber,omitempty"` + VirtualSocketNumber uint32 `json:"VirtualSocketNumber,omitempty"` + CountOfProcessors uint32 `json:"CountOfProcessors,omitempty"` + CountOfMemoryBlocks uint64 `json:"CountOfMemoryBlocks,omitempty"` + MemoryBackingType MemoryBackingType `json:"MemoryBackingType,omitempty"` +} diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/processor_2.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/processor_2.go deleted file mode 100644 index c64f335ec7..0000000000 --- a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/processor_2.go +++ /dev/null @@ -1,23 +0,0 @@ -/* - * HCS API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 2.5 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package hcsschema - -type Processor2 struct { - Count int32 `json:"Count,omitempty"` - - Limit int32 `json:"Limit,omitempty"` - - Weight int32 `json:"Weight,omitempty"` - - ExposeVirtualizationExtensions bool `json:"ExposeVirtualizationExtensions,omitempty"` - - // An optional object that configures the CPU Group to which a Virtual Machine is going to bind to. - CpuGroup *CpuGroup `json:"CpuGroup,omitempty"` -} diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/properties.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/properties.go index 0c7efe8d40..d4cb95bdde 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/properties.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/properties.go @@ -26,6 +26,8 @@ type Properties struct { RuntimeId string `json:"RuntimeId,omitempty"` + SystemGUID string `json:"SystemGUID,omitempty"` + RuntimeTemplateId string `json:"RuntimeTemplateId,omitempty"` State string `json:"State,omitempty"` diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/property_type.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/property_type.go index 98f2c96edb..934f777fcf 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/property_type.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/property_type.go @@ -23,4 +23,5 @@ const ( PTICHeartbeatStatus PropertyType = "ICHeartbeatStatus" PTProcessorTopology PropertyType = "ProcessorTopology" PTCPUGroup PropertyType = "CpuGroup" + PTSystemGUID PropertyType = "SystemGUID" ) diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/topology.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/topology.go index 8348699403..9cca85171e 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/topology.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/topology.go @@ -1,16 +1,18 @@ +// Autogenerated code; DO NOT EDIT. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema type Topology struct { - Memory *Memory2 `json:"Memory,omitempty"` - - Processor *Processor2 `json:"Processor,omitempty"` + Memory *VirtualMachineMemory `json:"Memory,omitempty"` + Processor *VirtualMachineProcessor `json:"Processor,omitempty"` + Numa *Numa `json:"Numa,omitempty"` } diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/virtual_machine.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/virtual_machine.go index 1e0fab2890..3f750466f8 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/virtual_machine.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/virtual_machine.go @@ -1,36 +1,29 @@ +// Autogenerated code; DO NOT EDIT. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema +// Configuration of a virtual machine, used during its creation to set up and/or use resources. type VirtualMachine struct { - - // StopOnReset is private in the schema. If regenerated need to put back. - StopOnReset bool `json:"StopOnReset,omitempty"` - - Chipset *Chipset `json:"Chipset,omitempty"` - - ComputeTopology *Topology `json:"ComputeTopology,omitempty"` - - Devices *Devices `json:"Devices,omitempty"` - - GuestState *GuestState `json:"GuestState,omitempty"` - - RestoreState *RestoreState `json:"RestoreState,omitempty"` - + Version *Version `json:"Version,omitempty"` + // When set to true, the virtual machine will treat a reset as a stop, releasing resources and cleaning up state. + StopOnReset bool `json:"StopOnReset,omitempty"` + Chipset *Chipset `json:"Chipset,omitempty"` + ComputeTopology *Topology `json:"ComputeTopology,omitempty"` + Devices *Devices `json:"Devices,omitempty"` + GuestState *GuestState `json:"GuestState,omitempty"` + RestoreState *RestoreState `json:"RestoreState,omitempty"` RegistryChanges *RegistryChanges `json:"RegistryChanges,omitempty"` - - StorageQoS *StorageQoS `json:"StorageQoS,omitempty"` - + StorageQoS *StorageQoS `json:"StorageQoS,omitempty"` + DebugOptions *DebugOptions `json:"DebugOptions,omitempty"` GuestConnection *GuestConnection `json:"GuestConnection,omitempty"` - - SecuritySettings *SecuritySettings `json:"SecuritySettings,omitempty"` - - DebugOptions *DebugOptions `json:"DebugOptions,omitempty"` + SecuritySettings *SecuritySettings `json:"SecuritySettings,omitempty"` } diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/virtual_machine_memory.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/virtual_machine_memory.go new file mode 100644 index 0000000000..17573c92a5 --- /dev/null +++ b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/virtual_machine_memory.go @@ -0,0 +1,33 @@ +// Autogenerated code; DO NOT EDIT. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type VirtualMachineMemory struct { + SizeInMB uint64 `json:"SizeInMB,omitempty"` + Backing *MemoryBackingType `json:"Backing,omitempty"` + // If enabled, then the VM's memory is backed by the Windows pagefile rather than physically backed, statically allocated memory. + AllowOvercommit bool `json:"AllowOvercommit,omitempty"` + // If enabled, then the memory hot hint feature is exposed to the VM, allowing it to prefetch pages into its working set. (if supported by the guest operating system). + EnableHotHint bool `json:"EnableHotHint,omitempty"` + // If enabled, then the memory cold hint feature is exposed to the VM, allowing it to trim zeroed pages from its working set (if supported by the guest operating system). + EnableColdHint bool `json:"EnableColdHint,omitempty"` + // If enabled, then the memory cold discard hint feature is exposed to the VM, allowing it to trim non-zeroed pages from the working set (if supported by the guest operating system). + EnableColdDiscardHint bool `json:"EnableColdDiscardHint,omitempty"` + // If enabled, then commit is not charged for each backing page until first access. + EnableDeferredCommit bool `json:"EnableDeferredCommit,omitempty"` + // Low MMIO region allocated below 4GB + LowMMIOGapInMB uint64 `json:"LowMmioGapInMB,omitempty"` + // High MMIO region allocated above 4GB (base and size) + HighMMIOBaseInMB uint64 `json:"HighMmioBaseInMB,omitempty"` + HighMMIOGapInMB uint64 `json:"HighMmioGapInMB,omitempty"` + SlitType *VirtualSlitType `json:"SlitType,omitempty"` +} diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/virtual_machine_processor.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/virtual_machine_processor.go new file mode 100644 index 0000000000..619cd83400 --- /dev/null +++ b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/virtual_machine_processor.go @@ -0,0 +1,21 @@ +// Autogenerated code; DO NOT EDIT. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type VirtualMachineProcessor struct { + Count uint32 `json:"Count,omitempty"` + Limit uint64 `json:"Limit,omitempty"` + Weight uint64 `json:"Weight,omitempty"` + Reservation uint64 `json:"Reservation,omitempty"` + CpuGroup *CpuGroup `json:"CpuGroup,omitempty"` + NumaProcessorsSettings *NumaProcessors `json:"NumaProcessorsSettings,omitempty"` +} diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/virtual_pci_device.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/virtual_pci_device.go index f5e05903c5..a4a62da163 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/virtual_pci_device.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/virtual_pci_device.go @@ -9,8 +9,9 @@ package hcsschema -// TODO: This is pre-release support in schema 2.3. Need to add build number +// TODO: PropagateNumaAffinity is pre-release/experimental field in schema 2.11. Need to add build number // docs when a public build with this is out. type VirtualPciDevice struct { Functions []VirtualPciFunction `json:",omitempty"` + PropagateNumaAffinity *bool `json:"PropagateNumaAffinity,omitempty"` } diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/virtual_slit_type.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/virtual_slit_type.go new file mode 100644 index 0000000000..dfad623134 --- /dev/null +++ b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/virtual_slit_type.go @@ -0,0 +1,23 @@ +// Autogenerated code; DO NOT EDIT. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// VirtualSlitType : Indicates if a virtual SLIT should ne enabled for a VM and the type of virtual SLIT to be enabled. +type VirtualSlitType string + +// List of VirtualSlitType +const ( + VirtualSlitType_NONE VirtualSlitType = "None" + VirtualSlitType_FIRMWARE VirtualSlitType = "Firmware" + VirtualSlitType_MEASURED VirtualSlitType = "Measured" + VirtualSlitType_FIRMWARE_FALLBACK_MEASURED VirtualSlitType = "FirmwareFallbackMeasured" +) diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/windows_crash_reporting.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/windows_crash_reporting.go index 8ed7e566d6..ee85c43b3e 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/windows_crash_reporting.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/windows_crash_reporting.go @@ -13,4 +13,6 @@ type WindowsCrashReporting struct { DumpFileName string `json:"DumpFileName,omitempty"` MaxDumpSize int64 `json:"MaxDumpSize,omitempty"` + + DumpType string `json:"DumpType,omitempty"` } diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/system.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/system.go index 81d60ed434..b1597466f6 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/hcs/system.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/hcs/system.go @@ -238,9 +238,10 @@ func (computeSystem *System) Shutdown(ctx context.Context) error { resultJSON, err := vmcompute.HcsShutdownComputeSystem(ctx, computeSystem.handle, "") events := processHcsResult(ctx, resultJSON) - switch err { //nolint:errorlint - case nil, ErrVmcomputeAlreadyStopped, ErrComputeSystemDoesNotExist, ErrVmcomputeOperationPending: - default: + if err != nil && + !errors.Is(err, ErrVmcomputeAlreadyStopped) && + !errors.Is(err, ErrComputeSystemDoesNotExist) && + !errors.Is(err, ErrVmcomputeOperationPending) { return makeSystemError(computeSystem, operation, err, events) } return nil @@ -259,9 +260,10 @@ func (computeSystem *System) Terminate(ctx context.Context) error { resultJSON, err := vmcompute.HcsTerminateComputeSystem(ctx, computeSystem.handle, "") events := processHcsResult(ctx, resultJSON) - switch err { //nolint:errorlint - case nil, ErrVmcomputeAlreadyStopped, ErrComputeSystemDoesNotExist, ErrVmcomputeOperationPending: - default: + if err != nil && + !errors.Is(err, ErrVmcomputeAlreadyStopped) && + !errors.Is(err, ErrComputeSystemDoesNotExist) && + !errors.Is(err, ErrVmcomputeOperationPending) { return makeSystemError(computeSystem, operation, err, events) } return nil @@ -279,14 +281,13 @@ func (computeSystem *System) waitBackground() { span.AddAttributes(trace.StringAttribute("cid", computeSystem.id)) err := waitForNotification(ctx, computeSystem.callbackNumber, hcsNotificationSystemExited, nil) - switch err { //nolint:errorlint - case nil: + if err == nil { log.G(ctx).Debug("system exited") - case ErrVmcomputeUnexpectedExit: + } else if errors.Is(err, ErrVmcomputeUnexpectedExit) { log.G(ctx).Debug("unexpected system exit") computeSystem.exitError = makeSystemError(computeSystem, operation, err, nil) err = nil - default: + } else { err = makeSystemError(computeSystem, operation, err, nil) } computeSystem.closedWaitOnce.Do(func() { diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsaccelnet.go b/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsaccelnet.go index 82ca5baefd..4b1e51cb73 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsaccelnet.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsaccelnet.go @@ -47,7 +47,7 @@ func (nnvManagementMacList *HNSNnvManagementMacList) Set() (*HNSNnvManagementMac func GetNnvManagementMacAddressList() (*HNSNnvManagementMacList, error) { operation := "Get" title := "hcsshim::nnvManagementMacList::" + operation - logrus.Debugf(title) + logrus.Debug(title) return HNSNnvManagementMacRequest("GET", "", "") } @@ -55,6 +55,6 @@ func GetNnvManagementMacAddressList() (*HNSNnvManagementMacList, error) { func DeleteNnvManagementMacAddressList() (*HNSNnvManagementMacList, error) { operation := "Delete" title := "hcsshim::nnvManagementMacList::" + operation - logrus.Debugf(title) + logrus.Debug(title) return HNSNnvManagementMacRequest("DELETE", "", "") } diff --git a/vendor/github.com/Microsoft/hcsshim/internal/jobobject/jobobject.go b/vendor/github.com/Microsoft/hcsshim/internal/jobobject/jobobject.go index b505731c36..3afa240aa6 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/jobobject/jobobject.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/jobobject/jobobject.go @@ -22,9 +22,8 @@ import ( // of the job and a mutex for synchronized handle access. type JobObject struct { handle windows.Handle - // All accesses to this MUST be done atomically except in `Open` as the object - // is being created in the function. 1 signifies that this job is currently a silo. - silo uint32 + // silo signifies that this job is currently a silo. + silo atomic.Bool mq *queue.MessageQueue handleLock sync.RWMutex } @@ -204,9 +203,7 @@ func Open(ctx context.Context, options *Options) (_ *JobObject, err error) { handle: jobHandle, } - if isJobSilo(jobHandle) { - job.silo = 1 - } + job.silo.Store(isJobSilo(jobHandle)) // If the IOCP we'll be using to receive messages for all jobs hasn't been // created, create it and start polling. @@ -479,7 +476,7 @@ func (job *JobObject) ApplyFileBinding(root, target string, readOnly bool) error return ErrAlreadyClosed } - if !job.isSilo() { + if !job.silo.Load() { return ErrNotSilo } @@ -546,7 +543,7 @@ func (job *JobObject) PromoteToSilo() error { return ErrAlreadyClosed } - if job.isSilo() { + if job.silo.Load() { return nil } @@ -569,15 +566,10 @@ func (job *JobObject) PromoteToSilo() error { return fmt.Errorf("failed to promote job to silo: %w", err) } - atomic.StoreUint32(&job.silo, 1) + job.silo.Store(true) return nil } -// isSilo returns if the job object is a silo. -func (job *JobObject) isSilo() bool { - return atomic.LoadUint32(&job.silo) == 1 -} - // QueryPrivateWorkingSet returns the private working set size for the job. This is calculated by adding up the // private working set for every process running in the job. func (job *JobObject) QueryPrivateWorkingSet() (uint64, error) { diff --git a/vendor/github.com/Microsoft/hcsshim/internal/jobobject/limits.go b/vendor/github.com/Microsoft/hcsshim/internal/jobobject/limits.go index e3b1a1edc9..fedf8add6c 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/jobobject/limits.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/jobobject/limits.go @@ -150,6 +150,7 @@ func (job *JobObject) SetCPUAffinity(affinityBitMask uint64) error { return fmt.Errorf("affinity bitmask (%d) exceeds max allowable value (%d)", affinityBitMask, maxUintptr) } + // CodeQL [SM03681] checked against max value above (there is no math.MaxUintPtr ...) info.BasicLimitInformation.Affinity = uintptr(affinityBitMask) return job.setExtendedInformation(info) } diff --git a/vendor/github.com/Microsoft/hcsshim/internal/log/context.go b/vendor/github.com/Microsoft/hcsshim/internal/log/context.go index d17d909d93..4399cec6f8 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/log/context.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/log/context.go @@ -4,7 +4,6 @@ import ( "context" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) type entryContextKeyType int @@ -20,13 +19,13 @@ var ( // Instead, use `L.With*` or `L.Dup()`. Or `G(context.Background())`. L = logrus.NewEntry(logrus.StandardLogger()) - // G is an alias for GetEntry + // G is an alias for GetEntry. G = GetEntry - // S is an alias for SetEntry + // S is an alias for SetEntry. S = SetEntry - // U is an alias for UpdateContext + // U is an alias for UpdateContext. U = UpdateContext ) @@ -83,7 +82,7 @@ func UpdateContext(ctx context.Context) context.Context { // WithContext returns a context that contains the provided log entry. // The entry can be extracted with `GetEntry` (`G`) // -// The entry in the context is a copy of `entry` (generated by `entry.WithContext`) +// The entry in the context is a copy of `entry` (generated by `entry.WithContext`). func WithContext(ctx context.Context, entry *logrus.Entry) (context.Context, *logrus.Entry) { // regardless of the order, entry.Context != GetEntry(ctx) // here, the returned entry will reference the supplied context @@ -93,25 +92,6 @@ func WithContext(ctx context.Context, entry *logrus.Entry) (context.Context, *lo return ctx, entry } -// Copy extracts the tracing Span and logging entry from the src Context, if they -// exist, and adds them to the dst Context. -// -// This is useful to share tracing and logging between contexts, but not the -// cancellation. For example, if the src Context has been cancelled but cleanup -// operations triggered by the cancellation require a non-cancelled context to -// execute. -func Copy(dst context.Context, src context.Context) context.Context { - if s := trace.FromContext(src); s != nil { - dst = trace.NewContext(dst, s) - } - - if e := fromContext(src); e != nil { - dst, _ = WithContext(dst, e) - } - - return dst -} - func fromContext(ctx context.Context) *logrus.Entry { e, _ := ctx.Value(_entryContextKey).(*logrus.Entry) return e diff --git a/vendor/github.com/Microsoft/hcsshim/internal/log/format.go b/vendor/github.com/Microsoft/hcsshim/internal/log/format.go index 1ceb26bada..f26316fabf 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/log/format.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/log/format.go @@ -103,9 +103,7 @@ func encode(v interface{}) (_ []byte, err error) { if jErr := enc.Encode(v); jErr != nil { if err != nil { - // TODO (go1.20): use multierror via fmt.Errorf("...: %w; ...: %w", ...) - //nolint:errorlint // non-wrapping format verb for fmt.Errorf - return nil, fmt.Errorf("protojson encoding: %v; json encoding: %w", err, jErr) + return nil, fmt.Errorf("protojson encoding: %w; json encoding: %w", err, jErr) } return nil, fmt.Errorf("json encoding: %w", jErr) } diff --git a/vendor/github.com/Microsoft/hcsshim/internal/log/scrub.go b/vendor/github.com/Microsoft/hcsshim/internal/log/scrub.go index 5a960e0d35..5346f9b7cf 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/log/scrub.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/log/scrub.go @@ -22,23 +22,14 @@ var ( // case sensitive keywords, so "env" is not a substring on "Environment" _scrubKeywords = [][]byte{[]byte("env"), []byte("Environment")} - _scrub int32 + _scrub atomic.Bool ) // SetScrubbing enables scrubbing -func SetScrubbing(enable bool) { - v := int32(0) // cant convert from bool to int32 directly - if enable { - v = 1 - } - atomic.StoreInt32(&_scrub, v) -} +func SetScrubbing(enable bool) { _scrub.Store(enable) } // IsScrubbingEnabled checks if scrubbing is enabled -func IsScrubbingEnabled() bool { - v := atomic.LoadInt32(&_scrub) - return v != 0 -} +func IsScrubbingEnabled() bool { return _scrub.Load() } // ScrubProcessParameters scrubs HCS Create Process requests with config parameters of // type internal/hcs/schema2.ScrubProcessParameters (aka hcsshema.ScrubProcessParameters) diff --git a/vendor/github.com/Microsoft/hcsshim/internal/vhdx/doc.go b/vendor/github.com/Microsoft/hcsshim/internal/vhdx/doc.go deleted file mode 100644 index 99daaa288f..0000000000 --- a/vendor/github.com/Microsoft/hcsshim/internal/vhdx/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// vhdx package adds the utility methods necessary to deal with the vhdx that are used as the scratch -// space for the containers and the uvm. -package vhdx diff --git a/vendor/github.com/Microsoft/hcsshim/internal/vhdx/info.go b/vendor/github.com/Microsoft/hcsshim/internal/vhdx/info.go deleted file mode 100644 index 4fc3bfd288..0000000000 --- a/vendor/github.com/Microsoft/hcsshim/internal/vhdx/info.go +++ /dev/null @@ -1,233 +0,0 @@ -//go:build windows - -package vhdx - -import ( - "bytes" - "context" - "encoding/binary" - "fmt" - "os" - "syscall" - "unsafe" - - "github.com/Microsoft/go-winio/pkg/guid" - "github.com/Microsoft/go-winio/vhd" - "github.com/Microsoft/hcsshim/internal/log" - "github.com/Microsoft/hcsshim/internal/oc" - "github.com/sirupsen/logrus" - "go.opencensus.io/trace" - "golang.org/x/sys/windows" -) - -const _IOCTL_DISK_GET_DRIVE_LAYOUT_EX = 0x00070050 - -var partitionBasicDataGUID = guid.GUID{ - Data1: 0xebd0a0a2, - Data2: 0xb9e5, - Data3: 0x4433, - Data4: [8]byte{0x87, 0xc0, 0x68, 0xb6, 0xb7, 0x26, 0x99, 0xc7}, -} - -const ( - partitionStyleMBR uint32 = iota - partitionStyleGPT - partitionStyleRaw -) - -// type partitionInformationMBR struct { -// PartitionType uint8 -// BootIndicator uint8 -// RecognizedPartition uint8 -// HiddenSectors uint32 -// PartitionId guid.GUID -// } - -type partitionInformationGPT struct { - PartitionType guid.GUID - PartitionId guid.GUID - Attributes uint64 - Name [72]byte // wide char -} - -type partitionInformationEx struct { - PartitionStyle uint32 - StartingOffset int64 - PartitionLength int64 - PartitionNumber uint32 - RewritePartition uint8 - IsServicePartition uint8 - _ uint16 - // A union of partitionInformationMBR and partitionInformationGPT - // since partitionInformationGPT is largest with 112 bytes - GptMbrUnion [112]byte -} - -type driveLayoutInformationGPT struct { - DiskID guid.GUID - StartingUsableOffset int64 - UsableLength int64 - MaxPartitionCount uint32 -} - -// type driveLayoutInformationMBR struct { -// Signature uint32 -// Checksum uint32 -// } - -type driveLayoutInformationEx struct { - PartitionStyle uint32 - PartitionCount uint32 - // A union of driveLayoutInformationGPT and driveLayoutInformationMBR - // since driveLayoutInformationGPT is largest with 40 bytes - GptMbrUnion [40]byte - PartitionEntry [1]partitionInformationEx -} - -// Takes the physical path of a disk and retrieves the drive layout information of that disk. Returns the -// driveLayoutInformationEx struct and a slice of partitionInfomrationEx struct containing one element for -// each partition found on the vhdx. Note: some of the members like (GptMbrUnion) of these structs are raw -// byte arrays and it is the responsibility of the calling function to properly parse them. -func getDriveLayout(ctx context.Context, drivePhysicalPath string) (driveLayoutInformationEx, []partitionInformationEx, error) { - var ( - outBytes uint32 - err error - volume *os.File - ) - - layoutData := struct { - info driveLayoutInformationEx - // driveLayoutInformationEx has a flexible array member at the end. The data returned - // by IOCTL_DISK_GET_DRIVE_LAYOUT_EX usually has driveLayoutInformationEx.PartitionCount - // number of elements in this array. For all practical purposes we don't expect to have - // more than 64 partitions in a container/uvm vhdx. - partitions [63]partitionInformationEx - }{} - - volume, err = os.OpenFile(drivePhysicalPath, os.O_RDONLY, 0) - if err != nil { - return layoutData.info, layoutData.partitions[:0], fmt.Errorf("failed to open drive: %w", err) - } - defer volume.Close() - - err = windows.DeviceIoControl(windows.Handle(volume.Fd()), - _IOCTL_DISK_GET_DRIVE_LAYOUT_EX, - nil, - 0, - (*byte)(unsafe.Pointer(&layoutData)), - uint32(unsafe.Sizeof(layoutData)), - &outBytes, - nil) - if err != nil { - return layoutData.info, layoutData.partitions[:0], fmt.Errorf("IOCTL to get disk layout failed: %w", err) - } - - if layoutData.info.PartitionCount == 0 { - return layoutData.info, []partitionInformationEx{}, nil - } else { - // parse the retrieved data into driveLayoutInformationEx and partitionInformationEx - partitions := make([]partitionInformationEx, layoutData.info.PartitionCount) - partitions[0] = layoutData.info.PartitionEntry[0] - copy(partitions[1:], layoutData.partitions[:layoutData.info.PartitionCount-1]) - return layoutData.info, partitions, nil - } -} - -// Scratch VHDs are formatted with GPT style and have 1 MSFT_RESERVED -// partition and 1 BASIC_DATA partition. This struct contains the -// partitionID of this BASIC_DATA partition and the DiskID of this -// scratch vhdx. -type ScratchVhdxPartitionInfo struct { - DiskID guid.GUID - PartitionID guid.GUID -} - -// Returns the VhdxInfo of a GPT vhdx at path vhdxPath. -func GetScratchVhdPartitionInfo(ctx context.Context, vhdxPath string) (_ ScratchVhdxPartitionInfo, err error) { - var ( - diskHandle syscall.Handle - driveLayout driveLayoutInformationEx - partitions []partitionInformationEx - gptDriveLayout driveLayoutInformationGPT - gptPartitionInfo partitionInformationGPT - volumePath string - ) - - title := "hcsshim::GetScratchVhdPartitionInfo" - ctx, span := trace.StartSpan(ctx, title) - defer span.End() - defer func() { oc.SetSpanStatus(span, err) }() - span.AddAttributes( - trace.StringAttribute("path", vhdxPath)) - - diskHandle, err = vhd.OpenVirtualDisk(vhdxPath, vhd.VirtualDiskAccessNone, vhd.OpenVirtualDiskFlagNone) - if err != nil { - return ScratchVhdxPartitionInfo{}, fmt.Errorf("get scratch vhd info failed: %w", err) - } - defer func() { - if closeErr := syscall.CloseHandle(diskHandle); closeErr != nil { - log.G(ctx).WithFields(logrus.Fields{ - "disk path": vhdxPath, - "error": closeErr, - }).Warn("failed to close vhd handle") - } - }() - - err = vhd.AttachVirtualDisk(diskHandle, vhd.AttachVirtualDiskFlagNone, &vhd.AttachVirtualDiskParameters{Version: 2}) - if err != nil { - return ScratchVhdxPartitionInfo{}, fmt.Errorf("get scratch vhd info failed: %w", err) - } - - defer func() { - if detachErr := vhd.DetachVirtualDisk(diskHandle); detachErr != nil { - log.G(ctx).WithFields(logrus.Fields{ - "disk path": vhdxPath, - "error": detachErr, - }).Warn("failed to detach vhd") - } - }() - - volumePath, err = vhd.GetVirtualDiskPhysicalPath(diskHandle) - if err != nil { - return ScratchVhdxPartitionInfo{}, fmt.Errorf("get vhd physical path: %w", err) - } - - driveLayout, partitions, err = getDriveLayout(ctx, volumePath) - if err != nil { - return ScratchVhdxPartitionInfo{}, err - } - - if driveLayout.PartitionStyle != partitionStyleGPT { - return ScratchVhdxPartitionInfo{}, fmt.Errorf("drive Layout:Expected partition style GPT(%d) found %d", partitionStyleGPT, driveLayout.PartitionStyle) - } - - if driveLayout.PartitionCount != 2 || len(partitions) != 2 { - return ScratchVhdxPartitionInfo{}, fmt.Errorf("expected exactly 2 partitions. Got %d partitions and partition count of %d", len(partitions), driveLayout.PartitionCount) - } - - if partitions[1].PartitionStyle != partitionStyleGPT { - return ScratchVhdxPartitionInfo{}, fmt.Errorf("partition Info:Expected partition style GPT(%d) found %d", partitionStyleGPT, partitions[1].PartitionStyle) - } - - bufReader := bytes.NewBuffer(driveLayout.GptMbrUnion[:]) - if err := binary.Read(bufReader, binary.LittleEndian, &gptDriveLayout); err != nil { - return ScratchVhdxPartitionInfo{}, fmt.Errorf("failed to parse drive GPT layout: %w", err) - } - - bufReader = bytes.NewBuffer(partitions[1].GptMbrUnion[:]) - if err := binary.Read(bufReader, binary.LittleEndian, &gptPartitionInfo); err != nil { - return ScratchVhdxPartitionInfo{}, fmt.Errorf("failed to parse GPT partition info: %w", err) - } - - if gptPartitionInfo.PartitionType != partitionBasicDataGUID { - return ScratchVhdxPartitionInfo{}, fmt.Errorf("expected partition type to have %s GUID found %s instead", partitionBasicDataGUID, gptPartitionInfo.PartitionType) - } - - log.G(ctx).WithFields(logrus.Fields{ - "Disk ID": gptDriveLayout.DiskID, - "GPT Partition ID": gptPartitionInfo.PartitionId, - }).Debug("Scratch VHD partition info") - - return ScratchVhdxPartitionInfo{DiskID: gptDriveLayout.DiskID, PartitionID: gptPartitionInfo.PartitionId}, nil - -} diff --git a/vendor/github.com/Microsoft/hcsshim/internal/vmcompute/vmcompute.go b/vendor/github.com/Microsoft/hcsshim/internal/vmcompute/vmcompute.go index 67ca897cfc..965086a580 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/vmcompute/vmcompute.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/vmcompute/vmcompute.go @@ -104,7 +104,7 @@ func execute(ctx gcontext.Context, timeout time.Duration, f func() error) error }() select { case <-ctx.Done(): - if ctx.Err() == gcontext.DeadlineExceeded { //nolint:errorlint + if ctx.Err() == gcontext.DeadlineExceeded { log.G(ctx).WithField(logfields.Timeout, trueTimeout). Warning("Syscall did not complete within operation timeout. This may indicate a platform issue. " + "If it appears to be making no forward progress, obtain the stacks and see if there is a syscall " + diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/cim/LayerWriter.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/cim/LayerWriter.go deleted file mode 100644 index 386cbcda9e..0000000000 --- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/cim/LayerWriter.go +++ /dev/null @@ -1,289 +0,0 @@ -//go:build windows - -package cim - -import ( - "context" - "fmt" - "io" - "os" - "path/filepath" - "strconv" - "strings" - - "github.com/Microsoft/go-winio" - "github.com/Microsoft/hcsshim/internal/log" - "github.com/Microsoft/hcsshim/internal/oc" - "github.com/Microsoft/hcsshim/internal/wclayer" - "github.com/Microsoft/hcsshim/osversion" - "github.com/Microsoft/hcsshim/pkg/cimfs" - "go.opencensus.io/trace" -) - -// A CimLayerWriter implements the wclayer.LayerWriter interface to allow writing container -// image layers in the cim format. -// A cim layer consist of cim files (which are usually stored in the `cim-layers` directory and -// some other files which are stored in the directory of that layer (i.e the `path` directory). -type CimLayerWriter struct { - ctx context.Context - s *trace.Span - // path to the layer (i.e layer's directory) as provided by the caller. - // Even if a layer is stored as a cim in the cim directory, some files associated - // with a layer are still stored in this path. - path string - // parent layer paths - parentLayerPaths []string - // Handle to the layer cim - writes to the cim file - cimWriter *cimfs.CimFsWriter - // Handle to the writer for writing files in the local filesystem - stdFileWriter *stdFileWriter - // reference to currently active writer either cimWriter or stdFileWriter - activeWriter io.Writer - // denotes if this layer has the UtilityVM directory - hasUtilityVM bool - // some files are written outside the cim during initial import (via stdFileWriter) because we need to - // make some modifications to these files before writing them to the cim. The pendingOps slice - // maintains a list of such delayed modifications to the layer cim. These modifications are applied at - // the very end of layer import process. - pendingOps []pendingCimOp -} - -type hive struct { - name string - base string - delta string -} - -var ( - hives = []hive{ - {"SYSTEM", "SYSTEM_BASE", "SYSTEM_DELTA"}, - {"SOFTWARE", "SOFTWARE_BASE", "SOFTWARE_DELTA"}, - {"SAM", "SAM_BASE", "SAM_DELTA"}, - {"SECURITY", "SECURITY_BASE", "SECURITY_DELTA"}, - {"DEFAULT", "DEFAULTUSER_BASE", "DEFAULTUSER_DELTA"}, - } -) - -func isDeltaOrBaseHive(path string) bool { - for _, hv := range hives { - if strings.EqualFold(path, filepath.Join(wclayer.HivesPath, hv.delta)) || - strings.EqualFold(path, filepath.Join(wclayer.RegFilesPath, hv.name)) { - return true - } - } - return false -} - -// checks if this particular file should be written with a stdFileWriter instead of -// using the cimWriter. -func isStdFile(path string) bool { - return (isDeltaOrBaseHive(path) || - path == filepath.Join(wclayer.UtilityVMPath, wclayer.RegFilesPath, "SYSTEM") || - path == filepath.Join(wclayer.UtilityVMPath, wclayer.RegFilesPath, "SOFTWARE") || - path == wclayer.BcdFilePath || path == wclayer.BootMgrFilePath) -} - -// Add adds a file to the layer with given metadata. -func (cw *CimLayerWriter) Add(name string, fileInfo *winio.FileBasicInfo, fileSize int64, securityDescriptor []byte, extendedAttributes []byte, reparseData []byte) error { - if name == wclayer.UtilityVMPath { - cw.hasUtilityVM = true - } - if isStdFile(name) { - // create a pending op for this file - cw.pendingOps = append(cw.pendingOps, &addOp{ - pathInCim: name, - hostPath: filepath.Join(cw.path, name), - fileInfo: fileInfo, - securityDescriptor: securityDescriptor, - extendedAttributes: extendedAttributes, - reparseData: reparseData, - }) - if err := cw.stdFileWriter.Add(name); err != nil { - return err - } - cw.activeWriter = cw.stdFileWriter - } else { - if err := cw.cimWriter.AddFile(name, fileInfo, fileSize, securityDescriptor, extendedAttributes, reparseData); err != nil { - return err - } - cw.activeWriter = cw.cimWriter - } - return nil -} - -// AddLink adds a hard link to the layer. The target must already have been added. -func (cw *CimLayerWriter) AddLink(name string, target string) error { - // set active write to nil so that we panic if layer tar is incorrectly formatted. - cw.activeWriter = nil - if isStdFile(target) { - // If this is a link to a std file it will have to be added later once the - // std file is written to the CIM. Create a pending op for this - cw.pendingOps = append(cw.pendingOps, &linkOp{ - oldPath: target, - newPath: name, - }) - return nil - } else if isStdFile(name) { - // None of the predefined std files are links. If they show up as links this is unexpected - // behavior. Error out. - return fmt.Errorf("unexpected link %s in layer", name) - } else { - return cw.cimWriter.AddLink(target, name) - } -} - -// AddAlternateStream creates another alternate stream at the given -// path. Any writes made after this call will go to that stream. -func (cw *CimLayerWriter) AddAlternateStream(name string, size uint64) error { - if isStdFile(name) { - // As of now there is no known case of std file having multiple data streams. - // If such a file is encountered our assumptions are wrong. Error out. - return fmt.Errorf("unexpected alternate stream %s in layer", name) - } - - if err := cw.cimWriter.CreateAlternateStream(name, size); err != nil { - return err - } - cw.activeWriter = cw.cimWriter - return nil -} - -// Remove removes a file that was present in a parent layer from the layer. -func (cw *CimLayerWriter) Remove(name string) error { - // set active write to nil so that we panic if layer tar is incorrectly formatted. - cw.activeWriter = nil - return cw.cimWriter.Unlink(name) -} - -// Write writes data to the current file. The data must be in the format of a Win32 -// backup stream. -func (cw *CimLayerWriter) Write(b []byte) (int, error) { - return cw.activeWriter.Write(b) -} - -// Close finishes the layer writing process and releases any resources. -func (cw *CimLayerWriter) Close(ctx context.Context) (retErr error) { - if err := cw.stdFileWriter.Close(ctx); err != nil { - return err - } - - // cimWriter must be closed even if there are errors. - defer func() { - if err := cw.cimWriter.Close(); retErr == nil { - retErr = err - } - }() - - // Find out the osversion of this layer, both base & non-base layers can have UtilityVM layer. - processUtilityVM := false - if cw.hasUtilityVM { - uvmSoftwareHivePath := filepath.Join(cw.path, wclayer.UtilityVMPath, wclayer.RegFilesPath, "SOFTWARE") - osvStr, err := getOsBuildNumberFromRegistry(uvmSoftwareHivePath) - if err != nil { - return fmt.Errorf("read os version string from UtilityVM SOFTWARE hive: %w", err) - } - - osv, err := strconv.ParseUint(osvStr, 10, 16) - if err != nil { - return fmt.Errorf("parse os version string (%s): %w", osvStr, err) - } - - // write this version to a file for future reference by the shim process - if err = wclayer.WriteLayerUvmBuildFile(cw.path, uint16(osv)); err != nil { - return fmt.Errorf("write uvm build version: %w", err) - } - - // CIMFS for hyperV isolated is only supported after 20348, processing UtilityVM layer on 2048 - // & lower will cause failures since those images won't have CIMFS specific UVM files (mostly - // BCD entries required for CIMFS) - processUtilityVM = (osv > osversion.LTSC2022) - log.G(ctx).Debugf("import image os version %d, processing UtilityVM layer: %t\n", osv, processUtilityVM) - } - - if len(cw.parentLayerPaths) == 0 { - if err := cw.processBaseLayer(ctx, processUtilityVM); err != nil { - return fmt.Errorf("process base layer: %w", err) - } - } else { - if err := cw.processNonBaseLayer(ctx, processUtilityVM); err != nil { - return fmt.Errorf("process non base layer: %w", err) - } - } - - for _, op := range cw.pendingOps { - if err := op.apply(cw.cimWriter); err != nil { - return fmt.Errorf("apply pending operations: %w", err) - } - } - return nil -} - -func NewCimLayerWriter(ctx context.Context, path string, parentLayerPaths []string) (_ *CimLayerWriter, err error) { - if !cimfs.IsCimFSSupported() { - return nil, fmt.Errorf("CimFs not supported on this build") - } - - ctx, span := trace.StartSpan(ctx, "hcsshim::NewCimLayerWriter") - defer func() { - if err != nil { - oc.SetSpanStatus(span, err) - span.End() - } - }() - span.AddAttributes( - trace.StringAttribute("path", path), - trace.StringAttribute("parentLayerPaths", strings.Join(parentLayerPaths, ", "))) - - parentCim := "" - cimDirPath := GetCimDirFromLayer(path) - if _, err = os.Stat(cimDirPath); os.IsNotExist(err) { - // create cim directory - if err = os.Mkdir(cimDirPath, 0755); err != nil { - return nil, fmt.Errorf("failed while creating cim layers directory: %w", err) - } - } else if err != nil { - return nil, fmt.Errorf("unable to access cim layers directory: %w", err) - - } - - if len(parentLayerPaths) > 0 { - parentCim = GetCimNameFromLayer(parentLayerPaths[0]) - } - - cim, err := cimfs.Create(cimDirPath, parentCim, GetCimNameFromLayer(path)) - if err != nil { - return nil, fmt.Errorf("error in creating a new cim: %w", err) - } - - sfw, err := newStdFileWriter(path, parentLayerPaths) - if err != nil { - return nil, fmt.Errorf("error in creating new standard file writer: %w", err) - } - return &CimLayerWriter{ - ctx: ctx, - s: span, - path: path, - parentLayerPaths: parentLayerPaths, - cimWriter: cim, - stdFileWriter: sfw, - }, nil -} - -// DestroyCimLayer destroys a cim layer i.e it removes all the cimfs files for the given layer as well as -// all of the other files that are stored in the layer directory (at path `layerPath`). -// If this is not a cimfs layer (i.e a cim file for the given layer does not exist) then nothing is done. -func DestroyCimLayer(ctx context.Context, layerPath string) error { - cimPath := GetCimPathFromLayer(layerPath) - - // verify that such a cim exists first, sometimes containerd tries to call - // this with the root snapshot directory as the layer path. We don't want to - // destroy everything inside the snapshots directory. - if _, err := os.Stat(cimPath); err != nil { - if os.IsNotExist(err) { - return nil - } - return err - } - - return cimfs.DestroyCim(ctx, cimPath) -} diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/cim/bcd.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/cim/bcd.go deleted file mode 100644 index 23a3ce6776..0000000000 --- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/cim/bcd.go +++ /dev/null @@ -1,107 +0,0 @@ -//go:build windows - -package cim - -import ( - "bytes" - "fmt" - "os/exec" - - "github.com/Microsoft/go-winio/pkg/guid" -) - -const ( - bcdFilePath = "UtilityVM\\Files\\EFI\\Microsoft\\Boot\\BCD" - cimfsDeviceOptionsID = "{763e9fea-502d-434f-aad9-5fabe9c91a7b}" - vmbusDeviceID = "{c63c9bdf-5fa5-4208-b03f-6b458b365592}" - compositeDeviceOptionsID = "{e1787220-d17f-49e7-977a-d8fe4c8537e2}" - bootContainerID = "{b890454c-80de-4e98-a7ab-56b74b4fbd0c}" -) - -func bcdExec(storePath string, args ...string) error { - var out bytes.Buffer - argsArr := []string{"/store", storePath, "/offline"} - argsArr = append(argsArr, args...) - cmd := exec.Command("bcdedit.exe", argsArr...) - cmd.Stdout = &out - if err := cmd.Run(); err != nil { - return fmt.Errorf("bcd command (%s) failed: %w", cmd, err) - } - return nil -} - -// A registry configuration required for the uvm. -func setBcdRestartOnFailure(storePath string) error { - return bcdExec(storePath, "/set", "{default}", "restartonfailure", "yes") -} - -func setBcdCimBootDevice(storePath, cimPathRelativeToVSMB string, diskID, partitionID guid.GUID) error { - // create options for cimfs boot device - if err := bcdExec(storePath, "/create", cimfsDeviceOptionsID, "/d", "CimFS Device Options", "/device"); err != nil { - return err - } - - // Set options. For now we need to set 2 options. First is the parent device i.e the device under - // which all cim files will be available. Second is the path of the cim (from which this UVM should - // boot) relative to the parent device. Note that even though the 2nd option is named - // `cimfsrootdirectory` it expects a path to the cim file and not a directory path. - if err := bcdExec(storePath, "/set", cimfsDeviceOptionsID, "cimfsparentdevice", fmt.Sprintf("vmbus=%s", vmbusDeviceID)); err != nil { - return err - } - - if err := bcdExec(storePath, "/set", cimfsDeviceOptionsID, "cimfsrootdirectory", fmt.Sprintf("\\%s", cimPathRelativeToVSMB)); err != nil { - return err - } - - // create options for the composite device - if err := bcdExec(storePath, "/create", compositeDeviceOptionsID, "/d", "Composite Device Options", "/device"); err != nil { - return err - } - - // We need to specify the diskID & the partition ID of the boot disk and we need to set the cimfs boot - // options ID - partitionStr := fmt.Sprintf("gpt_partition={%s};{%s}", diskID, partitionID) - if err := bcdExec(storePath, "/set", compositeDeviceOptionsID, "primarydevice", partitionStr); err != nil { - return err - } - - if err := bcdExec(storePath, "/set", compositeDeviceOptionsID, "secondarydevice", fmt.Sprintf("cimfs=%s,%s", bootContainerID, cimfsDeviceOptionsID)); err != nil { - return err - } - - if err := bcdExec(storePath, "/set", "{default}", "device", fmt.Sprintf("composite=0,%s", compositeDeviceOptionsID)); err != nil { - return err - } - - if err := bcdExec(storePath, "/set", "{default}", "osdevice", fmt.Sprintf("composite=0,%s", compositeDeviceOptionsID)); err != nil { - return err - } - - // Since our UVM file are stored under UtilityVM\Files directory inside the CIM we must prepend that - // directory in front of paths used by bootmgr - if err := bcdExec(storePath, "/set", "{default}", "path", "\\UtilityVM\\Files\\Windows\\System32\\winload.efi"); err != nil { - return err - } - - if err := bcdExec(storePath, "/set", "{default}", "systemroot", "\\UtilityVM\\Files\\Windows"); err != nil { - return err - } - - return nil -} - -// updateBcdStoreForBoot Updates the bcd store at path layerPath + UtilityVM\Files\EFI\Microsoft\Boot\BCD` to -// boot with the disk with given ID and given partitionID. cimPathRelativeToVSMB is the path of the cim which -// will be used for booting this UVM relative to the VSMB share. (Usually, the entire snapshots directory will -// be shared over VSMB, so if this is the cim-layers\1.cim under that directory, the value of -// `cimPathRelativeToVSMB` should be cim-layers\1.cim) -func updateBcdStoreForBoot(storePath string, cimPathRelativeToVSMB string, diskID, partitionID guid.GUID) error { - if err := setBcdRestartOnFailure(storePath); err != nil { - return err - } - - if err := setBcdCimBootDevice(storePath, cimPathRelativeToVSMB, diskID, partitionID); err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/cim/common.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/cim/common.go deleted file mode 100644 index bdeebd3c03..0000000000 --- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/cim/common.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build windows - -package cim - -import ( - "os" - "path/filepath" -) - -const ( - // name of the directory in which cims are stored - cimDir = "cim-layers" -) - -// Usually layers are stored at ./root/io.containerd.snapshotter.v1.windows/snapshots/. For cimfs we -// must store all layer cims in the same directory (for forked cims to work). So all cim layers are stored in -// /root/io.containerd.snapshotter.v1.windows/snapshots/cim-layers. And the cim file representing each -// individual layer is stored at /root/io.containerd.snapshotter.v1.windows/snapshots/cim-layers/.cim - -// CimName is the filename (.cim) of the file representing the cim -func GetCimNameFromLayer(layerPath string) string { - return filepath.Base(layerPath) + ".cim" -} - -// CimPath is the path to the CimDir/.cim file that represents a layer cim. -func GetCimPathFromLayer(layerPath string) string { - return filepath.Join(GetCimDirFromLayer(layerPath), GetCimNameFromLayer(layerPath)) -} - -// CimDir is the directory inside which all cims are stored. -func GetCimDirFromLayer(layerPath string) string { - dir := filepath.Dir(layerPath) - return filepath.Join(dir, cimDir) -} - -// IsCimLayer returns `true` if the layer at path `layerPath` is a cim layer. Returns `false` otherwise. -func IsCimLayer(layerPath string) bool { - cimPath := GetCimPathFromLayer(layerPath) - _, err := os.Stat(cimPath) - return (err == nil) -} diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/cim/doc.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/cim/doc.go deleted file mode 100644 index d814659965..0000000000 --- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/cim/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// This package provides utilities for working with container image layers in the cim format -// via the wclayer APIs. -package cim diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/cim/file_writer.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/cim/file_writer.go deleted file mode 100644 index 497bbbbb9a..0000000000 --- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/cim/file_writer.go +++ /dev/null @@ -1,90 +0,0 @@ -//go:build windows - -package cim - -import ( - "context" - "fmt" - "os" - "path/filepath" - "syscall" - - "github.com/Microsoft/go-winio" - "github.com/Microsoft/hcsshim/internal/safefile" - "github.com/Microsoft/hcsshim/internal/winapi" -) - -// stdFileWriter writes the files of a layer to the layer folder instead of writing them inside the cim. -// For some files (like the Hive files or some UtilityVM files) it is necessary to write them as a normal file -// first, do some modifications on them (for example merging of hives or processing of UtilityVM files) -// and then write the modified versions into the cim. This writer is used for such files. -type stdFileWriter struct { - activeFile *os.File - // parent layer paths - parentLayerPaths []string - // path to the current layer - path string - // the open handle to the path directory - root *os.File -} - -func newStdFileWriter(root string, parentRoots []string) (sfw *stdFileWriter, err error) { - sfw = &stdFileWriter{ - path: root, - parentLayerPaths: parentRoots, - } - sfw.root, err = safefile.OpenRoot(root) - if err != nil { - return - } - return -} - -func (sfw *stdFileWriter) closeActiveFile() (err error) { - if sfw.activeFile != nil { - err = sfw.activeFile.Close() - sfw.activeFile = nil - } - return -} - -// Adds a new file or an alternate data stream to an existing file inside the layer directory. -func (sfw *stdFileWriter) Add(name string) error { - if err := sfw.closeActiveFile(); err != nil { - return err - } - - // The directory of this file might be created inside the cim. - // make sure we have the same parent directory chain here - if err := safefile.MkdirAllRelative(filepath.Dir(name), sfw.root); err != nil { - return fmt.Errorf("failed to create file %s: %w", name, err) - } - - f, err := safefile.OpenRelative( - name, - sfw.root, - syscall.GENERIC_READ|syscall.GENERIC_WRITE|winio.WRITE_DAC|winio.WRITE_OWNER, - syscall.FILE_SHARE_READ, - winapi.FILE_CREATE, - 0, - ) - if err != nil { - return fmt.Errorf("error creating file %s: %w", name, err) - } - sfw.activeFile = f - return nil -} - -// Write writes data to the current file. The data must be in the format of a Win32 -// backup stream. -func (sfw *stdFileWriter) Write(b []byte) (int, error) { - return sfw.activeFile.Write(b) -} - -// Close finishes the layer writing process and releases any resources. -func (sfw *stdFileWriter) Close(ctx context.Context) error { - if err := sfw.closeActiveFile(); err != nil { - return fmt.Errorf("failed to close active file %s : %w", sfw.activeFile.Name(), err) - } - return nil -} diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/cim/mount.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/cim/mount.go deleted file mode 100644 index 22f21dd43a..0000000000 --- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/cim/mount.go +++ /dev/null @@ -1,89 +0,0 @@ -//go:build windows - -package cim - -import ( - "context" - "fmt" - "os" - "sync" - - "github.com/Microsoft/go-winio/pkg/guid" - hcsschema "github.com/Microsoft/hcsshim/internal/hcs/schema2" - cimfs "github.com/Microsoft/hcsshim/pkg/cimfs" -) - -// a cache of cim layer to its mounted volume - The mount manager plugin currently doesn't have an option of -// querying a mounted cim to get the volume at which it is mounted, so we maintain a cache of that here -var ( - cimMounts map[string]string = make(map[string]string) - cimMountMapLock sync.Mutex - // A random GUID used as a namespace for generating cim mount volume GUIDs: 6827367b-c388-4e9b-95ec-961c6d2c936c - cimMountNamespace guid.GUID = guid.GUID{Data1: 0x6827367b, Data2: 0xc388, Data3: 0x4e9b, Data4: [8]byte{0x96, 0x1c, 0x6d, 0x2c, 0x93, 0x6c}} -) - -// MountCimLayer mounts the cim at path `cimPath` and returns the mount location of that cim. This method -// uses the `CimMountFlagCacheFiles` mount flag when mounting the cim. The containerID is used to generated -// the volumeID for the volume at which this CIM is mounted. containerID is used so that if the shim process -// crashes for any reason, the mounted cim can be correctly cleaned up during `shim delete` call. -func MountCimLayer(ctx context.Context, cimPath, containerID string) (string, error) { - volumeGUID, err := guid.NewV5(cimMountNamespace, []byte(containerID)) - if err != nil { - return "", fmt.Errorf("generated cim mount GUID: %w", err) - } - - vol, err := cimfs.Mount(cimPath, volumeGUID, hcsschema.CimMountFlagCacheFiles) - if err != nil { - return "", err - } - - cimMountMapLock.Lock() - defer cimMountMapLock.Unlock() - cimMounts[fmt.Sprintf("%s_%s", containerID, cimPath)] = vol - - return vol, nil -} - -// Unmount unmounts the cim at mounted for given container. -func UnmountCimLayer(ctx context.Context, cimPath, containerID string) error { - cimMountMapLock.Lock() - defer cimMountMapLock.Unlock() - if vol, ok := cimMounts[fmt.Sprintf("%s_%s", containerID, cimPath)]; !ok { - return fmt.Errorf("cim %s not mounted", cimPath) - } else { - delete(cimMounts, fmt.Sprintf("%s_%s", containerID, cimPath)) - err := cimfs.Unmount(vol) - if err != nil { - return err - } - } - return nil -} - -// GetCimMountPath returns the volume at which a cim is mounted. If the cim is not mounted returns error -func GetCimMountPath(cimPath, containerID string) (string, error) { - cimMountMapLock.Lock() - defer cimMountMapLock.Unlock() - - if vol, ok := cimMounts[fmt.Sprintf("%s_%s", containerID, cimPath)]; !ok { - return "", fmt.Errorf("cim %s not mounted", cimPath) - } else { - return vol, nil - } -} - -func CleanupContainerMounts(containerID string) error { - volumeGUID, err := guid.NewV5(cimMountNamespace, []byte(containerID)) - if err != nil { - return fmt.Errorf("generated cim mount GUID: %w", err) - } - - volPath := fmt.Sprintf("\\\\?\\Volume{%s}\\", volumeGUID.String()) - if _, err := os.Stat(volPath); err == nil { - err = cimfs.Unmount(volPath) - if err != nil { - return err - } - } - return nil -} diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/cim/pending.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/cim/pending.go deleted file mode 100644 index d13bdff850..0000000000 --- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/cim/pending.go +++ /dev/null @@ -1,68 +0,0 @@ -//go:build windows - -package cim - -import ( - "fmt" - "io" - "os" - - "github.com/Microsoft/go-winio" - "github.com/Microsoft/hcsshim/pkg/cimfs" - "golang.org/x/sys/windows" -) - -type pendingCimOp interface { - apply(cw *cimfs.CimFsWriter) error -} - -// add op represents a pending operation of adding a new file inside the cim -type addOp struct { - // path inside the cim at which the file should be added - pathInCim string - // host path where this file was temporarily written. - hostPath string - // other file metadata fields that were provided during the add call. - fileInfo *winio.FileBasicInfo - securityDescriptor []byte - extendedAttributes []byte - reparseData []byte -} - -func (o *addOp) apply(cw *cimfs.CimFsWriter) error { - f, err := os.Open(o.hostPath) - if err != nil { - return fmt.Errorf("open file %s: %w", o.hostPath, err) - } - defer f.Close() - - fs, err := f.Stat() - if err != nil { - return fmt.Errorf("stat file %s: %w", o.hostPath, err) - } - - if err := cw.AddFile(o.pathInCim, o.fileInfo, fs.Size(), o.securityDescriptor, o.extendedAttributes, o.reparseData); err != nil { - return fmt.Errorf("cim add file %s: %w", o.hostPath, err) - } - - if o.fileInfo.FileAttributes != windows.FILE_ATTRIBUTE_DIRECTORY { - written, err := io.Copy(cw, f) - if err != nil { - return fmt.Errorf("write file %s inside cim: %w", o.hostPath, err) - } else if written != fs.Size() { - return fmt.Errorf("short write to cim for file %s, expected %d bytes wrote %d", o.hostPath, fs.Size(), written) - } - } - return nil -} - -// linkOp represents a pending link file operation inside the cim -type linkOp struct { - // old & new paths inside the cim where the link should be created - oldPath string - newPath string -} - -func (o *linkOp) apply(cw *cimfs.CimFsWriter) error { - return cw.AddLink(o.oldPath, o.newPath) -} diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/cim/process.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/cim/process.go deleted file mode 100644 index 9ed0428b7e..0000000000 --- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/cim/process.go +++ /dev/null @@ -1,230 +0,0 @@ -//go:build windows - -package cim - -import ( - "context" - "fmt" - "os" - "path/filepath" - "syscall" - "time" - - "github.com/Microsoft/go-winio" - "github.com/Microsoft/go-winio/vhd" - "github.com/Microsoft/hcsshim/computestorage" - "github.com/Microsoft/hcsshim/internal/memory" - "github.com/Microsoft/hcsshim/internal/security" - "github.com/Microsoft/hcsshim/internal/vhdx" - "github.com/Microsoft/hcsshim/internal/wclayer" - "golang.org/x/sys/windows" -) - -const defaultVHDXBlockSizeInMB = 1 - -// processUtilityVMLayer is similar to createContainerBaseLayerVHDs but along with the scratch creation it -// also does some BCD modifications to allow the UVM to boot from the CIM. It expects that the UVM BCD file is -// present at layerPath/`wclayer.BcdFilePath` and a UVM SYSTEM hive is present at -// layerPath/UtilityVM/`wclayer.RegFilesPath`/SYSTEM. The scratch VHDs are created under the `layerPath` -// directory. -func processUtilityVMLayer(ctx context.Context, layerPath string) error { - // func createUtilityVMLayerVHDs(ctx context.Context, layerPath string) error { - baseVhdPath := filepath.Join(layerPath, wclayer.UtilityVMPath, wclayer.UtilityVMBaseVhd) - diffVhdPath := filepath.Join(layerPath, wclayer.UtilityVMPath, wclayer.UtilityVMScratchVhd) - defaultVhdSize := uint64(10) - - // Just create the vhdx for utilityVM layer, no need to format it. - createParams := &vhd.CreateVirtualDiskParameters{ - Version: 2, - Version2: vhd.CreateVersion2{ - MaximumSize: defaultVhdSize * memory.GiB, - BlockSizeInBytes: defaultVHDXBlockSizeInMB * memory.MiB, - }, - } - - handle, err := vhd.CreateVirtualDisk(baseVhdPath, vhd.VirtualDiskAccessNone, vhd.CreateVirtualDiskFlagNone, createParams) - if err != nil { - return fmt.Errorf("failed to create vhdx: %w", err) - } - - defer func() { - if err != nil { - os.RemoveAll(baseVhdPath) - os.RemoveAll(diffVhdPath) - } - }() - - err = computestorage.FormatWritableLayerVhd(ctx, windows.Handle(handle)) - closeErr := syscall.CloseHandle(handle) - if err != nil { - return err - } else if closeErr != nil { - return fmt.Errorf("failed to close vhdx handle: %w", closeErr) - } - - partitionInfo, err := vhdx.GetScratchVhdPartitionInfo(ctx, baseVhdPath) - if err != nil { - return fmt.Errorf("failed to get base vhd layout info: %w", err) - } - // relativeCimPath needs to be the cim path relative to the snapshots directory. The snapshots - // directory is shared inside the UVM over VSMB, so during the UVM boot this relative path will be - // used to find the cim file under that VSMB share. - relativeCimPath := filepath.Join(filepath.Base(GetCimDirFromLayer(layerPath)), GetCimNameFromLayer(layerPath)) - bcdPath := filepath.Join(layerPath, bcdFilePath) - if err = updateBcdStoreForBoot(bcdPath, relativeCimPath, partitionInfo.DiskID, partitionInfo.PartitionID); err != nil { - return fmt.Errorf("failed to update BCD: %w", err) - } - - if err := enableCimBoot(filepath.Join(layerPath, wclayer.UtilityVMPath, wclayer.RegFilesPath, "SYSTEM")); err != nil { - return fmt.Errorf("failed to setup cim image for uvm boot: %w", err) - } - - // Note: diff vhd creation and granting of vm group access must be done AFTER - // getting the partition info of the base VHD. Otherwise it causes the vhd parent - // chain to get corrupted. - // TODO(ambarve): figure out why this happens so that bcd update can be moved to a separate function - - // Create the differencing disk that will be what's copied for the final rw layer - // for a container. - if err = vhd.CreateDiffVhd(diffVhdPath, baseVhdPath, defaultVHDXBlockSizeInMB); err != nil { - return fmt.Errorf("failed to create differencing disk: %w", err) - } - - if err := security.GrantVmGroupAccess(baseVhdPath); err != nil { - return fmt.Errorf("failed to grant vm group access to %s: %w", baseVhdPath, err) - } - if err := security.GrantVmGroupAccess(diffVhdPath); err != nil { - return fmt.Errorf("failed to grant vm group access to %s: %w", diffVhdPath, err) - } - return nil -} - -// processBaseLayerHives make the base layer specific modifications on the hives and emits equivalent the -// pendingCimOps that should be applied on the CIM. In base layer we need to create hard links from registry -// hives under Files/Windows/Sysetm32/config into Hives/*_BASE. This function creates these links outside so -// that the registry hives under Hives/ are available during children layers import. Then we write these hive -// files inside the cim and create links inside the cim. -func processBaseLayerHives(layerPath string) ([]pendingCimOp, error) { - pendingOps := []pendingCimOp{} - - // make hives directory both outside and in the cim - if err := os.Mkdir(filepath.Join(layerPath, wclayer.HivesPath), 0755); err != nil { - return pendingOps, fmt.Errorf("hives directory creation: %w", err) - } - - hivesDirInfo := &winio.FileBasicInfo{ - CreationTime: windows.NsecToFiletime(time.Now().UnixNano()), - LastAccessTime: windows.NsecToFiletime(time.Now().UnixNano()), - LastWriteTime: windows.NsecToFiletime(time.Now().UnixNano()), - ChangeTime: windows.NsecToFiletime(time.Now().UnixNano()), - FileAttributes: windows.FILE_ATTRIBUTE_DIRECTORY, - } - pendingOps = append(pendingOps, &addOp{ - pathInCim: wclayer.HivesPath, - hostPath: filepath.Join(layerPath, wclayer.HivesPath), - fileInfo: hivesDirInfo, - }) - - // add hard links from base hive files. - for _, hv := range hives { - oldHivePathRelative := filepath.Join(wclayer.RegFilesPath, hv.name) - newHivePathRelative := filepath.Join(wclayer.HivesPath, hv.base) - if err := os.Link(filepath.Join(layerPath, oldHivePathRelative), filepath.Join(layerPath, newHivePathRelative)); err != nil { - return pendingOps, fmt.Errorf("hive link creation: %w", err) - } - - pendingOps = append(pendingOps, &linkOp{ - oldPath: oldHivePathRelative, - newPath: newHivePathRelative, - }) - } - return pendingOps, nil -} - -// processLayoutFile creates a file named "layout" in the root of the base layer. This allows certain -// container startup related functions to understand that the hives are a part of the container rootfs. -func processLayoutFile(layerPath string) ([]pendingCimOp, error) { - fileContents := "vhd-with-hives\n" - if err := os.WriteFile(filepath.Join(layerPath, "layout"), []byte(fileContents), 0755); err != nil { - return []pendingCimOp{}, fmt.Errorf("write layout file: %w", err) - } - - layoutFileInfo := &winio.FileBasicInfo{ - CreationTime: windows.NsecToFiletime(time.Now().UnixNano()), - LastAccessTime: windows.NsecToFiletime(time.Now().UnixNano()), - LastWriteTime: windows.NsecToFiletime(time.Now().UnixNano()), - ChangeTime: windows.NsecToFiletime(time.Now().UnixNano()), - FileAttributes: windows.FILE_ATTRIBUTE_NORMAL, - } - - op := &addOp{ - pathInCim: "layout", - hostPath: filepath.Join(layerPath, "layout"), - fileInfo: layoutFileInfo, - } - return []pendingCimOp{op}, nil -} - -// Some of the layer files that are generated during the processBaseLayer call must be added back -// inside the cim, some registry file links must be updated. This function takes care of all those -// steps. This function opens the cim file for writing and updates it. -func (cw *CimLayerWriter) processBaseLayer(ctx context.Context, processUtilityVM bool) (err error) { - if processUtilityVM { - if err = processUtilityVMLayer(ctx, cw.path); err != nil { - return fmt.Errorf("process utilityVM layer: %w", err) - } - } - - ops, err := processBaseLayerHives(cw.path) - if err != nil { - return err - } - cw.pendingOps = append(cw.pendingOps, ops...) - - ops, err = processLayoutFile(cw.path) - if err != nil { - return err - } - cw.pendingOps = append(cw.pendingOps, ops...) - return nil -} - -// processNonBaseLayer takes care of the processing required for a non base layer. As of now -// the only processing required for non base layer is to merge the delta registry hives of the -// non-base layer with it's parent layer. -func (cw *CimLayerWriter) processNonBaseLayer(ctx context.Context, processUtilityVM bool) (err error) { - for _, hv := range hives { - baseHive := filepath.Join(wclayer.HivesPath, hv.base) - deltaHive := filepath.Join(wclayer.HivesPath, hv.delta) - _, err := os.Stat(filepath.Join(cw.path, deltaHive)) - // merge with parent layer if delta exists. - if err != nil && !os.IsNotExist(err) { - return fmt.Errorf("stat delta hive %s: %w", filepath.Join(cw.path, deltaHive), err) - } else if err == nil { - // merge base hive of parent layer with the delta hive of this layer and write it as - // the base hive of this layer. - err = mergeHive(filepath.Join(cw.parentLayerPaths[0], baseHive), filepath.Join(cw.path, deltaHive), filepath.Join(cw.path, baseHive)) - if err != nil { - return err - } - - // the newly created merged file must be added to the cim - cw.pendingOps = append(cw.pendingOps, &addOp{ - pathInCim: baseHive, - hostPath: filepath.Join(cw.path, baseHive), - fileInfo: &winio.FileBasicInfo{ - CreationTime: windows.NsecToFiletime(time.Now().UnixNano()), - LastAccessTime: windows.NsecToFiletime(time.Now().UnixNano()), - LastWriteTime: windows.NsecToFiletime(time.Now().UnixNano()), - ChangeTime: windows.NsecToFiletime(time.Now().UnixNano()), - FileAttributes: windows.FILE_ATTRIBUTE_NORMAL, - }, - }) - } - } - - if processUtilityVM { - return processUtilityVMLayer(ctx, cw.path) - } - return nil -} diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/cim/registry.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/cim/registry.go deleted file mode 100644 index dd2af81cf3..0000000000 --- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/cim/registry.go +++ /dev/null @@ -1,172 +0,0 @@ -//go:build windows - -package cim - -import ( - "encoding/binary" - "fmt" - "os" - "unsafe" - - "github.com/Microsoft/hcsshim/internal/log" - "github.com/Microsoft/hcsshim/internal/winapi" - "github.com/Microsoft/hcsshim/osversion" - "github.com/pkg/errors" - "github.com/sirupsen/logrus" - "golang.org/x/sys/windows" -) - -// enableCimBoot Opens the SYSTEM registry hive at path `hivePath` and updates it to include a CIMFS Start -// registry key. This prepares the uvm to boot from a cim file if requested. The registry changes required to -// actually make the uvm boot from a cim will be added in the uvm config (look at -// addBootFromCimRegistryChanges for details). This registry key needs to be available in the early boot -// phase and so including it in the uvm config doesn't work. -func enableCimBoot(hivePath string) (err error) { - dataZero := make([]byte, 4) - dataOne := make([]byte, 4) - binary.LittleEndian.PutUint32(dataOne, 1) - dataFour := make([]byte, 4) - binary.LittleEndian.PutUint32(dataFour, 4) - - bootGUID, err := windows.UTF16FromString(bootContainerID) - if err != nil { - return fmt.Errorf("failed to encode boot guid to utf16: %w", err) - } - - overrideBootPath, err := windows.UTF16FromString("\\Windows\\") - if err != nil { - return fmt.Errorf("failed to encode override boot path to utf16: %w", err) - } - - regChanges := []struct { - keyPath string - valueName string - valueType winapi.RegType - data *byte - dataLen uint32 - }{ - {"ControlSet001\\Control", "BootContainerGuid", winapi.REG_TYPE_SZ, (*byte)(unsafe.Pointer(&bootGUID[0])), 2 * uint32(len(bootGUID))}, - {"ControlSet001\\Services\\UnionFS", "Start", winapi.REG_TYPE_DWORD, &dataZero[0], uint32(len(dataZero))}, - {"ControlSet001\\Services\\wcifs", "Start", winapi.REG_TYPE_DWORD, &dataFour[0], uint32(len(dataZero))}, - // The bootmgr loads the uvm files from the cim and so uses the relative path `UtilityVM\\Files` inside the cim to access the uvm files. However, once the cim is mounted UnionFS will merge the correct directory (UtilityVM\\Files) of the cim with the scratch and then that point onwards we don't need to use the relative path. Below registry key tells the kernel that the boot path that was provided in BCD should now be overriden with this new path. - {"Setup", "BootPathOverride", winapi.REG_TYPE_SZ, (*byte)(unsafe.Pointer(&overrideBootPath[0])), 2 * uint32(len(overrideBootPath))}, - } - - var storeHandle winapi.ORHKey - if err = winapi.OROpenHive(hivePath, &storeHandle); err != nil { - return fmt.Errorf("failed to open registry store at %s: %w", hivePath, err) - } - - for _, change := range regChanges { - var changeKey winapi.ORHKey - if err = winapi.ORCreateKey(storeHandle, change.keyPath, 0, 0, 0, &changeKey, nil); err != nil { - return fmt.Errorf("failed to open reg key %s: %w", change.keyPath, err) - } - - if err = winapi.ORSetValue(changeKey, change.valueName, uint32(change.valueType), change.data, change.dataLen); err != nil { - return fmt.Errorf("failed to set value for regkey %s\\%s : %w", change.keyPath, change.valueName, err) - } - } - - // remove the existing file first - if err := os.Remove(hivePath); err != nil { - return fmt.Errorf("failed to remove existing registry %s: %w", hivePath, err) - } - - if err = winapi.ORSaveHive(winapi.ORHKey(storeHandle), hivePath, uint32(osversion.Get().MajorVersion), uint32(osversion.Get().MinorVersion)); err != nil { - return fmt.Errorf("error saving the registry store: %w", err) - } - - // close hive irrespective of the errors - if err := winapi.ORCloseHive(winapi.ORHKey(storeHandle)); err != nil { - return fmt.Errorf("error closing registry store; %w", err) - } - return nil - -} - -// mergeHive merges the hive located at parentHivePath with the hive located at deltaHivePath and stores -// the result into the file at mergedHivePath. If a file already exists at path `mergedHivePath` then it -// throws an error. -func mergeHive(parentHivePath, deltaHivePath, mergedHivePath string) (err error) { - var baseHive, deltaHive, mergedHive winapi.ORHKey - if err := winapi.OROpenHive(parentHivePath, &baseHive); err != nil { - return fmt.Errorf("failed to open base hive %s: %w", parentHivePath, err) - } - defer func() { - err2 := winapi.ORCloseHive(baseHive) - if err == nil { - err = errors.Wrap(err2, "failed to close base hive") - } - }() - if err := winapi.OROpenHive(deltaHivePath, &deltaHive); err != nil { - return fmt.Errorf("failed to open delta hive %s: %w", deltaHivePath, err) - } - defer func() { - err2 := winapi.ORCloseHive(deltaHive) - if err == nil { - err = errors.Wrap(err2, "failed to close delta hive") - } - }() - if err := winapi.ORMergeHives([]winapi.ORHKey{baseHive, deltaHive}, &mergedHive); err != nil { - return fmt.Errorf("failed to merge hives: %w", err) - } - defer func() { - err2 := winapi.ORCloseHive(mergedHive) - if err == nil { - err = errors.Wrap(err2, "failed to close merged hive") - } - }() - if err := winapi.ORSaveHive(mergedHive, mergedHivePath, uint32(osversion.Get().MajorVersion), uint32(osversion.Get().MinorVersion)); err != nil { - return fmt.Errorf("failed to save hive: %w", err) - } - return -} - -// getOsBuildNumberFromRegistry fetches the "CurrentBuild" value at path -// "Microsoft\Windows NT\CurrentVersion" from the SOFTWARE registry hive at path -// `regHivePath`. This is used to detect the build version of the uvm. -func getOsBuildNumberFromRegistry(regHivePath string) (_ string, err error) { - var storeHandle, keyHandle winapi.ORHKey - var dataType, dataLen uint32 - keyPath := "Microsoft\\Windows NT\\CurrentVersion" - valueName := "CurrentBuild" - dataLen = 16 // build version string can't be more than 5 wide chars? - dataBuf := make([]byte, dataLen) - - if err = winapi.OROpenHive(regHivePath, &storeHandle); err != nil { - return "", fmt.Errorf("failed to open registry store at %s: %w", regHivePath, err) - } - defer func() { - if closeErr := winapi.ORCloseHive(storeHandle); closeErr != nil { - log.L.WithFields(logrus.Fields{ - "error": closeErr, - "hive": regHivePath, - }).Warnf("failed to close hive") - } - }() - - if err = winapi.OROpenKey(storeHandle, keyPath, &keyHandle); err != nil { - return "", fmt.Errorf("failed to open key at %s: %w", keyPath, err) - } - defer func() { - if closeErr := winapi.ORCloseKey(keyHandle); closeErr != nil { - log.L.WithFields(logrus.Fields{ - "error": closeErr, - "hive": regHivePath, - "key": keyPath, - "value": valueName, - }).Warnf("failed to close hive key") - } - }() - - if err = winapi.ORGetValue(keyHandle, "", valueName, &dataType, &dataBuf[0], &dataLen); err != nil { - return "", fmt.Errorf("failed to get value of %s: %w", valueName, err) - } - - if dataType != uint32(winapi.REG_TYPE_SZ) { - return "", fmt.Errorf("unexpected build number data type (%d)", dataType) - } - - return winapi.ParseUtf16LE(dataBuf[:(dataLen - 2)]), nil -} diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/legacy.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/legacy.go index fc12eeba4d..627060cee4 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/legacy.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/legacy.go @@ -34,6 +34,7 @@ const ( UtilityVMPath = `UtilityVM` UtilityVMFilesPath = `UtilityVM\Files` RegFilesPath = `Files\Windows\System32\config` + BootDirRelativePath = `\EFI\Microsoft\Boot` BcdFilePath = `UtilityVM\Files\EFI\Microsoft\Boot\BCD` BootMgrFilePath = `UtilityVM\Files\EFI\Microsoft\Boot\bootmgfw.efi` ContainerBaseVhd = `blank-base.vhdx` diff --git a/vendor/github.com/Microsoft/hcsshim/internal/winapi/cimfs.go b/vendor/github.com/Microsoft/hcsshim/internal/winapi/cimfs.go index 21664577b7..6c026d9822 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/winapi/cimfs.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/winapi/cimfs.go @@ -32,10 +32,16 @@ type CimFsFileMetadata struct { EACount uint32 } +type CimFsImagePath struct { + ImageDir *uint16 + ImageName *uint16 +} + //sys CimMountImage(imagePath string, fsName string, flags uint32, volumeID *g) (hr error) = cimfs.CimMountImage? //sys CimDismountImage(volumeID *g) (hr error) = cimfs.CimDismountImage? //sys CimCreateImage(imagePath string, oldFSName *uint16, newFSName *uint16, cimFSHandle *FsHandle) (hr error) = cimfs.CimCreateImage? +//sys CimCreateImage2(imagePath string, flags uint32, oldFSName *uint16, newFSName *uint16, cimFSHandle *FsHandle) (hr error) = cimfs.CimCreateImage2? //sys CimCloseImage(cimFSHandle FsHandle) = cimfs.CimCloseImage? //sys CimCommitImage(cimFSHandle FsHandle) (hr error) = cimfs.CimCommitImage? @@ -45,3 +51,8 @@ type CimFsFileMetadata struct { //sys CimDeletePath(cimFSHandle FsHandle, path string) (hr error) = cimfs.CimDeletePath? //sys CimCreateHardLink(cimFSHandle FsHandle, newPath string, oldPath string) (hr error) = cimfs.CimCreateHardLink? //sys CimCreateAlternateStream(cimFSHandle FsHandle, path string, size uint64, cimStreamHandle *StreamHandle) (hr error) = cimfs.CimCreateAlternateStream? +//sys CimAddFsToMergedImage(cimFSHandle FsHandle, path string) (hr error) = cimfs.CimAddFsToMergedImage? +//sys CimAddFsToMergedImage2(cimFSHandle FsHandle, path string, flags uint32) (hr error) = cimfs.CimAddFsToMergedImage2? +//sys CimMergeMountImage(numCimPaths uint32, backingImagePaths *CimFsImagePath, flags uint32, volumeID *g) (hr error) = cimfs.CimMergeMountImage? +//sys CimTombstoneFile(cimFSHandle FsHandle, path string) (hr error) = cimfs.CimTombstoneFile? +//sys CimCreateMergeLink(cimFSHandle FsHandle, newPath string, oldPath string) (hr error) = cimfs.CimCreateMergeLink? 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 ecdded312e..2abdc2e072 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/winapi/zsyscall_windows.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/winapi/zsyscall_windows.go @@ -53,6 +53,8 @@ var ( procCM_Get_Device_ID_ListA = modcfgmgr32.NewProc("CM_Get_Device_ID_ListA") procCM_Get_Device_ID_List_SizeA = modcfgmgr32.NewProc("CM_Get_Device_ID_List_SizeA") procCM_Locate_DevNodeW = modcfgmgr32.NewProc("CM_Locate_DevNodeW") + procCimAddFsToMergedImage = modcimfs.NewProc("CimAddFsToMergedImage") + procCimAddFsToMergedImage2 = modcimfs.NewProc("CimAddFsToMergedImage2") procCimCloseImage = modcimfs.NewProc("CimCloseImage") procCimCloseStream = modcimfs.NewProc("CimCloseStream") procCimCommitImage = modcimfs.NewProc("CimCommitImage") @@ -60,9 +62,13 @@ var ( procCimCreateFile = modcimfs.NewProc("CimCreateFile") procCimCreateHardLink = modcimfs.NewProc("CimCreateHardLink") procCimCreateImage = modcimfs.NewProc("CimCreateImage") + procCimCreateImage2 = modcimfs.NewProc("CimCreateImage2") + procCimCreateMergeLink = modcimfs.NewProc("CimCreateMergeLink") procCimDeletePath = modcimfs.NewProc("CimDeletePath") procCimDismountImage = modcimfs.NewProc("CimDismountImage") + procCimMergeMountImage = modcimfs.NewProc("CimMergeMountImage") procCimMountImage = modcimfs.NewProc("CimMountImage") + procCimTombstoneFile = modcimfs.NewProc("CimTombstoneFile") procCimWriteStream = modcimfs.NewProc("CimWriteStream") procSetJobCompartmentId = modiphlpapi.NewProc("SetJobCompartmentId") procClosePseudoConsole = modkernel32.NewProc("ClosePseudoConsole") @@ -181,6 +187,54 @@ func _CMLocateDevNode(pdnDevInst *uint32, pDeviceID *uint16, uFlags uint32) (hr return } +func CimAddFsToMergedImage(cimFSHandle FsHandle, path string) (hr error) { + var _p0 *uint16 + _p0, hr = syscall.UTF16PtrFromString(path) + if hr != nil { + return + } + return _CimAddFsToMergedImage(cimFSHandle, _p0) +} + +func _CimAddFsToMergedImage(cimFSHandle FsHandle, path *uint16) (hr error) { + hr = procCimAddFsToMergedImage.Find() + if hr != nil { + return + } + r0, _, _ := syscall.SyscallN(procCimAddFsToMergedImage.Addr(), uintptr(cimFSHandle), uintptr(unsafe.Pointer(path))) + if int32(r0) < 0 { + if r0&0x1fff0000 == 0x00070000 { + r0 &= 0xffff + } + hr = syscall.Errno(r0) + } + return +} + +func CimAddFsToMergedImage2(cimFSHandle FsHandle, path string, flags uint32) (hr error) { + var _p0 *uint16 + _p0, hr = syscall.UTF16PtrFromString(path) + if hr != nil { + return + } + return _CimAddFsToMergedImage2(cimFSHandle, _p0, flags) +} + +func _CimAddFsToMergedImage2(cimFSHandle FsHandle, path *uint16, flags uint32) (hr error) { + hr = procCimAddFsToMergedImage2.Find() + if hr != nil { + return + } + r0, _, _ := syscall.SyscallN(procCimAddFsToMergedImage2.Addr(), uintptr(cimFSHandle), uintptr(unsafe.Pointer(path)), uintptr(flags)) + if int32(r0) < 0 { + if r0&0x1fff0000 == 0x00070000 { + r0 &= 0xffff + } + hr = syscall.Errno(r0) + } + return +} + func CimCloseImage(cimFSHandle FsHandle) (err error) { err = procCimCloseImage.Find() if err != nil { @@ -321,6 +375,59 @@ func _CimCreateImage(imagePath *uint16, oldFSName *uint16, newFSName *uint16, ci return } +func CimCreateImage2(imagePath string, flags uint32, oldFSName *uint16, newFSName *uint16, cimFSHandle *FsHandle) (hr error) { + var _p0 *uint16 + _p0, hr = syscall.UTF16PtrFromString(imagePath) + if hr != nil { + return + } + return _CimCreateImage2(_p0, flags, oldFSName, newFSName, cimFSHandle) +} + +func _CimCreateImage2(imagePath *uint16, flags uint32, oldFSName *uint16, newFSName *uint16, cimFSHandle *FsHandle) (hr error) { + hr = procCimCreateImage2.Find() + if hr != nil { + return + } + r0, _, _ := syscall.SyscallN(procCimCreateImage2.Addr(), uintptr(unsafe.Pointer(imagePath)), uintptr(flags), uintptr(unsafe.Pointer(oldFSName)), uintptr(unsafe.Pointer(newFSName)), uintptr(unsafe.Pointer(cimFSHandle))) + if int32(r0) < 0 { + if r0&0x1fff0000 == 0x00070000 { + r0 &= 0xffff + } + hr = syscall.Errno(r0) + } + return +} + +func CimCreateMergeLink(cimFSHandle FsHandle, newPath string, oldPath string) (hr error) { + var _p0 *uint16 + _p0, hr = syscall.UTF16PtrFromString(newPath) + if hr != nil { + return + } + var _p1 *uint16 + _p1, hr = syscall.UTF16PtrFromString(oldPath) + if hr != nil { + return + } + return _CimCreateMergeLink(cimFSHandle, _p0, _p1) +} + +func _CimCreateMergeLink(cimFSHandle FsHandle, newPath *uint16, oldPath *uint16) (hr error) { + hr = procCimCreateMergeLink.Find() + if hr != nil { + return + } + r0, _, _ := syscall.SyscallN(procCimCreateMergeLink.Addr(), uintptr(cimFSHandle), uintptr(unsafe.Pointer(newPath)), uintptr(unsafe.Pointer(oldPath))) + if int32(r0) < 0 { + if r0&0x1fff0000 == 0x00070000 { + r0 &= 0xffff + } + hr = syscall.Errno(r0) + } + return +} + func CimDeletePath(cimFSHandle FsHandle, path string) (hr error) { var _p0 *uint16 _p0, hr = syscall.UTF16PtrFromString(path) @@ -360,6 +467,21 @@ func CimDismountImage(volumeID *g) (hr error) { return } +func CimMergeMountImage(numCimPaths uint32, backingImagePaths *CimFsImagePath, flags uint32, volumeID *g) (hr error) { + hr = procCimMergeMountImage.Find() + if hr != nil { + return + } + r0, _, _ := syscall.SyscallN(procCimMergeMountImage.Addr(), uintptr(numCimPaths), uintptr(unsafe.Pointer(backingImagePaths)), uintptr(flags), uintptr(unsafe.Pointer(volumeID))) + if int32(r0) < 0 { + if r0&0x1fff0000 == 0x00070000 { + r0 &= 0xffff + } + hr = syscall.Errno(r0) + } + return +} + func CimMountImage(imagePath string, fsName string, flags uint32, volumeID *g) (hr error) { var _p0 *uint16 _p0, hr = syscall.UTF16PtrFromString(imagePath) @@ -389,6 +511,30 @@ func _CimMountImage(imagePath *uint16, fsName *uint16, flags uint32, volumeID *g return } +func CimTombstoneFile(cimFSHandle FsHandle, path string) (hr error) { + var _p0 *uint16 + _p0, hr = syscall.UTF16PtrFromString(path) + if hr != nil { + return + } + return _CimTombstoneFile(cimFSHandle, _p0) +} + +func _CimTombstoneFile(cimFSHandle FsHandle, path *uint16) (hr error) { + hr = procCimTombstoneFile.Find() + if hr != nil { + return + } + r0, _, _ := syscall.SyscallN(procCimTombstoneFile.Addr(), uintptr(cimFSHandle), uintptr(unsafe.Pointer(path))) + if int32(r0) < 0 { + if r0&0x1fff0000 == 0x00070000 { + r0 &= 0xffff + } + hr = syscall.Errno(r0) + } + return +} + func CimWriteStream(cimStreamHandle StreamHandle, buffer uintptr, bufferSize uint32) (hr error) { hr = procCimWriteStream.Find() if hr != nil { diff --git a/vendor/github.com/Microsoft/hcsshim/osversion/platform_compat_windows.go b/vendor/github.com/Microsoft/hcsshim/osversion/platform_compat_windows.go index f8d411ad7e..a7860895c7 100644 --- a/vendor/github.com/Microsoft/hcsshim/osversion/platform_compat_windows.go +++ b/vendor/github.com/Microsoft/hcsshim/osversion/platform_compat_windows.go @@ -3,7 +3,8 @@ package osversion // List of stable ABI compliant ltsc releases // Note: List must be sorted in ascending order var compatLTSCReleases = []uint16{ - V21H2Server, + LTSC2022, + LTSC2025, } // CheckHostAndContainerCompat checks if given host and container @@ -20,16 +21,25 @@ func CheckHostAndContainerCompat(host, ctr OSVersion) bool { } // If host is < WS 2022, exact version match is required - if host.Build < V21H2Server { + if host.Build < LTSC2022 { return host.Build == ctr.Build } - var supportedLtscRelease uint16 + // Find the latest LTSC version that is earlier than the host version. + // This is the earliest version of container that the host can run. + // + // If the host version is an LTSC, then it supports compatibility with + // everything from the previous LTSC up to itself, so we want supportedLTSCRelease + // to be the previous entry. + // + // If no match is found, then we know that the host is LTSC2022 exactly, + // since we already checked that it's not less than LTSC2022. + var supportedLTSCRelease uint16 = LTSC2022 for i := len(compatLTSCReleases) - 1; i >= 0; i-- { - if host.Build >= compatLTSCReleases[i] { - supportedLtscRelease = compatLTSCReleases[i] + if host.Build > compatLTSCReleases[i] { + supportedLTSCRelease = compatLTSCReleases[i] break } } - return ctr.Build >= supportedLtscRelease && ctr.Build <= host.Build + return supportedLTSCRelease <= ctr.Build && ctr.Build <= host.Build } diff --git a/vendor/github.com/Microsoft/hcsshim/osversion/windowsbuilds.go b/vendor/github.com/Microsoft/hcsshim/osversion/windowsbuilds.go index 446369591a..5392a4cea1 100644 --- a/vendor/github.com/Microsoft/hcsshim/osversion/windowsbuilds.go +++ b/vendor/github.com/Microsoft/hcsshim/osversion/windowsbuilds.go @@ -81,4 +81,11 @@ const ( // V22H2Win11 corresponds to Windows 11 (2022 Update). V22H2Win11 = 22621 + + // V23H2 is the 23H2 release in the Windows Server annual channel. + V23H2 = 25398 + + // Windows Server 2025 build 26100 + V25H1Server = 26100 + LTSC2025 = V25H1Server ) diff --git a/vendor/github.com/Microsoft/hcsshim/pkg/cimfs/cim_writer_windows.go b/vendor/github.com/Microsoft/hcsshim/pkg/cimfs/cim_writer_windows.go deleted file mode 100644 index 8e88216bfc..0000000000 --- a/vendor/github.com/Microsoft/hcsshim/pkg/cimfs/cim_writer_windows.go +++ /dev/null @@ -1,291 +0,0 @@ -//go:build windows -// +build windows - -package cimfs - -import ( - "context" - "fmt" - "os" - "path/filepath" - "strings" - "unsafe" - - "github.com/Microsoft/go-winio" - "github.com/Microsoft/hcsshim/internal/log" - "github.com/Microsoft/hcsshim/internal/winapi" - "github.com/sirupsen/logrus" - "golang.org/x/sys/windows" -) - -// CimFsWriter represents a writer to a single CimFS filesystem instance. On disk, the -// image is composed of a filesystem file and several object ID and region files. -// Note: The CimFsWriter isn't thread safe! -type CimFsWriter struct { - // name of this cim. Usually a .cim file will be created to represent this cim. - name string - // handle is the CIMFS_IMAGE_HANDLE that must be passed when calling CIMFS APIs. - handle winapi.FsHandle - // name of the active file i.e the file to which we are currently writing. - activeName string - // stream to currently active file. - activeStream winapi.StreamHandle - // amount of bytes that can be written to the activeStream. - activeLeft uint64 -} - -// Create creates a new cim image. The CimFsWriter returned can then be used to do -// operations on this cim. -func Create(imagePath string, oldFSName string, newFSName string) (_ *CimFsWriter, err error) { - var oldNameBytes *uint16 - // CimCreateImage API call has different behavior if the value of oldNameBytes / newNameBytes - // is empty than if it is nil. So we have to convert those strings into *uint16 here. - fsName := oldFSName - if oldFSName != "" { - oldNameBytes, err = windows.UTF16PtrFromString(oldFSName) - if err != nil { - return nil, err - } - } - var newNameBytes *uint16 - if newFSName != "" { - fsName = newFSName - newNameBytes, err = windows.UTF16PtrFromString(newFSName) - if err != nil { - return nil, err - } - } - var handle winapi.FsHandle - if err := winapi.CimCreateImage(imagePath, oldNameBytes, newNameBytes, &handle); err != nil { - return nil, fmt.Errorf("failed to create cim image at path %s, oldName: %s, newName: %s: %w", imagePath, oldFSName, newFSName, err) - } - return &CimFsWriter{handle: handle, name: filepath.Join(imagePath, fsName)}, nil -} - -// CreateAlternateStream creates alternate stream of given size at the given path inside the cim. This will -// replace the current active stream. Always, finish writing current active stream and then create an -// alternate stream. -func (c *CimFsWriter) CreateAlternateStream(path string, size uint64) (err error) { - err = c.closeStream() - if err != nil { - return err - } - err = winapi.CimCreateAlternateStream(c.handle, path, size, &c.activeStream) - if err != nil { - return fmt.Errorf("failed to create alternate stream for path %s: %w", path, err) - } - c.activeName = path - return nil -} - -// closes the currently active stream. -func (c *CimFsWriter) closeStream() error { - if c.activeStream == 0 { - return nil - } - err := winapi.CimCloseStream(c.activeStream) - if err == nil && c.activeLeft > 0 { - // Validate here because CimCloseStream does not and this improves error - // reporting. Otherwise the error will occur in the context of - // cimWriteStream. - err = fmt.Errorf("incomplete write, %d bytes left in the stream %s", c.activeLeft, c.activeName) - } - if err != nil { - err = &PathError{Cim: c.name, Op: "closeStream", Path: c.activeName, Err: err} - } - c.activeLeft = 0 - c.activeStream = 0 - c.activeName = "" - return err -} - -// AddFile adds a new file to the image. The file is added at the specified path. After -// calling this function, the file is set as the active stream for the image, so data can -// be written by calling `Write`. -func (c *CimFsWriter) AddFile(path string, info *winio.FileBasicInfo, fileSize int64, securityDescriptor []byte, extendedAttributes []byte, reparseData []byte) error { - err := c.closeStream() - if err != nil { - return err - } - fileMetadata := &winapi.CimFsFileMetadata{ - Attributes: info.FileAttributes, - FileSize: fileSize, - CreationTime: info.CreationTime, - LastWriteTime: info.LastWriteTime, - ChangeTime: info.ChangeTime, - LastAccessTime: info.LastAccessTime, - } - if len(securityDescriptor) == 0 { - // Passing an empty security descriptor creates a CIM in a weird state. - // Pass the NULL DACL. - securityDescriptor = nullSd - } - fileMetadata.SecurityDescriptorBuffer = unsafe.Pointer(&securityDescriptor[0]) - fileMetadata.SecurityDescriptorSize = uint32(len(securityDescriptor)) - if len(reparseData) > 0 { - fileMetadata.ReparseDataBuffer = unsafe.Pointer(&reparseData[0]) - fileMetadata.ReparseDataSize = uint32(len(reparseData)) - } - if len(extendedAttributes) > 0 { - fileMetadata.ExtendedAttributes = unsafe.Pointer(&extendedAttributes[0]) - fileMetadata.EACount = uint32(len(extendedAttributes)) - } - // remove the trailing `\` if present, otherwise it trips off the cim writer - path = strings.TrimSuffix(path, "\\") - err = winapi.CimCreateFile(c.handle, path, fileMetadata, &c.activeStream) - if err != nil { - return &PathError{Cim: c.name, Op: "addFile", Path: path, Err: err} - } - c.activeName = path - if info.FileAttributes&(windows.FILE_ATTRIBUTE_DIRECTORY) == 0 { - c.activeLeft = uint64(fileSize) - } - return nil -} - -// Write writes bytes to the active stream. -func (c *CimFsWriter) Write(p []byte) (int, error) { - if c.activeStream == 0 { - return 0, fmt.Errorf("no active stream") - } - if uint64(len(p)) > c.activeLeft { - return 0, &PathError{Cim: c.name, Op: "write", Path: c.activeName, Err: fmt.Errorf("wrote too much")} - } - err := winapi.CimWriteStream(c.activeStream, uintptr(unsafe.Pointer(&p[0])), uint32(len(p))) - if err != nil { - err = &PathError{Cim: c.name, Op: "write", Path: c.activeName, Err: err} - return 0, err - } - c.activeLeft -= uint64(len(p)) - return len(p), nil -} - -// AddLink adds a hard link from `oldPath` to `newPath` in the image. -func (c *CimFsWriter) AddLink(oldPath string, newPath string) error { - err := c.closeStream() - if err != nil { - return err - } - err = winapi.CimCreateHardLink(c.handle, newPath, oldPath) - if err != nil { - err = &LinkError{Cim: c.name, Op: "addLink", Old: oldPath, New: newPath, Err: err} - } - return err -} - -// Unlink deletes the file at `path` from the image. -func (c *CimFsWriter) Unlink(path string) error { - err := c.closeStream() - if err != nil { - return err - } - //TODO(ambarve): CimDeletePath currently returns an error if the file isn't found but we ideally want - // to put a tombstone at that path so that when cims are merged it removes that file from the lower - // layer - err = winapi.CimDeletePath(c.handle, path) - if err != nil && !os.IsNotExist(err) { - err = &PathError{Cim: c.name, Op: "unlink", Path: path, Err: err} - return err - } - return nil -} - -func (c *CimFsWriter) commit() error { - err := c.closeStream() - if err != nil { - return err - } - err = winapi.CimCommitImage(c.handle) - if err != nil { - err = &OpError{Cim: c.name, Op: "commit", Err: err} - } - return err -} - -// Close closes the CimFS filesystem. -func (c *CimFsWriter) Close() error { - if c.handle == 0 { - return fmt.Errorf("invalid writer") - } - if err := c.commit(); err != nil { - return &OpError{Cim: c.name, Op: "commit", Err: err} - } - if err := winapi.CimCloseImage(c.handle); err != nil { - return &OpError{Cim: c.name, Op: "close", Err: err} - } - c.handle = 0 - return nil -} - -// DestroyCim finds out the region files, object files of this cim and then delete -// the region files, object files and the .cim file itself. -func DestroyCim(ctx context.Context, cimPath string) (retErr error) { - regionFilePaths, err := getRegionFilePaths(ctx, cimPath) - if err != nil { - log.G(ctx).WithError(err).Warnf("get region files for cim %s", cimPath) - if retErr == nil { //nolint:govet // nilness: consistency with below - retErr = err - } - } - objectFilePaths, err := getObjectIDFilePaths(ctx, cimPath) - if err != nil { - log.G(ctx).WithError(err).Warnf("get objectid file for cim %s", cimPath) - if retErr == nil { - retErr = err - } - } - - log.G(ctx).WithFields(logrus.Fields{ - "cimPath": cimPath, - "regionFiles": regionFilePaths, - "objectFiles": objectFilePaths, - }).Debug("destroy cim") - - for _, regFilePath := range regionFilePaths { - if err := os.Remove(regFilePath); err != nil { - log.G(ctx).WithError(err).Warnf("remove file %s", regFilePath) - if retErr == nil { - retErr = err - } - } - } - - for _, objFilePath := range objectFilePaths { - if err := os.Remove(objFilePath); err != nil { - log.G(ctx).WithError(err).Warnf("remove file %s", objFilePath) - if retErr == nil { - retErr = err - } - } - } - - if err := os.Remove(cimPath); err != nil { - log.G(ctx).WithError(err).Warnf("remove file %s", cimPath) - if retErr == nil { - retErr = err - } - } - return retErr -} - -// GetCimUsage returns the total disk usage in bytes by the cim at path `cimPath`. -func GetCimUsage(ctx context.Context, cimPath string) (uint64, error) { - regionFilePaths, err := getRegionFilePaths(ctx, cimPath) - if err != nil { - return 0, fmt.Errorf("get region file paths for cim %s: %w", cimPath, err) - } - objectFilePaths, err := getObjectIDFilePaths(ctx, cimPath) - if err != nil { - return 0, fmt.Errorf("get objectid file for cim %s: %w", cimPath, err) - } - - var totalUsage uint64 - for _, f := range append(regionFilePaths, objectFilePaths...) { - fi, err := os.Stat(f) - if err != nil { - return 0, fmt.Errorf("stat file %s: %w", f, err) - } - totalUsage += uint64(fi.Size()) - } - return totalUsage, nil -} diff --git a/vendor/github.com/Microsoft/hcsshim/pkg/cimfs/cimfs.go b/vendor/github.com/Microsoft/hcsshim/pkg/cimfs/cimfs.go deleted file mode 100644 index 21cdf109bc..0000000000 --- a/vendor/github.com/Microsoft/hcsshim/pkg/cimfs/cimfs.go +++ /dev/null @@ -1,17 +0,0 @@ -//go:build windows -// +build windows - -package cimfs - -import ( - "github.com/Microsoft/hcsshim/osversion" - "github.com/sirupsen/logrus" -) - -func IsCimFSSupported() bool { - rv, err := osversion.BuildRevision() - if err != nil { - logrus.WithError(err).Warn("get build revision") - } - return osversion.Build() == 20348 && rv >= 2031 -} diff --git a/vendor/github.com/Microsoft/hcsshim/pkg/cimfs/common.go b/vendor/github.com/Microsoft/hcsshim/pkg/cimfs/common.go deleted file mode 100644 index 0a05f5a9d2..0000000000 --- a/vendor/github.com/Microsoft/hcsshim/pkg/cimfs/common.go +++ /dev/null @@ -1,134 +0,0 @@ -//go:build windows -// +build windows - -package cimfs - -import ( - "bytes" - "context" - "encoding/binary" - "fmt" - "os" - "path/filepath" - - "github.com/Microsoft/hcsshim/internal/log" - "github.com/Microsoft/hcsshim/pkg/cimfs/format" -) - -var ( - // Equivalent to SDDL of "D:NO_ACCESS_CONTROL". - nullSd = []byte{1, 0, 4, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} -) - -type OpError struct { - Cim string - Op string - Err error -} - -func (e *OpError) Error() string { - s := "cim " + e.Op + " " + e.Cim - s += ": " + e.Err.Error() - return s -} - -// PathError is the error type returned by most functions in this package. -type PathError struct { - Cim string - Op string - Path string - Err error -} - -func (e *PathError) Error() string { - s := "cim " + e.Op + " " + e.Cim - s += ":" + e.Path - s += ": " + e.Err.Error() - return s -} - -type LinkError struct { - Cim string - Op string - Old string - New string - Err error -} - -func (e *LinkError) Error() string { - return "cim " + e.Op + " " + e.Old + " " + e.New + ": " + e.Err.Error() -} - -func validateHeader(h *format.CommonHeader) error { - if !bytes.Equal(h.Magic[:], format.MagicValue[:]) { - return fmt.Errorf("not a cim file") - } - if h.Version.Major > format.CurrentVersion.Major || h.Version.Major < format.MinSupportedVersion.Major { - return fmt.Errorf("unsupported cim version. cim version %v must be between %v & %v", h.Version, format.MinSupportedVersion, format.CurrentVersion) - } - return nil -} - -func readFilesystemHeader(f *os.File) (format.FilesystemHeader, error) { - var fsh format.FilesystemHeader - - if err := binary.Read(f, binary.LittleEndian, &fsh); err != nil { - return fsh, fmt.Errorf("reading filesystem header: %w", err) - } - - if err := validateHeader(&fsh.Common); err != nil { - return fsh, fmt.Errorf("validating filesystem header: %w", err) - } - return fsh, nil -} - -// Returns the paths of all the objectID files associated with the cim at `cimPath`. -func getObjectIDFilePaths(ctx context.Context, cimPath string) ([]string, error) { - f, err := os.Open(cimPath) - if err != nil { - return []string{}, fmt.Errorf("open cim file %s: %w", cimPath, err) - } - defer f.Close() - - fsh, err := readFilesystemHeader(f) - if err != nil { - return []string{}, fmt.Errorf("readingp cim header: %w", err) - } - - paths := []string{} - for i := 0; i < int(fsh.Regions.Count); i++ { - path := filepath.Join(filepath.Dir(cimPath), fmt.Sprintf("%s_%v_%d", format.ObjectIDFileName, fsh.Regions.ID, i)) - if _, err := os.Stat(path); err == nil { - paths = append(paths, path) - } else { - log.G(ctx).WithError(err).Warnf("stat for object file %s", path) - } - - } - return paths, nil -} - -// Returns the paths of all the region files associated with the cim at `cimPath`. -func getRegionFilePaths(ctx context.Context, cimPath string) ([]string, error) { - f, err := os.Open(cimPath) - if err != nil { - return []string{}, fmt.Errorf("open cim file %s: %w", cimPath, err) - } - defer f.Close() - - fsh, err := readFilesystemHeader(f) - if err != nil { - return []string{}, fmt.Errorf("reading cim header: %w", err) - } - - paths := []string{} - for i := 0; i < int(fsh.Regions.Count); i++ { - path := filepath.Join(filepath.Dir(cimPath), fmt.Sprintf("%s_%v_%d", format.RegionFileName, fsh.Regions.ID, i)) - if _, err := os.Stat(path); err == nil { - paths = append(paths, path) - } else { - log.G(ctx).WithError(err).Warnf("stat for region file %s", path) - } - } - return paths, nil -} diff --git a/vendor/github.com/Microsoft/hcsshim/pkg/cimfs/doc.go b/vendor/github.com/Microsoft/hcsshim/pkg/cimfs/doc.go deleted file mode 100644 index 9b5476cb6c..0000000000 --- a/vendor/github.com/Microsoft/hcsshim/pkg/cimfs/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// This package provides simple go wrappers on top of the win32 CIMFS mount APIs. -// The mounting/unmount of cim layers is done by the cim mount functions the internal/wclayer/cim package. -package cimfs diff --git a/vendor/github.com/Microsoft/hcsshim/pkg/cimfs/format/doc.go b/vendor/github.com/Microsoft/hcsshim/pkg/cimfs/format/doc.go deleted file mode 100644 index a85e64710e..0000000000 --- a/vendor/github.com/Microsoft/hcsshim/pkg/cimfs/format/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// format package maintains some basic structures to allows us to read header of a cim file. This is mostly -// required to understand the region & objectid files associated with a particular cim. Otherwise, we don't -// need to parse the cim format. -package format diff --git a/vendor/github.com/Microsoft/hcsshim/pkg/cimfs/format/format.go b/vendor/github.com/Microsoft/hcsshim/pkg/cimfs/format/format.go deleted file mode 100644 index 72dea683eb..0000000000 --- a/vendor/github.com/Microsoft/hcsshim/pkg/cimfs/format/format.go +++ /dev/null @@ -1,61 +0,0 @@ -//go:build windows -// +build windows - -package format - -import "github.com/Microsoft/go-winio/pkg/guid" - -const ( - RegionFileName = "region" - ObjectIDFileName = "objectid" -) - -// Magic specifies the magic number at the beginning of a file. -type Magic [8]uint8 - -var MagicValue = Magic([8]uint8{'c', 'i', 'm', 'f', 'i', 'l', 'e', '0'}) - -type Version struct { - Major, Minor uint32 -} - -var CurrentVersion = Version{3, 0} - -var MinSupportedVersion = Version{2, 0} - -type FileType uint8 - -// RegionOffset encodes an offset to objects as index of the region file -// containing the object and the byte offset within that file. -type RegionOffset uint64 - -// CommonHeader is the common header for all CIM-related files. -type CommonHeader struct { - Magic Magic - HeaderLength uint32 - Type FileType - Reserved uint8 - Reserved2 uint16 - Version Version - Reserved3 uint64 -} - -type RegionSet struct { - ID guid.GUID - Count uint16 - Reserved uint16 - Reserved1 uint32 -} - -// FilesystemHeader is the header for a filesystem file. -// -// The filesystem file points to the filesystem object inside a region -// file and specifies regions sets. -type FilesystemHeader struct { - Common CommonHeader - Regions RegionSet - FilesystemOffset RegionOffset - Reserved uint32 - Reserved1 uint16 - ParentCount uint16 -} diff --git a/vendor/github.com/Microsoft/hcsshim/pkg/cimfs/mount_cim.go b/vendor/github.com/Microsoft/hcsshim/pkg/cimfs/mount_cim.go deleted file mode 100644 index ea7341b2f0..0000000000 --- a/vendor/github.com/Microsoft/hcsshim/pkg/cimfs/mount_cim.go +++ /dev/null @@ -1,65 +0,0 @@ -//go:build windows -// +build windows - -package cimfs - -import ( - "fmt" - "path/filepath" - "strings" - - "github.com/Microsoft/go-winio/pkg/guid" - "github.com/Microsoft/hcsshim/internal/winapi" - "github.com/pkg/errors" -) - -type MountError struct { - Cim string - Op string - VolumeGUID guid.GUID - Err error -} - -func (e *MountError) Error() string { - s := "cim " + e.Op - if e.Cim != "" { - s += " " + e.Cim - } - s += " " + e.VolumeGUID.String() + ": " + e.Err.Error() - return s -} - -// Mount mounts the given cim at a volume with given GUID. Returns the full volume -// path if mount is successful. -func Mount(cimPath string, volumeGUID guid.GUID, mountFlags uint32) (string, error) { - if err := winapi.CimMountImage(filepath.Dir(cimPath), filepath.Base(cimPath), mountFlags, &volumeGUID); err != nil { - return "", &MountError{Cim: cimPath, Op: "Mount", VolumeGUID: volumeGUID, Err: err} - } - return fmt.Sprintf("\\\\?\\Volume{%s}\\", volumeGUID.String()), nil -} - -// Unmount unmounts the cim at mounted at path `volumePath`. -func Unmount(volumePath string) error { - // The path is expected to be in the \\?\Volume{GUID}\ format - if volumePath[len(volumePath)-1] != '\\' { - volumePath += "\\" - } - - if !(strings.HasPrefix(volumePath, "\\\\?\\Volume{") && strings.HasSuffix(volumePath, "}\\")) { - return errors.Errorf("volume path %s is not in the expected format", volumePath) - } - - trimmedStr := strings.TrimPrefix(volumePath, "\\\\?\\Volume{") - trimmedStr = strings.TrimSuffix(trimmedStr, "}\\") - - volGUID, err := guid.FromString(trimmedStr) - if err != nil { - return errors.Wrapf(err, "guid parsing failed for %s", trimmedStr) - } - - if err := winapi.CimDismountImage(&volGUID); err != nil { - return &MountError{VolumeGUID: volGUID, Op: "Unmount", Err: err} - } - - return nil -} diff --git a/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/cim/import.go b/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/cim/import.go deleted file mode 100644 index a2e8759529..0000000000 --- a/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/cim/import.go +++ /dev/null @@ -1,166 +0,0 @@ -//go:build windows -// +build windows - -package cim - -import ( - "archive/tar" - "bufio" - "context" - "errors" - "fmt" - "io" - "os" - "path" - "path/filepath" - "strings" - - "github.com/Microsoft/go-winio/backuptar" - "github.com/Microsoft/hcsshim/internal/log" - "github.com/Microsoft/hcsshim/internal/wclayer/cim" - "github.com/Microsoft/hcsshim/pkg/ociwclayer" - "golang.org/x/sys/windows" -) - -// ImportCimLayerFromTar reads a layer from an OCI layer tar stream and extracts it into -// the CIM format at the specified path. The caller must specify the parent layers, if -// any, ordered from lowest to highest layer. -// This function expects that the layer paths (both the layer that is being imported & the parent layers) are -// formatted like `.../snapshots/` and the corresponding layer CIMs are located/will be created at -// `.../snapshots/cim-layers/.cim`. Each CIM file also has corresponding region & objectID files and those -// files will also be stored inside the `cim-layers` directory. -// -// This function returns the total size of the layer's files, in bytes. -func ImportCimLayerFromTar(ctx context.Context, r io.Reader, layerPath string, parentLayerPaths []string) (int64, error) { - err := os.MkdirAll(layerPath, 0) - if err != nil { - return 0, err - } - - w, err := cim.NewCimLayerWriter(ctx, layerPath, parentLayerPaths) - if err != nil { - return 0, err - } - - n, err := writeCimLayerFromTar(ctx, r, w, layerPath) - cerr := w.Close(ctx) - if err != nil { - return 0, err - } - if cerr != nil { - return 0, cerr - } - return n, nil -} - -func writeCimLayerFromTar(ctx context.Context, r io.Reader, w *cim.CimLayerWriter, layerPath string) (int64, error) { - tr := tar.NewReader(r) - buf := bufio.NewWriter(w) - size := int64(0) - - // Iterate through the files in the archive. - hdr, loopErr := tr.Next() - for loopErr == nil { - select { - case <-ctx.Done(): - return 0, ctx.Err() - default: - } - - // Note: path is used instead of filepath to prevent OS specific handling - // of the tar path - base := path.Base(hdr.Name) - if strings.HasPrefix(base, ociwclayer.WhiteoutPrefix) { - name := path.Join(path.Dir(hdr.Name), base[len(ociwclayer.WhiteoutPrefix):]) - if rErr := w.Remove(filepath.FromSlash(name)); rErr != nil { - return 0, rErr - } - hdr, loopErr = tr.Next() - } else if hdr.Typeflag == tar.TypeLink { - if linkErr := w.AddLink(filepath.FromSlash(hdr.Name), filepath.FromSlash(hdr.Linkname)); linkErr != nil { - return 0, linkErr - } - hdr, loopErr = tr.Next() - } else { - name, fileSize, fileInfo, err := backuptar.FileInfoFromHeader(hdr) - if err != nil { - return 0, err - } - sddl, err := backuptar.SecurityDescriptorFromTarHeader(hdr) - if err != nil { - return 0, err - } - eadata, err := backuptar.ExtendedAttributesFromTarHeader(hdr) - if err != nil { - return 0, err - } - - var reparse []byte - // As of now the only valid reparse data in a layer will be for a symlink. If file is - // a symlink set reparse attribute and ensure reparse data buffer isn't - // empty. Otherwise remove the reparse attributed. - fileInfo.FileAttributes &^= uint32(windows.FILE_ATTRIBUTE_REPARSE_POINT) - if hdr.Typeflag == tar.TypeSymlink { - reparse = backuptar.EncodeReparsePointFromTarHeader(hdr) - if len(reparse) > 0 { - fileInfo.FileAttributes |= uint32(windows.FILE_ATTRIBUTE_REPARSE_POINT) - } - } - - if addErr := w.Add(filepath.FromSlash(name), fileInfo, fileSize, sddl, eadata, reparse); addErr != nil { - return 0, addErr - } - if hdr.Typeflag == tar.TypeReg { - if _, cpErr := io.Copy(buf, tr); cpErr != nil { - return 0, cpErr - } - } - size += fileSize - - // Copy all the alternate data streams and return the next non-ADS header. - var ahdr *tar.Header - for { - ahdr, loopErr = tr.Next() - if loopErr != nil { - break - } - - if ahdr.Typeflag != tar.TypeReg || !strings.HasPrefix(ahdr.Name, hdr.Name+":") { - hdr = ahdr - break - } - - // stream names have following format: '::$DATA' - // $DATA is one of the valid types of streams. We currently only support - // data streams so fail if this is some other type of stream. - if !strings.HasSuffix(ahdr.Name, ":$DATA") { - return 0, fmt.Errorf("stream types other than $DATA are not supported, found: %s", ahdr.Name) - } - - if addErr := w.AddAlternateStream(filepath.FromSlash(ahdr.Name), uint64(ahdr.Size)); addErr != nil { - return 0, addErr - } - - if _, cpErr := io.Copy(buf, tr); cpErr != nil { - return 0, cpErr - } - } - } - - if flushErr := buf.Flush(); flushErr != nil { - if loopErr == nil { - loopErr = flushErr - } else { - log.G(ctx).WithError(flushErr).Warn("flush buffer during layer write failed") - } - } - } - if !errors.Is(loopErr, io.EOF) { - return 0, loopErr - } - return size, nil -} - -func DestroyCimLayer(layerPath string) error { - return cim.DestroyCimLayer(context.Background(), layerPath) -} diff --git a/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/import.go b/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/import.go index 4ebfbbc2f7..17247f0c56 100644 --- a/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/import.go +++ b/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/import.go @@ -61,8 +61,7 @@ func ImportLayerFromTar(ctx context.Context, r io.Reader, path string, parentLay func writeLayerFromTar(ctx context.Context, r io.Reader, w wclayer.LayerWriter, root string) (int64, error) { t := tar.NewReader(r) - // CodeQL [SM03409] False positive, `internal/safefile` package ensures tar extractions are always - // bound to the layer root directory. + // CodeQL [SM03409] `internal\wclayer` uses `internal/safefile` to bind tar extraction to the layer's root directory hdr, err := t.Next() totalSize := int64(0) buf := bufio.NewWriter(nil) @@ -80,16 +79,14 @@ func writeLayerFromTar(ctx context.Context, r io.Reader, w wclayer.LayerWriter, if err != nil { return 0, err } - // CodeQL [SM03409] False positive, `internal/safefile` package ensures tar extractions are always - // bound to the layer root directory. + // CodeQL [SM03409] `internal\wclayer` uses `internal/safefile` to bind tar extraction to the layer's root directory hdr, err = t.Next() } else if hdr.Typeflag == tar.TypeLink { err = w.AddLink(filepath.FromSlash(hdr.Name), filepath.FromSlash(hdr.Linkname)) if err != nil { return 0, err } - // CodeQL [SM03409] False positive, `internal/safefile` package ensures tar extractions are always - // bound to the layer root directory. + // CodeQL [SM03409] `internal\wclayer` uses `internal/safefile` to bind tar extraction to the layer's root directory hdr, err = t.Next() } else { var ( diff --git a/vendor/github.com/containerd/containerd/v2/client/client.go b/vendor/github.com/containerd/containerd/v2/client/client.go index 8a19d3307c..7996c4a5bc 100644 --- a/vendor/github.com/containerd/containerd/v2/client/client.go +++ b/vendor/github.com/containerd/containerd/v2/client/client.go @@ -37,6 +37,7 @@ import ( sandboxsapi "github.com/containerd/containerd/api/services/sandbox/v1" snapshotsapi "github.com/containerd/containerd/api/services/snapshots/v1" "github.com/containerd/containerd/api/services/tasks/v1" + transferapi "github.com/containerd/containerd/api/services/transfer/v1" versionservice "github.com/containerd/containerd/api/services/version/v1" apitypes "github.com/containerd/containerd/api/types" "github.com/containerd/containerd/v2/core/containers" @@ -55,6 +56,8 @@ import ( sandboxproxy "github.com/containerd/containerd/v2/core/sandbox/proxy" "github.com/containerd/containerd/v2/core/snapshots" snproxy "github.com/containerd/containerd/v2/core/snapshots/proxy" + "github.com/containerd/containerd/v2/core/transfer" + transferproxy "github.com/containerd/containerd/v2/core/transfer/proxy" "github.com/containerd/containerd/v2/defaults" "github.com/containerd/containerd/v2/pkg/dialer" "github.com/containerd/containerd/v2/pkg/namespaces" @@ -140,6 +143,8 @@ func New(address string, opts ...Opt) (*Client, error) { if len(copts.dialOptions) > 0 { gopts = copts.dialOptions } + gopts = append(gopts, copts.extraDialOpts...) + gopts = append(gopts, grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(defaults.DefaultMaxRecvMsgSize), grpc.MaxCallSendMsgSize(defaults.DefaultMaxSendMsgSize))) @@ -380,22 +385,26 @@ type RemoteContext struct { // after it has completed transferring. HandlerWrapper func(images.Handler) images.Handler - // ConvertSchema1 is whether to convert Docker registry schema 1 - // manifests. If this option is false then any image which resolves - // to schema 1 will return an error since schema 1 is not supported. - // - // Deprecated: use Schema 2 or OCI images. - ConvertSchema1 bool - // Platforms defines which platforms to handle when doing the image operation. // Platforms is ignored when a PlatformMatcher is set, otherwise the // platforms will be used to create a PlatformMatcher with no ordering // preference. Platforms []string - // MaxConcurrentDownloads is the max concurrent content downloads for each pull. + DownloadLimiter *semaphore.Weighted + + // MaxConcurrentDownloads restricts the total number of concurrent downloads + // across all layers during an image pull operation. This helps control the + // overall network bandwidth usage. MaxConcurrentDownloads int + // ConcurrentLayerFetchBuffer sets the maximum size in bytes for each chunk + // when downloading layers in parallel. Larger chunks reduce coordination + // overhead but use more memory. When ConcurrentLayerFetchBuffer is above + // 512 bytes, parallel layer fetch is enabled. It can accelerate pulls for + // big images. + ConcurrentLayerFetchBuffer int + // MaxConcurrentUploadedLayers is the max concurrent uploaded layers for each push. MaxConcurrentUploadedLayers int @@ -757,6 +766,16 @@ func (c *Client) SandboxController(name string) sandbox.Controller { return sandboxproxy.NewSandboxController(sandboxsapi.NewControllerClient(c.conn), name) } +// TranferService returns the underlying transferrer +func (c *Client) TransferService() transfer.Transferrer { + if c.transferService != nil { + return c.transferService + } + c.connMu.Lock() + defer c.connMu.Unlock() + return transferproxy.NewTransferrer(transferapi.NewTransferClient(c.conn), c.streamCreator()) +} + // VersionService returns the underlying VersionClient func (c *Client) VersionService() versionservice.VersionClient { c.connMu.Lock() diff --git a/vendor/github.com/containerd/containerd/v2/client/client_opts.go b/vendor/github.com/containerd/containerd/v2/client/client_opts.go index 54b37d4ca3..48f3ff2a26 100644 --- a/vendor/github.com/containerd/containerd/v2/client/client_opts.go +++ b/vendor/github.com/containerd/containerd/v2/client/client_opts.go @@ -24,6 +24,7 @@ import ( "github.com/containerd/containerd/v2/core/snapshots" "github.com/containerd/platforms" ocispec "github.com/opencontainers/image-spec/specs-go/v1" + "golang.org/x/sync/semaphore" "google.golang.org/grpc" ) @@ -34,6 +35,7 @@ type clientOpts struct { defaultPlatform platforms.MatchComparer services *services dialOptions []grpc.DialOption + extraDialOpts []grpc.DialOption callOptions []grpc.CallOption timeout time.Duration } @@ -76,6 +78,19 @@ func WithDialOpts(opts []grpc.DialOption) Opt { } } +// WithExtraDialOpts allows additional grpc.DialOptions to be set on the +// connection. Unlike [WithDialOpts], options set here are appended to, +// instead of overriding previous options, which allows setting options +// to extend containerd client's defaults. +// +// This option can be used multiple times to set additional dial options. +func WithExtraDialOpts(opts []grpc.DialOption) Opt { + return func(c *clientOpts) error { + c.extraDialOpts = append(c.extraDialOpts, opts...) + return nil + } +} + // WithCallOpts allows grpc.CallOptions to be set on the connection func WithCallOpts(opts []grpc.CallOption) Opt { return func(c *clientOpts) error { @@ -197,16 +212,6 @@ func WithChildLabelMap(fn func(ocispec.Descriptor) []string) RemoteOpt { } } -// WithSchema1Conversion is used to convert Docker registry schema 1 -// manifests to oci manifests on pull. Without this option schema 1 -// manifests will return a not supported error. -// -// Deprecated: use Schema 2 or OCI images. -func WithSchema1Conversion(client *Client, c *RemoteContext) error { - c.ConvertSchema1 = true - return nil -} - // WithResolver specifies the resolver to use. func WithResolver(resolver remotes.Resolver) RemoteOpt { return func(client *Client, c *RemoteContext) error { @@ -231,6 +236,14 @@ func WithImageHandlerWrapper(w func(images.Handler) images.Handler) RemoteOpt { } } +// WithDownloadLimiter sets the limiter for concurrent download operations. +func WithDownloadLimiter(limiter *semaphore.Weighted) RemoteOpt { + return func(client *Client, c *RemoteContext) error { + c.DownloadLimiter = limiter + return nil + } +} + // WithMaxConcurrentDownloads sets max concurrent download limit. func WithMaxConcurrentDownloads(max int) RemoteOpt { return func(client *Client, c *RemoteContext) error { @@ -239,6 +252,14 @@ func WithMaxConcurrentDownloads(max int) RemoteOpt { } } +// WithConcurrentLayerFetchBuffer sets the buffer size for concurrent layer fetches. +func WithConcurrentLayerFetchBuffer(buffer int) RemoteOpt { + return func(client *Client, c *RemoteContext) error { + c.ConcurrentLayerFetchBuffer = buffer + return nil + } +} + // WithMaxConcurrentUploadedLayers sets max concurrent uploaded layer limit. func WithMaxConcurrentUploadedLayers(max int) RemoteOpt { return func(client *Client, c *RemoteContext) error { diff --git a/vendor/github.com/containerd/containerd/v2/client/container.go b/vendor/github.com/containerd/containerd/v2/client/container.go index 5763ae6d7a..7845de10b3 100644 --- a/vendor/github.com/containerd/containerd/v2/client/container.go +++ b/vendor/github.com/containerd/containerd/v2/client/container.go @@ -85,6 +85,9 @@ type Container interface { Update(context.Context, ...UpdateContainerOpts) error // Checkpoint creates a checkpoint image of the current container Checkpoint(context.Context, string, ...CheckpointOpts) (Image, error) + // Restore restores a container and returns the PID of the + // restored containers init process. + Restore(context.Context, cio.Creator, string) (int, error) } func containerFromRecord(client *Client, c containers.Container) *container { @@ -221,7 +224,7 @@ func (c *container) Image(ctx context.Context) (Image, error) { return NewImage(c.client, i), nil } -func (c *container) NewTask(ctx context.Context, ioCreate cio.Creator, opts ...NewTaskOpts) (_ Task, err error) { +func (c *container) NewTask(ctx context.Context, ioCreate cio.Creator, opts ...NewTaskOpts) (_ Task, retErr error) { ctx, span := tracing.StartSpan(ctx, "container.NewTask") defer span.End() i, err := ioCreate(c.id) @@ -229,7 +232,7 @@ func (c *container) NewTask(ctx context.Context, ioCreate cio.Creator, opts ...N return nil, err } defer func() { - if err != nil && i != nil { + if retErr != nil && i != nil { i.Cancel() i.Close() } @@ -242,42 +245,14 @@ func (c *container) NewTask(ctx context.Context, ioCreate cio.Creator, opts ...N Stdout: cfg.Stdout, Stderr: cfg.Stderr, } + if err := c.handleMounts(ctx, request); err != nil { + return nil, err + } + r, err := c.get(ctx) if err != nil { return nil, err } - if r.SnapshotKey != "" { - if r.Snapshotter == "" { - 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 - s, err := c.client.getSnapshotter(ctx, r.Snapshotter) - if err != nil { - return nil, err - } - mounts, err := s.Mounts(ctx, r.SnapshotKey) - if err != nil { - return nil, err - } - spec, err := c.Spec(ctx) - if err != nil { - return nil, err - } - for _, m := range mounts { - if spec.Linux != nil && spec.Linux.MountLabel != "" { - if ml := label.FormatMountLabel("", spec.Linux.MountLabel); ml != "" { - m.Options = append(m.Options, ml) - } - } - request.Rootfs = append(request.Rootfs, &types.Mount{ - Type: m.Type, - Source: m.Source, - Target: m.Target, - Options: m.Options, - }) - } - } info := TaskInfo{ runtime: r.Runtime.Name, runtimeOptions: r.Runtime.Options, @@ -349,6 +324,94 @@ func (c *container) Update(ctx context.Context, opts ...UpdateContainerOpts) err return nil } +func (c *container) handleMounts(ctx context.Context, request *tasks.CreateTaskRequest) error { + r, err := c.get(ctx) + if err != nil { + return err + } + + if r.SnapshotKey != "" { + if r.Snapshotter == "" { + return 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 + s, err := c.client.getSnapshotter(ctx, r.Snapshotter) + if err != nil { + return err + } + mounts, err := s.Mounts(ctx, r.SnapshotKey) + if err != nil { + return err + } + spec, err := c.Spec(ctx) + if err != nil { + return err + } + for _, m := range mounts { + if spec.Linux != nil && spec.Linux.MountLabel != "" { + if ml := label.FormatMountLabel("", spec.Linux.MountLabel); ml != "" { + m.Options = append(m.Options, ml) + } + } + request.Rootfs = append(request.Rootfs, &types.Mount{ + Type: m.Type, + Source: m.Source, + Target: m.Target, + Options: m.Options, + }) + } + } + + return nil +} + +func (c *container) Restore(ctx context.Context, ioCreate cio.Creator, rootDir string) (_ int, retErr error) { + errorPid := -1 + i, err := ioCreate(c.id) + if err != nil { + return errorPid, err + } + defer func() { + if retErr != nil && i != nil { + i.Cancel() + i.Close() + } + }() + cfg := i.Config() + + request := &tasks.CreateTaskRequest{ + ContainerID: c.id, + Terminal: cfg.Terminal, + Stdin: cfg.Stdin, + Stdout: cfg.Stdout, + Stderr: cfg.Stderr, + } + + if err := c.handleMounts(ctx, request); err != nil { + return errorPid, err + } + + request.Checkpoint = &types.Descriptor{ + Annotations: map[string]string{ + // The following annotation is used to restore a checkpoint + // via CRI. This is mainly used to restore a container + // in Kubernetes. + "RestoreFromPath": rootDir, + }, + } + // (adrianreber): it is not totally clear to me, but it seems the only + // way to restore a container in containerd is going through Create(). + // This functions sets up Create() in such a way to handle container + // restore coming through the CRI. + response, err := c.client.TaskService().Create(ctx, request) + if err != nil { + return errorPid, errgrpc.ToNative(err) + } + + return int(response.GetPid()), nil +} + func (c *container) Checkpoint(ctx context.Context, ref string, opts ...CheckpointOpts) (Image, error) { index := &ocispec.Index{ Versioned: ver.Versioned{ diff --git a/vendor/github.com/containerd/containerd/v2/client/containerstore.go b/vendor/github.com/containerd/containerd/v2/client/containerstore.go index a908737c98..ec354a50ba 100644 --- a/vendor/github.com/containerd/containerd/v2/client/containerstore.go +++ b/vendor/github.com/containerd/containerd/v2/client/containerstore.go @@ -181,7 +181,6 @@ func containerFromProto(containerpb *containersapi.Container) containers.Contain } extensions := make(map[string]typeurl.Any) for k, v := range containerpb.Extensions { - v := v extensions[k] = v } return containers.Container{ @@ -203,7 +202,6 @@ func containersFromProto(containerspb []*containersapi.Container) []containers.C var containers []containers.Container for _, container := range containerspb { - container := container containers = append(containers, containerFromProto(container)) } diff --git a/vendor/github.com/containerd/containerd/v2/client/image_store.go b/vendor/github.com/containerd/containerd/v2/client/image_store.go index c52e99ea1a..a5a7d1c9d9 100644 --- a/vendor/github.com/containerd/containerd/v2/client/image_store.go +++ b/vendor/github.com/containerd/containerd/v2/client/image_store.go @@ -142,7 +142,6 @@ func imagesFromProto(imagespb []*imagesapi.Image) []images.Image { var images []images.Image for _, image := range imagespb { - image := image images = append(images, imageFromProto(image)) } diff --git a/vendor/github.com/containerd/containerd/v2/client/oss_fuzz.go b/vendor/github.com/containerd/containerd/v2/client/oss_fuzz.go deleted file mode 100644 index 429592667d..0000000000 --- a/vendor/github.com/containerd/containerd/v2/client/oss_fuzz.go +++ /dev/null @@ -1,26 +0,0 @@ -//go:build gofuzz - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 client - -import ( - "github.com/AdamKorcz/go-118-fuzz-build/testing" -) - -// To keep this package in go.mod. -var _ = testing.F{} diff --git a/vendor/github.com/containerd/containerd/v2/client/pull.go b/vendor/github.com/containerd/containerd/v2/client/pull.go index 060c729dfe..c7d169f6a4 100644 --- a/vendor/github.com/containerd/containerd/v2/client/pull.go +++ b/vendor/github.com/containerd/containerd/v2/client/pull.go @@ -27,7 +27,7 @@ import ( "github.com/containerd/containerd/v2/core/images" "github.com/containerd/containerd/v2/core/remotes" "github.com/containerd/containerd/v2/core/remotes/docker" - "github.com/containerd/containerd/v2/core/remotes/docker/schema1" //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. + "github.com/containerd/containerd/v2/core/transfer" "github.com/containerd/containerd/v2/core/unpack" "github.com/containerd/containerd/v2/pkg/tracing" "github.com/containerd/errdefs" @@ -52,6 +52,14 @@ func (c *Client) Pull(ctx context.Context, ref string, opts ...RemoteOpt) (_ Ima } } + if resolver, ok := pullCtx.Resolver.(remotes.ResolverWithOptions); ok { + resolver.SetOptions( + transfer.WithConcurrentLayerFetchBuffer(pullCtx.ConcurrentLayerFetchBuffer), + transfer.WithMaxConcurrentDownloads(pullCtx.MaxConcurrentDownloads), + transfer.WithDownloadLimiter(pullCtx.DownloadLimiter), + ) + } + if pullCtx.PlatformMatcher == nil { if len(pullCtx.Platforms) > 1 { return nil, errors.New("cannot pull multiplatform image locally, try Fetch") @@ -71,6 +79,7 @@ func (c *Client) Pull(ctx context.Context, ref string, opts ...RemoteOpt) (_ Ima tracing.Attribute("image.ref", ref), tracing.Attribute("unpack", pullCtx.Unpack), tracing.Attribute("max.concurrent.downloads", pullCtx.MaxConcurrentDownloads), + tracing.Attribute("concurrent.layer.fetch.buffer", pullCtx.ConcurrentLayerFetchBuffer), tracing.Attribute("platforms.count", len(pullCtx.Platforms)), ) @@ -109,9 +118,6 @@ func (c *Client) Pull(ctx context.Context, ref string, opts ...RemoteOpt) (_ Ima ApplyOpts: uconfig.ApplyOpts, } uopts := []unpack.UnpackerOpt{unpack.WithUnpackPlatform(platform)} - if pullCtx.MaxConcurrentDownloads > 0 { - uopts = append(uopts, unpack.WithLimiter(semaphore.NewWeighted(int64(pullCtx.MaxConcurrentDownloads)))) - } if uconfig.DuplicationSuppressor != nil { uopts = append(uopts, unpack.WithDuplicationSuppressor(uconfig.DuplicationSuppressor)) } @@ -164,7 +170,7 @@ func (c *Client) Pull(ctx context.Context, ref string, opts ...RemoteOpt) (_ Ima if unpacker != nil && ur.Unpacks == 0 { // Unpack was tried previously but nothing was unpacked - // This is at least required for schema 1 image. + // This was at least required for schema 1 image. if err := i.Unpack(ctx, pullCtx.Snapshotter, pullCtx.UnpackOpts...); err != nil { return nil, fmt.Errorf("failed to unpack image on snapshotter %s: %w", pullCtx.Snapshotter, err) } @@ -190,83 +196,65 @@ func (c *Client) fetch(ctx context.Context, rCtx *RemoteContext, ref string, lim var ( handler images.Handler - isConvertible bool - originalSchema1Digest string - converterFunc func(context.Context, ocispec.Descriptor) (ocispec.Descriptor, error) - limiter *semaphore.Weighted + isConvertible bool + converterFunc func(context.Context, ocispec.Descriptor) (ocispec.Descriptor, error) + limiter *semaphore.Weighted + ) + if desc.MediaType == images.MediaTypeDockerSchema1Manifest { + return images.Image{}, fmt.Errorf("%w: media type %q is no longer supported since containerd v2.1, please rebuild the image as %q or %q", + errdefs.ErrNotImplemented, + images.MediaTypeDockerSchema1Manifest, images.MediaTypeDockerSchema2Manifest, ocispec.MediaTypeImageManifest) + } + // Get all the children for a descriptor + childrenHandler := images.ChildrenHandler(store) + // Set any children labels for that content + childrenHandler = images.SetChildrenMappedLabels(store, childrenHandler, rCtx.ChildLabelMap) + if rCtx.AllMetadata { + // Filter manifests by platforms but allow to handle manifest + // and configuration for not-target platforms + childrenHandler = remotes.FilterManifestByPlatformHandler(childrenHandler, rCtx.PlatformMatcher) + } else { + // Filter children by platforms if specified. + childrenHandler = images.FilterPlatforms(childrenHandler, rCtx.PlatformMatcher) + } + // Sort and limit manifests if a finite number is needed + if limit > 0 { + childrenHandler = images.LimitManifests(childrenHandler, rCtx.PlatformMatcher, limit) + } + + // set isConvertible to true if there is application/octet-stream media type + convertibleHandler := images.HandlerFunc( + func(_ context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { + if desc.MediaType == docker.LegacyConfigMediaType { + isConvertible = true + } + + return []ocispec.Descriptor{}, nil + }, ) - if desc.MediaType == images.MediaTypeDockerSchema1Manifest && rCtx.ConvertSchema1 { - schema1Converter, err := schema1.NewConverter(store, fetcher) - if err != nil { - return images.Image{}, fmt.Errorf("failed to get converter for %q: %w", ref, err) - } + appendDistSrcLabelHandler, err := docker.AppendDistributionSourceLabel(store, ref) + if err != nil { + return images.Image{}, err + } - handler = images.Handlers(append(rCtx.BaseHandlers, schema1Converter)...) + handlers := append(rCtx.BaseHandlers, + remotes.FetchHandler(store, fetcher), + convertibleHandler, + childrenHandler, + appendDistSrcLabelHandler, + ) - isConvertible = true + handler = images.Handlers(handlers...) - converterFunc = func(ctx context.Context, _ ocispec.Descriptor) (ocispec.Descriptor, error) { - return schema1Converter.Convert(ctx) - } - - originalSchema1Digest = desc.Digest.String() - } else { - // Get all the children for a descriptor - childrenHandler := images.ChildrenHandler(store) - // Set any children labels for that content - childrenHandler = images.SetChildrenMappedLabels(store, childrenHandler, rCtx.ChildLabelMap) - if rCtx.AllMetadata { - // Filter manifests by platforms but allow to handle manifest - // and configuration for not-target platforms - childrenHandler = remotes.FilterManifestByPlatformHandler(childrenHandler, rCtx.PlatformMatcher) - } else { - // Filter children by platforms if specified. - childrenHandler = images.FilterPlatforms(childrenHandler, rCtx.PlatformMatcher) - } - // Sort and limit manifests if a finite number is needed - if limit > 0 { - childrenHandler = images.LimitManifests(childrenHandler, rCtx.PlatformMatcher, limit) - } - - // set isConvertible to true if there is application/octet-stream media type - convertibleHandler := images.HandlerFunc( - func(_ context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { - if desc.MediaType == docker.LegacyConfigMediaType { - isConvertible = true - } - - return []ocispec.Descriptor{}, nil - }, - ) - - appendDistSrcLabelHandler, err := docker.AppendDistributionSourceLabel(store, ref) - if err != nil { - return images.Image{}, err - } - - handlers := append(rCtx.BaseHandlers, - remotes.FetchHandler(store, fetcher), - convertibleHandler, - childrenHandler, - appendDistSrcLabelHandler, - ) - - handler = images.Handlers(handlers...) - - converterFunc = func(ctx context.Context, desc ocispec.Descriptor) (ocispec.Descriptor, error) { - return docker.ConvertManifest(ctx, store, desc) - } + converterFunc = func(ctx context.Context, desc ocispec.Descriptor) (ocispec.Descriptor, error) { + return docker.ConvertManifest(ctx, store, desc) } if rCtx.HandlerWrapper != nil { handler = rCtx.HandlerWrapper(handler) } - if rCtx.MaxConcurrentDownloads > 0 { - limiter = semaphore.NewWeighted(int64(rCtx.MaxConcurrentDownloads)) - } - if err := images.Dispatch(ctx, handler, limiter, desc); err != nil { return images.Image{}, err } @@ -277,13 +265,6 @@ func (c *Client) fetch(ctx context.Context, rCtx *RemoteContext, ref string, lim } } - if originalSchema1Digest != "" { - if rCtx.Labels == nil { - rCtx.Labels = make(map[string]string) - } - rCtx.Labels[images.ConvertedDockerSchema1LabelKey] = originalSchema1Digest - } - return images.Image{ Name: name, Target: desc, diff --git a/vendor/github.com/containerd/containerd/v2/client/services.go b/vendor/github.com/containerd/containerd/v2/client/services.go index d2e69a1cee..6772aa9c6f 100644 --- a/vendor/github.com/containerd/containerd/v2/client/services.go +++ b/vendor/github.com/containerd/containerd/v2/client/services.go @@ -31,6 +31,7 @@ import ( "github.com/containerd/containerd/v2/core/leases" "github.com/containerd/containerd/v2/core/sandbox" "github.com/containerd/containerd/v2/core/snapshots" + "github.com/containerd/containerd/v2/core/transfer" "github.com/containerd/containerd/v2/pkg/namespaces" "github.com/containerd/containerd/v2/plugins" srv "github.com/containerd/containerd/v2/plugins/services" @@ -50,6 +51,7 @@ type services struct { introspectionService introspection.Service sandboxStore sandbox.Store sandboxers map[string]sandbox.Controller + transferService transfer.Transferrer } // ServicesOpt allows callers to set options on the services @@ -163,6 +165,13 @@ func WithSandboxStore(client sandbox.Store) ServicesOpt { } } +// WithTransferService sets the transfer service. +func WithTransferService(tr transfer.Transferrer) ServicesOpt { + return func(s *services) { + s.transferService = tr + } +} + // WithInMemoryServices is suitable for cases when there is need to use containerd's client from // another (in-memory) containerd plugin (such as CRI). func WithInMemoryServices(ic *plugin.InitContext) Opt { @@ -178,6 +187,9 @@ func WithInMemoryServices(ic *plugin.InitContext) Opt { plugins.SandboxStorePlugin: func(i interface{}) ServicesOpt { return WithSandboxStore(i.(sandbox.Store)) }, + plugins.TransferPlugin: func(i interface{}) ServicesOpt { + return WithTransferService(i.(transfer.Transferrer)) + }, } { i, err := ic.GetSingle(t) if err != nil { diff --git a/vendor/github.com/containerd/containerd/v2/client/snapshotter_opts_unix.go b/vendor/github.com/containerd/containerd/v2/client/snapshotter_opts_unix.go index 5984b2176d..4e7cca6e85 100644 --- a/vendor/github.com/containerd/containerd/v2/client/snapshotter_opts_unix.go +++ b/vendor/github.com/containerd/containerd/v2/client/snapshotter_opts_unix.go @@ -39,9 +39,24 @@ const ( // to shift the filesystem ownership (user namespace mapping) automatically; currently // supported by the fuse-overlayfs and overlay snapshotters func WithRemapperLabels(ctrUID, hostUID, ctrGID, hostGID, length uint32) snapshots.Opt { + uidMap := []specs.LinuxIDMapping{{ContainerID: ctrUID, HostID: hostUID, Size: length}} + gidMap := []specs.LinuxIDMapping{{ContainerID: ctrGID, HostID: hostGID, Size: length}} + return WithUserNSRemapperLabels(uidMap, gidMap) +} + +// WithUserNSRemapperLabels creates the labels used by any supporting snapshotter +// to shift the filesystem ownership (user namespace mapping) automatically; currently +// supported by the fuse-overlayfs and overlay snapshotters +func WithUserNSRemapperLabels(uidmaps, gidmaps []specs.LinuxIDMapping) snapshots.Opt { + idMap := userns.IDMap{ + UidMap: uidmaps, + GidMap: gidmaps, + } + uidmapLabel, gidmapLabel := idMap.Marshal() return snapshots.WithLabels(map[string]string{ - snapshots.LabelSnapshotUIDMapping: fmt.Sprintf("%d:%d:%d", ctrUID, hostUID, length), - snapshots.LabelSnapshotGIDMapping: fmt.Sprintf("%d:%d:%d", ctrGID, hostGID, length)}) + snapshots.LabelSnapshotUIDMapping: uidmapLabel, + snapshots.LabelSnapshotGIDMapping: gidmapLabel, + }) } func resolveSnapshotOptions(ctx context.Context, client *Client, snapshotterName string, snapshotter snapshots.Snapshotter, parent string, opts ...snapshots.Opt) (string, error) { @@ -89,27 +104,15 @@ func resolveSnapshotOptions(ctx context.Context, client *Client, snapshotterName return "", fmt.Errorf("snapshotter %q doesn't support idmap mounts on this host, configure `slow_chown` to allow a slower and expensive fallback", snapshotterName) } - var uidMap, gidMap specs.LinuxIDMapping - _, err = fmt.Sscanf(uidMapLabel, "%d:%d:%d", &uidMap.ContainerID, &uidMap.HostID, &uidMap.Size) - if err != nil { - return "", fmt.Errorf("uidMapLabel unparsable: %w", err) - } - _, err = fmt.Sscanf(gidMapLabel, "%d:%d:%d", &gidMap.ContainerID, &gidMap.HostID, &gidMap.Size) - if err != nil { - return "", fmt.Errorf("gidMapLabel unparsable: %w", err) + rsn := remappedSnapshot{Parent: parent} + if err = rsn.IDMap.Unmarshal(uidMapLabel, gidMapLabel); err != nil { + return "", fmt.Errorf("failed to unmarshal uid/gid map snapshotter labels: %w", err) } - if uidMap.ContainerID != 0 || gidMap.ContainerID != 0 { - return "", fmt.Errorf("Container UID/GID of 0 only supported currently (%d/%d)", uidMap.ContainerID, gidMap.ContainerID) + if _, err := rsn.IDMap.RootPair(); err != nil { + return "", fmt.Errorf("container UID/GID mapping entries of 0 are required but not found") } - rsn := remappedSnapshot{ - Parent: parent, - IDMap: userns.IDMap{ - UidMap: []specs.LinuxIDMapping{uidMap}, - GidMap: []specs.LinuxIDMapping{gidMap}, - }, - } usernsID, err := rsn.ID() if err != nil { return "", fmt.Errorf("failed to remap snapshot: %w", err) diff --git a/vendor/github.com/containerd/containerd/v2/client/task.go b/vendor/github.com/containerd/containerd/v2/client/task.go index 1e3c3f6317..bfe8569e58 100644 --- a/vendor/github.com/containerd/containerd/v2/client/task.go +++ b/vendor/github.com/containerd/containerd/v2/client/task.go @@ -416,7 +416,7 @@ func (t *task) Delete(ctx context.Context, opts ...ProcessDeleteOpts) (*ExitStat return &ExitStatus{code: r.ExitStatus, exitedAt: protobuf.FromTimestamp(r.ExitedAt)}, nil } -func (t *task) Exec(ctx context.Context, id string, spec *specs.Process, ioCreate cio.Creator) (_ Process, err error) { +func (t *task) Exec(ctx context.Context, id string, spec *specs.Process, ioCreate cio.Creator) (_ Process, retErr error) { ctx, span := tracing.StartSpan(ctx, "task.Exec", tracing.WithAttribute("task.id", t.ID()), ) @@ -430,7 +430,7 @@ func (t *task) Exec(ctx context.Context, id string, spec *specs.Process, ioCreat return nil, err } defer func() { - if err != nil && i != nil { + if retErr != nil && i != nil { i.Cancel() i.Close() } diff --git a/vendor/github.com/containerd/containerd/v2/cmd/containerd/server/config/config.go b/vendor/github.com/containerd/containerd/v2/cmd/containerd/server/config/config.go index b9aacf6fea..cd42e89c6c 100644 --- a/vendor/github.com/containerd/containerd/v2/cmd/containerd/server/config/config.go +++ b/vendor/github.com/containerd/containerd/v2/cmd/containerd/server/config/config.go @@ -61,10 +61,6 @@ type Config struct { State string `toml:"state"` // TempDir is the path to a directory where to place containerd temporary files TempDir string `toml:"temp"` - // PluginDir is the directory for dynamic plugins to be stored - // - // Deprecated: Please use proxy or binary external plugins. - PluginDir string `toml:"plugin_dir"` // GRPC configuration settings GRPC GRPCConfig `toml:"grpc"` // TTRPC configuration settings diff --git a/vendor/github.com/containerd/containerd/v2/core/content/proxy/content_writer.go b/vendor/github.com/containerd/containerd/v2/core/content/proxy/content_writer.go index 98818f234a..45718be7d8 100644 --- a/vendor/github.com/containerd/containerd/v2/core/content/proxy/content_writer.go +++ b/vendor/github.com/containerd/containerd/v2/core/content/proxy/content_writer.go @@ -20,6 +20,7 @@ import ( "context" "fmt" "io" + "slices" contentapi "github.com/containerd/containerd/api/services/content/v1" "github.com/containerd/errdefs/pkg/errgrpc" @@ -78,15 +79,9 @@ func (rw *remoteWriter) Digest() digest.Digest { func (rw *remoteWriter) Write(p []byte) (n int, err error) { const maxBufferSize = defaults.DefaultMaxSendMsgSize >> 1 - for i := 0; i < len(p); i += maxBufferSize { + for data := range slices.Chunk(p, maxBufferSize) { offset := rw.offset - end := i + maxBufferSize - if end > len(p) { - end = len(p) - } - data := p[i:end] - resp, err := rw.send(&contentapi.WriteContentRequest{ Action: contentapi.WriteAction_WRITE, Offset: offset, diff --git a/vendor/github.com/containerd/containerd/v2/core/images/converter/default.go b/vendor/github.com/containerd/containerd/v2/core/images/converter/default.go index 98f7965367..751c0d9cd3 100644 --- a/vendor/github.com/containerd/containerd/v2/core/images/converter/default.go +++ b/vendor/github.com/containerd/containerd/v2/core/images/converter/default.go @@ -165,8 +165,6 @@ func (c *defaultConverter) convertManifest(ctx context.Context, cs content.Store var mu sync.Mutex eg, ctx2 := errgroup.WithContext(ctx) for i, l := range manifest.Layers { - i := i - l := l oldDiffID, err := images.GetDiffID(ctx, cs, l) if err != nil { return nil, err @@ -249,8 +247,6 @@ func (c *defaultConverter) convertIndex(ctx context.Context, cs content.Store, d var mu sync.Mutex eg, ctx2 := errgroup.WithContext(ctx) for i, mani := range index.Manifests { - i := i - mani := mani labelKey := fmt.Sprintf("containerd.io/gc.ref.content.m.%d", i) eg.Go(func() error { if mani.Platform != nil && !c.platformMC.Match(*mani.Platform) { diff --git a/vendor/github.com/containerd/containerd/v2/core/images/handlers.go b/vendor/github.com/containerd/containerd/v2/core/images/handlers.go index 0487fdebda..30543484c2 100644 --- a/vendor/github.com/containerd/containerd/v2/core/images/handlers.go +++ b/vendor/github.com/containerd/containerd/v2/core/images/handlers.go @@ -154,8 +154,6 @@ func WalkNotEmpty(ctx context.Context, handler Handler, descs ...ocispec.Descrip func Dispatch(ctx context.Context, handler Handler, limiter *semaphore.Weighted, descs ...ocispec.Descriptor) error { eg, ctx2 := errgroup.WithContext(ctx) for _, desc := range descs { - desc := desc - if limiter != nil { if err := limiter.Acquire(ctx, 1); err != nil { return err diff --git a/vendor/github.com/containerd/containerd/v2/core/images/labels.go b/vendor/github.com/containerd/containerd/v2/core/images/labels.go deleted file mode 100644 index 06dfed572d..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/images/labels.go +++ /dev/null @@ -1,21 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package images - -const ( - ConvertedDockerSchema1LabelKey = "io.containerd.image/converted-docker-schema1" -) diff --git a/vendor/github.com/containerd/containerd/v2/core/images/usage/calculator.go b/vendor/github.com/containerd/containerd/v2/core/images/usage/calculator.go index 35477ba1a6..fd5493958a 100644 --- a/vendor/github.com/containerd/containerd/v2/core/images/usage/calculator.go +++ b/vendor/github.com/containerd/containerd/v2/core/images/usage/calculator.go @@ -85,7 +85,7 @@ func CalculateImageUsage(ctx context.Context, i images.Image, provider content.I var ( handler = images.ChildrenHandler(provider) - size int64 + size atomic.Int64 mustExist bool ) @@ -153,7 +153,7 @@ func CalculateImageUsage(ctx context.Context, i images.Image, provider content.I usage += desc.Size } - atomic.AddInt64(&size, usage) + size.Add(usage) return children, nil } @@ -163,5 +163,5 @@ func CalculateImageUsage(ctx context.Context, i images.Image, provider content.I return 0, err } - return size, nil + return size.Load(), nil } diff --git a/vendor/github.com/containerd/containerd/v2/core/metadata/bolt.go b/vendor/github.com/containerd/containerd/v2/core/metadata/bolt.go index 50f26f2546..6757cde5a0 100644 --- a/vendor/github.com/containerd/containerd/v2/core/metadata/bolt.go +++ b/vendor/github.com/containerd/containerd/v2/core/metadata/bolt.go @@ -21,6 +21,7 @@ import ( "fmt" bolt "go.etcd.io/bbolt" + errbolt "go.etcd.io/bbolt/errors" ) type transactionKey struct{} @@ -56,7 +57,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 fmt.Errorf("unable to use transaction from context: %w", bolt.ErrTxNotWritable) + return fmt.Errorf("unable to use transaction from context: %w", errbolt.ErrTxNotWritable) } return fn(tx) } diff --git a/vendor/github.com/containerd/containerd/v2/core/metadata/containers.go b/vendor/github.com/containerd/containerd/v2/core/metadata/containers.go index d49259679c..ae65ac963c 100644 --- a/vendor/github.com/containerd/containerd/v2/core/metadata/containers.go +++ b/vendor/github.com/containerd/containerd/v2/core/metadata/containers.go @@ -20,7 +20,6 @@ import ( "context" "fmt" "strings" - "sync/atomic" "time" "github.com/containerd/containerd/v2/core/containers" @@ -35,6 +34,7 @@ import ( "github.com/containerd/errdefs" "github.com/containerd/typeurl/v2" bolt "go.etcd.io/bbolt" + errbolt "go.etcd.io/bbolt/errors" ) const ( @@ -143,7 +143,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 { + if err == errbolt.ErrBucketExists { err = fmt.Errorf("container %q: %w", container.ID, errdefs.ErrAlreadyExists) } return err @@ -294,13 +294,13 @@ func (s *containerStore) Delete(ctx context.Context, id string) error { } if err := bkt.DeleteBucket([]byte(id)); err != nil { - if err == bolt.ErrBucketNotFound { + if err == errbolt.ErrBucketNotFound { err = fmt.Errorf("container %v: %w", id, errdefs.ErrNotFound) } return err } - atomic.AddUint32(&s.db.dirty, 1) + s.db.dirty.Add(1) return nil }) diff --git a/vendor/github.com/containerd/containerd/v2/core/metadata/content.go b/vendor/github.com/containerd/containerd/v2/core/metadata/content.go index bc42d6ca37..d97fec90b9 100644 --- a/vendor/github.com/containerd/containerd/v2/core/metadata/content.go +++ b/vendor/github.com/containerd/containerd/v2/core/metadata/content.go @@ -22,14 +22,15 @@ import ( "fmt" "strings" "sync" - "sync/atomic" "time" + eventstypes "github.com/containerd/containerd/api/events" "github.com/containerd/errdefs" "github.com/containerd/log" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" bolt "go.etcd.io/bbolt" + errbolt "go.etcd.io/bbolt/errors" "github.com/containerd/containerd/v2/core/content" "github.com/containerd/containerd/v2/core/metadata/boltutil" @@ -209,7 +210,7 @@ func (cs *contentStore) Delete(ctx context.Context, dgst digest.Digest) error { cs.l.RLock() defer cs.l.RUnlock() - return update(ctx, cs.db, func(tx *bolt.Tx) error { + if err := update(ctx, cs.db, func(tx *bolt.Tx) error { bkt := getBlobBucket(tx, ns, dgst) if bkt == nil { return fmt.Errorf("content digest %v: %w", dgst, errdefs.ErrNotFound) @@ -223,11 +224,22 @@ func (cs *contentStore) Delete(ctx context.Context, dgst digest.Digest) error { } // Mark content store as dirty for triggering garbage collection - atomic.AddUint32(&cs.db.dirty, 1) + cs.db.dirty.Add(1) cs.db.dirtyCS = true return nil - }) + }); err != nil { + return err + } + + if publisher := cs.db.Publisher(ctx); publisher != nil { + if err := publisher.Publish(ctx, "/content/delete", &eventstypes.ContentDelete{ + Digest: dgst.String(), + }); err != nil { + return err + } + } + return nil } func (cs *contentStore) ListStatuses(ctx context.Context, fs ...string) ([]content.Status, error) { @@ -488,7 +500,7 @@ type namespacedWriter struct { ctx context.Context ref string namespace string - db Transactor + db *DB provider interface { content.Provider content.Ingester @@ -574,6 +586,8 @@ func (nw *namespacedWriter) Commit(ctx context.Context, size int64, expected dig defer nw.l.RUnlock() var innerErr error + var actualDgst digest.Digest + var actualSize int64 // We pre-sync the in-flight writes to the disk. This avoids the // subsequent fp.Sync() call[1] from taking too long (10s+) while @@ -588,16 +602,18 @@ func (nw *namespacedWriter) Commit(ctx context.Context, size int64, expected dig } if err := update(ctx, nw.db, func(tx *bolt.Tx) error { - dgst, err := nw.commit(ctx, tx, size, expected, opts...) + dgst, size, err := nw.commit(ctx, tx, size, expected, opts...) if err != nil { if !errdefs.IsAlreadyExists(err) { return err } innerErr = err } + actualDgst = dgst + actualSize = size bkt := getIngestsBucket(tx, nw.namespace) if bkt != nil { - if err := bkt.DeleteBucket([]byte(nw.ref)); err != nil && err != bolt.ErrBucketNotFound { + if err := bkt.DeleteBucket([]byte(nw.ref)); err != nil && err != errbolt.ErrBucketNotFound { return err } } @@ -608,8 +624,20 @@ func (nw *namespacedWriter) Commit(ctx context.Context, size int64, expected dig }); err != nil { return err } + if innerErr != nil { + return innerErr + } - return innerErr + if publisher := nw.db.Publisher(ctx); publisher != nil { + if err := publisher.Publish(ctx, "/content/create", &eventstypes.ContentCreate{ + Digest: actualDgst.String(), + Size: actualSize, + }); err != nil { + return err + } + } + + return nil } func (nw *namespacedWriter) Sync() error { @@ -619,30 +647,30 @@ func (nw *namespacedWriter) Sync() error { return nil } -func (nw *namespacedWriter) commit(ctx context.Context, tx *bolt.Tx, size int64, expected digest.Digest, opts ...content.Opt) (digest.Digest, error) { +func (nw *namespacedWriter) commit(ctx context.Context, tx *bolt.Tx, size int64, expected digest.Digest, opts ...content.Opt) (digest.Digest, int64, error) { var base content.Info for _, opt := range opts { if err := opt(&base); err != nil { if nw.w != nil { nw.w.Close() } - return "", err + return "", 0, err } } if err := validateInfo(&base); err != nil { if nw.w != nil { nw.w.Close() } - return "", err + return "", 0, err } var actual digest.Digest if nw.w == nil { if size != 0 && size != nw.desc.Size { - return "", fmt.Errorf("%q failed size validation: %v != %v: %w", nw.ref, nw.desc.Size, size, errdefs.ErrFailedPrecondition) + return "", 0, fmt.Errorf("%q failed size validation: %v != %v: %w", nw.ref, nw.desc.Size, size, errdefs.ErrFailedPrecondition) } if expected != "" && expected != nw.desc.Digest { - return "", fmt.Errorf("%q unexpected digest: %w", nw.ref, errdefs.ErrFailedPrecondition) + return "", 0, fmt.Errorf("%q unexpected digest: %w", nw.ref, errdefs.ErrFailedPrecondition) } size = nw.desc.Size actual = nw.desc.Digest @@ -650,42 +678,42 @@ func (nw *namespacedWriter) commit(ctx context.Context, tx *bolt.Tx, size int64, status, err := nw.w.Status() if err != nil { nw.w.Close() - return "", err + return "", 0, err } if size != 0 && size != status.Offset { nw.w.Close() - return "", fmt.Errorf("%q failed size validation: %v != %v: %w", nw.ref, status.Offset, size, errdefs.ErrFailedPrecondition) + return "", 0, fmt.Errorf("%q failed size validation: %v != %v: %w", nw.ref, status.Offset, size, errdefs.ErrFailedPrecondition) } size = status.Offset if err := nw.w.Commit(ctx, size, expected); err != nil && !errdefs.IsAlreadyExists(err) { - return "", err + return "", 0, err } actual = nw.w.Digest() } bkt, err := createBlobBucket(tx, nw.namespace, actual) if err != nil { - if err == bolt.ErrBucketExists { - return actual, fmt.Errorf("content %v: %w", actual, errdefs.ErrAlreadyExists) + if err == errbolt.ErrBucketExists { + return actual, 0, fmt.Errorf("content %v: %w", actual, errdefs.ErrAlreadyExists) } - return "", err + return "", 0, err } commitTime := time.Now().UTC() sizeEncoded, err := encodeInt(size) if err != nil { - return "", err + return "", 0, err } if err := boltutil.WriteTimestamps(bkt, commitTime, commitTime); err != nil { - return "", err + return "", 0, err } if err := boltutil.WriteLabels(bkt, base.Labels); err != nil { - return "", err + return "", 0, err } - return actual, bkt.Put(bucketKeySize, sizeEncoded) + return actual, size, bkt.Put(bucketKeySize, sizeEncoded) } func (nw *namespacedWriter) Status() (st content.Status, err error) { diff --git a/vendor/github.com/containerd/containerd/v2/core/metadata/db.go b/vendor/github.com/containerd/containerd/v2/core/metadata/db.go index 6d3a7404d4..f3a3e7d8ee 100644 --- a/vendor/github.com/containerd/containerd/v2/core/metadata/db.go +++ b/vendor/github.com/containerd/containerd/v2/core/metadata/db.go @@ -95,7 +95,7 @@ type DB struct { // a garbage collection to ensure the database is clean. This tracks // the number of dirty operations. This should be updated and read // atomically if outside of wlock.Lock. - dirty uint32 + dirty atomic.Uint32 // dirtySS and dirtyCS flags keeps track of datastores which have had // deletions since the last garbage collection. These datastores will @@ -262,7 +262,7 @@ func (m *DB) Update(fn func(*bolt.Tx) error) error { defer m.wlock.RUnlock() err := m.db.Update(fn) if err == nil { - dirty := atomic.LoadUint32(&m.dirty) > 0 + dirty := m.dirty.Load() > 0 for _, fn := range m.mutationCallbacks { fn(dirty) } @@ -431,8 +431,9 @@ func (m *DB) GarbageCollect(ctx context.Context) (gc.Stats, error) { wg.Done() }() - // reset dirty, no need for atomic inside of wlock.Lock - m.dirty = 0 + // Reset dirty. Truly don't need to be atomically stored inside of the wlock + // but we're using the atomic wrappers that guarantee atomic access everywhere. + m.dirty.Store(0) if len(m.dirtySS) > 0 { var sl sync.Mutex diff --git a/vendor/github.com/containerd/containerd/v2/core/metadata/gc.go b/vendor/github.com/containerd/containerd/v2/core/metadata/gc.go index 1dd4f79f4f..ccb424b2dc 100644 --- a/vendor/github.com/containerd/containerd/v2/core/metadata/gc.go +++ b/vendor/github.com/containerd/containerd/v2/core/metadata/gc.go @@ -171,7 +171,6 @@ func startGCContext(ctx context.Context, collectors map[gc.ResourceType]Collecto if len(collectors) > 0 { contexts = map[gc.ResourceType]CollectionContext{} for rt, collector := range collectors { - rt := rt c, err := collector.StartCollection(ctx) if err != nil { // Only skipping this resource this round diff --git a/vendor/github.com/containerd/containerd/v2/core/metadata/images.go b/vendor/github.com/containerd/containerd/v2/core/metadata/images.go index 60291857d6..dcd77725e7 100644 --- a/vendor/github.com/containerd/containerd/v2/core/metadata/images.go +++ b/vendor/github.com/containerd/containerd/v2/core/metadata/images.go @@ -22,7 +22,6 @@ import ( "errors" "fmt" "strings" - "sync/atomic" "time" eventstypes "github.com/containerd/containerd/api/events" @@ -36,6 +35,7 @@ import ( digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" bolt "go.etcd.io/bbolt" + errbolt "go.etcd.io/bbolt/errors" ) type imageStore struct { @@ -143,7 +143,7 @@ func (s *imageStore) Create(ctx context.Context, image images.Image) (images.Ima ibkt, err := bkt.CreateBucket([]byte(image.Name)) if err != nil { - if err != bolt.ErrBucketExists { + if err != errbolt.ErrBucketExists { return err } @@ -319,13 +319,13 @@ func (s *imageStore) Delete(ctx context.Context, name string, opts ...images.Del } if err = bkt.DeleteBucket([]byte(name)); err != nil { - if err == bolt.ErrBucketNotFound { + if err == errbolt.ErrBucketNotFound { err = fmt.Errorf("image %q: %w", name, errdefs.ErrNotFound) } return err } - atomic.AddUint32(&s.db.dirty, 1) + s.db.dirty.Add(1) return nil }) diff --git a/vendor/github.com/containerd/containerd/v2/core/metadata/leases.go b/vendor/github.com/containerd/containerd/v2/core/metadata/leases.go index 649d77bc50..ef4c46fbeb 100644 --- a/vendor/github.com/containerd/containerd/v2/core/metadata/leases.go +++ b/vendor/github.com/containerd/containerd/v2/core/metadata/leases.go @@ -21,7 +21,6 @@ import ( "errors" "fmt" "strings" - "sync/atomic" "time" "github.com/containerd/containerd/v2/core/leases" @@ -31,6 +30,7 @@ import ( "github.com/containerd/errdefs" digest "github.com/opencontainers/go-digest" bolt "go.etcd.io/bbolt" + errbolt "go.etcd.io/bbolt/errors" ) // leaseManager manages the create/delete lifecycle of leases @@ -72,7 +72,7 @@ func (lm *leaseManager) Create(ctx context.Context, opts ...leases.Opt) (leases. txbkt, err := topbkt.CreateBucket([]byte(l.ID)) if err != nil { - if err == bolt.ErrBucketExists { + if err == errbolt.ErrBucketExists { err = errdefs.ErrAlreadyExists } return fmt.Errorf("lease %q: %w", l.ID, err) @@ -114,13 +114,13 @@ func (lm *leaseManager) Delete(ctx context.Context, lease leases.Lease, _ ...lea return fmt.Errorf("lease %q: %w", lease.ID, errdefs.ErrNotFound) } if err := topbkt.DeleteBucket([]byte(lease.ID)); err != nil { - if err == bolt.ErrBucketNotFound { + if err == errbolt.ErrBucketNotFound { err = fmt.Errorf("lease %q: %w", lease.ID, errdefs.ErrNotFound) } return err } - atomic.AddUint32(&lm.db.dirty, 1) + lm.db.dirty.Add(1) return nil }) @@ -243,7 +243,7 @@ func (lm *leaseManager) DeleteResource(ctx context.Context, lease leases.Lease, } } - atomic.AddUint32(&lm.db.dirty, 1) + lm.db.dirty.Add(1) return nil }) diff --git a/vendor/github.com/containerd/containerd/v2/core/metadata/migrations.go b/vendor/github.com/containerd/containerd/v2/core/metadata/migrations.go index c507875105..e995243d76 100644 --- a/vendor/github.com/containerd/containerd/v2/core/metadata/migrations.go +++ b/vendor/github.com/containerd/containerd/v2/core/metadata/migrations.go @@ -179,7 +179,7 @@ func migrateSandboxes(tx *bolt.Tx) error { deletingBuckets := [][]byte{} - if merr := tx.ForEach(func(ns []byte, nsbkt *bolt.Bucket) error { + if err := tx.ForEach(func(ns []byte, nsbkt *bolt.Bucket) error { // Skip v1 bucket, even if users created sandboxes in v1 namespace. if bytes.Equal(bucketKeyVersion, ns) { return nil @@ -213,14 +213,14 @@ func migrateSandboxes(tx *bolt.Tx) error { } // copy single - if cerr := sbbkt.ForEach(func(key, value []byte) error { + if err := sbbkt.ForEach(func(key, value []byte) error { if value == nil { return nil } return tsbbkt.Put(key, value) - }); cerr != nil { - return cerr + }); err != nil { + return err } return sbbkt.ForEachBucket(func(subbkt []byte) error { @@ -238,13 +238,13 @@ func migrateSandboxes(tx *bolt.Tx) error { }) }) }) - }); merr != nil { + }); err != nil { return fmt.Errorf("failed to copy sandboxes into v1 bucket: %w", err) } for _, ns := range deletingBuckets { - derr := tx.DeleteBucket(ns) - if derr != nil { + err := tx.DeleteBucket(ns) + if err != nil { return fmt.Errorf("failed to cleanup bucket %s in root: %w", ns, err) } } diff --git a/vendor/github.com/containerd/containerd/v2/core/metadata/namespaces.go b/vendor/github.com/containerd/containerd/v2/core/metadata/namespaces.go index b3c56e6293..97f2366e49 100644 --- a/vendor/github.com/containerd/containerd/v2/core/metadata/namespaces.go +++ b/vendor/github.com/containerd/containerd/v2/core/metadata/namespaces.go @@ -26,6 +26,7 @@ import ( "github.com/containerd/containerd/v2/pkg/namespaces" "github.com/containerd/errdefs" bolt "go.etcd.io/bbolt" + errbolt "go.etcd.io/bbolt/errors" ) type namespaceStore struct { @@ -56,7 +57,7 @@ func (s *namespaceStore) Create(ctx context.Context, namespace string, labels ma // provides the already exists error. bkt, err := topbkt.CreateBucket([]byte(namespace)) if err != nil { - if err == bolt.ErrBucketExists { + if err == errbolt.ErrBucketExists { return fmt.Errorf("namespace %q: %w", namespace, errdefs.ErrAlreadyExists) } @@ -155,7 +156,7 @@ func (s *namespaceStore) Delete(ctx context.Context, namespace string, opts ...n } if err := bkt.DeleteBucket([]byte(namespace)); err != nil { - if err == bolt.ErrBucketNotFound { + if err == errbolt.ErrBucketNotFound { return fmt.Errorf("namespace %q: %w", namespace, errdefs.ErrNotFound) } diff --git a/vendor/github.com/containerd/containerd/v2/core/metadata/sandbox.go b/vendor/github.com/containerd/containerd/v2/core/metadata/sandbox.go index 6659b035ca..30f3a69b61 100644 --- a/vendor/github.com/containerd/containerd/v2/core/metadata/sandbox.go +++ b/vendor/github.com/containerd/containerd/v2/core/metadata/sandbox.go @@ -32,6 +32,7 @@ import ( "github.com/containerd/errdefs" "github.com/containerd/typeurl/v2" "go.etcd.io/bbolt" + errbolt "go.etcd.io/bbolt/errors" ) const ( @@ -266,7 +267,7 @@ func (s *sandboxStore) Delete(ctx context.Context, id string) error { } if err := buckets.DeleteBucket([]byte(id)); err != nil { - if err == bbolt.ErrBucketNotFound { + if err == errbolt.ErrBucketNotFound { err = errdefs.ErrNotFound } return fmt.Errorf("failed to delete sandbox %q: %w", id, err) @@ -299,7 +300,7 @@ func (s *sandboxStore) write(parent *bbolt.Bucket, instance *api.Sandbox, overwr } else { bucket, err = parent.CreateBucket(id) if err != nil { - if err == bbolt.ErrBucketExists { + if err == errbolt.ErrBucketExists { return fmt.Errorf("sandbox bucket %q already exists: %w", instance.ID, errdefs.ErrAlreadyExists) } return err diff --git a/vendor/github.com/containerd/containerd/v2/core/metadata/snapshot.go b/vendor/github.com/containerd/containerd/v2/core/metadata/snapshot.go index e46a0e9193..8e81dd6ac1 100644 --- a/vendor/github.com/containerd/containerd/v2/core/metadata/snapshot.go +++ b/vendor/github.com/containerd/containerd/v2/core/metadata/snapshot.go @@ -21,7 +21,6 @@ import ( "fmt" "strings" "sync" - "sync/atomic" "time" eventstypes "github.com/containerd/containerd/api/events" @@ -34,6 +33,7 @@ import ( "github.com/containerd/errdefs" "github.com/containerd/log" bolt "go.etcd.io/bbolt" + errbolt "go.etcd.io/bbolt/errors" ) const ( @@ -456,7 +456,7 @@ func (s *snapshotter) createSnapshot(ctx context.Context, key, parent string, re bbkt, err := bkt.CreateBucket([]byte(key)) if err != nil { - if err != bolt.ErrBucketExists { + if err != errbolt.ErrBucketExists { return err } if rerr == nil { @@ -555,7 +555,7 @@ func (s *snapshotter) Commit(ctx context.Context, name, key string, opts ...snap } bbkt, err := bkt.CreateBucket([]byte(name)) if err != nil { - if err == bolt.ErrBucketExists { + if err == errbolt.ErrBucketExists { rerr = fmt.Errorf("snapshot %q: %w", name, errdefs.ErrAlreadyExists) return nil } @@ -714,7 +714,7 @@ func (s *snapshotter) Remove(ctx context.Context, key string) error { } // Mark snapshotter as dirty for triggering garbage collection - atomic.AddUint32(&s.db.dirty, 1) + s.db.dirty.Add(1) s.db.dirtySS[s.name] = struct{}{} return nil diff --git a/vendor/github.com/containerd/containerd/v2/core/mount/mount_idmapped_linux.go b/vendor/github.com/containerd/containerd/v2/core/mount/mount_idmapped_linux.go index d929157d76..2c9519fa8a 100644 --- a/vendor/github.com/containerd/containerd/v2/core/mount/mount_idmapped_linux.go +++ b/vendor/github.com/containerd/containerd/v2/core/mount/mount_idmapped_linux.go @@ -26,49 +26,70 @@ import ( "golang.org/x/sys/unix" ) -// TODO: Support multiple mappings in future -func parseIDMapping(mapping string) ([]syscall.SysProcIDMap, error) { +func parseIDMapping(mapping string) (syscall.SysProcIDMap, error) { + var retval syscall.SysProcIDMap + parts := strings.Split(mapping, ":") if len(parts) != 3 { - return nil, fmt.Errorf("user namespace mappings require the format `container-id:host-id:size`") + return retval, fmt.Errorf("user namespace mappings require the format `container-id:host-id:size`") } cID, err := strconv.Atoi(parts[0]) if err != nil { - return nil, fmt.Errorf("invalid container id for user namespace remapping, %w", err) + return retval, fmt.Errorf("invalid container id for user namespace remapping, %w", err) } hID, err := strconv.Atoi(parts[1]) if err != nil { - return nil, fmt.Errorf("invalid host id for user namespace remapping, %w", err) + return retval, fmt.Errorf("invalid host id for user namespace remapping, %w", err) } size, err := strconv.Atoi(parts[2]) if err != nil { - return nil, fmt.Errorf("invalid size for user namespace remapping, %w", err) + return retval, fmt.Errorf("invalid size for user namespace remapping, %w", err) } if cID < 0 || hID < 0 || size < 0 { - return nil, fmt.Errorf("invalid mapping %s, all IDs and size must be positive integers", mapping) + return retval, fmt.Errorf("invalid mapping %s, all IDs and size must be positive integers", mapping) } - return []syscall.SysProcIDMap{ - { - ContainerID: cID, - HostID: hID, - Size: size, - }, - }, nil + retval = syscall.SysProcIDMap{ + ContainerID: cID, + HostID: hID, + Size: size, + } + + return retval, nil } -// IDMapMount applies GID/UID shift according to gidmap/uidmap for target path +func parseIDMappingList(mappings string) ([]syscall.SysProcIDMap, error) { + var ( + res []syscall.SysProcIDMap + maplist = strings.Split(mappings, ",") + ) + for _, m := range maplist { + r, err := parseIDMapping(m) + if err != nil { + return nil, err + } + res = append(res, r) + } + return res, nil +} + +// IDMapMount clones the mount at source to target, applying GID/UID idmapping of the user namespace for target path func IDMapMount(source, target string, usernsFd int) (err error) { + return IDMapMountWithAttrs(source, target, usernsFd, 0, 0) +} + +// IDMapMountWithAttrs clones the mount at source to target with the provided mount options and idmapping of the user namespace. +func IDMapMountWithAttrs(source, target string, usernsFd int, attrSet uint64, attrClr uint64) (err error) { var ( attr unix.MountAttr ) - attr.Attr_set = unix.MOUNT_ATTR_IDMAP - attr.Attr_clr = 0 + attr.Attr_set = unix.MOUNT_ATTR_IDMAP | attrSet + attr.Attr_clr = attrClr attr.Propagation = 0 attr.Userns_fd = uint64(usernsFd) @@ -79,7 +100,7 @@ func IDMapMount(source, target string, usernsFd int) (err error) { defer unix.Close(dFd) if err = unix.MountSetattr(dFd, "", unix.AT_EMPTY_PATH, &attr); err != nil { - return fmt.Errorf("Unable to shift GID/UID for %s: %w", target, err) + return fmt.Errorf("Unable to shift GID/UID or set mount attrs for %s: %w", target, err) } if err = unix.MoveMount(dFd, "", -int(unix.EBADF), target, unix.MOVE_MOUNT_F_EMPTY_PATH); err != nil { @@ -88,15 +109,15 @@ func IDMapMount(source, target string, usernsFd int) (err error) { return nil } -// GetUsernsFD forks the current process and creates a user namespace using -// the specified mappings. +// GetUsernsFD forks the current process and creates a user namespace using the specified mappings. +// Expected syntax of ID mapping parameter is "%d:%d:%d[,%d:%d:%d,...]" func GetUsernsFD(uidmap, gidmap string) (_usernsFD *os.File, _ error) { - uidMaps, err := parseIDMapping(uidmap) + uidMaps, err := parseIDMappingList(uidmap) if err != nil { return nil, err } - gidMaps, err := parseIDMapping(gidmap) + gidMaps, err := parseIDMappingList(gidmap) if err != nil { return nil, err } diff --git a/vendor/github.com/containerd/containerd/v2/core/mount/mount_linux.go b/vendor/github.com/containerd/containerd/v2/core/mount/mount_linux.go index a14d545fd0..6d63bfad14 100644 --- a/vendor/github.com/containerd/containerd/v2/core/mount/mount_linux.go +++ b/vendor/github.com/containerd/containerd/v2/core/mount/mount_linux.go @@ -66,7 +66,12 @@ func prepareIDMappedOverlay(usernsFd int, options []string) ([]string, func(), e return options, nil, fmt.Errorf("failed to parse overlay lowerdir's from given options") } - tmpLowerdirs, idMapCleanUp, err := doPrepareIDMappedOverlay(lowerDirs, usernsFd) + tempRemountsLocation, err := os.MkdirTemp(tempMountLocation, "ovl-idmapped") + if err != nil { + return options, nil, fmt.Errorf("failed to create temporary overlay lowerdir mount location: %w", err) + } + + tmpLowerdirs, idMapCleanUp, err := doPrepareIDMappedOverlay(tempRemountsLocation, lowerDirs, usernsFd) if err != nil { return options, idMapCleanUp, fmt.Errorf("failed to create idmapped mount: %w", err) } @@ -244,39 +249,35 @@ func getUnprivilegedMountFlags(path string) (int, error) { return flags, nil } -func doPrepareIDMappedOverlay(lowerDirs []string, usernsFd int) (tmpLowerDirs []string, _ func(), _ error) { - td, err := os.MkdirTemp(tempMountLocation, "ovl-idmapped") - if err != nil { - return nil, nil, err - } +func doPrepareIDMappedOverlay(tempRemountsLocation string, lowerDirs []string, usernsFd int) ([]string, func(), error) { + tmpLowerDirs := make([]string, 0, len(lowerDirs)) + cleanUp := func() { for _, lowerDir := range tmpLowerDirs { - // Do a detached unmount so even if the resource is busy, the mount will be - // gone (eventually) and we can safely delete the directory too. - if err := unix.Unmount(lowerDir, unix.MNT_DETACH); err != nil { + if err := unix.Unmount(lowerDir, 0); err != nil { log.L.WithError(err).Warnf("failed to unmount temp lowerdir %s", lowerDir) continue } // Using os.Remove() so if it's not empty, we don't delete files in the // rootfs. if err := os.Remove(lowerDir); err != nil { - log.L.WithError(err).Warnf("failed to remove temporary overlay lowerdir's") + log.L.WithError(err).Warnf("failed to remove temporary overlay lowerdir") } } // This dir should be empty now. Otherwise, we don't do anything. - if err := os.Remove(filepath.Join(tmpLowerDirs[0], "..")); err != nil { + if err := os.Remove(tempRemountsLocation); err != nil { log.L.WithError(err).Infof("failed to remove temporary overlay dir") } } for i, lowerDir := range lowerDirs { - tmpLowerDir := filepath.Join(td, strconv.Itoa(i)) + tmpLowerDir := filepath.Join(tempRemountsLocation, strconv.Itoa(i)) tmpLowerDirs = append(tmpLowerDirs, tmpLowerDir) - if err = os.MkdirAll(tmpLowerDir, 0700); err != nil { + if err := os.MkdirAll(tmpLowerDir, 0700); err != nil { return nil, cleanUp, fmt.Errorf("failed to create temporary dir: %w", err) } - if err = IDMapMount(lowerDir, tmpLowerDir, usernsFd); err != nil { + if err := IDMapMountWithAttrs(lowerDir, tmpLowerDir, usernsFd, unix.MOUNT_ATTR_RDONLY, 0); err != nil { return nil, cleanUp, err } } diff --git a/vendor/github.com/containerd/containerd/v2/core/mount/temp_unix.go b/vendor/github.com/containerd/containerd/v2/core/mount/temp_unix.go index 8845e47aa1..9e9472fac3 100644 --- a/vendor/github.com/containerd/containerd/v2/core/mount/temp_unix.go +++ b/vendor/github.com/containerd/containerd/v2/core/mount/temp_unix.go @@ -1,4 +1,4 @@ -//go:build !windows && !darwin +//go:build unix /* Copyright The containerd Authors. diff --git a/vendor/github.com/containerd/containerd/v2/core/mount/temp_unsupported.go b/vendor/github.com/containerd/containerd/v2/core/mount/temp_unsupported.go index 3ccc0444ff..4656debd78 100644 --- a/vendor/github.com/containerd/containerd/v2/core/mount/temp_unsupported.go +++ b/vendor/github.com/containerd/containerd/v2/core/mount/temp_unsupported.go @@ -1,4 +1,4 @@ -//go:build windows || darwin +//go:build windows /* Copyright The containerd Authors. diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/auth/fetch.go b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/auth/fetch.go index 16ea609a13..f68c22ab7a 100644 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/auth/fetch.go +++ b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/auth/fetch.go @@ -78,10 +78,10 @@ type TokenOptions struct { // FetchRefreshToken enables fetching a refresh token (aka "identity token", "offline token") along with the bearer token. // // For HTTP GET mode (FetchToken), FetchRefreshToken sets `offline_token=true` in the request. - // https://docs.docker.com/registry/spec/auth/token/#requesting-a-token + // https://distribution.github.io/distribution/spec/auth/token/#requesting-a-token // // For HTTP POST mode (FetchTokenWithOAuth), FetchRefreshToken sets `access_type=offline` in the request. - // https://docs.docker.com/registry/spec/auth/oauth/#getting-a-token + // https://distribution.github.io/distribution/spec/auth/oauth/#getting-a-token FetchRefreshToken bool } diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/authorizer.go b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/authorizer.go index 01fc792fa4..00d1b34114 100644 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/authorizer.go +++ b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/authorizer.go @@ -70,9 +70,18 @@ func WithAuthCreds(creds func(string) (string, string, error)) AuthorizerOpt { } // WithAuthHeader provides HTTP headers for authorization +// +// We need to merge instead of replacing because header may be set by +// a per-host hosts.toml or/AND by a global header config (e.g., cri.config.headers) func WithAuthHeader(hdr http.Header) AuthorizerOpt { return func(opt *authorizerConfig) { - opt.header = hdr + if opt.header == nil { + opt.header = hdr.Clone() + } else { + for k, v := range hdr { + opt.header[k] = append(opt.header[k], v...) + } + } } } @@ -88,7 +97,7 @@ func WithFetchRefreshToken(f OnFetchRefreshToken) AuthorizerOpt { // NewDockerAuthorizer creates an authorizer using Docker's registry // authentication spec. -// See https://docs.docker.com/registry/spec/auth/ +// See https://distribution.github.io/distribution/spec/auth/ func NewDockerAuthorizer(opts ...AuthorizerOpt) Authorizer { var ao authorizerConfig for _, opt := range opts { @@ -269,7 +278,7 @@ func (ah *authHandler) doBearerAuth(ctx context.Context) (token, refreshToken st to.Scopes = GetTokenScopes(ctx, to.Scopes) - // Docs: https://docs.docker.com/registry/spec/auth/scope + // Docs: https://distribution.github.io/distribution/spec/auth/scope/ scoped := strings.Join(to.Scopes, " ") // Keep track of the expiration time of cached bearer tokens so they can be diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/config/docker_fuzzer_internal.go b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/config/docker_fuzzer_internal.go deleted file mode 100644 index 335614fdb2..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/config/docker_fuzzer_internal.go +++ /dev/null @@ -1,44 +0,0 @@ -//go:build gofuzz - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package config - -import ( - "os" - - fuzz "github.com/AdaLogics/go-fuzz-headers" -) - -func FuzzParseHostsFile(data []byte) int { - f := fuzz.NewConsumer(data) - dir, err := os.MkdirTemp("", "fuzz-") - if err != nil { - return 0 - } - err = f.CreateFiles(dir) - if err != nil { - return 0 - } - defer os.RemoveAll(dir) - b, err := f.GetBytes() - if err != nil { - return 0 - } - _, _ = parseHostsFile(dir, b) - return 1 -} diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/config/hosts.go b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/config/hosts.go index 86ea23238c..681d97e0bc 100644 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/config/hosts.go +++ b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/config/hosts.go @@ -52,6 +52,8 @@ type hostConfig struct { clientPairs [][2]string skipVerify *bool + dialTimeout *time.Duration + header http.Header // TODO: Add credential configuration (domain alias, username) @@ -144,19 +146,7 @@ func ConfigureHosts(ctx context.Context, options HostOptions) docker.RegistryHos defaultTLSConfig = &tls.Config{} } - defaultTransport := &http.Transport{ - Proxy: http.ProxyFromEnvironment, - DialContext: (&net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, - FallbackDelay: 300 * time.Millisecond, - }).DialContext, - MaxIdleConns: 10, - IdleConnTimeout: 30 * time.Second, - TLSHandshakeTimeout: 10 * time.Second, - TLSClientConfig: defaultTLSConfig, - ExpectContinueTimeout: 5 * time.Second, - } + defaultTransport := docker.DefaultHTTPTransport(defaultTLSConfig) client := &http.Client{ Transport: defaultTransport, @@ -177,65 +167,43 @@ func ConfigureHosts(ctx context.Context, options HostOptions) docker.RegistryHos rhosts := make([]docker.RegistryHost, len(hosts)) for i, host := range hosts { // Allow setting for each host as well - explicitTLS := tlsConfigured - - if host.caCerts != nil || host.clientPairs != nil || host.skipVerify != nil { - explicitTLS = true - tr := defaultTransport.Clone() - tlsConfig := tr.TLSClientConfig - if host.skipVerify != nil { - tlsConfig.InsecureSkipVerify = *host.skipVerify - } - if host.caCerts != nil { - if tlsConfig.RootCAs == nil { - rootPool, err := rootSystemPool() - if err != nil { - return nil, 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, fmt.Errorf("unable to read CA cert %q: %w", f, err) - } - if !tlsConfig.RootCAs.AppendCertsFromPEM(data) { - return nil, fmt.Errorf("unable to load CA cert %q", f) - } - } - } - - for _, pair := range host.clientPairs { - certPEMBlock, err := os.ReadFile(pair[0]) - if err != nil { - 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, fmt.Errorf("unable to read CERT file %q: %w", pair[1], err) - } - } else { - // Load key block from same PEM file - keyPEMBlock = certPEMBlock - } - cert, err := tls.X509KeyPair(certPEMBlock, keyPEMBlock) - if err != nil { - return nil, fmt.Errorf("failed to load X509 key pair: %w", err) - } - - tlsConfig.Certificates = append(tlsConfig.Certificates, cert) - } + explicitTLSFromHost := host.caCerts != nil || host.clientPairs != nil || host.skipVerify != nil + explicitTLS := tlsConfigured || explicitTLSFromHost + if explicitTLSFromHost || host.dialTimeout != nil || len(host.header) != 0 { c := *client - c.Transport = tr + if explicitTLSFromHost || host.dialTimeout != nil { + tr := defaultTransport.Clone() + + if explicitTLSFromHost { + if err := updateTLSConfigFromHost(tr.TLSClientConfig, &host); err != nil { + return nil, err + } + } + + if host.dialTimeout != nil { + tr.DialContext = (&net.Dialer{ + Timeout: *host.dialTimeout, + KeepAlive: 30 * time.Second, + FallbackDelay: 300 * time.Millisecond, + }).DialContext + } + + c.Transport = tr + } + if options.UpdateClient != nil { if err := options.UpdateClient(&c); err != nil { return nil, err } } + // redeclare here to allow per-host changes + authOpts := authOpts + if len(host.header) != 0 { + authOpts = append(authOpts, docker.WithAuthHeader(host.header)) + } + rhosts[i].Client = &c rhosts[i].Authorizer = docker.NewDockerAuthorizer(append(authOpts, docker.WithAuthClient(&c))...) } else { @@ -270,6 +238,55 @@ func ConfigureHosts(ctx context.Context, options HostOptions) docker.RegistryHos } +func updateTLSConfigFromHost(tlsConfig *tls.Config, host *hostConfig) error { + if host.skipVerify != nil { + tlsConfig.InsecureSkipVerify = *host.skipVerify + } + + if host.caCerts != nil { + if tlsConfig.RootCAs == nil { + rootPool, err := rootSystemPool() + if err != nil { + return 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 fmt.Errorf("unable to read CA cert %q: %w", f, err) + } + if !tlsConfig.RootCAs.AppendCertsFromPEM(data) { + return fmt.Errorf("unable to load CA cert %q", f) + } + } + } + + for _, pair := range host.clientPairs { + certPEMBlock, err := os.ReadFile(pair[0]) + if err != nil { + return 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 fmt.Errorf("unable to read CERT file %q: %w", pair[1], err) + } + } else { + // Load key block from same PEM file + keyPEMBlock = certPEMBlock + } + cert, err := tls.X509KeyPair(certPEMBlock, keyPEMBlock) + if err != nil { + return fmt.Errorf("failed to load X509 key pair: %w", err) + } + tlsConfig.Certificates = append(tlsConfig.Certificates, cert) + } + + return nil +} + // HostDirFromRoot returns a function which finds a host directory // based at the given root. func HostDirFromRoot(root string) func(string) (string, error) { @@ -352,6 +369,10 @@ type hostFileConfig struct { // API root endpoint. OverridePath bool `toml:"override_path"` + // DialTimeout is the maximum amount of time a dial will wait for + // a connect to complete. + DialTimeout string `toml:"dial_timeout"` + // TODO: Credentials: helper? name? username? alternate domain? token? } @@ -512,6 +533,14 @@ func parseHostConfig(server string, baseDir string, config hostFileConfig) (host result.header = header } + if config.DialTimeout != "" { + dialTimeout, err := time.ParseDuration(config.DialTimeout) + if err != nil { + return hostConfig{}, err + } + result.dialTimeout = &dialTimeout + } + return result, nil } diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/converter_fuzz.go b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/converter_fuzz.go deleted file mode 100644 index c97b6b8994..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/converter_fuzz.go +++ /dev/null @@ -1,54 +0,0 @@ -//go:build gofuzz - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 docker - -import ( - "context" - "os" - - fuzz "github.com/AdaLogics/go-fuzz-headers" - "github.com/containerd/containerd/v2/plugins/content/local" - "github.com/containerd/log" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" -) - -func FuzzConvertManifest(data []byte) int { - ctx := context.Background() - - // Do not log the message below - // level=warning msg="do nothing for media type: ..." - log.G(ctx).Logger.SetLevel(log.PanicLevel) - - f := fuzz.NewConsumer(data) - desc := ocispec.Descriptor{} - err := f.GenerateStruct(&desc) - if err != nil { - return 0 - } - tmpdir, err := os.MkdirTemp("", "fuzzing-") - if err != nil { - return 0 - } - cs, err := local.NewStore(tmpdir) - if err != nil { - return 0 - } - _, _ = ConvertManifest(ctx, cs, desc) - return 1 -} diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/fetcher.go b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/fetcher.go index 2c7d880a9d..9388d8479e 100644 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/fetcher.go +++ b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/fetcher.go @@ -17,26 +17,202 @@ package docker import ( + "bytes" "compress/flate" "compress/gzip" "context" - "encoding/json" "errors" "fmt" "io" "net/http" "net/url" + "strconv" "strings" + "sync" - "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/core/remotes" "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/klauspost/compress/zstd" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" + + "github.com/containerd/containerd/v2/core/images" + "github.com/containerd/containerd/v2/core/remotes" ) +type bufferPool struct { + pool *sync.Pool +} + +func newbufferPool(bufCap int64) *bufferPool { + pool := &sync.Pool{ + New: func() any { + return bytes.NewBuffer(make([]byte, 0, bufCap)) + }, + } + return &bufferPool{ + pool: pool, + } +} + +func (p *bufferPool) Get() *bytes.Buffer { + buf := p.pool.Get().(*bytes.Buffer) + return buf +} + +func (p *bufferPool) Put(buffer *bytes.Buffer) { + p.pool.Put(buffer) +} + +var ErrClosedPipe = errors.New("bufpipe: read/write on closed pipe") + +// pipe implements an asynchronous buffered pipe designed for high-throughput +// I/O with configurable initial buffer sizes and buffer reuse. It decouples +// read/write operations, allowing writers to proceed without blocking (unless +// the pipe is closed) and readers to wait efficiently for incoming data. +// +// Key Characteristics: +// - Asynchronous Operation: Writers populate buffers independently of read +// timing, enabling continuous data flow without reader-writer synchronization. +// - Dynamic Buffering: Active buffer grows organically to handle large payloads, while +// the initial capacity (bufCap) balances memory pre-allocation and growth overhead. +// - Buffer Recycling: Retrieved from/pushed to a pool to minimize allocations, reducing +// garbage collection pressure in sustained I/O scenarios. +// - Error Semantics: Closes deterministically on first error (read or write), propagating +// errors atomically to both ends while draining buffered data. +// +// Difference with io.Pipe: +// - Unlike io.Pipe's strict synchronization (blocking write until read), this implementation +// allows writers to buffer data ahead of reads, improving throughput for bursty workloads. +// +// Synchronization & Internals: +// - Condition Variable (sync.Cond): Coordinates reader/writer, waking readers on new data +// or closure. Locking is centralized via the condition's mutex. +// - Buffer Lifecycle: Active buffer serves writes until read depletion, after which it's +// recycled to the pool. Pooled buffers retain their capacity across uses. +// - Error Handling: Write errors (werr) permanently fail writes; read errors (rerr) mark +// terminal read state after buffer exhaustion. +// +// Future Considerations: +// - Zero-copy reads/writes to avoid buffer copying overhead. +// - Memory-mapped file backing for multi-gigabyte payloads. +type pipe struct { + cond *sync.Cond // Coordinates read/write signaling via Lock+Wait/Signal + bufPool *bufferPool // Reusable buffers with initial capacity bufCap + buf *bytes.Buffer // Active data buffer (nil when empty/returned to pool) + rerr, werr error // Terminal read/write errors (sticky once set) +} + +type pipeReader struct { + *pipe +} + +type pipeWriter struct { + *pipe +} + +func newPipeWriter(bufPool *bufferPool) (*pipeReader, *pipeWriter) { + p := &pipe{ + cond: sync.NewCond(new(sync.Mutex)), + bufPool: bufPool, + buf: nil, + } + return &pipeReader{ + pipe: p, + }, &pipeWriter{ + pipe: p, + } +} + +// Read implements the standard Read interface: it reads data from the pipe, +// reading from the internal buffer, otherwise blocking until a writer arrives +// or the write end is closed. If the write end is closed with an error, that +// error is returned as err; otherwise err is io.EOF. +func (r *pipeReader) Read(data []byte) (n int, err error) { + r.cond.L.Lock() + defer r.cond.L.Unlock() + + if r.buf == nil { + r.buf = r.bufPool.Get() + } + + for { + n, err = r.buf.Read(data) + // If not closed and no read, wait for writing. + if err == io.EOF && r.rerr == nil && n == 0 { + r.cond.Wait() // Wait for data to be written + continue + } + break + } + if err == io.EOF { + // Put buffer back to pool + r.bufPool.Put(r.buf) + r.buf = nil + return n, r.rerr + } + return n, err +} + +// Close closes the reader; subsequent writes from the write half of the pipe +// will return error ErrClosedPipe. +func (r *pipeReader) Close() error { + return r.CloseWithError(nil) +} + +// CloseWithError closes the reader; subsequent writes to the write half of the +// pipe will return the error err. +func (r *pipeReader) CloseWithError(err error) error { + r.cond.L.Lock() + defer r.cond.L.Unlock() + + if err == nil { + err = ErrClosedPipe + } + r.werr = err + return nil +} + +// Write implements the standard Write interface: it writes data to the internal +// buffer. If the read end is closed with an error, that err is returned as err; +// otherwise err is ErrClosedPipe. +func (w *pipeWriter) Write(data []byte) (int, error) { + w.cond.L.Lock() + defer w.cond.L.Unlock() + + if w.werr != nil { + return 0, w.werr + } + + if w.buf == nil { + w.buf = w.bufPool.Get() + } + + n, err := w.buf.Write(data) + w.cond.Signal() + return n, err +} + +// Close closes the writer; subsequent reads from the read half of the pipe will +// return io.EOF once the internal buffer get empty. +func (w *pipeWriter) Close() error { + return w.CloseWithError(nil) +} + +// Close closes the writer; subsequent reads from the read half of the pipe will +// return err once the internal buffer get empty. +func (w *pipeWriter) CloseWithError(err error) error { + w.cond.L.Lock() + defer w.cond.L.Unlock() + + if err == nil { + err = io.EOF + } + w.rerr = err + w.cond.Broadcast() + return nil +} + type dockerFetcher struct { *dockerBase } @@ -84,7 +260,7 @@ func (r dockerFetcher) Fetch(ctx context.Context, desc ocispec.Descriptor) (io.R req.path = req.path + "?" + u.RawQuery } - rc, err := r.open(ctx, req, desc.MediaType, offset) + rc, err := r.open(ctx, req, desc.MediaType, offset, false) if err != nil { if errdefs.IsNotFound(err) { continue // try one of the other urls. @@ -97,17 +273,16 @@ func (r dockerFetcher) Fetch(ctx context.Context, desc ocispec.Descriptor) (io.R } // Try manifests endpoints for manifests types - if images.IsManifestType(desc.MediaType) || images.IsIndexType(desc.MediaType) || - desc.MediaType == images.MediaTypeDockerSchema1Manifest { + if images.IsManifestType(desc.MediaType) || images.IsIndexType(desc.MediaType) { var firstErr error - for _, host := range r.hosts { + for i, host := range r.hosts { req := r.request(host, http.MethodGet, "manifests", desc.Digest.String()) if err := req.addNamespace(r.refspec.Hostname()); err != nil { return nil, err } - rc, err := r.open(ctx, req, desc.MediaType, offset) + rc, err := r.open(ctx, req, desc.MediaType, offset, i == len(r.hosts)-1) if err != nil { // Store the error for referencing later if firstErr == nil { @@ -124,13 +299,13 @@ func (r dockerFetcher) Fetch(ctx context.Context, desc ocispec.Descriptor) (io.R // Finally use blobs endpoints var firstErr error - for _, host := range r.hosts { + for i, host := range r.hosts { req := r.request(host, http.MethodGet, "blobs", desc.Digest.String()) if err := req.addNamespace(r.refspec.Hostname()); err != nil { return nil, err } - rc, err := r.open(ctx, req, desc.MediaType, offset) + rc, err := r.open(ctx, req, desc.MediaType, offset, i == len(r.hosts)-1) if err != nil { // Store the error for referencing later if firstErr == nil { @@ -153,7 +328,7 @@ func (r dockerFetcher) Fetch(ctx context.Context, desc ocispec.Descriptor) (io.R }) } -func (r dockerFetcher) createGetReq(ctx context.Context, host RegistryHost, mediatype string, ps ...string) (*request, int64, error) { +func (r dockerFetcher) createGetReq(ctx context.Context, host RegistryHost, lastHost bool, mediatype string, ps ...string) (*request, int64, error) { headReq := r.request(host, http.MethodHead, ps...) if err := headReq.addNamespace(r.refspec.Hostname()); err != nil { return nil, 0, err @@ -165,7 +340,7 @@ func (r dockerFetcher) createGetReq(ctx context.Context, host RegistryHost, medi headReq.header.Set("Accept", strings.Join([]string{mediatype, `*/*`}, ", ")) } - headResp, err := headReq.doWithRetries(ctx, nil) + headResp, err := headReq.doWithRetries(ctx, lastHost) if err != nil { return nil, 0, err } @@ -209,8 +384,8 @@ func (r dockerFetcher) FetchByDigest(ctx context.Context, dgst digest.Digest, op firstErr error ) - for _, host := range r.hosts { - getReq, sz, err = r.createGetReq(ctx, host, config.Mediatype, "blobs", dgst.String()) + for i, host := range r.hosts { + getReq, sz, err = r.createGetReq(ctx, host, i == len(r.hosts)-1, config.Mediatype, "blobs", dgst.String()) if err == nil { break } @@ -222,8 +397,8 @@ func (r dockerFetcher) FetchByDigest(ctx context.Context, dgst digest.Digest, op if getReq == nil { // Fall back to the "manifests" endpoint - for _, host := range r.hosts { - getReq, sz, err = r.createGetReq(ctx, host, config.Mediatype, "manifests", dgst.String()) + for i, host := range r.hosts { + getReq, sz, err = r.createGetReq(ctx, host, i == len(r.hosts)-1, config.Mediatype, "manifests", dgst.String()) if err == nil { break } @@ -245,7 +420,7 @@ func (r dockerFetcher) FetchByDigest(ctx context.Context, dgst digest.Digest, op } seeker, err := newHTTPReadSeeker(sz, func(offset int64) (io.ReadCloser, error) { - return r.open(ctx, getReq, config.Mediatype, offset) + return r.open(ctx, getReq, config.Mediatype, offset, true) }) if err != nil { return nil, desc, err @@ -262,80 +437,142 @@ func (r dockerFetcher) FetchByDigest(ctx context.Context, dgst digest.Digest, op return seeker, desc, nil } -func (r dockerFetcher) open(ctx context.Context, req *request, mediatype string, offset int64) (_ io.ReadCloser, retErr error) { - if mediatype == "" { - req.header.Set("Accept", "*/*") - } else { - req.header.Set("Accept", strings.Join([]string{mediatype, `*/*`}, ", ")) +func (r dockerFetcher) open(ctx context.Context, req *request, mediatype string, offset int64, lastHost bool) (_ io.ReadCloser, retErr error) { + const minChunkSize = 512 + + chunkSize := int64(r.performances.ConcurrentLayerFetchBuffer) + parallelism := int64(r.performances.MaxConcurrentDownloads) + if chunkSize < minChunkSize { + parallelism = 1 } + log.G(ctx).WithField("initial_parallelism", r.performances.MaxConcurrentDownloads). + WithField("parallelism", parallelism). + WithField("chunk_size", chunkSize). + WithField("offset", offset). + Debug("fetching layer") + req.setMediaType(mediatype) req.header.Set("Accept-Encoding", "zstd;q=1.0, gzip;q=0.8, deflate;q=0.5") + req.setOffset(offset) - if offset > 0 { - // Note: "Accept-Ranges: bytes" cannot be trusted as some endpoints - // will return the header without supporting the range. The content - // range must always be checked. - req.header.Set("Range", fmt.Sprintf("bytes=%d-", offset)) - } - - resp, err := req.doWithRetries(ctx, nil) - if err != nil { + if err := r.Acquire(ctx, 1); err != nil { return nil, err } - defer func() { - if retErr != nil { - resp.Body.Close() - } - }() - - if resp.StatusCode > 299 { - // TODO(stevvooe): When doing a offset specific request, we should - // really distinguish between a 206 and a 200. In the case of 200, we - // can discard the bytes, hiding the seek behavior from the - // implementation. - - if resp.StatusCode == http.StatusNotFound { - 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, fmt.Errorf("unexpected status code %v: %v", req.String(), resp.Status) - } - 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, fmt.Errorf("unhandled content range in response: %v", cr) - - } - } else { - // TODO: Should any cases where use of content range - // without the proper header be considered? - // 206 responses? - - // Discard up to offset - // 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, fmt.Errorf("failed to discard to offset: %w", err) - } - if n != offset { - return nil, errors.New("unable to discard to offset") - } - + resp, err := req.doWithRetries(ctx, lastHost, withErrorCheck, withOffsetCheck(offset)) + switch err { + case nil: + // all good + case errContentRangeIgnored: + if parallelism != 1 { + log.G(ctx).WithError(err).Info("remote host ignored content range, forcing parallelism to 1") + parallelism = 1 } + default: + log.G(ctx).WithError(err).Debug("fetch failed") + r.Release(1) + return nil, err } body := resp.Body encoding := strings.FieldsFunc(resp.Header.Get("Content-Encoding"), func(r rune) bool { return r == ' ' || r == '\t' || r == ',' }) + + remaining, _ := strconv.ParseInt(resp.Header.Get("Content-Length"), 10, 0) + if parallelism > 1 && req.body == nil { + // If we have a content length, we can use multiple requests to fetch + // the content in parallel. This will make download of bigger bodies + // faster, at the cost of parallelism more requests and max + // ~(max_parallelism * goroutine footprint) memory usage. The goroutine + // footprint should be: the goroutine stack + pipe buffer size + numChunks := remaining / chunkSize + if numChunks*chunkSize < remaining { + numChunks++ + } + if numChunks < parallelism { + parallelism = numChunks + } + queue := make(chan int64, parallelism) + ctx, cancelCtx := context.WithCancel(ctx) + done := ctx.Done() + readers, writers := make([]io.Reader, numChunks), make([]*pipeWriter, numChunks) + bufPool := newbufferPool(chunkSize) + for i := range numChunks { + readers[i], writers[i] = newPipeWriter(bufPool) + } + go func() { + for i := range numChunks { + select { + case queue <- i: + case <-done: + return // avoid leaking a goroutine if we exit early. + } + } + close(queue) + }() + r.Release(1) + for range parallelism { + go func() { + for i := range queue { // first in first out + copy := func() error { + if err := r.Acquire(ctx, 1); err != nil { + return err + } + defer r.Release(1) + var body io.ReadCloser + if i == 0 { + body = resp.Body + } else { + reqClone := req.clone() + reqClone.setOffset(offset + i*chunkSize) + nresp, err := reqClone.doWithRetries(ctx, lastHost, withErrorCheck) + if err != nil { + _ = writers[i].CloseWithError(err) + select { + case <-done: + return ctx.Err() + default: + cancelCtx() + } + return err + } + body = nresp.Body + } + _, err := io.Copy(writers[i], io.LimitReader(body, chunkSize)) + _ = body.Close() + _ = writers[i].CloseWithError(err) + if err != nil && err != io.EOF { + cancelCtx() + return err + } + return nil + } + if copy() != nil { + return + } + } + }() + } + body = &fnOnClose{ + BeforeClose: func() { + cancelCtx() + }, + ReadCloser: io.NopCloser(io.MultiReader(readers...)), + } + } else { + body = &fnOnClose{ + BeforeClose: func() { + r.Release(1) + }, + ReadCloser: body, + } + } for i := len(encoding) - 1; i >= 0; i-- { algorithm := strings.ToLower(encoding[i]) switch algorithm { case "zstd": - r, err := zstd.NewReader(body) + r, err := zstd.NewReader(body, + zstd.WithDecoderLowmem(false), + ) if err != nil { return nil, err } @@ -356,3 +593,17 @@ func (r dockerFetcher) open(ctx context.Context, req *request, mediatype string, return body, nil } + +type fnOnClose struct { + BeforeClose func() + io.ReadCloser +} + +// Close calls the BeforeClose function before closing the underlying +// ReadCloser. +func (f *fnOnClose) Close() error { + f.BeforeClose() + return f.ReadCloser.Close() +} + +var _ io.ReadCloser = &fnOnClose{} diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/fetcher_fuzz.go b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/fetcher_fuzz.go deleted file mode 100644 index 5da9dca7a6..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/fetcher_fuzz.go +++ /dev/null @@ -1,75 +0,0 @@ -//go:build gofuzz - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 docker - -import ( - "context" - "fmt" - "io" - "net/http" - "net/http/httptest" - "net/url" - "strconv" -) - -func FuzzFetcher(data []byte) int { - dataLen := len(data) - if dataLen == 0 { - return -1 - } - - s := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - rw.Header().Set("content-range", fmt.Sprintf("bytes %d-%d/%d", 0, dataLen-1, dataLen)) - rw.Header().Set("content-length", strconv.Itoa(dataLen)) - rw.Write(data) - })) - defer s.Close() - - u, err := url.Parse(s.URL) - if err != nil { - return 0 - } - - f := dockerFetcher{&dockerBase{ - repository: "nonempty", - }} - host := RegistryHost{ - Client: s.Client(), - Host: u.Host, - Scheme: u.Scheme, - Path: u.Path, - } - - ctx := context.Background() - req := f.request(host, http.MethodGet) - rc, err := f.open(ctx, req, "", 0) - if err != nil { - return 0 - } - b, err := io.ReadAll(rc) - if err != nil { - return 0 - } - - expected := data - if len(b) != len(expected) { - panic("len of request is not equal to len of expected but should be") - } - return 1 -} diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/pusher.go b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/pusher.go index be712a3acf..eac7b56c17 100644 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/pusher.go +++ b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/pusher.go @@ -28,14 +28,15 @@ import ( "sync" "time" - "github.com/containerd/containerd/v2/core/content" - "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/core/remotes" - remoteserrors "github.com/containerd/containerd/v2/core/remotes/errors" "github.com/containerd/errdefs" "github.com/containerd/log" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" + + "github.com/containerd/containerd/v2/core/content" + "github.com/containerd/containerd/v2/core/images" + "github.com/containerd/containerd/v2/core/remotes" + remoteserrors "github.com/containerd/containerd/v2/core/remotes/errors" ) type dockerPusher struct { @@ -115,7 +116,7 @@ func (p dockerPusher) push(ctx context.Context, desc ocispec.Descriptor, ref str log.G(ctx).WithField("url", req.String()).Debugf("checking and pushing to") - resp, err := req.doWithRetries(ctx, nil) + resp, err := req.doWithRetries(ctx, true) if err != nil { if !errors.Is(err, ErrInvalidAuthorization) { return nil, err @@ -176,24 +177,28 @@ func (p dockerPusher) push(ctx context.Context, desc ocispec.Descriptor, ref str // // for the private repo, we should remove mount-from // query and send the request again. - resp, err = preq.doWithRetries(pctx, nil) + resp, err = preq.doWithRetries(pctx, true) if err != nil { - return nil, err + if !errors.Is(err, ErrInvalidAuthorization) { + return nil, fmt.Errorf("pushing with mount from %s: %w", fromRepo, err) + } + log.G(ctx).Debugf("failed to push with mount from repository %s: %v", fromRepo, err) } + if resp != nil { + switch resp.StatusCode { + case http.StatusUnauthorized: + log.G(ctx).Debugf("failed to mount from repository %s, not authorized", fromRepo) - switch resp.StatusCode { - case http.StatusUnauthorized: - log.G(ctx).Debugf("failed to mount from repository %s", fromRepo) - - resp.Body.Close() - resp = nil - case http.StatusCreated: - mountedFrom = path.Join(p.refspec.Hostname(), fromRepo) + resp.Body.Close() + resp = nil + case http.StatusCreated: + mountedFrom = path.Join(p.refspec.Hostname(), fromRepo) + } } } if resp == nil { - resp, err = req.doWithRetries(ctx, nil) + resp, err = req.doWithRetries(ctx, true) if err != nil { if errors.Is(err, ErrInvalidAuthorization) { return nil, fmt.Errorf("push access denied, repository does not exist or may require authorization: %w", err) @@ -285,7 +290,7 @@ func (p dockerPusher) push(ctx context.Context, desc ocispec.Descriptor, ref str req.size = desc.Size go func() { - resp, err := req.doWithRetries(ctx, nil) + resp, err := req.doWithRetries(ctx, true) if err != nil { pushw.setError(err) return diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/registry.go b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/registry.go index 98cafcd069..bbae768b15 100644 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/registry.go +++ b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/registry.go @@ -17,9 +17,11 @@ package docker import ( + "crypto/tls" "errors" "net" "net/http" + "time" ) // HostCapabilities represent the capabilities of the registry @@ -170,7 +172,9 @@ func ConfigureDefaultRegistries(ropts ...RegistryOpt) RegistryHosts { } if config.Client == nil { - config.Client = http.DefaultClient + config.Client = &http.Client{ + Transport: DefaultHTTPTransport(nil), + } } if opts.plainHTTP != nil { @@ -242,3 +246,19 @@ func MatchLocalhost(host string) (bool, error) { return ip.IsLoopback(), nil } + +func DefaultHTTPTransport(defaultTLSConfig *tls.Config) *http.Transport { + return &http.Transport{ + Proxy: http.ProxyFromEnvironment, + DialContext: (&net.Dialer{ + Timeout: 30 * time.Second, + KeepAlive: 30 * time.Second, + FallbackDelay: 300 * time.Millisecond, + }).DialContext, + MaxIdleConns: 10, + IdleConnTimeout: 30 * time.Second, + TLSHandshakeTimeout: 10 * time.Second, + TLSClientConfig: defaultTLSConfig, + ExpectContinueTimeout: 5 * time.Second, + } +} diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/resolver.go b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/resolver.go index dce391c54b..386270ddb6 100644 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/resolver.go +++ b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/resolver.go @@ -19,6 +19,7 @@ package docker import ( "context" "crypto/tls" + "encoding/json" "errors" "fmt" "io" @@ -34,11 +35,12 @@ import ( "github.com/containerd/log" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" + "golang.org/x/sync/semaphore" "github.com/containerd/containerd/v2/core/images" "github.com/containerd/containerd/v2/core/remotes" - "github.com/containerd/containerd/v2/core/remotes/docker/schema1" //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. remoteerrors "github.com/containerd/containerd/v2/core/remotes/errors" + "github.com/containerd/containerd/v2/core/transfer" "github.com/containerd/containerd/v2/pkg/reference" "github.com/containerd/containerd/v2/pkg/tracing" "github.com/containerd/containerd/v2/version" @@ -142,6 +144,7 @@ type dockerResolver struct { header http.Header resolveHeader http.Header tracker StatusTracker + config transfer.ImageResolverOptions } // NewResolver returns a new resolver to a Docker registry @@ -156,9 +159,6 @@ func NewResolver(options ResolverOptions) remotes.Resolver { // make a copy of the headers to avoid race due to concurrent map write options.Headers = options.Headers.Clone() } - if _, ok := options.Headers["User-Agent"]; !ok { - options.Headers.Set("User-Agent", "containerd/"+version.Version) - } resolveHeader := http.Header{} if _, ok := options.Headers["Accept"]; !ok { @@ -232,7 +232,7 @@ func (r *countingReader) Read(p []byte) (int, error) { return n, err } -var _ remotes.Resolver = &dockerResolver{} +var _ remotes.ResolverWithOptions = &dockerResolver{} func (r *dockerResolver) Resolve(ctx context.Context, ref string) (string, ocispec.Descriptor, error) { base, err := r.resolveDockerBase(ref) @@ -307,7 +307,7 @@ func (r *dockerResolver) Resolve(ctx context.Context, ref string) (string, ocisp } log.G(ctx).Debug("resolving") - resp, err := req.doWithRetries(ctx, nil) + resp, err := req.doWithRetries(ctx, i == len(hosts)-1) if err != nil { if errors.Is(err, ErrInvalidAuthorization) { err = fmt.Errorf("pull access denied, repository does not exist or may require authorization: %w", err) @@ -371,7 +371,7 @@ func (r *dockerResolver) Resolve(ctx context.Context, ref string) (string, ocisp req.header[key] = append(req.header[key], value...) } - resp, err := req.doWithRetries(ctx, nil) + resp, err := req.doWithRetries(ctx, true) if err != nil { return "", ocispec.Descriptor{}, err } @@ -387,13 +387,8 @@ func (r *dockerResolver) Resolve(ctx context.Context, ref string) (string, ocisp } if contentType == images.MediaTypeDockerSchema1Manifest { - b, err := schema1.ReadStripSignature(&bodyReader) - if err != nil { - return err - } - - dgst = digest.FromBytes(b) - return nil + return fmt.Errorf("%w: media type %q is no longer supported since containerd v2.0, please rebuild the image as %q or %q", + errdefs.ErrNotImplemented, images.MediaTypeDockerSchema1Manifest, images.MediaTypeDockerSchema2Manifest, ocispec.MediaTypeImageManifest) } dgst, err = digest.FromReader(&bodyReader) @@ -433,6 +428,12 @@ func (r *dockerResolver) Resolve(ctx context.Context, ref string) (string, ocisp return "", ocispec.Descriptor{}, firstErr } +func (r *dockerResolver) SetOptions(options ...transfer.ImageResolverOption) { + for _, opt := range options { + opt(&r.config) + } +} + func (r *dockerResolver) Fetcher(ctx context.Context, ref string) (remotes.Fetcher, error) { base, err := r.resolveDockerBase(ref) if err != nil { @@ -467,10 +468,25 @@ func (r *dockerResolver) resolveDockerBase(ref string) (*dockerBase, error) { } type dockerBase struct { - refspec reference.Spec - repository string - hosts []RegistryHost - header http.Header + refspec reference.Spec + repository string + hosts []RegistryHost + header http.Header + performances transfer.ImageResolverPerformanceSettings + limiter *semaphore.Weighted +} + +func (r *dockerBase) Acquire(ctx context.Context, weight int64) error { + if r.limiter == nil { + return nil + } + return r.limiter.Acquire(ctx, weight) +} + +func (r *dockerBase) Release(weight int64) { + if r.limiter != nil { + r.limiter.Release(weight) + } } func (r *dockerResolver) base(refspec reference.Spec) (*dockerBase, error) { @@ -480,10 +496,12 @@ func (r *dockerResolver) base(refspec reference.Spec) (*dockerBase, error) { return nil, err } return &dockerBase{ - refspec: refspec, - repository: strings.TrimPrefix(refspec.Locator, host+"/"), - hosts: hosts, - header: r.header, + refspec: refspec, + repository: strings.TrimPrefix(refspec.Locator, host+"/"), + hosts: hosts, + header: r.header, + performances: r.config.Performances, + limiter: r.config.DownloadLimiter, }, nil } @@ -505,6 +523,11 @@ func (r *dockerBase) request(host RegistryHost, method string, ps ...string) *re for key, value := range host.Header { header[key] = append(header[key], value...) } + + if len(header.Get("User-Agent")) == 0 { + header.Set("User-Agent", "containerd/"+version.Version) + } + parts := append([]string{"/", host.Path, r.repository}, ps...) p := path.Join(parts...) // Join strips trailing slash, re-add ending "/" if included @@ -562,6 +585,12 @@ type request struct { size int64 } +func (r *request) clone() *request { + res := *r + res.header = r.header.Clone() + return &res +} + func (r *request) do(ctx context.Context) (*http.Response, error) { u := r.host.Scheme + "://" + r.host.Host + r.path req, err := http.NewRequestWithContext(ctx, r.method, u, nil) @@ -617,26 +646,94 @@ func (r *request) do(ctx context.Context) (*http.Response, error) { return resp, nil } -func (r *request) doWithRetries(ctx context.Context, responses []*http.Response) (*http.Response, error) { +type doChecks func(r *request, resp *http.Response) error + +func withErrorCheck(r *request, resp *http.Response) error { + if resp.StatusCode > 299 { + if resp.StatusCode == http.StatusNotFound { + return fmt.Errorf("content at %v not found: %w", r.String(), errdefs.ErrNotFound) + } + var registryErr Errors + if err := json.NewDecoder(resp.Body).Decode(®istryErr); err != nil || registryErr.Len() < 1 { + return fmt.Errorf("unexpected status code %v: %v", r.String(), resp.Status) + } + return fmt.Errorf("unexpected status code %v: %s - Server message: %s", r.String(), resp.Status, registryErr.Error()) + } + return nil +} + +var errContentRangeIgnored = errors.New("content range requests ignored") + +func withOffsetCheck(offset int64) doChecks { + return func(r *request, resp *http.Response) error { + if offset == 0 { + return nil + } + if resp.StatusCode == http.StatusPartialContent { + return nil + } + if cr := resp.Header.Get("Content-Range"); cr != "" { + if !strings.HasPrefix(cr, fmt.Sprintf("bytes %d-", offset)) { + return fmt.Errorf("unhandled content range in response: %v", cr) + } + return nil + } + + // Discard up to offset + // 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 fmt.Errorf("failed to discard to offset: %w", err) + } + if n != offset { + return errors.New("unable to discard to offset") + } + + // content range ignored, we can't do concurrent fetches here. + // return an error to be caught + return errContentRangeIgnored + } +} + +func (r *request) doWithRetries(ctx context.Context, lastHost bool, checks ...doChecks) (resp *http.Response, err error) { + resp, err = r.doWithRetriesInner(ctx, nil, lastHost) + if err != nil { + return nil, err + } + defer func() { + if err != nil && err != errContentRangeIgnored { + resp.Body.Close() + } + }() + for _, check := range checks { + if err := check(r, resp); err != nil { + return resp, err + } + } + + return resp, nil +} + +func (r *request) doWithRetriesInner(ctx context.Context, responses []*http.Response, lastHost bool) (*http.Response, error) { resp, err := r.do(ctx) if err != nil { return nil, err } responses = append(responses, resp) - retry, err := r.retryRequest(ctx, responses) + retry, err := r.retryRequest(ctx, responses, lastHost) if err != nil { resp.Body.Close() return nil, err } if retry { resp.Body.Close() - return r.doWithRetries(ctx, responses) + return r.doWithRetriesInner(ctx, responses, lastHost) } return resp, err } -func (r *request) retryRequest(ctx context.Context, responses []*http.Response) (bool, error) { +func (r *request) retryRequest(ctx context.Context, responses []*http.Response, lastHost bool) (bool, error) { if len(responses) > 5 { return false, nil } @@ -662,9 +759,17 @@ func (r *request) retryRequest(ctx context.Context, responses []*http.Response) } case http.StatusRequestTimeout, http.StatusTooManyRequests: return true, nil + case http.StatusServiceUnavailable, http.StatusGatewayTimeout, http.StatusInternalServerError: + // Do not retry if the same error was seen in the last request + if len(responses) > 1 && responses[len(responses)-2].StatusCode == last.StatusCode { + return false, nil + } + // Only retry if this is the last host that will be attempted + if lastHost { + return true, nil + } } - // TODO: Handle 50x errors accounting for attempt history return false, nil } @@ -672,6 +777,18 @@ func (r *request) String() string { return r.host.Scheme + "://" + r.host.Host + r.path } +func (r *request) setMediaType(mediatype string) { + if mediatype == "" { + r.header.Set("Accept", "*/*") + } else { + r.header.Set("Accept", strings.Join([]string{mediatype, `*/*`}, ", ")) + } +} + +func (r *request) setOffset(offset int64) { + r.header.Set("Range", fmt.Sprintf("bytes=%d-", offset)) +} + func requestFields(req *http.Request) log.Fields { fields := map[string]interface{}{ "request.method": req.Method, diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/schema1/converter.go b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/schema1/converter.go deleted file mode 100644 index e724e4e55a..0000000000 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/schema1/converter.go +++ /dev/null @@ -1,626 +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 schema1 provides a converter to fetch an image formatted in Docker Image Manifest v2, Schema 1. -// -// Deprecated: use images formatted in Docker Image Manifest v2, Schema 2, or OCI Image Spec v1. -package schema1 - -import ( - "bytes" - "context" - "encoding/base64" - "encoding/json" - "errors" - "fmt" - "io" - "os" - "strconv" - "strings" - "sync" - "time" - - "github.com/containerd/containerd/v2/core/content" - "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/core/remotes" - "github.com/containerd/containerd/v2/pkg/archive/compression" - "github.com/containerd/containerd/v2/pkg/deprecation" - "github.com/containerd/containerd/v2/pkg/labels" - "github.com/containerd/errdefs" - "github.com/containerd/log" - digest "github.com/opencontainers/go-digest" - specs "github.com/opencontainers/image-spec/specs-go" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "golang.org/x/sync/errgroup" -) - -const ( - manifestSizeLimit = 8e6 // 8MB - labelDockerSchema1EmptyLayer = "containerd.io/docker.schema1.empty-layer" -) - -type blobState struct { - diffID digest.Digest - empty bool -} - -// Converter converts schema1 manifests to schema2 on fetch -type Converter struct { - contentStore content.Store - fetcher remotes.Fetcher - - pulledManifest *manifest - - mu sync.Mutex - blobMap map[digest.Digest]blobState - layerBlobs map[digest.Digest]ocispec.Descriptor -} - -var ErrDisabled = fmt.Errorf("Pulling Schema 1 images have been deprecated and disabled by default since containerd v2.0. "+ - "As a workaround you may set an environment variable `%s=1`, but this will be completely removed in containerd v2.1.", - deprecation.EnvPullSchema1Image) - -// NewConverter returns a new converter -func NewConverter(contentStore content.Store, fetcher remotes.Fetcher) (*Converter, error) { - s := os.Getenv(deprecation.EnvPullSchema1Image) - if s == "" { - return nil, ErrDisabled - } - enable, err := strconv.ParseBool(s) - if err != nil { - return nil, fmt.Errorf("failed to parse `%s=%s`: %w", deprecation.EnvPullSchema1Image, s, err) - } - if !enable { - return nil, ErrDisabled - } - log.L.Warn(ErrDisabled) - return &Converter{ - contentStore: contentStore, - fetcher: fetcher, - blobMap: map[digest.Digest]blobState{}, - layerBlobs: map[digest.Digest]ocispec.Descriptor{}, - }, nil -} - -// Handle fetching descriptors for a docker media type -func (c *Converter) Handle(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { - switch desc.MediaType { - case images.MediaTypeDockerSchema1Manifest: - if err := c.fetchManifest(ctx, desc); err != nil { - return nil, err - } - - m := c.pulledManifest - if len(m.FSLayers) != len(m.History) { - return nil, errors.New("invalid schema 1 manifest, history and layer mismatch") - } - descs := make([]ocispec.Descriptor, 0, len(c.pulledManifest.FSLayers)) - - for i := range m.FSLayers { - if _, ok := c.blobMap[c.pulledManifest.FSLayers[i].BlobSum]; !ok { - empty, err := isEmptyLayer([]byte(m.History[i].V1Compatibility)) - if err != nil { - return nil, err - } - - // Do no attempt to download a known empty blob - if !empty { - descs = append([]ocispec.Descriptor{ - { - MediaType: images.MediaTypeDockerSchema2LayerGzip, - Digest: c.pulledManifest.FSLayers[i].BlobSum, - Size: -1, - }, - }, descs...) - } - c.blobMap[c.pulledManifest.FSLayers[i].BlobSum] = blobState{ - empty: empty, - } - } - } - return descs, nil - case images.MediaTypeDockerSchema2LayerGzip: - if c.pulledManifest == nil { - return nil, errors.New("manifest required for schema 1 blob pull") - } - return nil, c.fetchBlob(ctx, desc) - default: - return nil, fmt.Errorf("%v not support for schema 1 manifests", desc.MediaType) - } -} - -// ConvertOptions provides options on converting a docker schema1 manifest. -type ConvertOptions struct { - // ManifestMediaType specifies the media type of the manifest OCI descriptor. - ManifestMediaType string - - // ConfigMediaType specifies the media type of the manifest config OCI - // descriptor. - ConfigMediaType string -} - -// ConvertOpt allows configuring a convert operation. -type ConvertOpt func(context.Context, *ConvertOptions) error - -// UseDockerSchema2 is used to indicate that a schema1 manifest should be -// converted into the media types for a docker schema2 manifest. -func UseDockerSchema2() ConvertOpt { - return func(ctx context.Context, o *ConvertOptions) error { - o.ManifestMediaType = images.MediaTypeDockerSchema2Manifest - o.ConfigMediaType = images.MediaTypeDockerSchema2Config - return nil - } -} - -// Convert a docker manifest to an OCI descriptor -func (c *Converter) Convert(ctx context.Context, opts ...ConvertOpt) (ocispec.Descriptor, error) { - co := ConvertOptions{ - ManifestMediaType: ocispec.MediaTypeImageManifest, - ConfigMediaType: ocispec.MediaTypeImageConfig, - } - for _, opt := range opts { - if err := opt(ctx, &co); err != nil { - return ocispec.Descriptor{}, err - } - } - - history, diffIDs, err := c.schema1ManifestHistory() - if err != nil { - 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{}, fmt.Errorf("failed to unmarshal image from schema 1 history: %w", err) - } - - img.History = history - img.RootFS = ocispec.RootFS{ - Type: "layers", - DiffIDs: diffIDs, - } - - b, err := json.MarshalIndent(img, "", " ") - if err != nil { - return ocispec.Descriptor{}, fmt.Errorf("failed to marshal image: %w", err) - } - - config := ocispec.Descriptor{ - MediaType: co.ConfigMediaType, - Digest: digest.Canonical.FromBytes(b), - Size: int64(len(b)), - } - - layers := make([]ocispec.Descriptor, len(diffIDs)) - for i, diffID := range diffIDs { - layers[i] = c.layerBlobs[diffID] - } - - manifest := ocispec.Manifest{ - Versioned: specs.Versioned{ - SchemaVersion: 2, - }, - Config: config, - Layers: layers, - } - - mb, err := json.MarshalIndent(manifest, "", " ") - if err != nil { - return ocispec.Descriptor{}, fmt.Errorf("failed to marshal image: %w", err) - } - - desc := ocispec.Descriptor{ - MediaType: co.ManifestMediaType, - Digest: digest.Canonical.FromBytes(mb), - Size: int64(len(mb)), - } - - labels := map[string]string{} - labels["containerd.io/gc.ref.content.0"] = manifest.Config.Digest.String() - for i, ch := range manifest.Layers { - labels[fmt.Sprintf("containerd.io/gc.ref.content.%d", i+1)] = ch.Digest.String() - } - - 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{}, 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{}, fmt.Errorf("failed to write image config: %w", err) - } - - return desc, nil -} - -// ReadStripSignature reads in a schema1 manifest and returns a byte array -// with the "signatures" field stripped -func ReadStripSignature(schema1Blob io.Reader) ([]byte, error) { - b, err := io.ReadAll(io.LimitReader(schema1Blob, manifestSizeLimit)) // limit to 8MB - if err != nil { - return nil, err - } - - return stripSignature(b) -} - -func (c *Converter) fetchManifest(ctx context.Context, desc ocispec.Descriptor) error { - log.G(ctx).Debug("fetch schema 1") - - rc, err := c.fetcher.Fetch(ctx, desc) - if err != nil { - return err - } - - b, err := ReadStripSignature(rc) - rc.Close() - if err != nil { - return err - } - - var m manifest - if err := json.Unmarshal(b, &m); err != nil { - return err - } - if len(m.Manifests) != 0 || len(m.Layers) != 0 { - return errors.New("converter: expected schema1 document but found extra keys") - } - c.pulledManifest = &m - - return nil -} - -func (c *Converter) fetchBlob(ctx context.Context, desc ocispec.Descriptor) error { - log.G(ctx).Debug("fetch blob") - - var ( - ref = remotes.MakeRefKey(ctx, desc) - calc = newBlobStateCalculator() - compressMethod = compression.Gzip - ) - - // size may be unknown, set to zero for content ingest - ingestDesc := desc - if ingestDesc.Size == -1 { - ingestDesc.Size = 0 - } - - cw, err := content.OpenWriter(ctx, c.contentStore, content.WithRef(ref), content.WithDescriptor(ingestDesc)) - if err != nil { - if !errdefs.IsAlreadyExists(err) { - return err - } - - reuse, err := c.reuseLabelBlobState(ctx, desc) - if err != nil { - return err - } - - if reuse { - return nil - } - - ra, err := c.contentStore.ReaderAt(ctx, desc) - if err != nil { - return err - } - defer ra.Close() - - r, err := compression.DecompressStream(content.NewReader(ra)) - if err != nil { - return err - } - - compressMethod = r.GetCompression() - _, err = io.Copy(calc, r) - r.Close() - if err != nil { - return err - } - } else { - defer cw.Close() - - rc, err := c.fetcher.Fetch(ctx, desc) - if err != nil { - return err - } - defer rc.Close() - - eg, _ := errgroup.WithContext(ctx) - pr, pw := io.Pipe() - - eg.Go(func() error { - r, err := compression.DecompressStream(pr) - if err != nil { - return err - } - - compressMethod = r.GetCompression() - _, err = io.Copy(calc, r) - r.Close() - pr.CloseWithError(err) - return err - }) - - eg.Go(func() error { - defer pw.Close() - - return content.Copy(ctx, cw, io.TeeReader(rc, pw), ingestDesc.Size, ingestDesc.Digest) - }) - - if err := eg.Wait(); err != nil { - return err - } - } - - if desc.Size == -1 { - info, err := c.contentStore.Info(ctx, desc.Digest) - if err != nil { - return fmt.Errorf("failed to get blob info: %w", err) - } - desc.Size = info.Size - } - - if compressMethod == compression.Uncompressed { - log.G(ctx).WithField("id", desc.Digest).Debugf("changed media type for uncompressed schema1 layer blob") - desc.MediaType = images.MediaTypeDockerSchema2Layer - } - - state := calc.State() - - cinfo := content.Info{ - Digest: desc.Digest, - Labels: map[string]string{ - labels.LabelUncompressed: state.diffID.String(), - labelDockerSchema1EmptyLayer: strconv.FormatBool(state.empty), - }, - } - - if _, err := c.contentStore.Update(ctx, cinfo, "labels."+labels.LabelUncompressed, fmt.Sprintf("labels.%s", labelDockerSchema1EmptyLayer)); err != nil { - return fmt.Errorf("failed to update uncompressed label: %w", err) - } - - c.mu.Lock() - c.blobMap[desc.Digest] = state - c.layerBlobs[state.diffID] = desc - c.mu.Unlock() - - return nil -} - -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, fmt.Errorf("failed to get blob info: %w", err) - } - desc.Size = cinfo.Size - - diffID, ok := cinfo.Labels[labels.LabelUncompressed] - if !ok { - return false, nil - } - - emptyVal, ok := cinfo.Labels[labelDockerSchema1EmptyLayer] - if !ok { - return false, nil - } - - isEmpty, err := strconv.ParseBool(emptyVal) - if err != nil { - log.G(ctx).WithField("id", desc.Digest).Warnf("failed to parse bool from label %s: %v", labelDockerSchema1EmptyLayer, isEmpty) - return false, nil - } - - bState := blobState{empty: isEmpty} - - if bState.diffID, err = digest.Parse(diffID); err != nil { - log.G(ctx).WithField("id", desc.Digest).Warnf("failed to parse digest from label %s: %v", labels.LabelUncompressed, diffID) - return false, nil - } - - // NOTE: there is no need to read header to get compression method - // because there are only two kinds of methods. - if bState.diffID == desc.Digest { - desc.MediaType = images.MediaTypeDockerSchema2Layer - } else { - desc.MediaType = images.MediaTypeDockerSchema2LayerGzip - } - - c.mu.Lock() - c.blobMap[desc.Digest] = bState - c.layerBlobs[bState.diffID] = desc - c.mu.Unlock() - return true, nil -} - -func (c *Converter) schema1ManifestHistory() ([]ocispec.History, []digest.Digest, error) { - if c.pulledManifest == nil { - return nil, nil, errors.New("missing schema 1 manifest for conversion") - } - m := *c.pulledManifest - - if len(m.History) == 0 { - return nil, nil, errors.New("no history") - } - - history := make([]ocispec.History, len(m.History)) - diffIDs := []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, fmt.Errorf("failed to unmarshal history: %w", err) - } - - blobSum := m.FSLayers[i].BlobSum - - state := c.blobMap[blobSum] - - history[len(history)-i-1] = ocispec.History{ - Author: h.Author, - Comment: h.Comment, - Created: &h.Created, - CreatedBy: strings.Join(h.ContainerConfig.Cmd, " "), - EmptyLayer: state.empty, - } - - if !state.empty { - diffIDs = append([]digest.Digest{state.diffID}, diffIDs...) - - } - } - - return history, diffIDs, nil -} - -type fsLayer struct { - BlobSum digest.Digest `json:"blobSum"` -} - -type history struct { - V1Compatibility string `json:"v1Compatibility"` -} - -type manifest struct { - FSLayers []fsLayer `json:"fsLayers"` - History []history `json:"history"` - Layers json.RawMessage `json:"layers,omitempty"` // OCI manifest - Manifests json.RawMessage `json:"manifests,omitempty"` // OCI index -} - -type v1History struct { - Author string `json:"author,omitempty"` - Created time.Time `json:"created"` - Comment string `json:"comment,omitempty"` - ThrowAway *bool `json:"throwaway,omitempty"` - Size *int `json:"Size,omitempty"` // used before ThrowAway field - ContainerConfig struct { - Cmd []string `json:"Cmd,omitempty"` - } `json:"container_config,omitempty"` -} - -// isEmptyLayer returns whether the v1 compatibility history describes an -// empty layer. A return value of true indicates the layer is empty, -// however false does not indicate non-empty. -func isEmptyLayer(compatHistory []byte) (bool, error) { - var h v1History - if err := json.Unmarshal(compatHistory, &h); err != nil { - return false, err - } - - if h.ThrowAway != nil { - return *h.ThrowAway, nil - } - if h.Size != nil { - return *h.Size == 0, nil - } - - // If no `Size` or `throwaway` field is given, then - // it cannot be determined whether the layer is empty - // from the history, return false - return false, nil -} - -type signature struct { - Signatures []jsParsedSignature `json:"signatures"` -} - -type jsParsedSignature struct { - Protected string `json:"protected"` -} - -type protectedBlock struct { - Length int `json:"formatLength"` - Tail string `json:"formatTail"` -} - -// joseBase64UrlDecode decodes the given string using the standard base64 url -// decoder but first adds the appropriate number of trailing '=' characters in -// accordance with the jose specification. -// http://tools.ietf.org/html/draft-ietf-jose-json-web-signature-31#section-2 -func joseBase64UrlDecode(s string) ([]byte, error) { - switch len(s) % 4 { - case 0: - case 2: - s += "==" - case 3: - s += "=" - default: - return nil, errors.New("illegal base64url string") - } - return base64.URLEncoding.DecodeString(s) -} - -func stripSignature(b []byte) ([]byte, error) { - var sig signature - if err := json.Unmarshal(b, &sig); err != nil { - return nil, err - } - if len(sig.Signatures) == 0 { - return nil, errors.New("no signatures") - } - pb, err := joseBase64UrlDecode(sig.Signatures[0].Protected) - if err != nil { - return nil, fmt.Errorf("could not decode %s: %w", sig.Signatures[0].Protected, err) - } - - var protected protectedBlock - if err := json.Unmarshal(pb, &protected); err != nil { - return nil, err - } - - if protected.Length > len(b) { - return nil, errors.New("invalid protected length block") - } - - tail, err := joseBase64UrlDecode(protected.Tail) - if err != nil { - return nil, fmt.Errorf("invalid tail base 64 value: %w", err) - } - - return append(b[:protected.Length], tail...), nil -} - -type blobStateCalculator struct { - empty bool - digester digest.Digester -} - -func newBlobStateCalculator() *blobStateCalculator { - return &blobStateCalculator{ - empty: true, - digester: digest.Canonical.Digester(), - } -} - -func (c *blobStateCalculator) Write(p []byte) (int, error) { - if c.empty { - for _, b := range p { - if b != 0x00 { - c.empty = false - break - } - } - } - return c.digester.Hash().Write(p) -} - -func (c *blobStateCalculator) State() blobState { - return blobState{ - empty: c.empty, - diffID: c.digester.Digest(), - } -} diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/scope.go b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/scope.go index 8135498bd9..ed38318631 100644 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/scope.go +++ b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/scope.go @@ -88,7 +88,7 @@ func GetTokenScopes(ctx context.Context, common []string) []string { 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/) + // Note: this comparison is unaware of the scope grammar (https://distribution.github.io/distribution/spec/auth/scope/) // So, "repository:foo/bar:pull,push" != "repository:foo/bar:push,pull", although semantically they are equal. if scopes[l] == scopes[idx] { continue diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/resolver.go b/vendor/github.com/containerd/containerd/v2/core/remotes/resolver.go index c39b93785e..66a2acdb4a 100644 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/resolver.go +++ b/vendor/github.com/containerd/containerd/v2/core/remotes/resolver.go @@ -21,6 +21,7 @@ import ( "io" "github.com/containerd/containerd/v2/core/content" + "github.com/containerd/containerd/v2/core/transfer" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) @@ -51,6 +52,12 @@ type Resolver interface { Pusher(ctx context.Context, ref string) (Pusher, error) } +// ResolverWithOptions is a Resolver that also supports setting options. +type ResolverWithOptions interface { + Resolver + SetOptions(options ...transfer.ImageResolverOption) +} + // Fetcher fetches content. // A fetcher implementation may implement the FetcherByDigest interface too. type Fetcher interface { diff --git a/vendor/github.com/containerd/containerd/v2/core/sandbox/helpers.go b/vendor/github.com/containerd/containerd/v2/core/sandbox/helpers.go index 86e6fa1130..e41eb03498 100644 --- a/vendor/github.com/containerd/containerd/v2/core/sandbox/helpers.go +++ b/vendor/github.com/containerd/containerd/v2/core/sandbox/helpers.go @@ -53,7 +53,6 @@ func FromProto(sandboxpb *types.Sandbox) Sandbox { extensions := make(map[string]typeurl.Any) for k, v := range sandboxpb.Extensions { - v := v extensions[k] = v } diff --git a/vendor/github.com/containerd/containerd/v2/core/transfer/streaming/writer.go b/vendor/github.com/containerd/containerd/v2/core/transfer/streaming/writer.go index 4e13b33bb2..77e2437dbd 100644 --- a/vendor/github.com/containerd/containerd/v2/core/transfer/streaming/writer.go +++ b/vendor/github.com/containerd/containerd/v2/core/transfer/streaming/writer.go @@ -56,7 +56,7 @@ func WriteByteStream(ctx context.Context, stream streaming.Stream) io.WriteClose } switch v := i.(type) { case *transferapi.WindowUpdate: - atomic.AddInt32(&wbs.remaining, v.Update) + wbs.remaining.Add(v.Update) select { case <-ctx.Done(): return @@ -76,13 +76,13 @@ func WriteByteStream(ctx context.Context, stream streaming.Stream) io.WriteClose type writeByteStream struct { ctx context.Context stream streaming.Stream - remaining int32 + remaining atomic.Int32 updated chan struct{} } func (wbs *writeByteStream) Write(p []byte) (n int, err error) { for len(p) > 0 { - remaining := atomic.LoadInt32(&wbs.remaining) + remaining := wbs.remaining.Load() if remaining == 0 { // Don't wait for window update since there are remaining select { @@ -120,7 +120,7 @@ func (wbs *writeByteStream) Write(p []byte) (n int, err error) { } n += int(max) p = p[max:] - atomic.AddInt32(&wbs.remaining, -1*max) + wbs.remaining.Add(-1 * max) } return } diff --git a/vendor/github.com/containerd/containerd/v2/core/transfer/transfer.go b/vendor/github.com/containerd/containerd/v2/core/transfer/transfer.go index 0329bfcfbb..cd4a4963aa 100644 --- a/vendor/github.com/containerd/containerd/v2/core/transfer/transfer.go +++ b/vendor/github.com/containerd/containerd/v2/core/transfer/transfer.go @@ -20,6 +20,8 @@ import ( "context" "io" + "golang.org/x/sync/semaphore" + ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/containerd/containerd/v2/core/content" @@ -34,6 +36,41 @@ type ImageResolver interface { Resolve(ctx context.Context) (name string, desc ocispec.Descriptor, err error) } +type ImageResolverOptionSetter interface { + ImageResolver + SetResolverOptions(opts ...ImageResolverOption) +} + +type ImageResolverOption func(*ImageResolverOptions) + +type ImageResolverOptions struct { + DownloadLimiter *semaphore.Weighted + Performances ImageResolverPerformanceSettings +} + +type ImageResolverPerformanceSettings struct { + MaxConcurrentDownloads int + ConcurrentLayerFetchBuffer int +} + +func WithDownloadLimiter(limiter *semaphore.Weighted) ImageResolverOption { + return func(opts *ImageResolverOptions) { + opts.DownloadLimiter = limiter + } +} + +func WithMaxConcurrentDownloads(maxConcurrentDownloads int) ImageResolverOption { + return func(opts *ImageResolverOptions) { + opts.Performances.MaxConcurrentDownloads = maxConcurrentDownloads + } +} + +func WithConcurrentLayerFetchBuffer(ConcurrentLayerFetchBuffer int) ImageResolverOption { + return func(opts *ImageResolverOptions) { + opts.Performances.ConcurrentLayerFetchBuffer = ConcurrentLayerFetchBuffer + } +} + type ImageFetcher interface { ImageResolver diff --git a/vendor/github.com/containerd/containerd/v2/core/unpack/unpacker.go b/vendor/github.com/containerd/containerd/v2/core/unpack/unpacker.go index 90385856a6..a1c49e23b8 100644 --- a/vendor/github.com/containerd/containerd/v2/core/unpack/unpacker.go +++ b/vendor/github.com/containerd/containerd/v2/core/unpack/unpacker.go @@ -28,6 +28,15 @@ import ( "sync/atomic" "time" + "github.com/containerd/errdefs" + "github.com/containerd/log" + "github.com/containerd/platforms" + "github.com/opencontainers/go-digest" + "github.com/opencontainers/image-spec/identity" + ocispec "github.com/opencontainers/image-spec/specs-go/v1" + "golang.org/x/sync/errgroup" + "golang.org/x/sync/semaphore" + "github.com/containerd/containerd/v2/core/content" "github.com/containerd/containerd/v2/core/diff" "github.com/containerd/containerd/v2/core/images" @@ -37,14 +46,6 @@ import ( "github.com/containerd/containerd/v2/internal/kmutex" "github.com/containerd/containerd/v2/pkg/labels" "github.com/containerd/containerd/v2/pkg/tracing" - "github.com/containerd/errdefs" - "github.com/containerd/log" - "github.com/containerd/platforms" - "github.com/opencontainers/go-digest" - "github.com/opencontainers/image-spec/identity" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "golang.org/x/sync/errgroup" - "golang.org/x/sync/semaphore" ) const ( @@ -71,12 +72,21 @@ type unpackerConfig struct { type Platform struct { Platform platforms.Matcher - SnapshotterKey string - Snapshotter snapshots.Snapshotter - SnapshotOpts []snapshots.Opt + SnapshotterKey string + Snapshotter snapshots.Snapshotter + SnapshotOpts []snapshots.Opt + SnapshotterExports map[string]string Applier diff.Applier ApplyOpts []diff.ApplyOpt + + // ConfigType is the supported config type to be considered for unpacking + // Defaults to OCI image config + ConfigType string + + // LayerTypes are the supported types to be considered layers + // Defaults to OCI image layers + LayerTypes []string } type UnpackerOpt func(*unpackerConfig) error @@ -125,7 +135,7 @@ func WithDuplicationSuppressor(d kmutex.KeyedLocker) UnpackerOpt { type Unpacker struct { unpackerConfig - unpacks int32 + unpacks atomic.Int32 ctx context.Context eg *errgroup.Group } @@ -163,6 +173,26 @@ func (u *Unpacker) Unpack(h images.Handler) images.Handler { lock sync.Mutex layers = map[digest.Digest][]ocispec.Descriptor{} ) + + var layerTypes map[string]bool + var configTypes map[string]bool + for _, p := range u.platforms { + if p.ConfigType != "" { + if configTypes == nil { + configTypes = make(map[string]bool) + } + configTypes[p.ConfigType] = true + } + if len(p.LayerTypes) > 0 { + if layerTypes == nil { + layerTypes = make(map[string]bool) + } + for _, t := range p.LayerTypes { + layerTypes[t] = true + } + } + } + return images.HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { ctx, span := tracing.StartSpan(ctx, tracing.Name(unpackSpanPrefix, "UnpackHandler")) defer span.End() @@ -188,7 +218,7 @@ func (u *Unpacker) Unpack(h images.Handler) images.Handler { span.SetAttributes( tracing.Attribute("descriptor.child."+strconv.Itoa(i), []string{child.MediaType, child.Digest.String()}), ) - if images.IsLayerType(child.MediaType) { + if images.IsLayerType(child.MediaType) || layerTypes[child.MediaType] { manifestLayers = append(manifestLayers, child) } else { nonLayers = append(nonLayers, child) @@ -202,7 +232,7 @@ func (u *Unpacker) Unpack(h images.Handler) images.Handler { lock.Unlock() children = nonLayers - } else if images.IsConfigType(desc.MediaType) { + } else if images.IsConfigType(desc.MediaType) || configTypes[desc.MediaType] { lock.Lock() l := layers[desc.Digest] lock.Unlock() @@ -223,10 +253,20 @@ func (u *Unpacker) Wait() (Result, error) { return Result{}, err } return Result{ - Unpacks: int(u.unpacks), + Unpacks: int(u.unpacks.Load()), }, nil } +// unpackConfig is a subset of the OCI config for resolving rootfs and platform, +// any config type which supports the platform and rootfs field can be supported. +type unpackConfig struct { + // Platform describes the platform which the image in the manifest runs on. + ocispec.Platform + + // RootFS references the layer content addresses used by the image. + RootFS ocispec.RootFS `json:"rootfs"` +} + func (u *Unpacker) unpack( h images.Handler, config ocispec.Descriptor, @@ -241,10 +281,11 @@ func (u *Unpacker) unpack( return err } - var i ocispec.Image + var i unpackConfig if err := json.Unmarshal(p, &i); err != nil { return fmt.Errorf("unmarshal image config: %w", err) } + diffIDs := i.RootFS.DiffIDs if len(layers) != len(diffIDs) { return fmt.Errorf("number of layers and diffIDs don't match: %d != %d", len(layers), len(diffIDs)) @@ -255,6 +296,13 @@ func (u *Unpacker) unpack( imgPlatform := platforms.Normalize(i.Platform) for _, up := range u.platforms { + if up.ConfigType != "" && up.ConfigType != config.MediaType { + continue + } + // "layers" is only supported rootfs value for OCI images + if (up.ConfigType == "" || images.IsConfigType(up.ConfigType)) && i.RootFS.Type != "" && i.RootFS.Type != "layers" { + continue + } if up.Platform.Match(imgPlatform) { unpack = up break @@ -266,15 +314,13 @@ func (u *Unpacker) unpack( return u.fetch(ctx, h, layers, nil) } - atomic.AddInt32(&u.unpacks, 1) + u.unpacks.Add(1) var ( sn = unpack.Snapshotter a = unpack.Applier cs = u.content - chain []digest.Digest - fetchOffset int fetchC []chan struct{} fetchErr chan error @@ -285,10 +331,17 @@ func (u *Unpacker) unpack( ctx, cancel := context.WithCancel(ctx) defer cancel() + // pre-calculate chain ids for each layer + chainIDs := make([]digest.Digest, len(diffIDs)) + copy(chainIDs, diffIDs) + chainIDs = identity.ChainIDs(chainIDs) + doUnpackFn := func(i int, desc ocispec.Descriptor) error { - parent := identity.ChainID(chain) - chain = append(chain, diffIDs[i]) - chainID := identity.ChainID(chain).String() + var parent string + if i > 0 { + parent = chainIDs[i-1].String() + } + chainID := chainIDs[i].String() unlock, err := u.lockSnChainID(ctx, chainID, unpack.SnapshotterKey) if err != nil { @@ -312,7 +365,7 @@ func (u *Unpacker) unpack( for try := 1; try <= 3; try++ { // Prepare snapshot with from parent, label as root key = fmt.Sprintf(snapshots.UnpackKeyFormat, uniquePart(), chainID) - mounts, err = sn.Prepare(ctx, key, parent.String(), opts...) + mounts, err = sn.Prepare(ctx, key, parent, opts...) if err != nil { if errdefs.IsAlreadyExists(err) { if _, err := sn.Stat(ctx, chainID); err != nil { @@ -424,7 +477,10 @@ func (u *Unpacker) unpack( }).Debug("layer unpacked") } - chainID := identity.ChainID(chain).String() + var chainID string + if len(chainIDs) > 0 { + chainID = chainIDs[len(chainIDs)-1].String() + } cinfo := content.Info{ Digest: config.Digest, Labels: map[string]string{ @@ -453,7 +509,6 @@ func (u *Unpacker) fetch(ctx context.Context, h images.Handler, layers []ocispec tracing.Attribute("layer.media.size", desc.Size), tracing.Attribute("layer.media.digest", desc.Digest.String()), ) - desc := desc var ch chan struct{} if done != nil { ch = done[i] diff --git a/vendor/github.com/containerd/containerd/v2/defaults/defaults_darwin.go b/vendor/github.com/containerd/containerd/v2/defaults/defaults_darwin.go index 1391884cde..192abcdde7 100644 --- a/vendor/github.com/containerd/containerd/v2/defaults/defaults_darwin.go +++ b/vendor/github.com/containerd/containerd/v2/defaults/defaults_darwin.go @@ -17,21 +17,6 @@ package defaults const ( - // DefaultRootDir is the default location used by containerd to store - // persistent data - DefaultRootDir = "/var/lib/containerd" - // DefaultStateDir is the default location used by containerd to store - // transient data - DefaultStateDir = "/var/run/containerd" - // DefaultAddress is the default unix socket address - DefaultAddress = "/var/run/containerd/containerd.sock" - // DefaultDebugAddress is the default unix socket address for pprof data - DefaultDebugAddress = "/var/run/containerd/debug.sock" - // DefaultFIFODir is the default location used by client-side cio library - // to store FIFOs. - DefaultFIFODir = "/var/run/containerd/fifo" // DefaultRuntime would be a multiple of choices, thus empty DefaultRuntime = "" - // DefaultConfigDir is the default location for config files. - DefaultConfigDir = "/etc/containerd" ) diff --git a/vendor/github.com/containerd/containerd/v2/defaults/defaults_differ_windows.go b/vendor/github.com/containerd/containerd/v2/defaults/defaults_differ_windows.go deleted file mode 100644 index 0762d259ee..0000000000 --- a/vendor/github.com/containerd/containerd/v2/defaults/defaults_differ_windows.go +++ /dev/null @@ -1,23 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package defaults - -const ( - // DefaultDiffer will set the default differ for the platform. - // This differ should be compatible with the windows snapshotter. - DefaultDiffer = "windows" -) diff --git a/vendor/github.com/containerd/containerd/v2/defaults/defaults_linux.go b/vendor/github.com/containerd/containerd/v2/defaults/defaults_linux.go index 7187c5a767..dc1ff0909c 100644 --- a/vendor/github.com/containerd/containerd/v2/defaults/defaults_linux.go +++ b/vendor/github.com/containerd/containerd/v2/defaults/defaults_linux.go @@ -17,6 +17,22 @@ package defaults const ( + // DefaultAddress is the default unix socket address + DefaultAddress = "/run/containerd/containerd.sock" + // DefaultDebugAddress is the default unix socket address for pprof data + DefaultDebugAddress = "/run/containerd/debug.sock" + // DefaultFIFODir is the default location used by client-side cio library + // to store FIFOs. + DefaultFIFODir = "/run/containerd/fifo" // DefaultRuntime is the default linux runtime DefaultRuntime = "io.containerd.runc.v2" + // DefaultSnapshotter will set the default snapshotter for the platform. + // This will be based on the client compilation target, so take that into + // account when choosing this value. + DefaultSnapshotter = "overlayfs" + // DefaultStateDir is the default location used by containerd to store + // transient data + DefaultStateDir = "/run/containerd" + // DefaultDiffer will set the default differ for the platform. + DefaultDiffer = "walking" ) diff --git a/vendor/github.com/containerd/containerd/v2/defaults/defaults_snapshotter_linux.go b/vendor/github.com/containerd/containerd/v2/defaults/defaults_snapshotter_linux.go deleted file mode 100644 index 84f9f4af66..0000000000 --- a/vendor/github.com/containerd/containerd/v2/defaults/defaults_snapshotter_linux.go +++ /dev/null @@ -1,26 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package defaults - -const ( - // DefaultSnapshotter will set the default snapshotter for the platform. - // This will be based on the client compilation target, so take that into - // account when choosing this value. - DefaultSnapshotter = "overlayfs" - // DefaultDiffer will set the default differ for the platform. - DefaultDiffer = "walking" -) diff --git a/vendor/github.com/containerd/containerd/v2/defaults/defaults_snapshotter_windows.go b/vendor/github.com/containerd/containerd/v2/defaults/defaults_snapshotter_windows.go deleted file mode 100644 index 37e5f7574d..0000000000 --- a/vendor/github.com/containerd/containerd/v2/defaults/defaults_snapshotter_windows.go +++ /dev/null @@ -1,24 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package defaults - -const ( - // DefaultSnapshotter will set the default snapshotter for the platform. - // This will be based on the client compilation target, so take that into - // account when choosing this value. - DefaultSnapshotter = "windows" -) diff --git a/vendor/github.com/containerd/containerd/v2/defaults/defaults_unix.go b/vendor/github.com/containerd/containerd/v2/defaults/defaults_unix.go index e68a522cad..41d00b943d 100644 --- a/vendor/github.com/containerd/containerd/v2/defaults/defaults_unix.go +++ b/vendor/github.com/containerd/containerd/v2/defaults/defaults_unix.go @@ -1,4 +1,4 @@ -//go:build !windows && !darwin +//go:build unix /* Copyright The containerd Authors. @@ -19,19 +19,9 @@ package defaults const ( + // DefaultConfigDir is the default location for config files. + DefaultConfigDir = "/etc/containerd" // DefaultRootDir is the default location used by containerd to store // persistent data DefaultRootDir = "/var/lib/containerd" - // DefaultStateDir is the default location used by containerd to store - // transient data - DefaultStateDir = "/run/containerd" - // DefaultAddress is the default unix socket address - DefaultAddress = "/run/containerd/containerd.sock" - // DefaultDebugAddress is the default unix socket address for pprof data - DefaultDebugAddress = "/run/containerd/debug.sock" - // DefaultFIFODir is the default location used by client-side cio library - // to store FIFOs. - DefaultFIFODir = "/run/containerd/fifo" - // DefaultConfigDir is the default location for config files. - DefaultConfigDir = "/etc/containerd" ) diff --git a/vendor/github.com/containerd/containerd/v2/defaults/defaults_snapshotter_unix.go b/vendor/github.com/containerd/containerd/v2/defaults/defaults_unix_nolinux.go similarity index 63% rename from vendor/github.com/containerd/containerd/v2/defaults/defaults_snapshotter_unix.go rename to vendor/github.com/containerd/containerd/v2/defaults/defaults_unix_nolinux.go index 328b5eae6c..8e263eca6c 100644 --- a/vendor/github.com/containerd/containerd/v2/defaults/defaults_snapshotter_unix.go +++ b/vendor/github.com/containerd/containerd/v2/defaults/defaults_unix_nolinux.go @@ -1,4 +1,4 @@ -//go:build darwin || freebsd || solaris +//go:build unix && !linux /* Copyright The containerd Authors. @@ -19,10 +19,20 @@ package defaults const ( + // DefaultAddress is the default unix socket address + DefaultAddress = "/var/run/containerd/containerd.sock" + // DefaultDebugAddress is the default unix socket address for pprof data + DefaultDebugAddress = "/var/run/containerd/debug.sock" + // DefaultFIFODir is the default location used by client-side cio library + // to store FIFOs. + DefaultFIFODir = "/var/run/containerd/fifo" // DefaultSnapshotter will set the default snapshotter for the platform. // This will be based on the client compilation target, so take that into // account when choosing this value. DefaultSnapshotter = "native" + // DefaultStateDir is the default location used by containerd to store + // transient data + DefaultStateDir = "/var/run/containerd" // DefaultDiffer will set the default differ for the platform. DefaultDiffer = "walking" ) diff --git a/vendor/github.com/containerd/containerd/v2/defaults/defaults_windows.go b/vendor/github.com/containerd/containerd/v2/defaults/defaults_windows.go index 9f4bed8b07..9f01c8fb88 100644 --- a/vendor/github.com/containerd/containerd/v2/defaults/defaults_windows.go +++ b/vendor/github.com/containerd/containerd/v2/defaults/defaults_windows.go @@ -38,9 +38,16 @@ const ( DefaultAddress = `\\.\pipe\containerd-containerd` // DefaultDebugAddress is the default winpipe address for pprof data DefaultDebugAddress = `\\.\pipe\containerd-debug` + // DefaultDiffer will set the default differ for the platform. + // This differ should be compatible with the windows snapshotter. + DefaultDiffer = "windows" // DefaultFIFODir is the default location used by client-side cio library // to store FIFOs. Unused on Windows. DefaultFIFODir = "" // DefaultRuntime is the default windows runtime DefaultRuntime = "io.containerd.runhcs.v1" + // DefaultSnapshotter will set the default snapshotter for the platform. + // This will be based on the client compilation target, so take that into + // account when choosing this value. + DefaultSnapshotter = "windows" ) diff --git a/vendor/github.com/containerd/containerd/v2/internal/lazyregexp/lazyregexp.go b/vendor/github.com/containerd/containerd/v2/internal/lazyregexp/lazyregexp.go new file mode 100644 index 0000000000..08d890f313 --- /dev/null +++ b/vendor/github.com/containerd/containerd/v2/internal/lazyregexp/lazyregexp.go @@ -0,0 +1,86 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +// Copyright 2018 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. + +// Code below was largely copied from golang.org/x/mod@v0.22; +// https://github.com/golang/mod/blob/v0.22.0/internal/lazyregexp/lazyre.go +// with some additional methods added. + +// Package lazyregexp is a thin wrapper over regexp, allowing the use of global +// regexp variables without forcing them to be compiled at init. +package lazyregexp + +import ( + "os" + "regexp" + "strings" + "sync" +) + +// Regexp is a wrapper around [regexp.Regexp], where the underlying regexp will be +// compiled the first time it is needed. +type Regexp struct { + str string + once sync.Once + rx *regexp.Regexp +} + +func (re *Regexp) re() *regexp.Regexp { + re.once.Do(re.build) + return re.rx +} + +func (re *Regexp) build() { + re.rx = regexp.MustCompile(re.str) + re.str = "" +} + +func (re *Regexp) FindStringIndex(s string) (loc []int) { + return re.re().FindStringIndex(s) +} + +func (re *Regexp) FindStringSubmatch(s string) []string { + return re.re().FindStringSubmatch(s) +} + +func (re *Regexp) MatchString(s string) bool { + return re.re().MatchString(s) +} + +func (re *Regexp) ReplaceAll(src, repl []byte) []byte { + return re.re().ReplaceAll(src, repl) +} + +func (re *Regexp) String() string { + return re.re().String() +} + +var inTest = len(os.Args) > 0 && strings.HasSuffix(strings.TrimSuffix(os.Args[0], ".exe"), ".test") + +// New creates a new lazy regexp, delaying the compiling work until it is first +// needed. If the code is being run as part of tests, the regexp compiling will +// happen immediately. +func New(str string) *Regexp { + lr := &Regexp{str: str} + if inTest { + // In tests, always compile the regexps early. + lr.re() + } + return lr +} diff --git a/vendor/github.com/containerd/containerd/v2/internal/userns/idmap.go b/vendor/github.com/containerd/containerd/v2/internal/userns/idmap.go index e547419a89..71d3bd89d5 100644 --- a/vendor/github.com/containerd/containerd/v2/internal/userns/idmap.go +++ b/vendor/github.com/containerd/containerd/v2/internal/userns/idmap.go @@ -24,6 +24,7 @@ package userns import ( "errors" "fmt" + "strings" "github.com/opencontainers/runtime-spec/specs-go" ) @@ -48,8 +49,21 @@ type IDMap struct { GidMap []specs.LinuxIDMapping `json:"GidMap"` } +// RootPair returns the ID pair for the root user +func (i *IDMap) RootPair() (User, error) { + uid, err := toHost(0, i.UidMap) + if err != nil { + return invalidUser, err + } + gid, err := toHost(0, i.GidMap) + if err != nil { + return invalidUser, err + } + return User{Uid: uid, Gid: gid}, nil +} + // ToHost returns the host user ID pair for the container ID pair. -func (i IDMap) ToHost(pair User) (User, error) { +func (i *IDMap) ToHost(pair User) (User, error) { var ( target User err error @@ -65,6 +79,45 @@ func (i IDMap) ToHost(pair User) (User, error) { return target, nil } +// Marshal serializes the IDMap object into two strings: +// one uidmap list and another one for gidmap list +func (i *IDMap) Marshal() (string, string) { + marshal := func(mappings []specs.LinuxIDMapping) string { + var arr []string + for _, m := range mappings { + arr = append(arr, serializeLinuxIDMapping(m)) + } + return strings.Join(arr, ",") + } + return marshal(i.UidMap), marshal(i.GidMap) +} + +// Unmarshal deserialize the passed uidmap and gidmap strings +// into a IDMap object. Error is returned in case of failure +func (i *IDMap) Unmarshal(uidMap, gidMap string) error { + unmarshal := func(str string, fn func(m specs.LinuxIDMapping)) error { + if len(str) == 0 { + return nil + } + for _, mapping := range strings.Split(str, ",") { + m, err := deserializeLinuxIDMapping(mapping) + if err != nil { + return err + } + fn(m) + } + return nil + } + if err := unmarshal(uidMap, func(m specs.LinuxIDMapping) { + i.UidMap = append(i.UidMap, m) + }); err != nil { + return err + } + return unmarshal(gidMap, func(m specs.LinuxIDMapping) { + i.GidMap = append(i.GidMap, m) + }) +} + // toHost takes an id mapping and a remapped ID, and translates the // ID to the mapped host ID. If no map is provided, then the translation // assumes a 1-to-1 mapping and returns the passed in id # @@ -96,3 +149,27 @@ func safeSum(x, y uint32) (uint32, error) { } return z, nil } + +// serializeLinuxIDMapping marshals a LinuxIDMapping object to string +func serializeLinuxIDMapping(m specs.LinuxIDMapping) string { + return fmt.Sprintf("%d:%d:%d", m.ContainerID, m.HostID, m.Size) +} + +// deserializeLinuxIDMapping unmarshals a string to a LinuxIDMapping object +func deserializeLinuxIDMapping(str string) (specs.LinuxIDMapping, error) { + var ( + hostID, ctrID, length int64 + ) + _, err := fmt.Sscanf(str, "%d:%d:%d", &ctrID, &hostID, &length) + if err != nil { + return specs.LinuxIDMapping{}, fmt.Errorf("input value %s unparsable: %w", str, err) + } + if ctrID < 0 || ctrID >= invalidID || hostID < 0 || hostID >= invalidID || length < 0 || length >= invalidID { + return specs.LinuxIDMapping{}, fmt.Errorf("invalid mapping \"%s\"", str) + } + return specs.LinuxIDMapping{ + ContainerID: uint32(ctrID), + HostID: uint32(hostID), + Size: uint32(length), + }, nil +} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/archive/compression/compression.go b/vendor/github.com/containerd/containerd/v2/pkg/archive/compression/compression.go index cba5e477cd..de3cb07adb 100644 --- a/vendor/github.com/containerd/containerd/v2/pkg/archive/compression/compression.go +++ b/vendor/github.com/containerd/containerd/v2/pkg/archive/compression/compression.go @@ -220,7 +220,9 @@ func DecompressStream(archive io.Reader) (DecompressReadCloser, error) { }, }, nil case Zstd: - zstdReader, err := zstd.NewReader(buf) + zstdReader, err := zstd.NewReader(buf, + zstd.WithDecoderLowmem(false), + ) if err != nil { return nil, err } diff --git a/vendor/github.com/containerd/containerd/v2/pkg/archive/compression/compression_fuzzer.go b/vendor/github.com/containerd/containerd/v2/pkg/archive/compression/compression_fuzzer.go deleted file mode 100644 index 3516494ac0..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/archive/compression/compression_fuzzer.go +++ /dev/null @@ -1,28 +0,0 @@ -//go:build gofuzz - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package compression - -import ( - "bytes" -) - -func FuzzDecompressStream(data []byte) int { - _, _ = DecompressStream(bytes.NewReader(data)) - return 1 -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/archive/tar_opts_windows.go b/vendor/github.com/containerd/containerd/v2/pkg/archive/tar_opts_windows.go index 3ec253f497..567a3c3520 100644 --- a/vendor/github.com/containerd/containerd/v2/pkg/archive/tar_opts_windows.go +++ b/vendor/github.com/containerd/containerd/v2/pkg/archive/tar_opts_windows.go @@ -22,7 +22,6 @@ import ( "github.com/Microsoft/go-winio" "github.com/Microsoft/hcsshim/pkg/ociwclayer" - ocicimlayer "github.com/Microsoft/hcsshim/pkg/ociwclayer/cim" ) // applyWindowsLayer applies a tar stream of an OCI style diff tar of a Windows layer @@ -78,16 +77,3 @@ func WithParentLayers(p []string) WriteDiffOpt { return nil } } - -func applyWindowsCimLayer(ctx context.Context, root string, r io.Reader, options ApplyOptions) (size int64, err error) { - return ocicimlayer.ImportCimLayerFromTar(ctx, r, root, options.Parents) -} - -// AsCimContainerLayer indicates that the tar stream to apply is that of a Windows container Layer written in -// the cim format. -func AsCimContainerLayer() ApplyOpt { - return func(options *ApplyOptions) error { - options.applyFunc = applyWindowsCimLayer - return nil - } -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/deprecation/deprecation.go b/vendor/github.com/containerd/containerd/v2/pkg/deprecation/deprecation.go deleted file mode 100644 index 603bf41f06..0000000000 --- a/vendor/github.com/containerd/containerd/v2/pkg/deprecation/deprecation.go +++ /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. -*/ - -package deprecation - -type Warning string - -const ( - // Prefix is a standard prefix for all Warnings, used for filtering plugin Exports - Prefix = "io.containerd.deprecation/" - // PullSchema1Image is a warning for the use of schema 1 images - PullSchema1Image Warning = Prefix + "pull-schema-1-image" - // GoPluginLibrary is a warning for the use of dynamic library Go plugins - GoPluginLibrary Warning = Prefix + "go-plugin-library" - // CRIRegistryMirrors is a warning for the use of the `mirrors` property - CRIRegistryMirrors Warning = Prefix + "cri-registry-mirrors" - // CRIRegistryAuths is a warning for the use of the `auths` property - CRIRegistryAuths Warning = Prefix + "cri-registry-auths" - // CRIRegistryConfigs is a warning for the use of the `configs` property - CRIRegistryConfigs Warning = Prefix + "cri-registry-configs" - // OTLPTracingConfig is a warning for the use of the `otlp` property - TracingOTLPConfig Warning = Prefix + "tracing-processor-config" - // TracingServiceConfig is a warning for the use of the `tracing` property - TracingServiceConfig Warning = Prefix + "tracing-service-config" -) - -const ( - EnvPrefix = "CONTAINERD_ENABLE_DEPRECATED_" - EnvPullSchema1Image = EnvPrefix + "PULL_SCHEMA_1_IMAGE" -) - -var messages = map[Warning]string{ - PullSchema1Image: "Schema 1 images are deprecated since containerd v1.7, disabled in containerd v2.0, and will be removed in containerd v2.1. " + - `Since containerd v1.7.8, schema 1 images are identified by the "io.containerd.image/converted-docker-schema1" label.`, - GoPluginLibrary: "Dynamically-linked Go plugins as containerd runtimes are deprecated since containerd v2.0 and removed in containerd v2.1.", - CRIRegistryMirrors: "The `mirrors` property of `[plugins.\"io.containerd.grpc.v1.cri\".registry]` is deprecated since containerd v1.5 and will be removed in containerd v2.1." + - "Use `config_path` instead.", - CRIRegistryAuths: "The `auths` property of `[plugins.\"io.containerd.grpc.v1.cri\".registry]` is deprecated since containerd v1.3 and will be removed in containerd v2.1." + - "Use `ImagePullSecrets` instead.", - CRIRegistryConfigs: "The `configs` property of `[plugins.\"io.containerd.grpc.v1.cri\".registry]` is deprecated since containerd v1.5 and will be removed in containerd v2.1." + - "Use `config_path` instead.", - - TracingOTLPConfig: "The `otlp` property of `[plugins.\"io.containerd.tracing.processor.v1\".otlp]` is deprecated since containerd v1.6 and will be removed in containerd v2.0." + - "Use OTLP environment variables instead: https://opentelemetry.io/docs/specs/otel/protocol/exporter/", - TracingServiceConfig: "The `tracing` property of `[plugins.\"io.containerd.internal.v1\".tracing]` is deprecated since containerd v1.6 and will be removed in containerd v2.0." + - "Use OTEL environment variables instead: https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/", -} - -// Valid checks whether a given Warning is valid -func Valid(id Warning) bool { - _, ok := messages[id] - return ok -} - -// Message returns the human-readable message for a given Warning -func Message(id Warning) (string, bool) { - msg, ok := messages[id] - return msg, ok -} diff --git a/vendor/github.com/containerd/containerd/v2/pkg/identifiers/validate.go b/vendor/github.com/containerd/containerd/v2/pkg/identifiers/validate.go index 0acbf3fc4b..c1c7a336a4 100644 --- a/vendor/github.com/containerd/containerd/v2/pkg/identifiers/validate.go +++ b/vendor/github.com/containerd/containerd/v2/pkg/identifiers/validate.go @@ -26,8 +26,8 @@ package identifiers import ( "fmt" - "regexp" + "github.com/containerd/containerd/v2/internal/lazyregexp" "github.com/containerd/errdefs" ) @@ -39,7 +39,7 @@ const ( var ( // identifierRe defines the pattern for valid identifiers. - identifierRe = regexp.MustCompile(reAnchor(alphanum + reGroup(separators+reGroup(alphanum)) + "*")) + identifierRe = lazyregexp.New(reAnchor(alphanum + reGroup(separators+reGroup(alphanum)) + "*")) ) // Validate returns nil if the string s is a valid identifier. diff --git a/vendor/github.com/containerd/containerd/v2/pkg/namespaces/ttrpc.go b/vendor/github.com/containerd/containerd/v2/pkg/namespaces/ttrpc.go index bcd2643cf5..f9b24ad69a 100644 --- a/vendor/github.com/containerd/containerd/v2/pkg/namespaces/ttrpc.go +++ b/vendor/github.com/containerd/containerd/v2/pkg/namespaces/ttrpc.go @@ -27,20 +27,12 @@ const ( TTRPCHeader = "containerd-namespace-ttrpc" ) -func copyMetadata(src ttrpc.MD) ttrpc.MD { - md := ttrpc.MD{} - for k, v := range src { - md[k] = append(md[k], v...) - } - return md -} - func withTTRPCNamespaceHeader(ctx context.Context, namespace string) context.Context { md, ok := ttrpc.GetMetadata(ctx) if !ok { md = ttrpc.MD{} } else { - md = copyMetadata(md) + md = md.Clone() } md.Set(TTRPCHeader, namespace) return ttrpc.WithMetadata(ctx, md) diff --git a/vendor/github.com/containerd/containerd/v2/pkg/reference/reference.go b/vendor/github.com/containerd/containerd/v2/pkg/reference/reference.go index d983c4e135..55c7b6fb52 100644 --- a/vendor/github.com/containerd/containerd/v2/pkg/reference/reference.go +++ b/vendor/github.com/containerd/containerd/v2/pkg/reference/reference.go @@ -20,9 +20,9 @@ import ( "errors" "net/url" "path" - "regexp" "strings" + "github.com/containerd/containerd/v2/internal/lazyregexp" digest "github.com/opencontainers/go-digest" ) @@ -80,7 +80,7 @@ type Spec struct { Object string } -var splitRe = regexp.MustCompile(`[:@]`) +var splitRe = lazyregexp.New(`[:@]`) // Parse parses the string into a structured ref. func Parse(s string) (Spec, error) { diff --git a/vendor/github.com/containerd/containerd/v2/pkg/sys/filesys_windows.go b/vendor/github.com/containerd/containerd/v2/pkg/sys/filesys_windows.go index 67fc4048c1..e06fbdbb8d 100644 --- a/vendor/github.com/containerd/containerd/v2/pkg/sys/filesys_windows.go +++ b/vendor/github.com/containerd/containerd/v2/pkg/sys/filesys_windows.go @@ -18,11 +18,12 @@ package sys import ( "os" - "regexp" "syscall" "unsafe" "golang.org/x/sys/windows" + + "github.com/containerd/containerd/v2/internal/lazyregexp" ) // SddlAdministratorsLocalSystem is local administrators plus NT AUTHORITY\System. @@ -31,7 +32,7 @@ const SddlAdministratorsLocalSystem = "D:P(A;OICI;GA;;;BA)(A;OICI;GA;;;SY)" // volumePath is a regular expression to check if a path is a Windows // volume path (e.g., "\\?\Volume{4c1b02c1-d990-11dc-99ae-806e6f6e6963}" // or "\\?\Volume{4c1b02c1-d990-11dc-99ae-806e6f6e6963}\"). -var volumePath = regexp.MustCompile(`^\\\\\?\\Volume{[a-z0-9-]+}\\?$`) +var volumePath = lazyregexp.New(`^\\\\\?\\Volume{[a-z0-9-]+}\\?$`) // MkdirAllWithACL is a custom version of os.MkdirAll modified for use on Windows // so that it is both volume path aware, and to create a directory diff --git a/vendor/github.com/containerd/containerd/v2/pkg/sys/socket_unix.go b/vendor/github.com/containerd/containerd/v2/pkg/sys/socket_unix.go index 5ecbeddc91..91034e1718 100644 --- a/vendor/github.com/containerd/containerd/v2/pkg/sys/socket_unix.go +++ b/vendor/github.com/containerd/containerd/v2/pkg/sys/socket_unix.go @@ -51,7 +51,7 @@ func GetLocalListener(path string, uid, gid int) (net.Listener, error) { l, err := CreateUnixSocket(path) if err != nil { - return l, err + return l, fmt.Errorf("failed to create unix socket on %s: %w", path, err) } if err := os.Chmod(path, 0660); err != nil { diff --git a/vendor/github.com/containerd/containerd/v2/pkg/sys/unshare_linux.go b/vendor/github.com/containerd/containerd/v2/pkg/sys/unshare_linux.go index 31f36323a5..85af4fe3b8 100644 --- a/vendor/github.com/containerd/containerd/v2/pkg/sys/unshare_linux.go +++ b/vendor/github.com/containerd/containerd/v2/pkg/sys/unshare_linux.go @@ -77,8 +77,8 @@ func UnshareAfterEnterUserns(uidMap, gidMap string, unshareFlags uintptr, f func // - https://github.com/golang/go/issues/68984 // - https://github.com/golang/go/milestone/371 if goVer := runtime.Version(); goVer == "go1.23.0" || goVer == "go1.23.1" { - dupPidfd, dupErr := unix.FcntlInt(uintptr(pidfd), syscall.F_DUPFD_CLOEXEC, 0) - if dupErr != nil { + dupPidfd, err := unix.FcntlInt(uintptr(pidfd), syscall.F_DUPFD_CLOEXEC, 0) + if err != nil { proc.Kill() proc.Wait() return fmt.Errorf("failed to dupfd: %w", err) diff --git a/vendor/github.com/containerd/containerd/v2/plugins/content/local/content_local_fuzzer.go b/vendor/github.com/containerd/containerd/v2/plugins/content/local/content_local_fuzzer.go deleted file mode 100644 index 39ec84b375..0000000000 --- a/vendor/github.com/containerd/containerd/v2/plugins/content/local/content_local_fuzzer.go +++ /dev/null @@ -1,76 +0,0 @@ -//go:build gofuzz - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package local - -import ( - "bufio" - "bytes" - "context" - _ "crypto/sha256" - "io" - "testing" - - "github.com/opencontainers/go-digest" - - "github.com/containerd/containerd/v2/core/content" -) - -func FuzzContentStoreWriter(data []byte) int { - t := &testing.T{} - ctx := context.Background() - ctx, _, cs, cleanup := contentStoreEnv(t) - defer cleanup() - - cw, err := cs.Writer(ctx, content.WithRef("myref")) - if err != nil { - return 0 - } - if err := cw.Close(); err != nil { - return 0 - } - - // reopen, so we can test things - cw, err = cs.Writer(ctx, content.WithRef("myref")) - if err != nil { - return 0 - } - - err = checkCopyFuzz(int64(len(data)), cw, bufio.NewReader(io.NopCloser(bytes.NewReader(data)))) - if err != nil { - return 0 - } - expected := digest.FromBytes(data) - - if err = cw.Commit(ctx, int64(len(data)), expected); err != nil { - return 0 - } - return 1 -} - -func checkCopyFuzz(size int64, dst io.Writer, src io.Reader) error { - nn, err := io.Copy(dst, src) - if err != nil { - return err - } - - if nn != size { - return err - } - return nil -} diff --git a/vendor/github.com/containerd/containerd/v2/plugins/content/local/test_helper.go b/vendor/github.com/containerd/containerd/v2/plugins/content/local/test_helper.go deleted file mode 100644 index a4c238c47c..0000000000 --- a/vendor/github.com/containerd/containerd/v2/plugins/content/local/test_helper.go +++ /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. -*/ - -package local - -import ( - "context" - "testing" - - "github.com/containerd/containerd/v2/core/content" -) - -func contentStoreEnv(t testing.TB) (context.Context, string, content.Store, func()) { - tmpdir := t.TempDir() - - cs, err := NewStore(tmpdir) - if err != nil { - t.Fatal(err) - } - - ctx, cancel := context.WithCancel(context.Background()) - return ctx, tmpdir, cs, func() { - cancel() - } -} diff --git a/vendor/github.com/containerd/containerd/v2/plugins/snapshots/overlay/overlayutils/check.go b/vendor/github.com/containerd/containerd/v2/plugins/snapshots/overlay/overlayutils/check.go index fd943777d2..2d9a6b9ea3 100644 --- a/vendor/github.com/containerd/containerd/v2/plugins/snapshots/overlay/overlayutils/check.go +++ b/vendor/github.com/containerd/containerd/v2/plugins/snapshots/overlay/overlayutils/check.go @@ -261,7 +261,8 @@ func SupportsIDMappedMounts() (bool, error) { } defer usernsFd.Close() - if err = mount.IDMapMount(lowerDir, lowerDir, int(usernsFd.Fd())); err != nil { + // MOUNT_ATTR_RDONLY to replicate our actual construction of overlayfs + if err = mount.IDMapMountWithAttrs(lowerDir, lowerDir, int(usernsFd.Fd()), unix.MOUNT_ATTR_RDONLY, 0); err != nil { return false, fmt.Errorf("failed to remap lowerdir %s: %w", lowerDir, err) } defer func() { diff --git a/vendor/github.com/containerd/containerd/v2/plugins/types.go b/vendor/github.com/containerd/containerd/v2/plugins/types.go index c63320678a..aaf8c536b1 100644 --- a/vendor/github.com/containerd/containerd/v2/plugins/types.go +++ b/vendor/github.com/containerd/containerd/v2/plugins/types.go @@ -29,7 +29,7 @@ const ( RuntimePlugin plugin.Type = "io.containerd.runtime.v1" // RuntimePluginV2 implements a runtime v2 RuntimePluginV2 plugin.Type = "io.containerd.runtime.v2" - // ServicePlugin implements a internal service + // ServicePlugin implements an internal service ServicePlugin plugin.Type = "io.containerd.service.v1" // GRPCPlugin implements a grpc service GRPCPlugin plugin.Type = "io.containerd.grpc.v1" @@ -55,7 +55,7 @@ const ( LeasePlugin plugin.Type = "io.containerd.lease.v1" // StreamingPlugin implements a stream manager StreamingPlugin plugin.Type = "io.containerd.streaming.v1" - // TracingProcessorPlugin implements a open telemetry span processor + // TracingProcessorPlugin implements an open telemetry span processor TracingProcessorPlugin plugin.Type = "io.containerd.tracing.processor.v1" // NRIApiPlugin implements the NRI adaptation interface for containerd. NRIApiPlugin plugin.Type = "io.containerd.nri.v1" diff --git a/vendor/github.com/containerd/containerd/v2/version/version.go b/vendor/github.com/containerd/containerd/v2/version/version.go index bd5a0b5129..a1f3ae4fb7 100644 --- a/vendor/github.com/containerd/containerd/v2/version/version.go +++ b/vendor/github.com/containerd/containerd/v2/version/version.go @@ -24,7 +24,7 @@ var ( Package = "github.com/containerd/containerd/v2" // Version holds the complete version number. Filled in at linking time. - Version = "2.0.5+unknown" + Version = "2.1.1+unknown" // Revision is filled with the VCS (e.g. git) revision being used to build // the program at linking time. diff --git a/vendor/github.com/containernetworking/cni/libcni/api.go b/vendor/github.com/containernetworking/cni/libcni/api.go index 201a12e977..6ac26949e6 100644 --- a/vendor/github.com/containernetworking/cni/libcni/api.go +++ b/vendor/github.com/containernetworking/cni/libcni/api.go @@ -67,18 +67,23 @@ type RuntimeConf struct { CacheDir string } -type NetworkConfig struct { - Network *types.NetConf +// Use PluginConfig instead of NetworkConfig, the NetworkConfig +// backwards-compat alias will be removed in a future release. +type NetworkConfig = PluginConfig + +type PluginConfig struct { + Network *types.PluginConf Bytes []byte } type NetworkConfigList struct { - Name string - CNIVersion string - DisableCheck bool - DisableGC bool - Plugins []*NetworkConfig - Bytes []byte + Name string + CNIVersion string + DisableCheck bool + DisableGC bool + LoadOnlyInlinedPlugins bool + Plugins []*PluginConfig + Bytes []byte } type NetworkAttachment struct { @@ -102,14 +107,14 @@ type CNI interface { GetNetworkListCachedResult(net *NetworkConfigList, rt *RuntimeConf) (types.Result, error) GetNetworkListCachedConfig(net *NetworkConfigList, rt *RuntimeConf) ([]byte, *RuntimeConf, error) - AddNetwork(ctx context.Context, net *NetworkConfig, rt *RuntimeConf) (types.Result, error) - CheckNetwork(ctx context.Context, net *NetworkConfig, rt *RuntimeConf) error - DelNetwork(ctx context.Context, net *NetworkConfig, rt *RuntimeConf) error - GetNetworkCachedResult(net *NetworkConfig, rt *RuntimeConf) (types.Result, error) - GetNetworkCachedConfig(net *NetworkConfig, rt *RuntimeConf) ([]byte, *RuntimeConf, error) + AddNetwork(ctx context.Context, net *PluginConfig, rt *RuntimeConf) (types.Result, error) + CheckNetwork(ctx context.Context, net *PluginConfig, rt *RuntimeConf) error + DelNetwork(ctx context.Context, net *PluginConfig, rt *RuntimeConf) error + GetNetworkCachedResult(net *PluginConfig, rt *RuntimeConf) (types.Result, error) + GetNetworkCachedConfig(net *PluginConfig, rt *RuntimeConf) ([]byte, *RuntimeConf, error) ValidateNetworkList(ctx context.Context, net *NetworkConfigList) ([]string, error) - ValidateNetwork(ctx context.Context, net *NetworkConfig) ([]string, error) + ValidateNetwork(ctx context.Context, net *PluginConfig) ([]string, error) GCNetworkList(ctx context.Context, net *NetworkConfigList, args *GCArgs) error GetStatusNetworkList(ctx context.Context, net *NetworkConfigList) error @@ -147,7 +152,7 @@ func NewCNIConfigWithCacheDir(path []string, cacheDir string, exec invoke.Exec) } } -func buildOneConfig(name, cniVersion string, orig *NetworkConfig, prevResult types.Result, rt *RuntimeConf) (*NetworkConfig, error) { +func buildOneConfig(name, cniVersion string, orig *PluginConfig, prevResult types.Result, rt *RuntimeConf) (*PluginConfig, error) { var err error inject := map[string]interface{}{ @@ -183,7 +188,7 @@ func buildOneConfig(name, cniVersion string, orig *NetworkConfig, prevResult typ // capabilities include "portMappings", and the CapabilityArgs map includes a // "portMappings" key, that key and its value are added to the "runtimeConfig" // dictionary to be passed to the plugin's stdin. -func injectRuntimeConfig(orig *NetworkConfig, rt *RuntimeConf) (*NetworkConfig, error) { +func injectRuntimeConfig(orig *PluginConfig, rt *RuntimeConf) (*PluginConfig, error) { var err error rc := make(map[string]interface{}) @@ -404,7 +409,7 @@ func (c *CNIConfig) GetNetworkListCachedResult(list *NetworkConfigList, rt *Runt // GetNetworkCachedResult returns the cached Result of the previous // AddNetwork() operation for a network, or an error. -func (c *CNIConfig) GetNetworkCachedResult(net *NetworkConfig, rt *RuntimeConf) (types.Result, error) { +func (c *CNIConfig) GetNetworkCachedResult(net *PluginConfig, rt *RuntimeConf) (types.Result, error) { return c.getCachedResult(net.Network.Name, net.Network.CNIVersion, rt) } @@ -416,7 +421,7 @@ func (c *CNIConfig) GetNetworkListCachedConfig(list *NetworkConfigList, rt *Runt // GetNetworkCachedConfig copies the input RuntimeConf to output // RuntimeConf with fields updated with info from the cached Config. -func (c *CNIConfig) GetNetworkCachedConfig(net *NetworkConfig, rt *RuntimeConf) ([]byte, *RuntimeConf, error) { +func (c *CNIConfig) GetNetworkCachedConfig(net *PluginConfig, rt *RuntimeConf) ([]byte, *RuntimeConf, error) { return c.getCachedConfig(net.Network.Name, rt) } @@ -482,7 +487,7 @@ func (c *CNIConfig) GetCachedAttachments(containerID string) ([]*NetworkAttachme return attachments, nil } -func (c *CNIConfig) addNetwork(ctx context.Context, name, cniVersion string, net *NetworkConfig, prevResult types.Result, rt *RuntimeConf) (types.Result, error) { +func (c *CNIConfig) addNetwork(ctx context.Context, name, cniVersion string, net *PluginConfig, prevResult types.Result, rt *RuntimeConf) (types.Result, error) { c.ensureExec() pluginPath, err := c.exec.FindInPath(net.Network.Type, c.Path) if err != nil { @@ -524,7 +529,7 @@ func (c *CNIConfig) AddNetworkList(ctx context.Context, list *NetworkConfigList, return result, nil } -func (c *CNIConfig) checkNetwork(ctx context.Context, name, cniVersion string, net *NetworkConfig, prevResult types.Result, rt *RuntimeConf) error { +func (c *CNIConfig) checkNetwork(ctx context.Context, name, cniVersion string, net *PluginConfig, prevResult types.Result, rt *RuntimeConf) error { c.ensureExec() pluginPath, err := c.exec.FindInPath(net.Network.Type, c.Path) if err != nil { @@ -566,7 +571,7 @@ func (c *CNIConfig) CheckNetworkList(ctx context.Context, list *NetworkConfigLis return nil } -func (c *CNIConfig) delNetwork(ctx context.Context, name, cniVersion string, net *NetworkConfig, prevResult types.Result, rt *RuntimeConf) error { +func (c *CNIConfig) delNetwork(ctx context.Context, name, cniVersion string, net *PluginConfig, prevResult types.Result, rt *RuntimeConf) error { c.ensureExec() pluginPath, err := c.exec.FindInPath(net.Network.Type, c.Path) if err != nil { @@ -607,7 +612,7 @@ func (c *CNIConfig) DelNetworkList(ctx context.Context, list *NetworkConfigList, return nil } -func pluginDescription(net *types.NetConf) string { +func pluginDescription(net *types.PluginConf) string { if net == nil { return "" } @@ -621,7 +626,7 @@ func pluginDescription(net *types.NetConf) string { } // AddNetwork executes the plugin with the ADD command -func (c *CNIConfig) AddNetwork(ctx context.Context, net *NetworkConfig, rt *RuntimeConf) (types.Result, error) { +func (c *CNIConfig) AddNetwork(ctx context.Context, net *PluginConfig, rt *RuntimeConf) (types.Result, error) { result, err := c.addNetwork(ctx, net.Network.Name, net.Network.CNIVersion, net, nil, rt) if err != nil { return nil, err @@ -635,7 +640,7 @@ func (c *CNIConfig) AddNetwork(ctx context.Context, net *NetworkConfig, rt *Runt } // CheckNetwork executes the plugin with the CHECK command -func (c *CNIConfig) CheckNetwork(ctx context.Context, net *NetworkConfig, rt *RuntimeConf) error { +func (c *CNIConfig) CheckNetwork(ctx context.Context, net *PluginConfig, rt *RuntimeConf) error { // CHECK was added in CNI spec version 0.4.0 and higher if gtet, err := version.GreaterThanOrEqualTo(net.Network.CNIVersion, "0.4.0"); err != nil { return err @@ -651,7 +656,7 @@ func (c *CNIConfig) CheckNetwork(ctx context.Context, net *NetworkConfig, rt *Ru } // DelNetwork executes the plugin with the DEL command -func (c *CNIConfig) DelNetwork(ctx context.Context, net *NetworkConfig, rt *RuntimeConf) error { +func (c *CNIConfig) DelNetwork(ctx context.Context, net *PluginConfig, rt *RuntimeConf) error { var cachedResult types.Result // Cached result on DEL was added in CNI spec version 0.4.0 and higher @@ -711,7 +716,7 @@ func (c *CNIConfig) ValidateNetworkList(ctx context.Context, list *NetworkConfig // ValidateNetwork checks that a configuration is reasonably valid. // It uses the same logic as ValidateNetworkList) // Returns a list of capabilities -func (c *CNIConfig) ValidateNetwork(ctx context.Context, net *NetworkConfig) ([]string, error) { +func (c *CNIConfig) ValidateNetwork(ctx context.Context, net *PluginConfig) ([]string, error) { caps := []string{} for c, ok := range net.Network.Capabilities { if ok { @@ -836,7 +841,7 @@ func (c *CNIConfig) GCNetworkList(ctx context.Context, list *NetworkConfigList, return errors.Join(errs...) } -func (c *CNIConfig) gcNetwork(ctx context.Context, net *NetworkConfig) error { +func (c *CNIConfig) gcNetwork(ctx context.Context, net *PluginConfig) error { c.ensureExec() pluginPath, err := c.exec.FindInPath(net.Network.Type, c.Path) if err != nil { @@ -871,7 +876,7 @@ func (c *CNIConfig) GetStatusNetworkList(ctx context.Context, list *NetworkConfi return nil } -func (c *CNIConfig) getStatusNetwork(ctx context.Context, net *NetworkConfig) error { +func (c *CNIConfig) getStatusNetwork(ctx context.Context, net *PluginConfig) error { c.ensureExec() pluginPath, err := c.exec.FindInPath(net.Network.Type, c.Path) if err != nil { diff --git a/vendor/github.com/containernetworking/cni/libcni/conf.go b/vendor/github.com/containernetworking/cni/libcni/conf.go index 1d1b821c63..7f8482e75e 100644 --- a/vendor/github.com/containernetworking/cni/libcni/conf.go +++ b/vendor/github.com/containernetworking/cni/libcni/conf.go @@ -45,9 +45,16 @@ func (e NoConfigsFoundError) Error() string { return fmt.Sprintf(`no net configurations found in %s`, e.Dir) } -func ConfFromBytes(bytes []byte) (*NetworkConfig, error) { - conf := &NetworkConfig{Bytes: bytes, Network: &types.NetConf{}} - if err := json.Unmarshal(bytes, conf.Network); err != nil { +// This will not validate that the plugins actually belong to the netconfig by ensuring +// that they are loaded from a directory named after the networkName, relative to the network config. +// +// Since here we are just accepting raw bytes, the caller is responsible for ensuring that the plugin +// config provided here actually "belongs" to the networkconfig in question. +func NetworkPluginConfFromBytes(pluginConfBytes []byte) (*PluginConfig, error) { + // TODO why are we creating a struct that holds both the byte representation and the deserialized + // representation, and returning that, instead of just returning the deserialized representation? + conf := &PluginConfig{Bytes: pluginConfBytes, Network: &types.PluginConf{}} + if err := json.Unmarshal(pluginConfBytes, conf.Network); err != nil { return nil, fmt.Errorf("error parsing configuration: %w", err) } if conf.Network.Type == "" { @@ -56,17 +63,35 @@ func ConfFromBytes(bytes []byte) (*NetworkConfig, error) { return conf, nil } -func ConfFromFile(filename string) (*NetworkConfig, error) { - bytes, err := os.ReadFile(filename) +// Given a path to a directory containing a network configuration, and the name of a network, +// loads all plugin definitions found at path `networkConfPath/networkName/*.conf` +func NetworkPluginConfsFromFiles(networkConfPath, networkName string) ([]*PluginConfig, error) { + var pConfs []*PluginConfig + + pluginConfPath := filepath.Join(networkConfPath, networkName) + + pluginConfFiles, err := ConfFiles(pluginConfPath, []string{".conf"}) if err != nil { - return nil, fmt.Errorf("error reading %s: %w", filename, err) + return nil, fmt.Errorf("failed to read plugin config files in %s: %w", pluginConfPath, err) } - return ConfFromBytes(bytes) + + for _, pluginConfFile := range pluginConfFiles { + pluginConfBytes, err := os.ReadFile(pluginConfFile) + if err != nil { + return nil, fmt.Errorf("error reading %s: %w", pluginConfFile, err) + } + pluginConf, err := NetworkPluginConfFromBytes(pluginConfBytes) + if err != nil { + return nil, err + } + pConfs = append(pConfs, pluginConf) + } + return pConfs, nil } -func ConfListFromBytes(bytes []byte) (*NetworkConfigList, error) { +func NetworkConfFromBytes(confBytes []byte) (*NetworkConfigList, error) { rawList := make(map[string]interface{}) - if err := json.Unmarshal(bytes, &rawList); err != nil { + if err := json.Unmarshal(confBytes, &rawList); err != nil { return nil, fmt.Errorf("error parsing configuration list: %w", err) } @@ -167,19 +192,36 @@ func ConfListFromBytes(bytes []byte) (*NetworkConfigList, error) { return nil, err } + loadOnlyInlinedPlugins, err := readBool("loadOnlyInlinedPlugins") + if err != nil { + return nil, err + } + list := &NetworkConfigList{ - Name: name, - DisableCheck: disableCheck, - DisableGC: disableGC, - CNIVersion: cniVersion, - Bytes: bytes, + Name: name, + DisableCheck: disableCheck, + DisableGC: disableGC, + LoadOnlyInlinedPlugins: loadOnlyInlinedPlugins, + CNIVersion: cniVersion, + Bytes: confBytes, } var plugins []interface{} plug, ok := rawList["plugins"] - if !ok { - return nil, fmt.Errorf("error parsing configuration list: no 'plugins' key") + // We can have a `plugins` list key in the main conf, + // We can also have `loadOnlyInlinedPlugins == true` + // + // If `plugins` is there, then `loadOnlyInlinedPlugins` can be true + // + // If plugins is NOT there, then `loadOnlyInlinedPlugins` cannot be true + // + // We have to have at least some plugins. + if !ok && loadOnlyInlinedPlugins { + return nil, fmt.Errorf("error parsing configuration list: `loadOnlyInlinedPlugins` is true, and no 'plugins' key") + } else if !ok && !loadOnlyInlinedPlugins { + return list, nil } + plugins, ok = plug.([]interface{}) if !ok { return nil, fmt.Errorf("error parsing configuration list: invalid 'plugins' type %T", plug) @@ -199,24 +241,68 @@ func ConfListFromBytes(bytes []byte) (*NetworkConfigList, error) { } list.Plugins = append(list.Plugins, netConf) } - return list, nil } -func ConfListFromFile(filename string) (*NetworkConfigList, error) { +func NetworkConfFromFile(filename string) (*NetworkConfigList, error) { bytes, err := os.ReadFile(filename) if err != nil { return nil, fmt.Errorf("error reading %s: %w", filename, err) } - return ConfListFromBytes(bytes) + + conf, err := NetworkConfFromBytes(bytes) + if err != nil { + return nil, err + } + + if !conf.LoadOnlyInlinedPlugins { + plugins, err := NetworkPluginConfsFromFiles(filepath.Dir(filename), conf.Name) + if err != nil { + return nil, err + } + conf.Plugins = append(conf.Plugins, plugins...) + } + + if len(conf.Plugins) == 0 { + // Having 0 plugins for a given network is not necessarily a problem, + // but return as error for caller to decide, since they tried to load + return nil, fmt.Errorf("no plugin configs found") + } + return conf, nil } +// Deprecated: This file format is no longer supported, use NetworkConfXXX and NetworkPluginXXX functions +func ConfFromBytes(bytes []byte) (*NetworkConfig, error) { + return NetworkPluginConfFromBytes(bytes) +} + +// Deprecated: This file format is no longer supported, use NetworkConfXXX and NetworkPluginXXX functions +func ConfFromFile(filename string) (*NetworkConfig, error) { + bytes, err := os.ReadFile(filename) + if err != nil { + return nil, fmt.Errorf("error reading %s: %w", filename, err) + } + return ConfFromBytes(bytes) +} + +func ConfListFromBytes(bytes []byte) (*NetworkConfigList, error) { + return NetworkConfFromBytes(bytes) +} + +func ConfListFromFile(filename string) (*NetworkConfigList, error) { + return NetworkConfFromFile(filename) +} + +// ConfFiles simply returns a slice of all files in the provided directory +// with extensions matching the provided set. func ConfFiles(dir string, extensions []string) ([]string, error) { // In part, adapted from rkt/networking/podenv.go#listFiles files, err := os.ReadDir(dir) switch { case err == nil: // break case os.IsNotExist(err): + // If folder not there, return no error - only return an + // error if we cannot read contents or there are no contents. return nil, nil default: return nil, err @@ -237,6 +323,7 @@ func ConfFiles(dir string, extensions []string) ([]string, error) { return confFiles, nil } +// Deprecated: This file format is no longer supported, use NetworkConfXXX and NetworkPluginXXX functions func LoadConf(dir, name string) (*NetworkConfig, error) { files, err := ConfFiles(dir, []string{".conf", ".json"}) switch { @@ -260,6 +347,15 @@ func LoadConf(dir, name string) (*NetworkConfig, error) { } func LoadConfList(dir, name string) (*NetworkConfigList, error) { + return LoadNetworkConf(dir, name) +} + +// LoadNetworkConf looks at all the network configs in a given dir, +// loads and parses them all, and returns the first one with an extension of `.conf` +// that matches the provided network name predicate. +func LoadNetworkConf(dir, name string) (*NetworkConfigList, error) { + // TODO this .conflist/.conf extension thing is confusing and inexact + // for implementors. We should pick one extension for everything and stick with it. files, err := ConfFiles(dir, []string{".conflist"}) if err != nil { return nil, err @@ -267,7 +363,7 @@ func LoadConfList(dir, name string) (*NetworkConfigList, error) { sort.Strings(files) for _, confFile := range files { - conf, err := ConfListFromFile(confFile) + conf, err := NetworkConfFromFile(confFile) if err != nil { return nil, err } @@ -276,7 +372,7 @@ func LoadConfList(dir, name string) (*NetworkConfigList, error) { } } - // Try and load a network configuration file (instead of list) + // Deprecated: Try and load a network configuration file (instead of list) // from the same name, then upconvert. singleConf, err := LoadConf(dir, name) if err != nil { @@ -292,7 +388,8 @@ func LoadConfList(dir, name string) (*NetworkConfigList, error) { return ConfListFromConf(singleConf) } -func InjectConf(original *NetworkConfig, newValues map[string]interface{}) (*NetworkConfig, error) { +// InjectConf takes a PluginConfig and inserts additional values into it, ensuring the result is serializable. +func InjectConf(original *PluginConfig, newValues map[string]interface{}) (*PluginConfig, error) { config := make(map[string]interface{}) err := json.Unmarshal(original.Bytes, &config) if err != nil { @@ -316,12 +413,14 @@ func InjectConf(original *NetworkConfig, newValues map[string]interface{}) (*Net return nil, err } - return ConfFromBytes(newBytes) + return NetworkPluginConfFromBytes(newBytes) } // ConfListFromConf "upconverts" a network config in to a NetworkConfigList, // with the single network as the only entry in the list. -func ConfListFromConf(original *NetworkConfig) (*NetworkConfigList, error) { +// +// Deprecated: Non-conflist file formats are unsupported, use NetworkConfXXX and NetworkPluginXXX functions +func ConfListFromConf(original *PluginConfig) (*NetworkConfigList, error) { // Re-deserialize the config's json, then make a raw map configlist. // This may seem a bit strange, but it's to make the Bytes fields // actually make sense. Otherwise, the generated json is littered with diff --git a/vendor/github.com/containernetworking/cni/pkg/types/types.go b/vendor/github.com/containernetworking/cni/pkg/types/types.go index 8453bb5d87..f4b3ce3535 100644 --- a/vendor/github.com/containernetworking/cni/pkg/types/types.go +++ b/vendor/github.com/containernetworking/cni/pkg/types/types.go @@ -56,8 +56,12 @@ func (n *IPNet) UnmarshalJSON(data []byte) error { return nil } -// NetConfType describes a network. -type NetConfType struct { +// Use PluginConf instead of NetConf, the NetConf +// backwards-compat alias will be removed in a future release. +type NetConf = PluginConf + +// PluginConf describes a plugin configuration for a specific network. +type PluginConf struct { CNIVersion string `json:"cniVersion,omitempty"` Name string `json:"name,omitempty"` @@ -73,9 +77,6 @@ type NetConfType struct { ValidAttachments []GCAttachment `json:"cni.dev/valid-attachments,omitempty"` } -// NetConf is defined as different type as custom MarshalJSON() and issue #1096 -type NetConf NetConfType - // GCAttachment is the parameters to a GC call -- namely, // the container ID and ifname pair that represents a // still-valid attachment. @@ -86,11 +87,8 @@ type GCAttachment struct { // Note: DNS should be omit if DNS is empty but default Marshal function // will output empty structure hence need to write a Marshal function -func (n *NetConfType) MarshalJSON() ([]byte, error) { - // use type alias to escape recursion for json.Marshal() to MarshalJSON() - type fixObjType = NetConf - - bytes, err := json.Marshal(fixObjType(*n)) +func (n *PluginConf) MarshalJSON() ([]byte, error) { + bytes, err := json.Marshal(*n) if err != nil { return nil, err } @@ -120,10 +118,10 @@ func (i *IPAM) IsEmpty() bool { type NetConfList struct { CNIVersion string `json:"cniVersion,omitempty"` - Name string `json:"name,omitempty"` - DisableCheck bool `json:"disableCheck,omitempty"` - DisableGC bool `json:"disableGC,omitempty"` - Plugins []*NetConf `json:"plugins,omitempty"` + Name string `json:"name,omitempty"` + DisableCheck bool `json:"disableCheck,omitempty"` + DisableGC bool `json:"disableGC,omitempty"` + Plugins []*PluginConf `json:"plugins,omitempty"` } // Result is an interface that provides the result of plugin execution diff --git a/vendor/github.com/containernetworking/cni/pkg/version/version.go b/vendor/github.com/containernetworking/cni/pkg/version/version.go index a4d442c8ec..cfb6a12fa3 100644 --- a/vendor/github.com/containernetworking/cni/pkg/version/version.go +++ b/vendor/github.com/containernetworking/cni/pkg/version/version.go @@ -63,7 +63,7 @@ func NewResult(version string, resultBytes []byte) (types.Result, error) { // ParsePrevResult parses a prevResult in a NetConf structure and sets // the NetConf's PrevResult member to the parsed Result object. -func ParsePrevResult(conf *types.NetConf) error { +func ParsePrevResult(conf *types.PluginConf) error { if conf.RawPrevResult == nil { return nil } diff --git a/vendor/github.com/in-toto/in-toto-golang/in_toto/attestations.go b/vendor/github.com/in-toto/in-toto-golang/in_toto/attestations.go new file mode 100644 index 0000000000..73aafe7e1c --- /dev/null +++ b/vendor/github.com/in-toto/in-toto-golang/in_toto/attestations.go @@ -0,0 +1,99 @@ +package in_toto + +import ( + "github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/common" + slsa01 "github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/v0.1" + slsa02 "github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/v0.2" + slsa1 "github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/v1" +) + +const ( + // StatementInTotoV01 is the statement type for the generalized link format + // containing statements. This is constant for all predicate types. + StatementInTotoV01 = "https://in-toto.io/Statement/v0.1" + // PredicateSPDX represents a SBOM using the SPDX standard. + // The SPDX mandates 'spdxVersion' field, so predicate type can omit + // version. + PredicateSPDX = "https://spdx.dev/Document" + // PredicateCycloneDX represents a CycloneDX SBOM + PredicateCycloneDX = "https://cyclonedx.org/bom" + // PredicateLinkV1 represents an in-toto 0.9 link. + PredicateLinkV1 = "https://in-toto.io/Link/v1" +) + +// Subject describes the set of software artifacts the statement applies to. +type Subject struct { + Name string `json:"name"` + Digest common.DigestSet `json:"digest"` +} + +// StatementHeader defines the common fields for all statements +type StatementHeader struct { + Type string `json:"_type"` + PredicateType string `json:"predicateType"` + Subject []Subject `json:"subject"` +} + +/* +Statement binds the attestation to a particular subject and identifies the +of the predicate. This struct represents a generic statement. +*/ +type Statement struct { + StatementHeader + // Predicate contains type speficic metadata. + Predicate interface{} `json:"predicate"` +} + +// ProvenanceStatementSLSA01 is the definition for an entire provenance statement with SLSA 0.1 predicate. +type ProvenanceStatementSLSA01 struct { + StatementHeader + Predicate slsa01.ProvenancePredicate `json:"predicate"` +} + +// ProvenanceStatementSLSA02 is the definition for an entire provenance statement with SLSA 0.2 predicate. +type ProvenanceStatementSLSA02 struct { + StatementHeader + Predicate slsa02.ProvenancePredicate `json:"predicate"` +} + +// ProvenanceStatementSLSA1 is the definition for an entire provenance statement with SLSA 1.0 predicate. +type ProvenanceStatementSLSA1 struct { + StatementHeader + Predicate slsa1.ProvenancePredicate `json:"predicate"` +} + +// ProvenanceStatement is the definition for an entire provenance statement with SLSA 0.2 predicate. +// Deprecated: Only version-specific provenance structs will be maintained (ProvenanceStatementSLSA01, ProvenanceStatementSLSA02). +type ProvenanceStatement struct { + StatementHeader + Predicate slsa02.ProvenancePredicate `json:"predicate"` +} + +// LinkStatement is the definition for an entire link statement. +type LinkStatement struct { + StatementHeader + Predicate Link `json:"predicate"` +} + +/* +SPDXStatement is the definition for an entire SPDX statement. +This is currently not implemented. Some tooling exists here: +https://github.com/spdx/tools-golang, but this software is still in +early state. +This struct is the same as the generic Statement struct but is added for +completeness +*/ +type SPDXStatement struct { + StatementHeader + Predicate interface{} `json:"predicate"` +} + +/* +CycloneDXStatement defines a cyclonedx sbom in the predicate. It is not +currently serialized just as its SPDX counterpart. It is an empty +interface, like the generic Statement. +*/ +type CycloneDXStatement struct { + StatementHeader + Predicate interface{} `json:"predicate"` +} diff --git a/vendor/github.com/in-toto/in-toto-golang/in_toto/envelope.go b/vendor/github.com/in-toto/in-toto-golang/in_toto/envelope.go new file mode 100644 index 0000000000..2c8afff1f7 --- /dev/null +++ b/vendor/github.com/in-toto/in-toto-golang/in_toto/envelope.go @@ -0,0 +1,166 @@ +package in_toto + +import ( + "context" + "encoding/base64" + "encoding/json" + "errors" + "fmt" + "os" + + "github.com/secure-systems-lab/go-securesystemslib/cjson" + "github.com/secure-systems-lab/go-securesystemslib/dsse" + "github.com/secure-systems-lab/go-securesystemslib/signerverifier" +) + +// PayloadType is the payload type used for links and layouts. +const PayloadType = "application/vnd.in-toto+json" + +// ErrInvalidPayloadType indicates that the envelope used an unknown payload type +var ErrInvalidPayloadType = errors.New("unknown payload type") + +type Envelope struct { + envelope *dsse.Envelope + payload any +} + +func loadEnvelope(env *dsse.Envelope) (*Envelope, error) { + e := &Envelope{envelope: env} + + contentBytes, err := env.DecodeB64Payload() + if err != nil { + return nil, err + } + + payload, err := loadPayload(contentBytes) + if err != nil { + return nil, err + } + e.payload = payload + + return e, nil +} + +func (e *Envelope) SetPayload(payload any) error { + encodedBytes, err := cjson.EncodeCanonical(payload) + if err != nil { + return err + } + + e.payload = payload + e.envelope = &dsse.Envelope{ + Payload: base64.StdEncoding.EncodeToString(encodedBytes), + PayloadType: PayloadType, + } + + return nil +} + +func (e *Envelope) GetPayload() any { + return e.payload +} + +func (e *Envelope) VerifySignature(key Key) error { + verifier, err := getSignerVerifierFromKey(key) + if err != nil { + return err + } + + ev, err := dsse.NewEnvelopeVerifier(verifier) + if err != nil { + return err + } + + _, err = ev.Verify(context.Background(), e.envelope) + return err +} + +func (e *Envelope) Sign(key Key) error { + signer, err := getSignerVerifierFromKey(key) + if err != nil { + return err + } + + es, err := dsse.NewEnvelopeSigner(signer) + if err != nil { + return err + } + + payload, err := e.envelope.DecodeB64Payload() + if err != nil { + return err + } + + env, err := es.SignPayload(context.Background(), e.envelope.PayloadType, payload) + if err != nil { + return err + } + + e.envelope = env + return nil +} + +func (e *Envelope) Sigs() []Signature { + sigs := []Signature{} + for _, s := range e.envelope.Signatures { + sigs = append(sigs, Signature{ + KeyID: s.KeyID, + Sig: s.Sig, + }) + } + return sigs +} + +func (e *Envelope) GetSignatureForKeyID(keyID string) (Signature, error) { + for _, s := range e.Sigs() { + if s.KeyID == keyID { + return s, nil + } + } + + return Signature{}, fmt.Errorf("no signature found for key '%s'", keyID) +} + +func (e *Envelope) Dump(path string) error { + jsonBytes, err := json.MarshalIndent(e.envelope, "", " ") + if err != nil { + return err + } + + // Write JSON bytes to the passed path with permissions (-rw-r--r--) + err = os.WriteFile(path, jsonBytes, 0644) + if err != nil { + return err + } + + return nil +} + +func getSignerVerifierFromKey(key Key) (dsse.SignerVerifier, error) { + sslibKey := getSSLibKeyFromKey(key) + + switch sslibKey.KeyType { + case signerverifier.RSAKeyType: + return signerverifier.NewRSAPSSSignerVerifierFromSSLibKey(&sslibKey) + case signerverifier.ED25519KeyType: + return signerverifier.NewED25519SignerVerifierFromSSLibKey(&sslibKey) + case signerverifier.ECDSAKeyType: + return signerverifier.NewECDSASignerVerifierFromSSLibKey(&sslibKey) + } + + return nil, ErrUnsupportedKeyType +} + +func getSSLibKeyFromKey(key Key) signerverifier.SSLibKey { + return signerverifier.SSLibKey{ + KeyType: key.KeyType, + KeyIDHashAlgorithms: key.KeyIDHashAlgorithms, + KeyID: key.KeyID, + Scheme: key.Scheme, + KeyVal: signerverifier.KeyVal{ + Public: key.KeyVal.Public, + Private: key.KeyVal.Private, + Certificate: key.KeyVal.Certificate, + }, + } +} diff --git a/vendor/github.com/in-toto/in-toto-golang/in_toto/keylib.go b/vendor/github.com/in-toto/in-toto-golang/in_toto/keylib.go index 7de482821a..52429ca44b 100644 --- a/vendor/github.com/in-toto/in-toto-golang/in_toto/keylib.go +++ b/vendor/github.com/in-toto/in-toto-golang/in_toto/keylib.go @@ -13,7 +13,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "os" "strings" @@ -325,7 +324,7 @@ func (k *Key) LoadKeyReader(r io.Reader, scheme string, KeyIDHashAlgorithms []st return ErrNoPEMBlock } // Read key bytes - pemBytes, err := ioutil.ReadAll(r) + pemBytes, err := io.ReadAll(r) if err != nil { return err } @@ -344,7 +343,7 @@ func (k *Key) LoadKeyReaderDefaults(r io.Reader) error { return ErrNoPEMBlock } // Read key bytes - pemBytes, err := ioutil.ReadAll(r) + pemBytes, err := io.ReadAll(r) if err != nil { return err } @@ -366,7 +365,7 @@ func (k *Key) LoadKeyReaderDefaults(r io.Reader) error { func getDefaultKeyScheme(key interface{}) (scheme string, keyIDHashAlgorithms []string, err error) { keyIDHashAlgorithms = []string{"sha256", "sha512"} - switch key.(type) { + switch k := key.(type) { case *rsa.PublicKey, *rsa.PrivateKey: scheme = rsassapsssha256Scheme case ed25519.PrivateKey, ed25519.PublicKey: @@ -374,7 +373,7 @@ func getDefaultKeyScheme(key interface{}) (scheme string, keyIDHashAlgorithms [] case *ecdsa.PrivateKey, *ecdsa.PublicKey: scheme = ecdsaSha2nistp256 case *x509.Certificate: - return getDefaultKeyScheme(key.(*x509.Certificate).PublicKey) + return getDefaultKeyScheme(k.PublicKey) default: err = ErrUnsupportedKeyType } @@ -382,11 +381,10 @@ func getDefaultKeyScheme(key interface{}) (scheme string, keyIDHashAlgorithms [] return scheme, keyIDHashAlgorithms, err } -func (k *Key) loadKey(key interface{}, pemData *pem.Block, scheme string, keyIDHashAlgorithms []string) error { - - switch key.(type) { +func (k *Key) loadKey(keyObj interface{}, pemData *pem.Block, scheme string, keyIDHashAlgorithms []string) error { + switch key := keyObj.(type) { case *rsa.PublicKey: - pubKeyBytes, err := x509.MarshalPKIXPublicKey(key.(*rsa.PublicKey)) + pubKeyBytes, err := x509.MarshalPKIXPublicKey(key) if err != nil { return err } @@ -396,7 +394,7 @@ func (k *Key) loadKey(key interface{}, pemData *pem.Block, scheme string, keyIDH case *rsa.PrivateKey: // Note: RSA Public Keys will get stored as X.509 SubjectPublicKeyInfo (RFC5280) // This behavior is consistent to the securesystemslib - pubKeyBytes, err := x509.MarshalPKIXPublicKey(key.(*rsa.PrivateKey).Public()) + pubKeyBytes, err := x509.MarshalPKIXPublicKey(key.Public()) if err != nil { return err } @@ -404,16 +402,16 @@ func (k *Key) loadKey(key interface{}, pemData *pem.Block, scheme string, keyIDH return err } case ed25519.PublicKey: - if err := k.setKeyComponents(key.(ed25519.PublicKey), []byte{}, ed25519KeyType, scheme, keyIDHashAlgorithms); err != nil { + if err := k.setKeyComponents(key, []byte{}, ed25519KeyType, scheme, keyIDHashAlgorithms); err != nil { return err } case ed25519.PrivateKey: - pubKeyBytes := key.(ed25519.PrivateKey).Public() - if err := k.setKeyComponents(pubKeyBytes.(ed25519.PublicKey), key.(ed25519.PrivateKey), ed25519KeyType, scheme, keyIDHashAlgorithms); err != nil { + pubKeyBytes := key.Public() + if err := k.setKeyComponents(pubKeyBytes.(ed25519.PublicKey), key, ed25519KeyType, scheme, keyIDHashAlgorithms); err != nil { return err } case *ecdsa.PrivateKey: - pubKeyBytes, err := x509.MarshalPKIXPublicKey(key.(*ecdsa.PrivateKey).Public()) + pubKeyBytes, err := x509.MarshalPKIXPublicKey(key.Public()) if err != nil { return err } @@ -421,7 +419,7 @@ func (k *Key) loadKey(key interface{}, pemData *pem.Block, scheme string, keyIDH return err } case *ecdsa.PublicKey: - pubKeyBytes, err := x509.MarshalPKIXPublicKey(key.(*ecdsa.PublicKey)) + pubKeyBytes, err := x509.MarshalPKIXPublicKey(key) if err != nil { return err } @@ -429,7 +427,7 @@ func (k *Key) loadKey(key interface{}, pemData *pem.Block, scheme string, keyIDH return err } case *x509.Certificate: - err := k.loadKey(key.(*x509.Certificate).PublicKey, pemData, scheme, keyIDHashAlgorithms) + err := k.loadKey(key.PublicKey, pemData, scheme, keyIDHashAlgorithms) if err != nil { return err } diff --git a/vendor/github.com/in-toto/in-toto-golang/in_toto/model.go b/vendor/github.com/in-toto/in-toto-golang/in_toto/model.go index e22b79da32..f56b784ea0 100644 --- a/vendor/github.com/in-toto/in-toto-golang/in_toto/model.go +++ b/vendor/github.com/in-toto/in-toto-golang/in_toto/model.go @@ -7,7 +7,6 @@ import ( "encoding/json" "errors" "fmt" - "io/ioutil" "os" "reflect" "regexp" @@ -15,10 +14,6 @@ import ( "strings" "time" - "github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/common" - slsa01 "github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/v0.1" - slsa02 "github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/v0.2" - "github.com/secure-systems-lab/go-securesystemslib/cjson" "github.com/secure-systems-lab/go-securesystemslib/dsse" ) @@ -30,7 +25,7 @@ and private keys in PEM format stored as strings. For public keys the Private field may be an empty string. */ type KeyVal struct { - Private string `json:"private"` + Private string `json:"private,omitempty"` Public string `json:"public"` Certificate string `json:"certificate,omitempty"` } @@ -48,9 +43,6 @@ type Key struct { Scheme string `json:"scheme"` } -// PayloadType is the payload type used for links and layouts. -const PayloadType = "application/vnd.in-toto+json" - // ErrEmptyKeyField will be thrown if a field in our Key struct is empty. var ErrEmptyKeyField = errors.New("empty field in key") @@ -73,23 +65,6 @@ var ErrNoPublicKey = errors.New("the given key is not a public key") // for example: curve size = "521" and scheme = "ecdsa-sha2-nistp224" var ErrCurveSizeSchemeMismatch = errors.New("the scheme does not match the curve size") -const ( - // StatementInTotoV01 is the statement type for the generalized link format - // containing statements. This is constant for all predicate types. - StatementInTotoV01 = "https://in-toto.io/Statement/v0.1" - // PredicateSPDX represents a SBOM using the SPDX standard. - // The SPDX mandates 'spdxVersion' field, so predicate type can omit - // version. - PredicateSPDX = "https://spdx.dev/Document" - // PredicateCycloneDX represents a CycloneDX SBOM - PredicateCycloneDX = "https://cyclonedx.org/bom" - // PredicateLinkV1 represents an in-toto 0.9 link. - PredicateLinkV1 = "https://in-toto.io/Link/v1" -) - -// ErrInvalidPayloadType indicates that the envelope used an unkown payload type -var ErrInvalidPayloadType = errors.New("unknown payload type") - /* matchEcdsaScheme checks if the scheme suffix, matches the ecdsa key curve size. We do not need a full regex match here, because @@ -702,6 +677,67 @@ func validateLayout(layout Layout) error { return nil } +type Metadata interface { + Sign(Key) error + VerifySignature(Key) error + GetPayload() any + Sigs() []Signature + GetSignatureForKeyID(string) (Signature, error) + Dump(string) error +} + +func LoadMetadata(path string) (Metadata, error) { + jsonBytes, err := os.ReadFile(path) + if err != nil { + return nil, err + } + + var rawData map[string]*json.RawMessage + if err := json.Unmarshal(jsonBytes, &rawData); err != nil { + return nil, err + } + + if _, ok := rawData["payloadType"]; ok { + dsseEnv := &dsse.Envelope{} + if rawData["payload"] == nil || rawData["signatures"] == nil { + return nil, fmt.Errorf("in-toto metadata envelope requires 'payload' and 'signatures' parts") + } + + if err := json.Unmarshal(jsonBytes, dsseEnv); err != nil { + return nil, err + } + + if dsseEnv.PayloadType != PayloadType { + return nil, ErrInvalidPayloadType + } + + return loadEnvelope(dsseEnv) + } + + mb := &Metablock{} + + // Error out on missing `signed` or `signatures` field or if + // one of them has a `null` value, which would lead to a nil pointer + // dereference in Unmarshal below. + if rawData["signed"] == nil || rawData["signatures"] == nil { + return nil, fmt.Errorf("in-toto metadata requires 'signed' and 'signatures' parts") + } + + // Fully unmarshal signatures part + if err := json.Unmarshal(*rawData["signatures"], &mb.Signatures); err != nil { + return nil, err + } + + payload, err := loadPayload(*rawData["signed"]) + if err != nil { + return nil, err + } + + mb.Signed = payload + + return mb, nil +} + /* Metablock is a generic container for signable in-toto objects such as Layout or Link. It has two fields, one that contains the signable object and one that @@ -767,17 +803,13 @@ func checkRequiredJSONFields(obj map[string]interface{}, Load parses JSON formatted metadata at the passed path into the Metablock object on which it was called. It returns an error if it cannot parse a valid JSON formatted Metablock that contains a Link or Layout. + +Deprecated: Use LoadMetadata for a signature wrapper agnostic way to load an +envelope. */ func (mb *Metablock) Load(path string) error { - // Open file and close before returning - jsonFile, err := os.Open(path) - if err != nil { - return err - } - defer jsonFile.Close() - // Read entire file - jsonBytes, err := ioutil.ReadAll(jsonFile) + jsonBytes, err := os.ReadFile(path) if err != nil { return err } @@ -803,54 +835,14 @@ func (mb *Metablock) Load(path string) error { return err } - // Temporarily copy signed to opaque map to inspect the `_type` of signed - // and create link or layout accordingly - var signed map[string]interface{} - if err := json.Unmarshal(*rawMb["signed"], &signed); err != nil { + payload, err := loadPayload(*rawMb["signed"]) + if err != nil { return err } - if signed["_type"] == "link" { - var link Link - if err := checkRequiredJSONFields(signed, reflect.TypeOf(link)); err != nil { - return err - } + mb.Signed = payload - data, err := rawMb["signed"].MarshalJSON() - if err != nil { - return err - } - decoder := json.NewDecoder(strings.NewReader(string(data))) - decoder.DisallowUnknownFields() - if err := decoder.Decode(&link); err != nil { - return err - } - mb.Signed = link - - } else if signed["_type"] == "layout" { - var layout Layout - if err := checkRequiredJSONFields(signed, reflect.TypeOf(layout)); err != nil { - return err - } - - data, err := rawMb["signed"].MarshalJSON() - if err != nil { - return err - } - decoder := json.NewDecoder(strings.NewReader(string(data))) - decoder.DisallowUnknownFields() - if err := decoder.Decode(&layout); err != nil { - return err - } - - mb.Signed = layout - - } else { - return fmt.Errorf("the '_type' field of the 'signed' part of in-toto" + - " metadata must be one of 'link' or 'layout'") - } - - return jsonFile.Close() + return nil } /* @@ -866,7 +858,7 @@ func (mb *Metablock) Dump(path string) error { } // Write JSON bytes to the passed path with permissions (-rw-r--r--) - err = ioutil.WriteFile(path, jsonBytes, 0644) + err = os.WriteFile(path, jsonBytes, 0644) if err != nil { return err } @@ -883,6 +875,14 @@ func (mb *Metablock) GetSignableRepresentation() ([]byte, error) { return cjson.EncodeCanonical(mb.Signed) } +func (mb *Metablock) GetPayload() any { + return mb.Signed +} + +func (mb *Metablock) Sigs() []Signature { + return mb.Signatures +} + /* VerifySignature verifies the first signature, corresponding to the passed Key, that it finds in the Signatures field of the Metablock on which it was called. @@ -965,109 +965,3 @@ func (mb *Metablock) Sign(key Key) error { mb.Signatures = append(mb.Signatures, newSignature) return nil } - -// Subject describes the set of software artifacts the statement applies to. -type Subject struct { - Name string `json:"name"` - Digest common.DigestSet `json:"digest"` -} - -// StatementHeader defines the common fields for all statements -type StatementHeader struct { - Type string `json:"_type"` - PredicateType string `json:"predicateType"` - Subject []Subject `json:"subject"` -} - -/* -Statement binds the attestation to a particular subject and identifies the -of the predicate. This struct represents a generic statement. -*/ -type Statement struct { - StatementHeader - // Predicate contains type speficic metadata. - Predicate interface{} `json:"predicate"` -} - -// ProvenanceStatementSLSA01 is the definition for an entire provenance statement with SLSA 0.1 predicate. -type ProvenanceStatementSLSA01 struct { - StatementHeader - Predicate slsa01.ProvenancePredicate `json:"predicate"` -} - -// ProvenanceStatementSLSA02 is the definition for an entire provenance statement with SLSA 0.2 predicate. -type ProvenanceStatementSLSA02 struct { - StatementHeader - Predicate slsa02.ProvenancePredicate `json:"predicate"` -} - -// ProvenanceStatement is the definition for an entire provenance statement with SLSA 0.2 predicate. -// Deprecated: Only version-specific provenance structs will be maintained (ProvenanceStatementSLSA01, ProvenanceStatementSLSA02). -type ProvenanceStatement struct { - StatementHeader - Predicate slsa02.ProvenancePredicate `json:"predicate"` -} - -// LinkStatement is the definition for an entire link statement. -type LinkStatement struct { - StatementHeader - Predicate Link `json:"predicate"` -} - -/* -SPDXStatement is the definition for an entire SPDX statement. -This is currently not implemented. Some tooling exists here: -https://github.com/spdx/tools-golang, but this software is still in -early state. -This struct is the same as the generic Statement struct but is added for -completeness -*/ -type SPDXStatement struct { - StatementHeader - Predicate interface{} `json:"predicate"` -} - -/* -CycloneDXStatement defines a cyclonedx sbom in the predicate. It is not -currently serialized just as its SPDX counterpart. It is an empty -interface, like the generic Statement. -*/ -type CycloneDXStatement struct { - StatementHeader - Predicate interface{} `json:"predicate"` -} - -/* -DSSESigner provides signature generation and validation based on the SSL -Signing Spec: https://github.com/secure-systems-lab/signing-spec -as describe by: https://github.com/MarkLodato/ITE/tree/media-type/ITE/5 -It wraps the generic SSL envelope signer and enforces the correct payload -type both during signature generation and validation. -*/ -type DSSESigner struct { - signer *dsse.EnvelopeSigner -} - -func NewDSSESigner(p ...dsse.SignVerifier) (*DSSESigner, error) { - es, err := dsse.NewEnvelopeSigner(p...) - if err != nil { - return nil, err - } - - return &DSSESigner{ - signer: es, - }, nil -} - -func (s *DSSESigner) SignPayload(body []byte) (*dsse.Envelope, error) { - return s.signer.SignPayload(PayloadType, body) -} - -func (s *DSSESigner) Verify(e *dsse.Envelope) error { - if e.PayloadType != PayloadType { - return ErrInvalidPayloadType - } - - _, err := s.signer.Verify(e) - return err -} diff --git a/vendor/github.com/in-toto/in-toto-golang/in_toto/runlib.go b/vendor/github.com/in-toto/in-toto-golang/in_toto/runlib.go index 87e6905070..f0a55d8219 100644 --- a/vendor/github.com/in-toto/in-toto-golang/in_toto/runlib.go +++ b/vendor/github.com/in-toto/in-toto-golang/in_toto/runlib.go @@ -4,7 +4,7 @@ import ( "bytes" "errors" "fmt" - "io/ioutil" + "io" "os" "os/exec" "path/filepath" @@ -44,7 +44,7 @@ normalized to Unix-style line separators (LF) before hashing file contents. func RecordArtifact(path string, hashAlgorithms []string, lineNormalization bool) (map[string]interface{}, error) { supportedHashMappings := getHashMapping() // Read file from passed path - contents, err := ioutil.ReadFile(path) + contents, err := os.ReadFile(path) hashedContentsMap := make(map[string]interface{}) if err != nil { return nil, err @@ -92,10 +92,10 @@ the following format: If recording an artifact fails the first return value is nil and the second return value is the error. */ -func RecordArtifacts(paths []string, hashAlgorithms []string, gitignorePatterns []string, lStripPaths []string, lineNormalization bool) (evalArtifacts map[string]interface{}, err error) { +func RecordArtifacts(paths []string, hashAlgorithms []string, gitignorePatterns []string, lStripPaths []string, lineNormalization bool, followSymlinkDirs bool) (evalArtifacts map[string]interface{}, err error) { // Make sure to initialize a fresh hashset for every RecordArtifacts call visitedSymlinks = NewSet() - evalArtifacts, err = recordArtifacts(paths, hashAlgorithms, gitignorePatterns, lStripPaths, lineNormalization) + evalArtifacts, err = recordArtifacts(paths, hashAlgorithms, gitignorePatterns, lStripPaths, lineNormalization, followSymlinkDirs) // pass result and error through return evalArtifacts, err } @@ -118,7 +118,7 @@ the following format: If recording an artifact fails the first return value is nil and the second return value is the error. */ -func recordArtifacts(paths []string, hashAlgorithms []string, gitignorePatterns []string, lStripPaths []string, lineNormalization bool) (map[string]interface{}, error) { +func recordArtifacts(paths []string, hashAlgorithms []string, gitignorePatterns []string, lStripPaths []string, lineNormalization bool, followSymlinkDirs bool) (map[string]interface{}, error) { artifacts := make(map[string]interface{}) for _, path := range paths { err := filepath.Walk(path, @@ -160,18 +160,35 @@ func recordArtifacts(paths []string, hashAlgorithms []string, gitignorePatterns if err != nil { return err } + info, err := os.Stat(evalSym) + if err != nil { + return err + } + targetIsDir := false + if info.IsDir() { + if !followSymlinkDirs { + // We don't follow symlinked directories + return nil + } + targetIsDir = true + } // add symlink to visitedSymlinks set // this way, we know which link we have visited already // if we visit a symlink twice, we have detected a symlink cycle visitedSymlinks.Add(path) - // We recursively call RecordArtifacts() to follow + // We recursively call recordArtifacts() to follow // the new path. - evalArtifacts, evalErr := recordArtifacts([]string{evalSym}, hashAlgorithms, gitignorePatterns, lStripPaths, lineNormalization) + evalArtifacts, evalErr := recordArtifacts([]string{evalSym}, hashAlgorithms, gitignorePatterns, lStripPaths, lineNormalization, followSymlinkDirs) if evalErr != nil { return evalErr } for key, value := range evalArtifacts { - artifacts[key] = value + if targetIsDir { + symlinkPath := filepath.Join(path, strings.TrimPrefix(key, evalSym)) + artifacts[symlinkPath] = value + } else { + artifacts[path] = value + } } return nil } @@ -189,8 +206,7 @@ func recordArtifacts(paths []string, hashAlgorithms []string, gitignorePatterns } } // Check if path is unique - _, existingPath := artifacts[path] - if existingPath { + if _, exists := artifacts[path]; exists { return fmt.Errorf("left stripping has resulted in non unique dictionary key: %s", path) } artifacts[path] = artifact @@ -273,8 +289,8 @@ func RunCommand(cmdArgs []string, runDir string) (map[string]interface{}, error) } // TODO: duplicate stdout, stderr - stdout, _ := ioutil.ReadAll(stdoutPipe) - stderr, _ := ioutil.ReadAll(stderrPipe) + stdout, _ := io.ReadAll(stdoutPipe) + stderr, _ := io.ReadAll(stderrPipe) retVal := waitErrToExitCode(cmd.Wait()) @@ -293,14 +309,10 @@ and materials at the passed materialPaths. The returned link is wrapped in a Metablock object. If command execution or artifact recording fails the first return value is an empty Metablock and the second return value is the error. */ -func InTotoRun(name string, runDir string, materialPaths []string, productPaths []string, - cmdArgs []string, key Key, hashAlgorithms []string, gitignorePatterns []string, - lStripPaths []string, lineNormalization bool) (Metablock, error) { - var linkMb Metablock - - materials, err := RecordArtifacts(materialPaths, hashAlgorithms, gitignorePatterns, lStripPaths, lineNormalization) +func InTotoRun(name string, runDir string, materialPaths []string, productPaths []string, cmdArgs []string, key Key, hashAlgorithms []string, gitignorePatterns []string, lStripPaths []string, lineNormalization bool, followSymlinkDirs bool, useDSSE bool) (Metadata, error) { + materials, err := RecordArtifacts(materialPaths, hashAlgorithms, gitignorePatterns, lStripPaths, lineNormalization, followSymlinkDirs) if err != nil { - return linkMb, err + return nil, err } // make sure that we only run RunCommand if cmdArgs is not nil or empty @@ -308,16 +320,16 @@ func InTotoRun(name string, runDir string, materialPaths []string, productPaths if len(cmdArgs) != 0 { byProducts, err = RunCommand(cmdArgs, runDir) if err != nil { - return linkMb, err + return nil, err } } - products, err := RecordArtifacts(productPaths, hashAlgorithms, gitignorePatterns, lStripPaths, lineNormalization) + products, err := RecordArtifacts(productPaths, hashAlgorithms, gitignorePatterns, lStripPaths, lineNormalization, followSymlinkDirs) if err != nil { - return linkMb, err + return nil, err } - linkMb.Signed = Link{ + link := Link{ Type: "link", Name: name, Materials: materials, @@ -327,14 +339,25 @@ func InTotoRun(name string, runDir string, materialPaths []string, productPaths Environment: map[string]interface{}{}, } - linkMb.Signatures = []Signature{} - // We use a new feature from Go1.13 here, to check the key struct. - // IsZero() will return True, if the key hasn't been initialized + if useDSSE { + env := &Envelope{} + if err := env.SetPayload(link); err != nil { + return nil, err + } - // with other values than the default ones. + if !reflect.ValueOf(key).IsZero() { + if err := env.Sign(key); err != nil { + return nil, err + } + } + + return env, nil + } + + linkMb := &Metablock{Signed: link, Signatures: []Signature{}} if !reflect.ValueOf(key).IsZero() { if err := linkMb.Sign(key); err != nil { - return linkMb, err + return nil, err } } @@ -347,14 +370,13 @@ in order to provide evidence for supply chain steps that cannot be carries out by a single command. InTotoRecordStart collects the hashes of the materials before any commands are run, signs the unfinished link, and returns the link. */ -func InTotoRecordStart(name string, materialPaths []string, key Key, hashAlgorithms, gitignorePatterns []string, lStripPaths []string, lineNormalization bool) (Metablock, error) { - var linkMb Metablock - materials, err := RecordArtifacts(materialPaths, hashAlgorithms, gitignorePatterns, lStripPaths, lineNormalization) +func InTotoRecordStart(name string, materialPaths []string, key Key, hashAlgorithms, gitignorePatterns []string, lStripPaths []string, lineNormalization bool, followSymlinkDirs bool, useDSSE bool) (Metadata, error) { + materials, err := RecordArtifacts(materialPaths, hashAlgorithms, gitignorePatterns, lStripPaths, lineNormalization, followSymlinkDirs) if err != nil { - return linkMb, err + return nil, err } - linkMb.Signed = Link{ + link := Link{ Type: "link", Name: name, Materials: materials, @@ -364,9 +386,26 @@ func InTotoRecordStart(name string, materialPaths []string, key Key, hashAlgorit Environment: map[string]interface{}{}, } + if useDSSE { + env := &Envelope{} + if err := env.SetPayload(link); err != nil { + return nil, err + } + + if !reflect.ValueOf(key).IsZero() { + if err := env.Sign(key); err != nil { + return nil, err + } + } + + return env, nil + } + + linkMb := &Metablock{Signed: link, Signatures: []Signature{}} + linkMb.Signatures = []Signature{} if !reflect.ValueOf(key).IsZero() { if err := linkMb.Sign(key); err != nil { - return linkMb, err + return nil, err } } @@ -380,25 +419,39 @@ created by InTotoRecordStart and records the hashes of any products creted by commands run between InTotoRecordStart and InTotoRecordStop. The resultant finished link metablock is then signed by the provided key and returned. */ -func InTotoRecordStop(prelimLinkMb Metablock, productPaths []string, key Key, hashAlgorithms, gitignorePatterns []string, lStripPaths []string, lineNormalization bool) (Metablock, error) { - var linkMb Metablock - if err := prelimLinkMb.VerifySignature(key); err != nil { - return linkMb, err +func InTotoRecordStop(prelimLinkEnv Metadata, productPaths []string, key Key, hashAlgorithms, gitignorePatterns []string, lStripPaths []string, lineNormalization bool, followSymlinkDirs bool, useDSSE bool) (Metadata, error) { + if err := prelimLinkEnv.VerifySignature(key); err != nil { + return nil, err } - link, ok := prelimLinkMb.Signed.(Link) + link, ok := prelimLinkEnv.GetPayload().(Link) if !ok { - return linkMb, errors.New("invalid metadata block") + return nil, errors.New("invalid metadata block") } - products, err := RecordArtifacts(productPaths, hashAlgorithms, gitignorePatterns, lStripPaths, lineNormalization) + products, err := RecordArtifacts(productPaths, hashAlgorithms, gitignorePatterns, lStripPaths, lineNormalization, followSymlinkDirs) if err != nil { - return linkMb, err + return nil, err } link.Products = products - linkMb.Signed = link + if useDSSE { + env := &Envelope{} + if err := env.SetPayload(link); err != nil { + return nil, err + } + + if !reflect.ValueOf(key).IsZero() { + if err := env.Sign(key); err != nil { + return nil, err + } + } + + return env, nil + } + + linkMb := &Metablock{Signed: link, Signatures: []Signature{}} if !reflect.ValueOf(key).IsZero() { if err := linkMb.Sign(key); err != nil { return linkMb, err diff --git a/vendor/github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/v0.2/provenance.go b/vendor/github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/v0.2/provenance.go index 5fca7abb73..40416e29a8 100644 --- a/vendor/github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/v0.2/provenance.go +++ b/vendor/github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/v0.2/provenance.go @@ -11,6 +11,13 @@ const ( PredicateSLSAProvenance = "https://slsa.dev/provenance/v0.2" ) +// These are type aliases to common to avoid backwards incompatible changes. +type ( + DigestSet = common.DigestSet + ProvenanceBuilder = common.ProvenanceBuilder + ProvenanceMaterial = common.ProvenanceMaterial +) + // ProvenancePredicate is the provenance predicate definition. type ProvenancePredicate struct { // Builder identifies the entity that executed the invocation, which is trusted to have diff --git a/vendor/github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/v1/provenance.go b/vendor/github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/v1/provenance.go new file mode 100644 index 0000000000..e849731dce --- /dev/null +++ b/vendor/github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/v1/provenance.go @@ -0,0 +1,151 @@ +package v1 + +import ( + "time" + + "github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/common" +) + +const ( + // PredicateSLSAProvenance represents a build provenance for an artifact. + PredicateSLSAProvenance = "https://slsa.dev/provenance/v1" +) + +// ProvenancePredicate is the provenance predicate definition. +type ProvenancePredicate struct { + // The BuildDefinition describes all of the inputs to the build. The + // accuracy and completeness are implied by runDetails.builder.id. + // + // It SHOULD contain all the information necessary and sufficient to + // initialize the build and begin execution. + BuildDefinition ProvenanceBuildDefinition `json:"buildDefinition"` + + // Details specific to this particular execution of the build. + RunDetails ProvenanceRunDetails `json:"runDetails"` +} + +// ProvenanceBuildDefinition describes the inputs to the build. +type ProvenanceBuildDefinition struct { + // Identifies the template for how to perform the build and interpret the + // parameters and dependencies. + + // The URI SHOULD resolve to a human-readable specification that includes: + // overall description of the build type; schema for externalParameters and + // systemParameters; unambiguous instructions for how to initiate the build + // given this BuildDefinition, and a complete example. + BuildType string `json:"buildType"` + + // The parameters that are under external control, such as those set by a + // user or tenant of the build system. They MUST be complete at SLSA Build + // L3, meaning that that there is no additional mechanism for an external + // party to influence the build. (At lower SLSA Build levels, the + // completeness MAY be best effort.) + + // The build system SHOULD be designed to minimize the size and complexity + // of externalParameters, in order to reduce fragility and ease + // verification. Consumers SHOULD have an expectation of what “good” looks + // like; the more information that they need to check, the harder that task + // becomes. + ExternalParameters interface{} `json:"externalParameters"` + + // The parameters that are under the control of the entity represented by + // builder.id. The primary intention of this field is for debugging, + // incident response, and vulnerability management. The values here MAY be + // necessary for reproducing the build. There is no need to verify these + // parameters because the build system is already trusted, and in many cases + // it is not practical to do so. + InternalParameters interface{} `json:"internalParameters,omitempty"` + + // Unordered collection of artifacts needed at build time. Completeness is + // best effort, at least through SLSA Build L3. For example, if the build + // script fetches and executes “example.com/foo.sh”, which in turn fetches + // “example.com/bar.tar.gz”, then both “foo.sh” and “bar.tar.gz” SHOULD be + // listed here. + ResolvedDependencies []ResourceDescriptor `json:"resolvedDependencies,omitempty"` +} + +// ProvenanceRunDetails includes details specific to a particular execution of a +// build. +type ProvenanceRunDetails struct { + // Identifies the entity that executed the invocation, which is trusted to + // have correctly performed the operation and populated this provenance. + // + // This field is REQUIRED for SLSA Build 1 unless id is implicit from the + // attestation envelope. + Builder Builder `json:"builder"` + + // Metadata about this particular execution of the build. + BuildMetadata BuildMetadata `json:"metadata,omitempty"` + + // Additional artifacts generated during the build that are not considered + // the “output” of the build but that might be needed during debugging or + // incident response. For example, this might reference logs generated + // during the build and/or a digest of the fully evaluated build + // configuration. + // + // In most cases, this SHOULD NOT contain all intermediate files generated + // during the build. Instead, this SHOULD only contain files that are + // likely to be useful later and that cannot be easily reproduced. + Byproducts []ResourceDescriptor `json:"byproducts,omitempty"` +} + +// ResourceDescriptor describes a particular software artifact or resource +// (mutable or immutable). +// See https://github.com/in-toto/attestation/blob/main/spec/v1.0/resource_descriptor.md +type ResourceDescriptor struct { + // A URI used to identify the resource or artifact globally. This field is + // REQUIRED unless either digest or content is set. + URI string `json:"uri,omitempty"` + + // A set of cryptographic digests of the contents of the resource or + // artifact. This field is REQUIRED unless either uri or content is set. + Digest common.DigestSet `json:"digest,omitempty"` + + // TMachine-readable identifier for distinguishing between descriptors. + Name string `json:"name,omitempty"` + + // The location of the described resource or artifact, if different from the + // uri. + DownloadLocation string `json:"downloadLocation,omitempty"` + + // The MIME Type (i.e., media type) of the described resource or artifact. + MediaType string `json:"mediaType,omitempty"` + + // The contents of the resource or artifact. This field is REQUIRED unless + // either uri or digest is set. + Content []byte `json:"content,omitempty"` + + // This field MAY be used to provide additional information or metadata + // about the resource or artifact that may be useful to the consumer when + // evaluating the attestation against a policy. + Annotations map[string]interface{} `json:"annotations,omitempty"` +} + +// Builder represents the transitive closure of all the entities that are, by +// necessity, trusted to faithfully run the build and record the provenance. +type Builder struct { + // URI indicating the transitive closure of the trusted builder. + ID string `json:"id"` + + // Version numbers of components of the builder. + Version map[string]string `json:"version,omitempty"` + + // Dependencies used by the orchestrator that are not run within the + // workload and that do not affect the build, but might affect the + // provenance generation or security guarantees. + BuilderDependencies []ResourceDescriptor `json:"builderDependencies,omitempty"` +} + +type BuildMetadata struct { + // Identifies this particular build invocation, which can be useful for + // finding associated logs or other ad-hoc analysis. The exact meaning and + // format is defined by builder.id; by default it is treated as opaque and + // case-sensitive. The value SHOULD be globally unique. + InvocationID string `json:"invocationID,omitempty"` + + // The timestamp of when the build started. + StartedOn *time.Time `json:"startedOn,omitempty"` + + // The timestamp of when the build completed. + FinishedOn *time.Time `json:"finishedOn,omitempty"` +} diff --git a/vendor/github.com/in-toto/in-toto-golang/in_toto/util.go b/vendor/github.com/in-toto/in-toto-golang/in_toto/util.go index 59cba86eb5..5c36dede13 100644 --- a/vendor/github.com/in-toto/in-toto-golang/in_toto/util.go +++ b/vendor/github.com/in-toto/in-toto-golang/in_toto/util.go @@ -1,9 +1,15 @@ package in_toto import ( + "encoding/json" + "errors" "fmt" + "reflect" + "strings" ) +var ErrUnknownMetadataType = errors.New("unknown metadata type encountered: not link or layout") + /* Set represents a data structure for set operations. See `NewSet` for how to create a Set, and available Set receivers for useful set operations. @@ -145,3 +151,40 @@ func (s Set) IsSubSet(subset Set) bool { } return true } + +func loadPayload(payloadBytes []byte) (any, error) { + var payload map[string]any + if err := json.Unmarshal(payloadBytes, &payload); err != nil { + return nil, fmt.Errorf("error decoding payload: %w", err) + } + + if payload["_type"] == "link" { + var link Link + if err := checkRequiredJSONFields(payload, reflect.TypeOf(link)); err != nil { + return nil, fmt.Errorf("error decoding payload: %w", err) + } + + decoder := json.NewDecoder(strings.NewReader(string(payloadBytes))) + decoder.DisallowUnknownFields() + if err := decoder.Decode(&link); err != nil { + return nil, fmt.Errorf("error decoding payload: %w", err) + } + + return link, nil + } else if payload["_type"] == "layout" { + var layout Layout + if err := checkRequiredJSONFields(payload, reflect.TypeOf(layout)); err != nil { + return nil, fmt.Errorf("error decoding payload: %w", err) + } + + decoder := json.NewDecoder(strings.NewReader(string(payloadBytes))) + decoder.DisallowUnknownFields() + if err := decoder.Decode(&layout); err != nil { + return nil, fmt.Errorf("error decoding payload: %w", err) + } + + return layout, nil + } + + return nil, ErrUnknownMetadataType +} diff --git a/vendor/github.com/in-toto/in-toto-golang/in_toto/verifylib.go b/vendor/github.com/in-toto/in-toto-golang/in_toto/verifylib.go index 2302040f46..2564bd47eb 100644 --- a/vendor/github.com/in-toto/in-toto-golang/in_toto/verifylib.go +++ b/vendor/github.com/in-toto/in-toto-golang/in_toto/verifylib.go @@ -12,7 +12,6 @@ import ( "io" "os" "path" - osPath "path" "path/filepath" "reflect" "regexp" @@ -23,6 +22,8 @@ import ( // ErrInspectionRunDirIsSymlink gets thrown if the runDir is a symlink var ErrInspectionRunDirIsSymlink = errors.New("runDir is a symlink. This is a security risk") +var ErrNotLayout = errors.New("verification workflow passed a non-layout") + /* RunInspections iteratively executes the command in the Run field of all inspections of the passed layout, creating unsigned link metadata that records @@ -41,8 +42,8 @@ If executing the inspection command fails, or if the executed command has a non-zero exit code, the first return value is an empty Metablock map and the second return value is the error. */ -func RunInspections(layout Layout, runDir string, lineNormalization bool) (map[string]Metablock, error) { - inspectionMetadata := make(map[string]Metablock) +func RunInspections(layout Layout, runDir string, lineNormalization bool, useDSSE bool) (map[string]Metadata, error) { + inspectionMetadata := make(map[string]Metadata) for _, inspection := range layout.Inspect { @@ -51,14 +52,14 @@ func RunInspections(layout Layout, runDir string, lineNormalization bool) (map[s paths = []string{runDir} } - linkMb, err := InTotoRun(inspection.Name, runDir, paths, paths, - inspection.Run, Key{}, []string{"sha256"}, nil, nil, lineNormalization) + linkEnv, err := InTotoRun(inspection.Name, runDir, paths, paths, + inspection.Run, Key{}, []string{"sha256"}, nil, nil, lineNormalization, false, useDSSE) if err != nil { return nil, err } - retVal := linkMb.Signed.(Link).ByProducts["return-value"] + retVal := linkEnv.GetPayload().(Link).ByProducts["return-value"] if retVal != float64(0) { return nil, fmt.Errorf("inspection command '%s' of inspection '%s'"+ " returned a non-zero value: %d", inspection.Run, inspection.Name, @@ -67,11 +68,11 @@ func RunInspections(layout Layout, runDir string, lineNormalization bool) (map[s // Dump inspection link to cwd using the short link name format linkName := fmt.Sprintf(LinkNameFormatShort, inspection.Name) - if err := linkMb.Dump(linkName); err != nil { + if err := linkEnv.Dump(linkName); err != nil { fmt.Printf("JSON serialization or writing failed: %s", err) } - inspectionMetadata[inspection.Name] = linkMb + inspectionMetadata[inspection.Name] = linkEnv } return inspectionMetadata, nil } @@ -80,10 +81,10 @@ func RunInspections(layout Layout, runDir string, lineNormalization bool) (map[s // type MATCH. See VerifyArtifacts for more details. func verifyMatchRule(ruleData map[string]string, srcArtifacts map[string]interface{}, srcArtifactQueue Set, - itemsMetadata map[string]Metablock) Set { + itemsMetadata map[string]Metadata) Set { consumed := NewSet() // Get destination link metadata - dstLinkMb, exists := itemsMetadata[ruleData["dstName"]] + dstLinkEnv, exists := itemsMetadata[ruleData["dstName"]] if !exists { // Destination link does not exist, rule can't consume any // artifacts @@ -94,9 +95,9 @@ func verifyMatchRule(ruleData map[string]string, var dstArtifacts map[string]interface{} switch ruleData["dstType"] { case "materials": - dstArtifacts = dstLinkMb.Signed.(Link).Materials + dstArtifacts = dstLinkEnv.GetPayload().(Link).Materials case "products": - dstArtifacts = dstLinkMb.Signed.(Link).Products + dstArtifacts = dstLinkEnv.GetPayload().(Link).Products } // cleanup paths in pattern and artifact maps @@ -140,7 +141,7 @@ func verifyMatchRule(ruleData map[string]string, // Construct corresponding destination artifact path, i.e. // an optional destination prefix plus the source base path - dstPath := path.Clean(osPath.Join(ruleData["dstPrefix"], srcBasePath)) + dstPath := path.Clean(path.Join(ruleData["dstPrefix"], srcBasePath)) // Try to find the corresponding destination artifact dstArtifact, exists := dstArtifacts[dstPath] @@ -180,7 +181,7 @@ DISALLOW rule to fail overall verification, if artifacts are left in the queue that should have been consumed by preceding rules. */ func VerifyArtifacts(items []interface{}, - itemsMetadata map[string]Metablock) error { + itemsMetadata map[string]Metadata) error { // Verify artifact rules for each item in the layout for _, itemI := range items { // The layout item (interface) must be a Link or an Inspection we are only @@ -207,7 +208,7 @@ func VerifyArtifacts(items []interface{}, } // Use the item's name to extract the corresponding link - srcLinkMb, exists := itemsMetadata[itemName] + srcLinkEnv, exists := itemsMetadata[itemName] if !exists { return fmt.Errorf("VerifyArtifacts could not find metadata"+ " for item '%s', got: '%s'", itemName, itemsMetadata) @@ -215,8 +216,8 @@ func VerifyArtifacts(items []interface{}, // Create shortcuts to materials and products (including hashes) reported // by the item's link, required to verify "match" rules - materials := srcLinkMb.Signed.(Link).Materials - products := srcLinkMb.Signed.(Link).Products + materials := srcLinkEnv.GetPayload().(Link).Materials + products := srcLinkEnv.GetPayload().(Link).Products // All other rules only require the material or product paths (without // hashes). We extract them from the corresponding maps and store them as @@ -364,9 +365,9 @@ Products, the first return value is an empty Metablock map and the second return value is the error. */ func ReduceStepsMetadata(layout Layout, - stepsMetadata map[string]map[string]Metablock) (map[string]Metablock, + stepsMetadata map[string]map[string]Metadata) (map[string]Metadata, error) { - stepsMetadataReduced := make(map[string]Metablock) + stepsMetadataReduced := make(map[string]Metadata) for _, step := range layout.Steps { linksPerStep, ok := stepsMetadata[step.Name] @@ -379,16 +380,16 @@ func ReduceStepsMetadata(layout Layout, // Get the first link (could be any link) for the current step, which will // serve as reference link for below comparisons var referenceKeyID string - var referenceLinkMb Metablock - for keyID, linkMb := range linksPerStep { - referenceLinkMb = linkMb + var referenceLinkEnv Metadata + for keyID, linkEnv := range linksPerStep { + referenceLinkEnv = linkEnv referenceKeyID = keyID break } // Only one link, nothing to reduce, take the reference link if len(linksPerStep) == 1 { - stepsMetadataReduced[step.Name] = referenceLinkMb + stepsMetadataReduced[step.Name] = referenceLinkEnv // Multiple links, reduce but first check } else { @@ -396,11 +397,11 @@ func ReduceStepsMetadata(layout Layout, // TODO: What should we do if there are more links, than the // threshold requires, but not all of them are equal? Right now we would // also error. - for keyID, linkMb := range linksPerStep { - if !reflect.DeepEqual(linkMb.Signed.(Link).Materials, - referenceLinkMb.Signed.(Link).Materials) || - !reflect.DeepEqual(linkMb.Signed.(Link).Products, - referenceLinkMb.Signed.(Link).Products) { + for keyID, linkEnv := range linksPerStep { + if !reflect.DeepEqual(linkEnv.GetPayload().(Link).Materials, + referenceLinkEnv.GetPayload().(Link).Materials) || + !reflect.DeepEqual(linkEnv.GetPayload().(Link).Products, + referenceLinkEnv.GetPayload().(Link).Products) { return nil, fmt.Errorf("link '%s' and '%s' have different"+ " artifacts", fmt.Sprintf(LinkNameFormat, step.Name, referenceKeyID), @@ -408,7 +409,7 @@ func ReduceStepsMetadata(layout Layout, } } // We haven't errored out, so we can reduce (i.e take the reference link) - stepsMetadataReduced[step.Name] = referenceLinkMb + stepsMetadataReduced[step.Name] = referenceLinkEnv } } return stepsMetadataReduced, nil @@ -421,7 +422,7 @@ command, as per the layout. Soft verification means that, in case a command does not align, a warning is issued. */ func VerifyStepCommandAlignment(layout Layout, - stepsMetadata map[string]map[string]Metablock) { + stepsMetadata map[string]map[string]Metadata) { for _, step := range layout.Steps { linksPerStep, ok := stepsMetadata[step.Name] // We should never get here, layout verification must fail earlier @@ -430,9 +431,9 @@ func VerifyStepCommandAlignment(layout Layout, "', no link metadata found.") } - for signerKeyID, linkMb := range linksPerStep { + for signerKeyID, linkEnv := range linksPerStep { expectedCommandS := strings.Join(step.ExpectedCommand, " ") - executedCommandS := strings.Join(linkMb.Signed.(Link).Command, " ") + executedCommandS := strings.Join(linkEnv.GetPayload().(Link).Command, " ") if expectedCommandS != executedCommandS { linkName := fmt.Sprintf(LinkNameFormat, step.Name, signerKeyID) @@ -502,11 +503,11 @@ return value is an empty map of Metablock maps and the second return value is the error. */ func VerifyLinkSignatureThesholds(layout Layout, - stepsMetadata map[string]map[string]Metablock, rootCertPool, intermediateCertPool *x509.CertPool) ( - map[string]map[string]Metablock, error) { + stepsMetadata map[string]map[string]Metadata, rootCertPool, intermediateCertPool *x509.CertPool) ( + map[string]map[string]Metadata, error) { // This will stores links with valid signature from an authorized functionary // for all steps - stepsMetadataVerified := make(map[string]map[string]Metablock) + stepsMetadataVerified := make(map[string]map[string]Metadata) // Try to find enough (>= threshold) links each with a valid signature from // distinct authorized functionaries for each step @@ -515,7 +516,7 @@ func VerifyLinkSignatureThesholds(layout Layout, // This will store links with valid signature from an authorized // functionary for the given step - linksPerStepVerified := make(map[string]Metablock) + linksPerStepVerified := make(map[string]Metadata) // Check if there are any links at all for the given step linksPerStep, ok := stepsMetadata[step.Name] @@ -528,12 +529,12 @@ func VerifyLinkSignatureThesholds(layout Layout, // verification passes. Only good links are stored, to verify thresholds // below. isAuthorizedSignature := false - for signerKeyID, linkMb := range linksPerStep { + for signerKeyID, linkEnv := range linksPerStep { for _, authorizedKeyID := range step.PubKeys { if signerKeyID == authorizedKeyID { if verifierKey, ok := layout.Keys[authorizedKeyID]; ok { - if err := linkMb.VerifySignature(verifierKey); err == nil { - linksPerStepVerified[signerKeyID] = linkMb + if err := linkEnv.VerifySignature(verifierKey); err == nil { + linksPerStepVerified[signerKeyID] = linkEnv isAuthorizedSignature = true break } @@ -544,7 +545,7 @@ func VerifyLinkSignatureThesholds(layout Layout, // If the signer's key wasn't in our step's pubkeys array, check the cert pool to // see if the key is known to us. if !isAuthorizedSignature { - sig, err := linkMb.GetSignatureForKeyID(signerKeyID) + sig, err := linkEnv.GetSignatureForKeyID(signerKeyID) if err != nil { stepErr = err continue @@ -563,13 +564,13 @@ func VerifyLinkSignatureThesholds(layout Layout, continue } - err = linkMb.VerifySignature(cert) + err = linkEnv.VerifySignature(cert) if err != nil { stepErr = err continue } - linksPerStepVerified[signerKeyID] = linkMb + linksPerStepVerified[signerKeyID] = linkEnv } } @@ -614,30 +615,30 @@ ignored. Only a preliminary threshold check is performed, that is, if there aren't at least Threshold links for any given step, the first return value is an empty map of Metablock maps and the second return value is the error. */ -func LoadLinksForLayout(layout Layout, linkDir string) (map[string]map[string]Metablock, error) { - stepsMetadata := make(map[string]map[string]Metablock) +func LoadLinksForLayout(layout Layout, linkDir string) (map[string]map[string]Metadata, error) { + stepsMetadata := make(map[string]map[string]Metadata) for _, step := range layout.Steps { - linksPerStep := make(map[string]Metablock) + linksPerStep := make(map[string]Metadata) // Since we can verify against certificates belonging to a CA, we need to // load any possible links - linkFiles, err := filepath.Glob(osPath.Join(linkDir, fmt.Sprintf(LinkGlobFormat, step.Name))) + linkFiles, err := filepath.Glob(path.Join(linkDir, fmt.Sprintf(LinkGlobFormat, step.Name))) if err != nil { return nil, err } for _, linkPath := range linkFiles { - var linkMb Metablock - if err := linkMb.Load(linkPath); err != nil { + linkEnv, err := LoadMetadata(linkPath) + if err != nil { continue } // To get the full key from the metadata's signatures, we have to check // for one with the same short id... signerShortKeyID := strings.TrimSuffix(strings.TrimPrefix(filepath.Base(linkPath), step.Name+"."), ".link") - for _, sig := range linkMb.Signatures { + for _, sig := range linkEnv.Sigs() { if strings.HasPrefix(sig.KeyID, signerShortKeyID) { - linksPerStep[sig.KeyID] = linkMb + linksPerStep[sig.KeyID] = linkEnv break } } @@ -677,14 +678,14 @@ Signatures and keys are associated by key id. If the key map is empty, or the Metablock's Signature field does not have a signature for one or more of the passed keys, or a matching signature is invalid, an error is returned. */ -func VerifyLayoutSignatures(layoutMb Metablock, +func VerifyLayoutSignatures(layoutEnv Metadata, layoutKeys map[string]Key) error { if len(layoutKeys) < 1 { return fmt.Errorf("layout verification requires at least one key") } for _, key := range layoutKeys { - if err := layoutMb.VerifySignature(key); err != nil { + if err := layoutEnv.VerifySignature(key); err != nil { return err } } @@ -700,29 +701,35 @@ NOTE: The assumption is that the steps mentioned in the layout are to be performed sequentially. So, the first step mentioned in the layout denotes what comes into the supply chain and the last step denotes what goes out. */ -func GetSummaryLink(layout Layout, stepsMetadataReduced map[string]Metablock, - stepName string) (Metablock, error) { +func GetSummaryLink(layout Layout, stepsMetadataReduced map[string]Metadata, + stepName string, useDSSE bool) (Metadata, error) { var summaryLink Link - var result Metablock if len(layout.Steps) > 0 { firstStepLink := stepsMetadataReduced[layout.Steps[0].Name] lastStepLink := stepsMetadataReduced[layout.Steps[len(layout.Steps)-1].Name] - summaryLink.Materials = firstStepLink.Signed.(Link).Materials + summaryLink.Materials = firstStepLink.GetPayload().(Link).Materials summaryLink.Name = stepName - summaryLink.Type = firstStepLink.Signed.(Link).Type + summaryLink.Type = firstStepLink.GetPayload().(Link).Type - summaryLink.Products = lastStepLink.Signed.(Link).Products - summaryLink.ByProducts = lastStepLink.Signed.(Link).ByProducts + summaryLink.Products = lastStepLink.GetPayload().(Link).Products + summaryLink.ByProducts = lastStepLink.GetPayload().(Link).ByProducts // Using the last command of the sublayout as the command // of the summary link can be misleading. Is it necessary to // include all the commands executed as part of sublayout? - summaryLink.Command = lastStepLink.Signed.(Link).Command + summaryLink.Command = lastStepLink.GetPayload().(Link).Command } - result.Signed = summaryLink + if useDSSE { + env := &Envelope{} + if err := env.SetPayload(summaryLink); err != nil { + return nil, err + } - return result, nil + return env, nil + } + + return &Metablock{Signed: summaryLink}, nil } /* @@ -731,11 +738,11 @@ so, recursively resolves it and replaces it with a summary link summarizing the steps carried out in the sublayout. */ func VerifySublayouts(layout Layout, - stepsMetadataVerified map[string]map[string]Metablock, - superLayoutLinkPath string, intermediatePems [][]byte, lineNormalization bool) (map[string]map[string]Metablock, error) { + stepsMetadataVerified map[string]map[string]Metadata, + superLayoutLinkPath string, intermediatePems [][]byte, lineNormalization bool) (map[string]map[string]Metadata, error) { for stepName, linkData := range stepsMetadataVerified { for keyID, metadata := range linkData { - if _, ok := metadata.Signed.(Layout); ok { + if _, ok := metadata.GetPayload().(Layout); ok { layoutKeys := make(map[string]Key) layoutKeys[keyID] = layout.Keys[keyID] @@ -861,55 +868,60 @@ Metablock object. NOTE: Artifact rules of type "create", "modify" and "delete" are currently not supported. */ -func InTotoVerify(layoutMb Metablock, layoutKeys map[string]Key, +func InTotoVerify(layoutEnv Metadata, layoutKeys map[string]Key, linkDir string, stepName string, parameterDictionary map[string]string, intermediatePems [][]byte, lineNormalization bool) ( - Metablock, error) { - - var summaryLink Metablock - var err error + Metadata, error) { // Verify root signatures - if err := VerifyLayoutSignatures(layoutMb, layoutKeys); err != nil { - return summaryLink, err + if err := VerifyLayoutSignatures(layoutEnv, layoutKeys); err != nil { + return nil, err } - // Extract the layout from its Metablock container (for further processing) - layout := layoutMb.Signed.(Layout) + useDSSE := false + if _, ok := layoutEnv.(*Envelope); ok { + useDSSE = true + } + + // Extract the layout from its Metadata container (for further processing) + layout, ok := layoutEnv.GetPayload().(Layout) + if !ok { + return nil, ErrNotLayout + } // Verify layout expiration if err := VerifyLayoutExpiration(layout); err != nil { - return summaryLink, err + return nil, err } // Substitute parameters in layout - layout, err = SubstituteParameters(layout, parameterDictionary) + layout, err := SubstituteParameters(layout, parameterDictionary) if err != nil { - return summaryLink, err + return nil, err } rootCertPool, intermediateCertPool, err := LoadLayoutCertificates(layout, intermediatePems) if err != nil { - return summaryLink, err + return nil, err } // Load links for layout stepsMetadata, err := LoadLinksForLayout(layout, linkDir) if err != nil { - return summaryLink, err + return nil, err } // Verify link signatures stepsMetadataVerified, err := VerifyLinkSignatureThesholds(layout, stepsMetadata, rootCertPool, intermediateCertPool) if err != nil { - return summaryLink, err + return nil, err } // Verify and resolve sublayouts stepsSublayoutVerified, err := VerifySublayouts(layout, stepsMetadataVerified, linkDir, intermediatePems, lineNormalization) if err != nil { - return summaryLink, err + return nil, err } // Verify command alignment (WARNING only) @@ -922,18 +934,18 @@ func InTotoVerify(layoutMb Metablock, layoutKeys map[string]Key, stepsMetadataReduced, err := ReduceStepsMetadata(layout, stepsSublayoutVerified) if err != nil { - return summaryLink, err + return nil, err } // Verify artifact rules if err = VerifyArtifacts(layout.stepsAsInterfaceSlice(), stepsMetadataReduced); err != nil { - return summaryLink, err + return nil, err } - inspectionMetadata, err := RunInspections(layout, "", lineNormalization) + inspectionMetadata, err := RunInspections(layout, "", lineNormalization, useDSSE) if err != nil { - return summaryLink, err + return nil, err } // Add steps metadata to inspection metadata, because inspection artifact @@ -944,51 +956,48 @@ func InTotoVerify(layoutMb Metablock, layoutKeys map[string]Key, if err = VerifyArtifacts(layout.inspectAsInterfaceSlice(), inspectionMetadata); err != nil { - return summaryLink, err + return nil, err } - summaryLink, err = GetSummaryLink(layout, stepsMetadataReduced, stepName) + summaryLink, err := GetSummaryLink(layout, stepsMetadataReduced, stepName, useDSSE) if err != nil { - return summaryLink, err + return nil, err } return summaryLink, nil } /* -InTotoVerifyWithDirectory provides the same functionality as IntotoVerify, but +InTotoVerifyWithDirectory provides the same functionality as InTotoVerify, but adds the possibility to select a local directory from where the inspections are run. */ -func InTotoVerifyWithDirectory(layoutMb Metablock, layoutKeys map[string]Key, +func InTotoVerifyWithDirectory(layoutEnv Metadata, layoutKeys map[string]Key, linkDir string, runDir string, stepName string, parameterDictionary map[string]string, intermediatePems [][]byte, lineNormalization bool) ( - Metablock, error) { - - var summaryLink Metablock - var err error + Metadata, error) { // runDir sanity checks // check if path exists info, err := os.Stat(runDir) if err != nil { - return Metablock{}, err + return nil, err } // check if runDir is a symlink if info.Mode()&os.ModeSymlink == os.ModeSymlink { - return Metablock{}, ErrInspectionRunDirIsSymlink + return nil, ErrInspectionRunDirIsSymlink } // check if runDir is writable and a directory err = isWritable(runDir) if err != nil { - return Metablock{}, err + return nil, err } // check if runDir is empty (we do not want to overwrite files) // We abuse File.Readdirnames for this action. f, err := os.Open(runDir) if err != nil { - return Metablock{}, err + return nil, err } defer f.Close() // We use Readdirnames(1) for performance reasons, one child node @@ -996,55 +1005,63 @@ func InTotoVerifyWithDirectory(layoutMb Metablock, layoutKeys map[string]Key, _, err = f.Readdirnames(1) // if io.EOF gets returned as error the directory is empty if err == io.EOF { - return Metablock{}, err + return nil, err } err = f.Close() if err != nil { - return Metablock{}, err + return nil, err } // Verify root signatures - if err := VerifyLayoutSignatures(layoutMb, layoutKeys); err != nil { - return summaryLink, err + if err := VerifyLayoutSignatures(layoutEnv, layoutKeys); err != nil { + return nil, err } - // Extract the layout from its Metablock container (for further processing) - layout := layoutMb.Signed.(Layout) + useDSSE := false + if _, ok := layoutEnv.(*Envelope); ok { + useDSSE = true + } + + // Extract the layout from its Metadata container (for further processing) + layout, ok := layoutEnv.GetPayload().(Layout) + if !ok { + return nil, ErrNotLayout + } // Verify layout expiration if err := VerifyLayoutExpiration(layout); err != nil { - return summaryLink, err + return nil, err } // Substitute parameters in layout layout, err = SubstituteParameters(layout, parameterDictionary) if err != nil { - return summaryLink, err + return nil, err } rootCertPool, intermediateCertPool, err := LoadLayoutCertificates(layout, intermediatePems) if err != nil { - return summaryLink, err + return nil, err } // Load links for layout stepsMetadata, err := LoadLinksForLayout(layout, linkDir) if err != nil { - return summaryLink, err + return nil, err } // Verify link signatures stepsMetadataVerified, err := VerifyLinkSignatureThesholds(layout, stepsMetadata, rootCertPool, intermediateCertPool) if err != nil { - return summaryLink, err + return nil, err } // Verify and resolve sublayouts stepsSublayoutVerified, err := VerifySublayouts(layout, stepsMetadataVerified, linkDir, intermediatePems, lineNormalization) if err != nil { - return summaryLink, err + return nil, err } // Verify command alignment (WARNING only) @@ -1057,18 +1074,18 @@ func InTotoVerifyWithDirectory(layoutMb Metablock, layoutKeys map[string]Key, stepsMetadataReduced, err := ReduceStepsMetadata(layout, stepsSublayoutVerified) if err != nil { - return summaryLink, err + return nil, err } // Verify artifact rules if err = VerifyArtifacts(layout.stepsAsInterfaceSlice(), stepsMetadataReduced); err != nil { - return summaryLink, err + return nil, err } - inspectionMetadata, err := RunInspections(layout, runDir, lineNormalization) + inspectionMetadata, err := RunInspections(layout, runDir, lineNormalization, useDSSE) if err != nil { - return summaryLink, err + return nil, err } // Add steps metadata to inspection metadata, because inspection artifact @@ -1079,12 +1096,12 @@ func InTotoVerifyWithDirectory(layoutMb Metablock, layoutKeys map[string]Key, if err = VerifyArtifacts(layout.inspectAsInterfaceSlice(), inspectionMetadata); err != nil { - return summaryLink, err + return nil, err } - summaryLink, err = GetSummaryLink(layout, stepsMetadataReduced, stepName) + summaryLink, err := GetSummaryLink(layout, stepsMetadataReduced, stepName, useDSSE) if err != nil { - return summaryLink, err + return nil, err } return summaryLink, nil diff --git a/vendor/github.com/moby/buildkit/api/services/control/control.pb.go b/vendor/github.com/moby/buildkit/api/services/control/control.pb.go index d76537782c..8d6442afad 100644 --- a/vendor/github.com/moby/buildkit/api/services/control/control.pb.go +++ b/vendor/github.com/moby/buildkit/api/services/control/control.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 +// protoc-gen-go v1.36.6 // protoc v3.11.4 // source: github.com/moby/buildkit/api/services/control/control.proto @@ -16,6 +16,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -75,16 +76,15 @@ func (BuildHistoryEventType) EnumDescriptor() ([]byte, []int) { } type PruneRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Filter []string `protobuf:"bytes,1,rep,name=filter,proto3" json:"filter,omitempty"` + All bool `protobuf:"varint,2,opt,name=all,proto3" json:"all,omitempty"` + KeepDuration int64 `protobuf:"varint,3,opt,name=keepDuration,proto3" json:"keepDuration,omitempty"` + ReservedSpace int64 `protobuf:"varint,4,opt,name=reservedSpace,proto3" json:"reservedSpace,omitempty"` + MaxUsedSpace int64 `protobuf:"varint,5,opt,name=maxUsedSpace,proto3" json:"maxUsedSpace,omitempty"` + MinFreeSpace int64 `protobuf:"varint,6,opt,name=minFreeSpace,proto3" json:"minFreeSpace,omitempty"` unknownFields protoimpl.UnknownFields - - Filter []string `protobuf:"bytes,1,rep,name=filter,proto3" json:"filter,omitempty"` - All bool `protobuf:"varint,2,opt,name=all,proto3" json:"all,omitempty"` - KeepDuration int64 `protobuf:"varint,3,opt,name=keepDuration,proto3" json:"keepDuration,omitempty"` - ReservedSpace int64 `protobuf:"varint,4,opt,name=reservedSpace,proto3" json:"reservedSpace,omitempty"` - MaxUsedSpace int64 `protobuf:"varint,5,opt,name=maxUsedSpace,proto3" json:"maxUsedSpace,omitempty"` - MinFreeSpace int64 `protobuf:"varint,6,opt,name=minFreeSpace,proto3" json:"minFreeSpace,omitempty"` + sizeCache protoimpl.SizeCache } func (x *PruneRequest) Reset() { @@ -160,12 +160,11 @@ func (x *PruneRequest) GetMinFreeSpace() int64 { } type DiskUsageRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Filter []string `protobuf:"bytes,1,rep,name=filter,proto3" json:"filter,omitempty"` + AgeLimit int64 `protobuf:"varint,2,opt,name=ageLimit,proto3" json:"ageLimit,omitempty"` unknownFields protoimpl.UnknownFields - - Filter []string `protobuf:"bytes,1,rep,name=filter,proto3" json:"filter,omitempty"` - AgeLimit int64 `protobuf:"varint,2,opt,name=ageLimit,proto3" json:"ageLimit,omitempty"` + sizeCache protoimpl.SizeCache } func (x *DiskUsageRequest) Reset() { @@ -213,11 +212,10 @@ func (x *DiskUsageRequest) GetAgeLimit() int64 { } type DiskUsageResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Record []*UsageRecord `protobuf:"bytes,1,rep,name=record,proto3" json:"record,omitempty"` unknownFields protoimpl.UnknownFields - - Record []*UsageRecord `protobuf:"bytes,1,rep,name=record,proto3" json:"record,omitempty"` + sizeCache protoimpl.SizeCache } func (x *DiskUsageResponse) Reset() { @@ -258,23 +256,22 @@ func (x *DiskUsageResponse) GetRecord() []*UsageRecord { } type UsageRecord struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` - Mutable bool `protobuf:"varint,2,opt,name=Mutable,proto3" json:"Mutable,omitempty"` - InUse bool `protobuf:"varint,3,opt,name=InUse,proto3" json:"InUse,omitempty"` - Size int64 `protobuf:"varint,4,opt,name=Size,proto3" json:"Size,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` + Mutable bool `protobuf:"varint,2,opt,name=Mutable,proto3" json:"Mutable,omitempty"` + InUse bool `protobuf:"varint,3,opt,name=InUse,proto3" json:"InUse,omitempty"` + Size int64 `protobuf:"varint,4,opt,name=Size,proto3" json:"Size,omitempty"` // Deprecated: Marked as deprecated in github.com/moby/buildkit/api/services/control/control.proto. - Parent string `protobuf:"bytes,5,opt,name=Parent,proto3" json:"Parent,omitempty"` - CreatedAt *timestamp.Timestamp `protobuf:"bytes,6,opt,name=CreatedAt,proto3" json:"CreatedAt,omitempty"` - LastUsedAt *timestamp.Timestamp `protobuf:"bytes,7,opt,name=LastUsedAt,proto3" json:"LastUsedAt,omitempty"` - UsageCount int64 `protobuf:"varint,8,opt,name=UsageCount,proto3" json:"UsageCount,omitempty"` - Description string `protobuf:"bytes,9,opt,name=Description,proto3" json:"Description,omitempty"` - RecordType string `protobuf:"bytes,10,opt,name=RecordType,proto3" json:"RecordType,omitempty"` - Shared bool `protobuf:"varint,11,opt,name=Shared,proto3" json:"Shared,omitempty"` - Parents []string `protobuf:"bytes,12,rep,name=Parents,proto3" json:"Parents,omitempty"` + Parent string `protobuf:"bytes,5,opt,name=Parent,proto3" json:"Parent,omitempty"` + CreatedAt *timestamp.Timestamp `protobuf:"bytes,6,opt,name=CreatedAt,proto3" json:"CreatedAt,omitempty"` + LastUsedAt *timestamp.Timestamp `protobuf:"bytes,7,opt,name=LastUsedAt,proto3" json:"LastUsedAt,omitempty"` + UsageCount int64 `protobuf:"varint,8,opt,name=UsageCount,proto3" json:"UsageCount,omitempty"` + Description string `protobuf:"bytes,9,opt,name=Description,proto3" json:"Description,omitempty"` + RecordType string `protobuf:"bytes,10,opt,name=RecordType,proto3" json:"RecordType,omitempty"` + Shared bool `protobuf:"varint,11,opt,name=Shared,proto3" json:"Shared,omitempty"` + Parents []string `protobuf:"bytes,12,rep,name=Parents,proto3" json:"Parents,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *UsageRecord) Reset() { @@ -393,27 +390,26 @@ func (x *UsageRecord) GetParents() []string { } type SolveRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Ref string `protobuf:"bytes,1,opt,name=Ref,proto3" json:"Ref,omitempty"` - Definition *pb.Definition `protobuf:"bytes,2,opt,name=Definition,proto3" json:"Definition,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Ref string `protobuf:"bytes,1,opt,name=Ref,proto3" json:"Ref,omitempty"` + Definition *pb.Definition `protobuf:"bytes,2,opt,name=Definition,proto3" json:"Definition,omitempty"` // ExporterDeprecated and ExporterAttrsDeprecated are deprecated in favor // of the new Exporters. If these fields are set, then they will be // appended to the Exporters field if Exporters was not explicitly set. ExporterDeprecated string `protobuf:"bytes,3,opt,name=ExporterDeprecated,proto3" json:"ExporterDeprecated,omitempty"` - ExporterAttrsDeprecated map[string]string `protobuf:"bytes,4,rep,name=ExporterAttrsDeprecated,proto3" json:"ExporterAttrsDeprecated,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + ExporterAttrsDeprecated map[string]string `protobuf:"bytes,4,rep,name=ExporterAttrsDeprecated,proto3" json:"ExporterAttrsDeprecated,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` Session string `protobuf:"bytes,5,opt,name=Session,proto3" json:"Session,omitempty"` Frontend string `protobuf:"bytes,6,opt,name=Frontend,proto3" json:"Frontend,omitempty"` - FrontendAttrs map[string]string `protobuf:"bytes,7,rep,name=FrontendAttrs,proto3" json:"FrontendAttrs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + FrontendAttrs map[string]string `protobuf:"bytes,7,rep,name=FrontendAttrs,proto3" json:"FrontendAttrs,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` Cache *CacheOptions `protobuf:"bytes,8,opt,name=Cache,proto3" json:"Cache,omitempty"` Entitlements []string `protobuf:"bytes,9,rep,name=Entitlements,proto3" json:"Entitlements,omitempty"` - FrontendInputs map[string]*pb.Definition `protobuf:"bytes,10,rep,name=FrontendInputs,proto3" json:"FrontendInputs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + FrontendInputs map[string]*pb.Definition `protobuf:"bytes,10,rep,name=FrontendInputs,proto3" json:"FrontendInputs,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` Internal bool `protobuf:"varint,11,opt,name=Internal,proto3" json:"Internal,omitempty"` // Internal builds are not recorded in build history SourcePolicy *pb1.Policy `protobuf:"bytes,12,opt,name=SourcePolicy,proto3" json:"SourcePolicy,omitempty"` Exporters []*Exporter `protobuf:"bytes,13,rep,name=Exporters,proto3" json:"Exporters,omitempty"` EnableSessionExporter bool `protobuf:"varint,14,opt,name=EnableSessionExporter,proto3" json:"EnableSessionExporter,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *SolveRequest) Reset() { @@ -545,10 +541,7 @@ func (x *SolveRequest) GetEnableSessionExporter() bool { } type CacheOptions struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // ExportRefDeprecated is deprecated in favor or the new Exports since BuildKit v0.4.0. // When ExportRefDeprecated is set, the solver appends // {.Type = "registry", .Attrs = ExportAttrs.add("ref", ExportRef)} @@ -561,11 +554,13 @@ type CacheOptions struct { ImportRefsDeprecated []string `protobuf:"bytes,2,rep,name=ImportRefsDeprecated,proto3" json:"ImportRefsDeprecated,omitempty"` // ExportAttrsDeprecated is deprecated since BuildKit v0.4.0. // See the description of ExportRefDeprecated. - ExportAttrsDeprecated map[string]string `protobuf:"bytes,3,rep,name=ExportAttrsDeprecated,proto3" json:"ExportAttrsDeprecated,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + ExportAttrsDeprecated map[string]string `protobuf:"bytes,3,rep,name=ExportAttrsDeprecated,proto3" json:"ExportAttrsDeprecated,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // Exports was introduced in BuildKit v0.4.0. Exports []*CacheOptionsEntry `protobuf:"bytes,4,rep,name=Exports,proto3" json:"Exports,omitempty"` // Imports was introduced in BuildKit v0.4.0. - Imports []*CacheOptionsEntry `protobuf:"bytes,5,rep,name=Imports,proto3" json:"Imports,omitempty"` + Imports []*CacheOptionsEntry `protobuf:"bytes,5,rep,name=Imports,proto3" json:"Imports,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *CacheOptions) Reset() { @@ -634,15 +629,14 @@ func (x *CacheOptions) GetImports() []*CacheOptionsEntry { } type CacheOptionsEntry struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Type is like "registry" or "local" Type string `protobuf:"bytes,1,opt,name=Type,proto3" json:"Type,omitempty"` // Attrs are like mode=(min,max), ref=example.com:5000/foo/bar . // See cache importer/exporter implementations' documentation. - Attrs map[string]string `protobuf:"bytes,2,rep,name=Attrs,proto3" json:"Attrs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Attrs map[string]string `protobuf:"bytes,2,rep,name=Attrs,proto3" json:"Attrs,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *CacheOptionsEntry) Reset() { @@ -690,11 +684,10 @@ func (x *CacheOptionsEntry) GetAttrs() map[string]string { } type SolveResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ExporterResponse map[string]string `protobuf:"bytes,1,rep,name=ExporterResponse,proto3" json:"ExporterResponse,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + state protoimpl.MessageState `protogen:"open.v1"` + ExporterResponse map[string]string `protobuf:"bytes,1,rep,name=ExporterResponse,proto3" json:"ExporterResponse,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *SolveResponse) Reset() { @@ -735,11 +728,10 @@ func (x *SolveResponse) GetExporterResponse() map[string]string { } type StatusRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Ref string `protobuf:"bytes,1,opt,name=Ref,proto3" json:"Ref,omitempty"` unknownFields protoimpl.UnknownFields - - Ref string `protobuf:"bytes,1,opt,name=Ref,proto3" json:"Ref,omitempty"` + sizeCache protoimpl.SizeCache } func (x *StatusRequest) Reset() { @@ -780,14 +772,13 @@ func (x *StatusRequest) GetRef() string { } type StatusResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Vertexes []*Vertex `protobuf:"bytes,1,rep,name=vertexes,proto3" json:"vertexes,omitempty"` + Statuses []*VertexStatus `protobuf:"bytes,2,rep,name=statuses,proto3" json:"statuses,omitempty"` + Logs []*VertexLog `protobuf:"bytes,3,rep,name=logs,proto3" json:"logs,omitempty"` + Warnings []*VertexWarning `protobuf:"bytes,4,rep,name=warnings,proto3" json:"warnings,omitempty"` unknownFields protoimpl.UnknownFields - - Vertexes []*Vertex `protobuf:"bytes,1,rep,name=vertexes,proto3" json:"vertexes,omitempty"` - Statuses []*VertexStatus `protobuf:"bytes,2,rep,name=statuses,proto3" json:"statuses,omitempty"` - Logs []*VertexLog `protobuf:"bytes,3,rep,name=logs,proto3" json:"logs,omitempty"` - Warnings []*VertexWarning `protobuf:"bytes,4,rep,name=warnings,proto3" json:"warnings,omitempty"` + sizeCache protoimpl.SizeCache } func (x *StatusResponse) Reset() { @@ -849,18 +840,17 @@ func (x *StatusResponse) GetWarnings() []*VertexWarning { } type Vertex struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Digest string `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"` + Inputs []string `protobuf:"bytes,2,rep,name=inputs,proto3" json:"inputs,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Cached bool `protobuf:"varint,4,opt,name=cached,proto3" json:"cached,omitempty"` + Started *timestamp.Timestamp `protobuf:"bytes,5,opt,name=started,proto3" json:"started,omitempty"` + Completed *timestamp.Timestamp `protobuf:"bytes,6,opt,name=completed,proto3" json:"completed,omitempty"` + Error string `protobuf:"bytes,7,opt,name=error,proto3" json:"error,omitempty"` // typed errors? + ProgressGroup *pb.ProgressGroup `protobuf:"bytes,8,opt,name=progressGroup,proto3" json:"progressGroup,omitempty"` unknownFields protoimpl.UnknownFields - - Digest string `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"` - Inputs []string `protobuf:"bytes,2,rep,name=inputs,proto3" json:"inputs,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - Cached bool `protobuf:"varint,4,opt,name=cached,proto3" json:"cached,omitempty"` - Started *timestamp.Timestamp `protobuf:"bytes,5,opt,name=started,proto3" json:"started,omitempty"` - Completed *timestamp.Timestamp `protobuf:"bytes,6,opt,name=completed,proto3" json:"completed,omitempty"` - Error string `protobuf:"bytes,7,opt,name=error,proto3" json:"error,omitempty"` // typed errors? - ProgressGroup *pb.ProgressGroup `protobuf:"bytes,8,opt,name=progressGroup,proto3" json:"progressGroup,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Vertex) Reset() { @@ -950,18 +940,17 @@ func (x *Vertex) GetProgressGroup() *pb.ProgressGroup { } type VertexStatus struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` + Vertex string `protobuf:"bytes,2,opt,name=vertex,proto3" json:"vertex,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Current int64 `protobuf:"varint,4,opt,name=current,proto3" json:"current,omitempty"` + Total int64 `protobuf:"varint,5,opt,name=total,proto3" json:"total,omitempty"` + Timestamp *timestamp.Timestamp `protobuf:"bytes,6,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Started *timestamp.Timestamp `protobuf:"bytes,7,opt,name=started,proto3" json:"started,omitempty"` + Completed *timestamp.Timestamp `protobuf:"bytes,8,opt,name=completed,proto3" json:"completed,omitempty"` unknownFields protoimpl.UnknownFields - - ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` - Vertex string `protobuf:"bytes,2,opt,name=vertex,proto3" json:"vertex,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - Current int64 `protobuf:"varint,4,opt,name=current,proto3" json:"current,omitempty"` - Total int64 `protobuf:"varint,5,opt,name=total,proto3" json:"total,omitempty"` - Timestamp *timestamp.Timestamp `protobuf:"bytes,6,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Started *timestamp.Timestamp `protobuf:"bytes,7,opt,name=started,proto3" json:"started,omitempty"` - Completed *timestamp.Timestamp `protobuf:"bytes,8,opt,name=completed,proto3" json:"completed,omitempty"` + sizeCache protoimpl.SizeCache } func (x *VertexStatus) Reset() { @@ -1051,14 +1040,13 @@ func (x *VertexStatus) GetCompleted() *timestamp.Timestamp { } type VertexLog struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Vertex string `protobuf:"bytes,1,opt,name=vertex,proto3" json:"vertex,omitempty"` + Timestamp *timestamp.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Stream int64 `protobuf:"varint,3,opt,name=stream,proto3" json:"stream,omitempty"` + Msg []byte `protobuf:"bytes,4,opt,name=msg,proto3" json:"msg,omitempty"` unknownFields protoimpl.UnknownFields - - Vertex string `protobuf:"bytes,1,opt,name=vertex,proto3" json:"vertex,omitempty"` - Timestamp *timestamp.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Stream int64 `protobuf:"varint,3,opt,name=stream,proto3" json:"stream,omitempty"` - Msg []byte `protobuf:"bytes,4,opt,name=msg,proto3" json:"msg,omitempty"` + sizeCache protoimpl.SizeCache } func (x *VertexLog) Reset() { @@ -1120,17 +1108,16 @@ func (x *VertexLog) GetMsg() []byte { } type VertexWarning struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Vertex string `protobuf:"bytes,1,opt,name=vertex,proto3" json:"vertex,omitempty"` + Level int64 `protobuf:"varint,2,opt,name=level,proto3" json:"level,omitempty"` + Short []byte `protobuf:"bytes,3,opt,name=short,proto3" json:"short,omitempty"` + Detail [][]byte `protobuf:"bytes,4,rep,name=detail,proto3" json:"detail,omitempty"` + Url string `protobuf:"bytes,5,opt,name=url,proto3" json:"url,omitempty"` + Info *pb.SourceInfo `protobuf:"bytes,6,opt,name=info,proto3" json:"info,omitempty"` + Ranges []*pb.Range `protobuf:"bytes,7,rep,name=ranges,proto3" json:"ranges,omitempty"` unknownFields protoimpl.UnknownFields - - Vertex string `protobuf:"bytes,1,opt,name=vertex,proto3" json:"vertex,omitempty"` - Level int64 `protobuf:"varint,2,opt,name=level,proto3" json:"level,omitempty"` - Short []byte `protobuf:"bytes,3,opt,name=short,proto3" json:"short,omitempty"` - Detail [][]byte `protobuf:"bytes,4,rep,name=detail,proto3" json:"detail,omitempty"` - Url string `protobuf:"bytes,5,opt,name=url,proto3" json:"url,omitempty"` - Info *pb.SourceInfo `protobuf:"bytes,6,opt,name=info,proto3" json:"info,omitempty"` - Ranges []*pb.Range `protobuf:"bytes,7,rep,name=ranges,proto3" json:"ranges,omitempty"` + sizeCache protoimpl.SizeCache } func (x *VertexWarning) Reset() { @@ -1213,11 +1200,10 @@ func (x *VertexWarning) GetRanges() []*pb.Range { } type BytesMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` unknownFields protoimpl.UnknownFields - - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + sizeCache protoimpl.SizeCache } func (x *BytesMessage) Reset() { @@ -1258,11 +1244,10 @@ func (x *BytesMessage) GetData() []byte { } type ListWorkersRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Filter []string `protobuf:"bytes,1,rep,name=filter,proto3" json:"filter,omitempty"` // containerd style unknownFields protoimpl.UnknownFields - - Filter []string `protobuf:"bytes,1,rep,name=filter,proto3" json:"filter,omitempty"` // containerd style + sizeCache protoimpl.SizeCache } func (x *ListWorkersRequest) Reset() { @@ -1303,11 +1288,10 @@ func (x *ListWorkersRequest) GetFilter() []string { } type ListWorkersResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Record []*types.WorkerRecord `protobuf:"bytes,1,rep,name=record,proto3" json:"record,omitempty"` unknownFields protoimpl.UnknownFields - - Record []*types.WorkerRecord `protobuf:"bytes,1,rep,name=record,proto3" json:"record,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ListWorkersResponse) Reset() { @@ -1348,9 +1332,9 @@ func (x *ListWorkersResponse) GetRecord() []*types.WorkerRecord { } type InfoRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *InfoRequest) Reset() { @@ -1384,11 +1368,10 @@ func (*InfoRequest) Descriptor() ([]byte, []int) { } type InfoResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` BuildkitVersion *types.BuildkitVersion `protobuf:"bytes,1,opt,name=buildkitVersion,proto3" json:"buildkitVersion,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *InfoResponse) Reset() { @@ -1429,15 +1412,14 @@ func (x *InfoResponse) GetBuildkitVersion() *types.BuildkitVersion { } type BuildHistoryRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ActiveOnly bool `protobuf:"varint,1,opt,name=ActiveOnly,proto3" json:"ActiveOnly,omitempty"` + Ref string `protobuf:"bytes,2,opt,name=Ref,proto3" json:"Ref,omitempty"` + EarlyExit bool `protobuf:"varint,3,opt,name=EarlyExit,proto3" json:"EarlyExit,omitempty"` + Filter []string `protobuf:"bytes,4,rep,name=Filter,proto3" json:"Filter,omitempty"` + Limit int32 `protobuf:"varint,5,opt,name=Limit,proto3" json:"Limit,omitempty"` unknownFields protoimpl.UnknownFields - - ActiveOnly bool `protobuf:"varint,1,opt,name=ActiveOnly,proto3" json:"ActiveOnly,omitempty"` - Ref string `protobuf:"bytes,2,opt,name=Ref,proto3" json:"Ref,omitempty"` - EarlyExit bool `protobuf:"varint,3,opt,name=EarlyExit,proto3" json:"EarlyExit,omitempty"` - Filter []string `protobuf:"bytes,4,rep,name=Filter,proto3" json:"Filter,omitempty"` - Limit int32 `protobuf:"varint,5,opt,name=Limit,proto3" json:"Limit,omitempty"` + sizeCache protoimpl.SizeCache } func (x *BuildHistoryRequest) Reset() { @@ -1506,12 +1488,11 @@ func (x *BuildHistoryRequest) GetLimit() int32 { } type BuildHistoryEvent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Type BuildHistoryEventType `protobuf:"varint,1,opt,name=type,proto3,enum=moby.buildkit.v1.BuildHistoryEventType" json:"type,omitempty"` + Record *BuildHistoryRecord `protobuf:"bytes,2,opt,name=record,proto3" json:"record,omitempty"` unknownFields protoimpl.UnknownFields - - Type BuildHistoryEventType `protobuf:"varint,1,opt,name=type,proto3,enum=moby.buildkit.v1.BuildHistoryEventType" json:"type,omitempty"` - Record *BuildHistoryRecord `protobuf:"bytes,2,opt,name=record,proto3" json:"record,omitempty"` + sizeCache protoimpl.SizeCache } func (x *BuildHistoryEvent) Reset() { @@ -1559,21 +1540,18 @@ func (x *BuildHistoryEvent) GetRecord() *BuildHistoryRecord { } type BuildHistoryRecord struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` Ref string `protobuf:"bytes,1,opt,name=Ref,proto3" json:"Ref,omitempty"` Frontend string `protobuf:"bytes,2,opt,name=Frontend,proto3" json:"Frontend,omitempty"` - FrontendAttrs map[string]string `protobuf:"bytes,3,rep,name=FrontendAttrs,proto3" json:"FrontendAttrs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + FrontendAttrs map[string]string `protobuf:"bytes,3,rep,name=FrontendAttrs,proto3" json:"FrontendAttrs,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` Exporters []*Exporter `protobuf:"bytes,4,rep,name=Exporters,proto3" json:"Exporters,omitempty"` Error *status.Status `protobuf:"bytes,5,opt,name=error,proto3" json:"error,omitempty"` CreatedAt *timestamp.Timestamp `protobuf:"bytes,6,opt,name=CreatedAt,proto3" json:"CreatedAt,omitempty"` CompletedAt *timestamp.Timestamp `protobuf:"bytes,7,opt,name=CompletedAt,proto3" json:"CompletedAt,omitempty"` Logs *Descriptor `protobuf:"bytes,8,opt,name=logs,proto3" json:"logs,omitempty"` - ExporterResponse map[string]string `protobuf:"bytes,9,rep,name=ExporterResponse,proto3" json:"ExporterResponse,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + ExporterResponse map[string]string `protobuf:"bytes,9,rep,name=ExporterResponse,proto3" json:"ExporterResponse,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` Result *BuildResultInfo `protobuf:"bytes,10,opt,name=Result,proto3" json:"Result,omitempty"` - Results map[string]*BuildResultInfo `protobuf:"bytes,11,rep,name=Results,proto3" json:"Results,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Results map[string]*BuildResultInfo `protobuf:"bytes,11,rep,name=Results,proto3" json:"Results,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` Generation int32 `protobuf:"varint,12,opt,name=Generation,proto3" json:"Generation,omitempty"` Trace *Descriptor `protobuf:"bytes,13,opt,name=trace,proto3" json:"trace,omitempty"` Pinned bool `protobuf:"varint,14,opt,name=pinned,proto3" json:"pinned,omitempty"` @@ -1582,6 +1560,8 @@ type BuildHistoryRecord struct { NumCompletedSteps int32 `protobuf:"varint,17,opt,name=numCompletedSteps,proto3" json:"numCompletedSteps,omitempty"` ExternalError *Descriptor `protobuf:"bytes,18,opt,name=externalError,proto3" json:"externalError,omitempty"` NumWarnings int32 `protobuf:"varint,19,opt,name=numWarnings,proto3" json:"numWarnings,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *BuildHistoryRecord) Reset() { @@ -1748,14 +1728,13 @@ func (x *BuildHistoryRecord) GetNumWarnings() int32 { } type UpdateBuildHistoryRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Ref string `protobuf:"bytes,1,opt,name=Ref,proto3" json:"Ref,omitempty"` + Pinned bool `protobuf:"varint,2,opt,name=Pinned,proto3" json:"Pinned,omitempty"` + Delete bool `protobuf:"varint,3,opt,name=Delete,proto3" json:"Delete,omitempty"` + Finalize bool `protobuf:"varint,4,opt,name=Finalize,proto3" json:"Finalize,omitempty"` unknownFields protoimpl.UnknownFields - - Ref string `protobuf:"bytes,1,opt,name=Ref,proto3" json:"Ref,omitempty"` - Pinned bool `protobuf:"varint,2,opt,name=Pinned,proto3" json:"Pinned,omitempty"` - Delete bool `protobuf:"varint,3,opt,name=Delete,proto3" json:"Delete,omitempty"` - Finalize bool `protobuf:"varint,4,opt,name=Finalize,proto3" json:"Finalize,omitempty"` + sizeCache protoimpl.SizeCache } func (x *UpdateBuildHistoryRequest) Reset() { @@ -1817,9 +1796,9 @@ func (x *UpdateBuildHistoryRequest) GetFinalize() bool { } type UpdateBuildHistoryResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *UpdateBuildHistoryResponse) Reset() { @@ -1853,14 +1832,13 @@ func (*UpdateBuildHistoryResponse) Descriptor() ([]byte, []int) { } type Descriptor struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + MediaType string `protobuf:"bytes,1,opt,name=media_type,json=mediaType,proto3" json:"media_type,omitempty"` + Digest string `protobuf:"bytes,2,opt,name=digest,proto3" json:"digest,omitempty"` + 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" protobuf_val:"bytes,2,opt,name=value"` unknownFields protoimpl.UnknownFields - - MediaType string `protobuf:"bytes,1,opt,name=media_type,json=mediaType,proto3" json:"media_type,omitempty"` - Digest string `protobuf:"bytes,2,opt,name=digest,proto3" json:"digest,omitempty"` - 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"` + sizeCache protoimpl.SizeCache } func (x *Descriptor) Reset() { @@ -1922,13 +1900,12 @@ func (x *Descriptor) GetAnnotations() map[string]string { } type BuildResultInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ResultDeprecated *Descriptor `protobuf:"bytes,1,opt,name=ResultDeprecated,proto3" json:"ResultDeprecated,omitempty"` - Attestations []*Descriptor `protobuf:"bytes,2,rep,name=Attestations,proto3" json:"Attestations,omitempty"` - Results map[int64]*Descriptor `protobuf:"bytes,3,rep,name=Results,proto3" json:"Results,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + state protoimpl.MessageState `protogen:"open.v1"` + ResultDeprecated *Descriptor `protobuf:"bytes,1,opt,name=ResultDeprecated,proto3" json:"ResultDeprecated,omitempty"` + Attestations []*Descriptor `protobuf:"bytes,2,rep,name=Attestations,proto3" json:"Attestations,omitempty"` + Results map[int64]*Descriptor `protobuf:"bytes,3,rep,name=Results,proto3" json:"Results,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *BuildResultInfo) Reset() { @@ -1984,14 +1961,13 @@ func (x *BuildResultInfo) GetResults() map[int64]*Descriptor { // Exporter describes the output exporter type Exporter struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Type identifies the exporter Type string `protobuf:"bytes,1,opt,name=Type,proto3" json:"Type,omitempty"` // Attrs specifies exporter configuration - Attrs map[string]string `protobuf:"bytes,2,rep,name=Attrs,proto3" json:"Attrs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Attrs map[string]string `protobuf:"bytes,2,rep,name=Attrs,proto3" json:"Attrs,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Exporter) Reset() { @@ -2040,495 +2016,232 @@ func (x *Exporter) GetAttrs() map[string]string { var File_github_com_moby_buildkit_api_services_control_control_proto protoreflect.FileDescriptor -var file_github_com_moby_buildkit_api_services_control_control_proto_rawDesc = []byte{ - 0x0a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, - 0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2f, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x6d, - 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x1a, - 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, 0x79, - 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, - 0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x73, 0x6f, 0x6c, 0x76, 0x65, - 0x72, 0x2f, 0x70, 0x62, 0x2f, 0x6f, 0x70, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x35, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, 0x79, 0x2f, - 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x70, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2f, 0x70, 0x62, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x72, - 0x70, 0x63, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0xca, 0x01, 0x0a, 0x0c, 0x50, 0x72, 0x75, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, 0x6c, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, 0x22, 0x0a, 0x0c, 0x6b, 0x65, - 0x65, 0x70, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x0c, 0x6b, 0x65, 0x65, 0x70, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x24, - 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x53, 0x70, 0x61, 0x63, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x53, - 0x70, 0x61, 0x63, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x61, 0x78, 0x55, 0x73, 0x65, 0x64, 0x53, - 0x70, 0x61, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x6d, 0x61, 0x78, 0x55, - 0x73, 0x65, 0x64, 0x53, 0x70, 0x61, 0x63, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x69, 0x6e, 0x46, - 0x72, 0x65, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, - 0x6d, 0x69, 0x6e, 0x46, 0x72, 0x65, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x22, 0x46, 0x0a, 0x10, - 0x44, 0x69, 0x73, 0x6b, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x67, 0x65, 0x4c, - 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x61, 0x67, 0x65, 0x4c, - 0x69, 0x6d, 0x69, 0x74, 0x22, 0x4a, 0x0a, 0x11, 0x44, 0x69, 0x73, 0x6b, 0x55, 0x73, 0x61, 0x67, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x06, 0x72, 0x65, 0x63, - 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6d, 0x6f, 0x62, 0x79, - 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x61, - 0x67, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, - 0x22, 0x87, 0x03, 0x0a, 0x0b, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, - 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x44, - 0x12, 0x18, 0x0a, 0x07, 0x4d, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x07, 0x4d, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x49, 0x6e, - 0x55, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x49, 0x6e, 0x55, 0x73, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, - 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1a, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, 0x06, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x12, 0x38, 0x0a, 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x3a, 0x0a, 0x0a, 0x4c, 0x61, - 0x73, 0x74, 0x55, 0x73, 0x65, 0x64, 0x41, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x4c, 0x61, 0x73, 0x74, - 0x55, 0x73, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x55, 0x73, 0x61, 0x67, 0x65, 0x43, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x55, 0x73, 0x61, 0x67, - 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x44, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x52, 0x65, 0x63, 0x6f, - 0x72, 0x64, 0x54, 0x79, 0x70, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x52, 0x65, - 0x63, 0x6f, 0x72, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x68, 0x61, 0x72, - 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, - 0x12, 0x18, 0x0a, 0x07, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x07, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xf4, 0x07, 0x0a, 0x0c, 0x53, - 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x52, - 0x65, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x52, 0x65, 0x66, 0x12, 0x2e, 0x0a, - 0x0a, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x0a, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, - 0x12, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, - 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x45, 0x78, 0x70, 0x6f, 0x72, - 0x74, 0x65, 0x72, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x75, 0x0a, - 0x17, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x41, 0x74, 0x74, 0x72, 0x73, 0x44, 0x65, - 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, - 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, - 0x31, 0x2e, 0x53, 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x45, - 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x41, 0x74, 0x74, 0x72, 0x73, 0x44, 0x65, 0x70, 0x72, - 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x17, 0x45, 0x78, 0x70, - 0x6f, 0x72, 0x74, 0x65, 0x72, 0x41, 0x74, 0x74, 0x72, 0x73, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, - 0x61, 0x74, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, - 0x0a, 0x08, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x12, 0x57, 0x0a, 0x0d, 0x46, 0x72, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x31, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, - 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x2e, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x73, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x41, 0x74, - 0x74, 0x72, 0x73, 0x12, 0x34, 0x0a, 0x05, 0x43, 0x61, 0x63, 0x68, 0x65, 0x18, 0x08, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, - 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x63, 0x68, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x52, 0x05, 0x43, 0x61, 0x63, 0x68, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x45, 0x6e, 0x74, - 0x69, 0x74, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x0c, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x5a, 0x0a, - 0x0e, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x18, - 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, - 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x49, 0x6e, - 0x70, 0x75, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x46, 0x72, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x49, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x49, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x12, 0x49, 0x0a, 0x0c, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6d, 0x6f, - 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x50, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x52, 0x0c, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x12, 0x38, 0x0a, 0x09, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x73, 0x18, 0x0d, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, - 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x52, - 0x09, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x73, 0x12, 0x34, 0x0a, 0x15, 0x45, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x70, 0x6f, 0x72, - 0x74, 0x65, 0x72, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x45, 0x6e, 0x61, 0x62, 0x6c, - 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, - 0x1a, 0x4a, 0x0a, 0x1c, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x41, 0x74, 0x74, 0x72, - 0x73, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x40, 0x0a, 0x12, - 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x51, - 0x0a, 0x13, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x24, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x66, 0x69, - 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x22, 0xad, 0x03, 0x0a, 0x0c, 0x43, 0x61, 0x63, 0x68, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x12, 0x30, 0x0a, 0x13, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x66, 0x44, - 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x13, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x66, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, - 0x61, 0x74, 0x65, 0x64, 0x12, 0x32, 0x0a, 0x14, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, - 0x66, 0x73, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x14, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x66, 0x73, 0x44, 0x65, - 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x6f, 0x0a, 0x15, 0x45, 0x78, 0x70, 0x6f, - 0x72, 0x74, 0x41, 0x74, 0x74, 0x72, 0x73, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, - 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, - 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x63, 0x68, 0x65, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x41, 0x74, - 0x74, 0x72, 0x73, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x15, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x41, 0x74, 0x74, 0x72, 0x73, 0x44, - 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x3d, 0x0a, 0x07, 0x45, 0x78, 0x70, - 0x6f, 0x72, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6d, 0x6f, 0x62, - 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, - 0x63, 0x68, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x07, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x12, 0x3d, 0x0a, 0x07, 0x49, 0x6d, 0x70, 0x6f, - 0x72, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6d, 0x6f, 0x62, 0x79, - 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x63, - 0x68, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, - 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x1a, 0x48, 0x0a, 0x1a, 0x45, 0x78, 0x70, 0x6f, 0x72, - 0x74, 0x41, 0x74, 0x74, 0x72, 0x73, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x22, 0xa7, 0x01, 0x0a, 0x11, 0x43, 0x61, 0x63, 0x68, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x44, 0x0a, 0x05, 0x41, - 0x74, 0x74, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x6d, 0x6f, 0x62, - 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, - 0x63, 0x68, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x2e, - 0x41, 0x74, 0x74, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x41, 0x74, 0x74, 0x72, - 0x73, 0x1a, 0x38, 0x0a, 0x0a, 0x41, 0x74, 0x74, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xb7, 0x01, 0x0a, 0x0d, - 0x53, 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, - 0x10, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, - 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x6c, 0x76, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, - 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, - 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x1a, 0x43, 0x0a, 0x15, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x21, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x52, 0x65, 0x66, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x52, 0x65, 0x66, 0x22, 0xf0, 0x01, 0x0a, 0x0e, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x08, 0x76, - 0x65, 0x72, 0x74, 0x65, 0x78, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, - 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, - 0x2e, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x52, 0x08, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 0x65, - 0x73, 0x12, 0x3a, 0x0a, 0x08, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, - 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x08, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x12, 0x2f, 0x0a, - 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6d, 0x6f, - 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x56, - 0x65, 0x72, 0x74, 0x65, 0x78, 0x4c, 0x6f, 0x67, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x12, 0x3b, - 0x0a, 0x08, 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x1f, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, - 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x57, 0x61, 0x72, 0x6e, 0x69, 0x6e, - 0x67, 0x52, 0x08, 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x73, 0x22, 0xa3, 0x02, 0x0a, 0x06, - 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x16, - 0x0a, 0x06, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, - 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x61, - 0x63, 0x68, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x63, 0x61, 0x63, 0x68, - 0x65, 0x64, 0x12, 0x34, 0x0a, 0x07, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x07, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x12, 0x38, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x70, - 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, - 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x37, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x67, - 0x72, 0x65, 0x73, 0x73, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x47, 0x72, 0x6f, 0x75, - 0x70, 0x22, 0xa4, 0x02, 0x0a, 0x0c, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, - 0x0a, 0x07, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x07, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, - 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x38, - 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x34, 0x0a, 0x07, 0x73, 0x74, 0x61, 0x72, - 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x12, 0x38, - 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, - 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x22, 0x87, 0x01, 0x0a, 0x09, 0x56, 0x65, 0x72, - 0x74, 0x65, 0x78, 0x4c, 0x6f, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 0x12, 0x38, - 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x72, 0x65, - 0x61, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, - 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6d, - 0x73, 0x67, 0x22, 0xc4, 0x01, 0x0a, 0x0d, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x57, 0x61, 0x72, - 0x6e, 0x69, 0x6e, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 0x12, 0x14, 0x0a, 0x05, - 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x65, 0x76, - 0x65, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x05, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, - 0x69, 0x6c, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, - 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, - 0x72, 0x6c, 0x12, 0x22, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x21, 0x0a, 0x06, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, - 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, - 0x65, 0x52, 0x06, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x22, 0x22, 0x0a, 0x0c, 0x42, 0x79, 0x74, - 0x65, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x2c, 0x0a, - 0x12, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x53, 0x0a, 0x13, 0x4c, - 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, - 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x57, 0x6f, 0x72, 0x6b, - 0x65, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, - 0x22, 0x0d, 0x0a, 0x0b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, - 0x61, 0x0a, 0x0c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x51, 0x0a, 0x0f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, - 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x52, 0x0f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x22, 0x93, 0x01, 0x0a, 0x13, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x48, 0x69, 0x73, 0x74, - 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x41, 0x63, - 0x74, 0x69, 0x76, 0x65, 0x4f, 0x6e, 0x6c, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, - 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x52, 0x65, - 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x52, 0x65, 0x66, 0x12, 0x1c, 0x0a, 0x09, - 0x45, 0x61, 0x72, 0x6c, 0x79, 0x45, 0x78, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x09, 0x45, 0x61, 0x72, 0x6c, 0x79, 0x45, 0x78, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x46, 0x69, - 0x6c, 0x74, 0x65, 0x72, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x46, 0x69, 0x6c, 0x74, - 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x05, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x8e, 0x01, 0x0a, 0x11, 0x42, 0x75, 0x69, - 0x6c, 0x64, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x3b, - 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x6d, - 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, - 0x42, 0x75, 0x69, 0x6c, 0x64, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x3c, 0x0a, 0x06, 0x72, - 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6d, 0x6f, - 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x42, - 0x75, 0x69, 0x6c, 0x64, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x63, 0x6f, 0x72, - 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, 0xd3, 0x09, 0x0a, 0x12, 0x42, 0x75, - 0x69, 0x6c, 0x64, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, - 0x12, 0x10, 0x0a, 0x03, 0x52, 0x65, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x52, - 0x65, 0x66, 0x12, 0x1a, 0x0a, 0x08, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x12, 0x5d, - 0x0a, 0x0d, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x73, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, - 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x48, 0x69, - 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x46, 0x72, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, - 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x73, 0x12, 0x38, 0x0a, - 0x09, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, - 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x52, 0x09, 0x45, 0x78, - 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x73, 0x12, 0x28, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, - 0x72, 0x12, 0x38, 0x0a, 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x52, 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x3c, 0x0a, 0x0b, 0x43, - 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x43, 0x6f, - 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x30, 0x0a, 0x04, 0x6c, 0x6f, 0x67, - 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, - 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x12, 0x66, 0x0a, 0x10, 0x45, - 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, - 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, - 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x48, 0x69, - 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x45, 0x78, 0x70, 0x6f, - 0x72, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x10, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x0a, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, - 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x4b, - 0x0a, 0x07, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x31, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, - 0x76, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, - 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x07, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x47, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x0a, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x05, 0x74, - 0x72, 0x61, 0x63, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6d, 0x6f, 0x62, - 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x05, 0x74, 0x72, 0x61, 0x63, 0x65, 0x12, - 0x16, 0x0a, 0x06, 0x70, 0x69, 0x6e, 0x6e, 0x65, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x06, 0x70, 0x69, 0x6e, 0x6e, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0e, 0x6e, 0x75, 0x6d, 0x43, 0x61, - 0x63, 0x68, 0x65, 0x64, 0x53, 0x74, 0x65, 0x70, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x0e, 0x6e, 0x75, 0x6d, 0x43, 0x61, 0x63, 0x68, 0x65, 0x64, 0x53, 0x74, 0x65, 0x70, 0x73, 0x12, - 0x24, 0x0a, 0x0d, 0x6e, 0x75, 0x6d, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x74, 0x65, 0x70, 0x73, - 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x6e, 0x75, 0x6d, 0x54, 0x6f, 0x74, 0x61, 0x6c, - 0x53, 0x74, 0x65, 0x70, 0x73, 0x12, 0x2c, 0x0a, 0x11, 0x6e, 0x75, 0x6d, 0x43, 0x6f, 0x6d, 0x70, - 0x6c, 0x65, 0x74, 0x65, 0x64, 0x53, 0x74, 0x65, 0x70, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x11, 0x6e, 0x75, 0x6d, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x53, 0x74, - 0x65, 0x70, 0x73, 0x12, 0x42, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x45, - 0x72, 0x72, 0x6f, 0x72, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6d, 0x6f, 0x62, - 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x6e, 0x75, 0x6d, 0x57, 0x61, - 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x13, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6e, 0x75, - 0x6d, 0x57, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x73, 0x1a, 0x40, 0x0a, 0x12, 0x46, 0x72, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x43, 0x0a, 0x15, 0x45, - 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, - 0x1a, 0x5d, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x37, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x21, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, - 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, - 0x79, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x48, 0x69, - 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, - 0x52, 0x65, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x52, 0x65, 0x66, 0x12, 0x16, - 0x0a, 0x06, 0x50, 0x69, 0x6e, 0x6e, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, - 0x50, 0x69, 0x6e, 0x6e, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x1a, - 0x0a, 0x08, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x08, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x22, 0x1c, 0x0a, 0x1a, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xe8, 0x01, 0x0a, 0x0a, 0x44, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x65, 0x64, 0x69, 0x61, - 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x64, - 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x12, - 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, - 0x7a, 0x65, 0x12, 0x4f, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, - 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x1a, 0x3e, 0x0a, 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x02, 0x38, 0x01, 0x22, 0xc1, 0x02, 0x0a, 0x0f, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x48, 0x0a, 0x10, 0x52, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1c, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, - 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, - 0x10, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, - 0x64, 0x12, 0x40, 0x0a, 0x0c, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, - 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x0c, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x48, 0x0a, 0x07, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, - 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x1a, 0x58, 0x0a, - 0x0c, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, - 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, - 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, - 0x31, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x95, 0x01, 0x0a, 0x08, 0x45, 0x78, 0x70, 0x6f, - 0x72, 0x74, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x3b, 0x0a, 0x05, 0x41, 0x74, 0x74, 0x72, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, - 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, - 0x74, 0x65, 0x72, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, - 0x41, 0x74, 0x74, 0x72, 0x73, 0x1a, 0x38, 0x0a, 0x0a, 0x41, 0x74, 0x74, 0x72, 0x73, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x2a, - 0x3f, 0x0a, 0x15, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x54, 0x41, 0x52, - 0x54, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x54, - 0x45, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x02, - 0x32, 0x89, 0x06, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x54, 0x0a, 0x09, - 0x44, 0x69, 0x73, 0x6b, 0x55, 0x73, 0x61, 0x67, 0x65, 0x12, 0x22, 0x2e, 0x6d, 0x6f, 0x62, 0x79, - 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, 0x73, - 0x6b, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, - 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, - 0x2e, 0x44, 0x69, 0x73, 0x6b, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x48, 0x0a, 0x05, 0x50, 0x72, 0x75, 0x6e, 0x65, 0x12, 0x1e, 0x2e, 0x6d, 0x6f, - 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, - 0x72, 0x75, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6d, 0x6f, - 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x55, - 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x30, 0x01, 0x12, 0x48, 0x0a, 0x05, - 0x53, 0x6f, 0x6c, 0x76, 0x65, 0x12, 0x1e, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, - 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, - 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x1f, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, - 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, - 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x4d, 0x0a, 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x12, 0x1e, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, - 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x1a, 0x1e, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, - 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x28, 0x01, 0x30, 0x01, 0x12, 0x5a, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, - 0x65, 0x72, 0x73, 0x12, 0x24, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, - 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x65, - 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6d, 0x6f, 0x62, 0x79, - 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x45, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, - 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, - 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x65, - 0x6e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x25, 0x2e, - 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, - 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, - 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x48, 0x69, 0x73, - 0x74, 0x6f, 0x72, 0x79, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x30, 0x01, 0x12, 0x6f, 0x0a, 0x12, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, - 0x79, 0x12, 0x2b, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, - 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x75, 0x69, 0x6c, 0x64, - 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, - 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, - 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x48, 0x69, 0x73, - 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x40, 0x5a, 0x3e, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, 0x79, 0x2f, - 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x3b, 0x6d, 0x6f, - 0x62, 0x79, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x5f, 0x76, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_github_com_moby_buildkit_api_services_control_control_proto_rawDesc = "" + + "\n" + + ";github.com/moby/buildkit/api/services/control/control.proto\x12\x10moby.buildkit.v1\x1a/github.com/moby/buildkit/api/types/worker.proto\x1a,github.com/moby/buildkit/solver/pb/ops.proto\x1a5github.com/moby/buildkit/sourcepolicy/pb/policy.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xca\x01\n" + + "\fPruneRequest\x12\x16\n" + + "\x06filter\x18\x01 \x03(\tR\x06filter\x12\x10\n" + + "\x03all\x18\x02 \x01(\bR\x03all\x12\"\n" + + "\fkeepDuration\x18\x03 \x01(\x03R\fkeepDuration\x12$\n" + + "\rreservedSpace\x18\x04 \x01(\x03R\rreservedSpace\x12\"\n" + + "\fmaxUsedSpace\x18\x05 \x01(\x03R\fmaxUsedSpace\x12\"\n" + + "\fminFreeSpace\x18\x06 \x01(\x03R\fminFreeSpace\"F\n" + + "\x10DiskUsageRequest\x12\x16\n" + + "\x06filter\x18\x01 \x03(\tR\x06filter\x12\x1a\n" + + "\bageLimit\x18\x02 \x01(\x03R\bageLimit\"J\n" + + "\x11DiskUsageResponse\x125\n" + + "\x06record\x18\x01 \x03(\v2\x1d.moby.buildkit.v1.UsageRecordR\x06record\"\x87\x03\n" + + "\vUsageRecord\x12\x0e\n" + + "\x02ID\x18\x01 \x01(\tR\x02ID\x12\x18\n" + + "\aMutable\x18\x02 \x01(\bR\aMutable\x12\x14\n" + + "\x05InUse\x18\x03 \x01(\bR\x05InUse\x12\x12\n" + + "\x04Size\x18\x04 \x01(\x03R\x04Size\x12\x1a\n" + + "\x06Parent\x18\x05 \x01(\tB\x02\x18\x01R\x06Parent\x128\n" + + "\tCreatedAt\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\tCreatedAt\x12:\n" + + "\n" + + "LastUsedAt\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\n" + + "LastUsedAt\x12\x1e\n" + + "\n" + + "UsageCount\x18\b \x01(\x03R\n" + + "UsageCount\x12 \n" + + "\vDescription\x18\t \x01(\tR\vDescription\x12\x1e\n" + + "\n" + + "RecordType\x18\n" + + " \x01(\tR\n" + + "RecordType\x12\x16\n" + + "\x06Shared\x18\v \x01(\bR\x06Shared\x12\x18\n" + + "\aParents\x18\f \x03(\tR\aParents\"\xf4\a\n" + + "\fSolveRequest\x12\x10\n" + + "\x03Ref\x18\x01 \x01(\tR\x03Ref\x12.\n" + + "\n" + + "Definition\x18\x02 \x01(\v2\x0e.pb.DefinitionR\n" + + "Definition\x12.\n" + + "\x12ExporterDeprecated\x18\x03 \x01(\tR\x12ExporterDeprecated\x12u\n" + + "\x17ExporterAttrsDeprecated\x18\x04 \x03(\v2;.moby.buildkit.v1.SolveRequest.ExporterAttrsDeprecatedEntryR\x17ExporterAttrsDeprecated\x12\x18\n" + + "\aSession\x18\x05 \x01(\tR\aSession\x12\x1a\n" + + "\bFrontend\x18\x06 \x01(\tR\bFrontend\x12W\n" + + "\rFrontendAttrs\x18\a \x03(\v21.moby.buildkit.v1.SolveRequest.FrontendAttrsEntryR\rFrontendAttrs\x124\n" + + "\x05Cache\x18\b \x01(\v2\x1e.moby.buildkit.v1.CacheOptionsR\x05Cache\x12\"\n" + + "\fEntitlements\x18\t \x03(\tR\fEntitlements\x12Z\n" + + "\x0eFrontendInputs\x18\n" + + " \x03(\v22.moby.buildkit.v1.SolveRequest.FrontendInputsEntryR\x0eFrontendInputs\x12\x1a\n" + + "\bInternal\x18\v \x01(\bR\bInternal\x12I\n" + + "\fSourcePolicy\x18\f \x01(\v2%.moby.buildkit.v1.sourcepolicy.PolicyR\fSourcePolicy\x128\n" + + "\tExporters\x18\r \x03(\v2\x1a.moby.buildkit.v1.ExporterR\tExporters\x124\n" + + "\x15EnableSessionExporter\x18\x0e \x01(\bR\x15EnableSessionExporter\x1aJ\n" + + "\x1cExporterAttrsDeprecatedEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1a@\n" + + "\x12FrontendAttrsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1aQ\n" + + "\x13FrontendInputsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12$\n" + + "\x05value\x18\x02 \x01(\v2\x0e.pb.DefinitionR\x05value:\x028\x01\"\xad\x03\n" + + "\fCacheOptions\x120\n" + + "\x13ExportRefDeprecated\x18\x01 \x01(\tR\x13ExportRefDeprecated\x122\n" + + "\x14ImportRefsDeprecated\x18\x02 \x03(\tR\x14ImportRefsDeprecated\x12o\n" + + "\x15ExportAttrsDeprecated\x18\x03 \x03(\v29.moby.buildkit.v1.CacheOptions.ExportAttrsDeprecatedEntryR\x15ExportAttrsDeprecated\x12=\n" + + "\aExports\x18\x04 \x03(\v2#.moby.buildkit.v1.CacheOptionsEntryR\aExports\x12=\n" + + "\aImports\x18\x05 \x03(\v2#.moby.buildkit.v1.CacheOptionsEntryR\aImports\x1aH\n" + + "\x1aExportAttrsDeprecatedEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xa7\x01\n" + + "\x11CacheOptionsEntry\x12\x12\n" + + "\x04Type\x18\x01 \x01(\tR\x04Type\x12D\n" + + "\x05Attrs\x18\x02 \x03(\v2..moby.buildkit.v1.CacheOptionsEntry.AttrsEntryR\x05Attrs\x1a8\n" + + "\n" + + "AttrsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xb7\x01\n" + + "\rSolveResponse\x12a\n" + + "\x10ExporterResponse\x18\x01 \x03(\v25.moby.buildkit.v1.SolveResponse.ExporterResponseEntryR\x10ExporterResponse\x1aC\n" + + "\x15ExporterResponseEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"!\n" + + "\rStatusRequest\x12\x10\n" + + "\x03Ref\x18\x01 \x01(\tR\x03Ref\"\xf0\x01\n" + + "\x0eStatusResponse\x124\n" + + "\bvertexes\x18\x01 \x03(\v2\x18.moby.buildkit.v1.VertexR\bvertexes\x12:\n" + + "\bstatuses\x18\x02 \x03(\v2\x1e.moby.buildkit.v1.VertexStatusR\bstatuses\x12/\n" + + "\x04logs\x18\x03 \x03(\v2\x1b.moby.buildkit.v1.VertexLogR\x04logs\x12;\n" + + "\bwarnings\x18\x04 \x03(\v2\x1f.moby.buildkit.v1.VertexWarningR\bwarnings\"\xa3\x02\n" + + "\x06Vertex\x12\x16\n" + + "\x06digest\x18\x01 \x01(\tR\x06digest\x12\x16\n" + + "\x06inputs\x18\x02 \x03(\tR\x06inputs\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\x12\x16\n" + + "\x06cached\x18\x04 \x01(\bR\x06cached\x124\n" + + "\astarted\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\astarted\x128\n" + + "\tcompleted\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\tcompleted\x12\x14\n" + + "\x05error\x18\a \x01(\tR\x05error\x127\n" + + "\rprogressGroup\x18\b \x01(\v2\x11.pb.ProgressGroupR\rprogressGroup\"\xa4\x02\n" + + "\fVertexStatus\x12\x0e\n" + + "\x02ID\x18\x01 \x01(\tR\x02ID\x12\x16\n" + + "\x06vertex\x18\x02 \x01(\tR\x06vertex\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\x12\x18\n" + + "\acurrent\x18\x04 \x01(\x03R\acurrent\x12\x14\n" + + "\x05total\x18\x05 \x01(\x03R\x05total\x128\n" + + "\ttimestamp\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp\x124\n" + + "\astarted\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\astarted\x128\n" + + "\tcompleted\x18\b \x01(\v2\x1a.google.protobuf.TimestampR\tcompleted\"\x87\x01\n" + + "\tVertexLog\x12\x16\n" + + "\x06vertex\x18\x01 \x01(\tR\x06vertex\x128\n" + + "\ttimestamp\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp\x12\x16\n" + + "\x06stream\x18\x03 \x01(\x03R\x06stream\x12\x10\n" + + "\x03msg\x18\x04 \x01(\fR\x03msg\"\xc4\x01\n" + + "\rVertexWarning\x12\x16\n" + + "\x06vertex\x18\x01 \x01(\tR\x06vertex\x12\x14\n" + + "\x05level\x18\x02 \x01(\x03R\x05level\x12\x14\n" + + "\x05short\x18\x03 \x01(\fR\x05short\x12\x16\n" + + "\x06detail\x18\x04 \x03(\fR\x06detail\x12\x10\n" + + "\x03url\x18\x05 \x01(\tR\x03url\x12\"\n" + + "\x04info\x18\x06 \x01(\v2\x0e.pb.SourceInfoR\x04info\x12!\n" + + "\x06ranges\x18\a \x03(\v2\t.pb.RangeR\x06ranges\"\"\n" + + "\fBytesMessage\x12\x12\n" + + "\x04data\x18\x01 \x01(\fR\x04data\",\n" + + "\x12ListWorkersRequest\x12\x16\n" + + "\x06filter\x18\x01 \x03(\tR\x06filter\"S\n" + + "\x13ListWorkersResponse\x12<\n" + + "\x06record\x18\x01 \x03(\v2$.moby.buildkit.v1.types.WorkerRecordR\x06record\"\r\n" + + "\vInfoRequest\"a\n" + + "\fInfoResponse\x12Q\n" + + "\x0fbuildkitVersion\x18\x01 \x01(\v2'.moby.buildkit.v1.types.BuildkitVersionR\x0fbuildkitVersion\"\x93\x01\n" + + "\x13BuildHistoryRequest\x12\x1e\n" + + "\n" + + "ActiveOnly\x18\x01 \x01(\bR\n" + + "ActiveOnly\x12\x10\n" + + "\x03Ref\x18\x02 \x01(\tR\x03Ref\x12\x1c\n" + + "\tEarlyExit\x18\x03 \x01(\bR\tEarlyExit\x12\x16\n" + + "\x06Filter\x18\x04 \x03(\tR\x06Filter\x12\x14\n" + + "\x05Limit\x18\x05 \x01(\x05R\x05Limit\"\x8e\x01\n" + + "\x11BuildHistoryEvent\x12;\n" + + "\x04type\x18\x01 \x01(\x0e2'.moby.buildkit.v1.BuildHistoryEventTypeR\x04type\x12<\n" + + "\x06record\x18\x02 \x01(\v2$.moby.buildkit.v1.BuildHistoryRecordR\x06record\"\xd3\t\n" + + "\x12BuildHistoryRecord\x12\x10\n" + + "\x03Ref\x18\x01 \x01(\tR\x03Ref\x12\x1a\n" + + "\bFrontend\x18\x02 \x01(\tR\bFrontend\x12]\n" + + "\rFrontendAttrs\x18\x03 \x03(\v27.moby.buildkit.v1.BuildHistoryRecord.FrontendAttrsEntryR\rFrontendAttrs\x128\n" + + "\tExporters\x18\x04 \x03(\v2\x1a.moby.buildkit.v1.ExporterR\tExporters\x12(\n" + + "\x05error\x18\x05 \x01(\v2\x12.google.rpc.StatusR\x05error\x128\n" + + "\tCreatedAt\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\tCreatedAt\x12<\n" + + "\vCompletedAt\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\vCompletedAt\x120\n" + + "\x04logs\x18\b \x01(\v2\x1c.moby.buildkit.v1.DescriptorR\x04logs\x12f\n" + + "\x10ExporterResponse\x18\t \x03(\v2:.moby.buildkit.v1.BuildHistoryRecord.ExporterResponseEntryR\x10ExporterResponse\x129\n" + + "\x06Result\x18\n" + + " \x01(\v2!.moby.buildkit.v1.BuildResultInfoR\x06Result\x12K\n" + + "\aResults\x18\v \x03(\v21.moby.buildkit.v1.BuildHistoryRecord.ResultsEntryR\aResults\x12\x1e\n" + + "\n" + + "Generation\x18\f \x01(\x05R\n" + + "Generation\x122\n" + + "\x05trace\x18\r \x01(\v2\x1c.moby.buildkit.v1.DescriptorR\x05trace\x12\x16\n" + + "\x06pinned\x18\x0e \x01(\bR\x06pinned\x12&\n" + + "\x0enumCachedSteps\x18\x0f \x01(\x05R\x0enumCachedSteps\x12$\n" + + "\rnumTotalSteps\x18\x10 \x01(\x05R\rnumTotalSteps\x12,\n" + + "\x11numCompletedSteps\x18\x11 \x01(\x05R\x11numCompletedSteps\x12B\n" + + "\rexternalError\x18\x12 \x01(\v2\x1c.moby.buildkit.v1.DescriptorR\rexternalError\x12 \n" + + "\vnumWarnings\x18\x13 \x01(\x05R\vnumWarnings\x1a@\n" + + "\x12FrontendAttrsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1aC\n" + + "\x15ExporterResponseEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1a]\n" + + "\fResultsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x127\n" + + "\x05value\x18\x02 \x01(\v2!.moby.buildkit.v1.BuildResultInfoR\x05value:\x028\x01\"y\n" + + "\x19UpdateBuildHistoryRequest\x12\x10\n" + + "\x03Ref\x18\x01 \x01(\tR\x03Ref\x12\x16\n" + + "\x06Pinned\x18\x02 \x01(\bR\x06Pinned\x12\x16\n" + + "\x06Delete\x18\x03 \x01(\bR\x06Delete\x12\x1a\n" + + "\bFinalize\x18\x04 \x01(\bR\bFinalize\"\x1c\n" + + "\x1aUpdateBuildHistoryResponse\"\xe8\x01\n" + + "\n" + + "Descriptor\x12\x1d\n" + + "\n" + + "media_type\x18\x01 \x01(\tR\tmediaType\x12\x16\n" + + "\x06digest\x18\x02 \x01(\tR\x06digest\x12\x12\n" + + "\x04size\x18\x03 \x01(\x03R\x04size\x12O\n" + + "\vannotations\x18\x05 \x03(\v2-.moby.buildkit.v1.Descriptor.AnnotationsEntryR\vannotations\x1a>\n" + + "\x10AnnotationsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xc1\x02\n" + + "\x0fBuildResultInfo\x12H\n" + + "\x10ResultDeprecated\x18\x01 \x01(\v2\x1c.moby.buildkit.v1.DescriptorR\x10ResultDeprecated\x12@\n" + + "\fAttestations\x18\x02 \x03(\v2\x1c.moby.buildkit.v1.DescriptorR\fAttestations\x12H\n" + + "\aResults\x18\x03 \x03(\v2..moby.buildkit.v1.BuildResultInfo.ResultsEntryR\aResults\x1aX\n" + + "\fResultsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\x03R\x03key\x122\n" + + "\x05value\x18\x02 \x01(\v2\x1c.moby.buildkit.v1.DescriptorR\x05value:\x028\x01\"\x95\x01\n" + + "\bExporter\x12\x12\n" + + "\x04Type\x18\x01 \x01(\tR\x04Type\x12;\n" + + "\x05Attrs\x18\x02 \x03(\v2%.moby.buildkit.v1.Exporter.AttrsEntryR\x05Attrs\x1a8\n" + + "\n" + + "AttrsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01*?\n" + + "\x15BuildHistoryEventType\x12\v\n" + + "\aSTARTED\x10\x00\x12\f\n" + + "\bCOMPLETE\x10\x01\x12\v\n" + + "\aDELETED\x10\x022\x89\x06\n" + + "\aControl\x12T\n" + + "\tDiskUsage\x12\".moby.buildkit.v1.DiskUsageRequest\x1a#.moby.buildkit.v1.DiskUsageResponse\x12H\n" + + "\x05Prune\x12\x1e.moby.buildkit.v1.PruneRequest\x1a\x1d.moby.buildkit.v1.UsageRecord0\x01\x12H\n" + + "\x05Solve\x12\x1e.moby.buildkit.v1.SolveRequest\x1a\x1f.moby.buildkit.v1.SolveResponse\x12M\n" + + "\x06Status\x12\x1f.moby.buildkit.v1.StatusRequest\x1a .moby.buildkit.v1.StatusResponse0\x01\x12M\n" + + "\aSession\x12\x1e.moby.buildkit.v1.BytesMessage\x1a\x1e.moby.buildkit.v1.BytesMessage(\x010\x01\x12Z\n" + + "\vListWorkers\x12$.moby.buildkit.v1.ListWorkersRequest\x1a%.moby.buildkit.v1.ListWorkersResponse\x12E\n" + + "\x04Info\x12\x1d.moby.buildkit.v1.InfoRequest\x1a\x1e.moby.buildkit.v1.InfoResponse\x12b\n" + + "\x12ListenBuildHistory\x12%.moby.buildkit.v1.BuildHistoryRequest\x1a#.moby.buildkit.v1.BuildHistoryEvent0\x01\x12o\n" + + "\x12UpdateBuildHistory\x12+.moby.buildkit.v1.UpdateBuildHistoryRequest\x1a,.moby.buildkit.v1.UpdateBuildHistoryResponseB@Z>github.com/moby/buildkit/api/services/control;moby_buildkit_v1b\x06proto3" var ( file_github_com_moby_buildkit_api_services_control_control_proto_rawDescOnce sync.Once - file_github_com_moby_buildkit_api_services_control_control_proto_rawDescData = file_github_com_moby_buildkit_api_services_control_control_proto_rawDesc + file_github_com_moby_buildkit_api_services_control_control_proto_rawDescData []byte ) func file_github_com_moby_buildkit_api_services_control_control_proto_rawDescGZIP() []byte { file_github_com_moby_buildkit_api_services_control_control_proto_rawDescOnce.Do(func() { - file_github_com_moby_buildkit_api_services_control_control_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_moby_buildkit_api_services_control_control_proto_rawDescData) + file_github_com_moby_buildkit_api_services_control_control_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_moby_buildkit_api_services_control_control_proto_rawDesc), len(file_github_com_moby_buildkit_api_services_control_control_proto_rawDesc))) }) return file_github_com_moby_buildkit_api_services_control_control_proto_rawDescData } @@ -2672,7 +2385,7 @@ func file_github_com_moby_buildkit_api_services_control_control_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_moby_buildkit_api_services_control_control_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_moby_buildkit_api_services_control_control_proto_rawDesc), len(file_github_com_moby_buildkit_api_services_control_control_proto_rawDesc)), NumEnums: 1, NumMessages: 39, NumExtensions: 0, @@ -2684,7 +2397,6 @@ func file_github_com_moby_buildkit_api_services_control_control_proto_init() { MessageInfos: file_github_com_moby_buildkit_api_services_control_control_proto_msgTypes, }.Build() File_github_com_moby_buildkit_api_services_control_control_proto = out.File - file_github_com_moby_buildkit_api_services_control_control_proto_rawDesc = nil file_github_com_moby_buildkit_api_services_control_control_proto_goTypes = nil file_github_com_moby_buildkit_api_services_control_control_proto_depIdxs = nil } diff --git a/vendor/github.com/moby/buildkit/api/types/worker.pb.go b/vendor/github.com/moby/buildkit/api/types/worker.pb.go index b49b47d322..448548c82e 100644 --- a/vendor/github.com/moby/buildkit/api/types/worker.pb.go +++ b/vendor/github.com/moby/buildkit/api/types/worker.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 +// protoc-gen-go v1.36.6 // protoc v3.11.4 // source: github.com/moby/buildkit/api/types/worker.proto @@ -12,6 +12,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -22,16 +23,15 @@ const ( ) type WorkerRecord struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,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"` - Platforms []*pb.Platform `protobuf:"bytes,3,rep,name=platforms,proto3" json:"platforms,omitempty"` - GCPolicy []*GCPolicy `protobuf:"bytes,4,rep,name=GCPolicy,proto3" json:"GCPolicy,omitempty"` - BuildkitVersion *BuildkitVersion `protobuf:"bytes,5,opt,name=BuildkitVersion,proto3" json:"BuildkitVersion,omitempty"` - CDIDevices []*CDIDevice `protobuf:"bytes,6,rep,name=CDIDevices,proto3" json:"CDIDevices,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` + Labels map[string]string `protobuf:"bytes,2,rep,name=Labels,proto3" json:"Labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + Platforms []*pb.Platform `protobuf:"bytes,3,rep,name=platforms,proto3" json:"platforms,omitempty"` + GCPolicy []*GCPolicy `protobuf:"bytes,4,rep,name=GCPolicy,proto3" json:"GCPolicy,omitempty"` + BuildkitVersion *BuildkitVersion `protobuf:"bytes,5,opt,name=BuildkitVersion,proto3" json:"BuildkitVersion,omitempty"` + CDIDevices []*CDIDevice `protobuf:"bytes,6,rep,name=CDIDevices,proto3" json:"CDIDevices,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *WorkerRecord) Reset() { @@ -107,17 +107,16 @@ func (x *WorkerRecord) GetCDIDevices() []*CDIDevice { } type GCPolicy struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - All bool `protobuf:"varint,1,opt,name=all,proto3" json:"all,omitempty"` - KeepDuration int64 `protobuf:"varint,2,opt,name=keepDuration,proto3" json:"keepDuration,omitempty"` - Filters []string `protobuf:"bytes,4,rep,name=filters,proto3" json:"filters,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + All bool `protobuf:"varint,1,opt,name=all,proto3" json:"all,omitempty"` + KeepDuration int64 `protobuf:"varint,2,opt,name=keepDuration,proto3" json:"keepDuration,omitempty"` + Filters []string `protobuf:"bytes,4,rep,name=filters,proto3" json:"filters,omitempty"` // reservedSpace was renamed from freeBytes ReservedSpace int64 `protobuf:"varint,3,opt,name=reservedSpace,proto3" json:"reservedSpace,omitempty"` MaxUsedSpace int64 `protobuf:"varint,5,opt,name=maxUsedSpace,proto3" json:"maxUsedSpace,omitempty"` MinFreeSpace int64 `protobuf:"varint,6,opt,name=minFreeSpace,proto3" json:"minFreeSpace,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *GCPolicy) Reset() { @@ -193,13 +192,12 @@ func (x *GCPolicy) GetMinFreeSpace() int64 { } type BuildkitVersion struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Package string `protobuf:"bytes,1,opt,name=package,proto3" json:"package,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + Revision string `protobuf:"bytes,3,opt,name=revision,proto3" json:"revision,omitempty"` unknownFields protoimpl.UnknownFields - - Package string `protobuf:"bytes,1,opt,name=package,proto3" json:"package,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - Revision string `protobuf:"bytes,3,opt,name=revision,proto3" json:"revision,omitempty"` + sizeCache protoimpl.SizeCache } func (x *BuildkitVersion) Reset() { @@ -254,14 +252,13 @@ func (x *BuildkitVersion) GetRevision() string { } type CDIDevice struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` + AutoAllow bool `protobuf:"varint,2,opt,name=AutoAllow,proto3" json:"AutoAllow,omitempty"` + Annotations map[string]string `protobuf:"bytes,3,rep,name=Annotations,proto3" json:"Annotations,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + OnDemand bool `protobuf:"varint,4,opt,name=OnDemand,proto3" json:"OnDemand,omitempty"` unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` - AutoAllow bool `protobuf:"varint,2,opt,name=AutoAllow,proto3" json:"AutoAllow,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"` - OnDemand bool `protobuf:"varint,4,opt,name=OnDemand,proto3" json:"OnDemand,omitempty"` + sizeCache protoimpl.SizeCache } func (x *CDIDevice) Reset() { @@ -324,90 +321,49 @@ func (x *CDIDevice) GetOnDemand() bool { var File_github_com_moby_buildkit_api_types_worker_proto protoreflect.FileDescriptor -var file_github_com_moby_buildkit_api_types_worker_proto_rawDesc = []byte{ - 0x0a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, - 0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x16, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, - 0x2e, 0x76, 0x31, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x1a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, 0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, - 0x6b, 0x69, 0x74, 0x2f, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x62, 0x2f, 0x6f, 0x70, - 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa3, 0x03, 0x0a, 0x0c, 0x57, 0x6f, 0x72, 0x6b, - 0x65, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x44, 0x12, 0x48, 0x0a, 0x06, 0x4c, 0x61, 0x62, 0x65, - 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, - 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x4c, - 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x4c, 0x61, 0x62, 0x65, - 0x6c, 0x73, 0x12, 0x2a, 0x0a, 0x09, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, - 0x6f, 0x72, 0x6d, 0x52, 0x09, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x12, 0x3c, - 0x0a, 0x08, 0x47, 0x43, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x20, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, - 0x2e, 0x76, 0x31, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x47, 0x43, 0x50, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x52, 0x08, 0x47, 0x43, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x51, 0x0a, 0x0f, - 0x42, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, - 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, - 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0f, - 0x42, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x41, 0x0a, 0x0a, 0x43, 0x44, 0x49, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x06, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, - 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x44, 0x49, - 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x0a, 0x43, 0x44, 0x49, 0x44, 0x65, 0x76, 0x69, 0x63, - 0x65, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xc8, 0x01, - 0x0a, 0x08, 0x47, 0x43, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, - 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, 0x22, 0x0a, 0x0c, - 0x6b, 0x65, 0x65, 0x70, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x0c, 0x6b, 0x65, 0x65, 0x70, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x72, 0x65, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x53, 0x70, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x0d, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x53, 0x70, 0x61, 0x63, 0x65, - 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x61, 0x78, 0x55, 0x73, 0x65, 0x64, 0x53, 0x70, 0x61, 0x63, 0x65, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x6d, 0x61, 0x78, 0x55, 0x73, 0x65, 0x64, 0x53, - 0x70, 0x61, 0x63, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x69, 0x6e, 0x46, 0x72, 0x65, 0x65, 0x53, - 0x70, 0x61, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x6d, 0x69, 0x6e, 0x46, - 0x72, 0x65, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x22, 0x61, 0x0a, 0x0f, 0x42, 0x75, 0x69, 0x6c, - 0x64, 0x6b, 0x69, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x70, - 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, - 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xef, 0x01, 0x0a, 0x09, - 0x43, 0x44, 0x49, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, - 0x09, 0x41, 0x75, 0x74, 0x6f, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x09, 0x41, 0x75, 0x74, 0x6f, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x12, 0x54, 0x0a, 0x0b, 0x41, - 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x32, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, - 0x2e, 0x76, 0x31, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x44, 0x49, 0x44, 0x65, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x4f, 0x6e, 0x44, 0x65, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x08, 0x4f, 0x6e, 0x44, 0x65, 0x6d, 0x61, 0x6e, 0x64, 0x1a, 0x3e, 0x0a, - 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x3b, 0x5a, - 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, 0x79, - 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x3b, 0x6d, 0x6f, 0x62, 0x79, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, - 0x74, 0x5f, 0x76, 0x31, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -} +const file_github_com_moby_buildkit_api_types_worker_proto_rawDesc = "" + + "\n" + + "/github.com/moby/buildkit/api/types/worker.proto\x12\x16moby.buildkit.v1.types\x1a,github.com/moby/buildkit/solver/pb/ops.proto\"\xa3\x03\n" + + "\fWorkerRecord\x12\x0e\n" + + "\x02ID\x18\x01 \x01(\tR\x02ID\x12H\n" + + "\x06Labels\x18\x02 \x03(\v20.moby.buildkit.v1.types.WorkerRecord.LabelsEntryR\x06Labels\x12*\n" + + "\tplatforms\x18\x03 \x03(\v2\f.pb.PlatformR\tplatforms\x12<\n" + + "\bGCPolicy\x18\x04 \x03(\v2 .moby.buildkit.v1.types.GCPolicyR\bGCPolicy\x12Q\n" + + "\x0fBuildkitVersion\x18\x05 \x01(\v2'.moby.buildkit.v1.types.BuildkitVersionR\x0fBuildkitVersion\x12A\n" + + "\n" + + "CDIDevices\x18\x06 \x03(\v2!.moby.buildkit.v1.types.CDIDeviceR\n" + + "CDIDevices\x1a9\n" + + "\vLabelsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xc8\x01\n" + + "\bGCPolicy\x12\x10\n" + + "\x03all\x18\x01 \x01(\bR\x03all\x12\"\n" + + "\fkeepDuration\x18\x02 \x01(\x03R\fkeepDuration\x12\x18\n" + + "\afilters\x18\x04 \x03(\tR\afilters\x12$\n" + + "\rreservedSpace\x18\x03 \x01(\x03R\rreservedSpace\x12\"\n" + + "\fmaxUsedSpace\x18\x05 \x01(\x03R\fmaxUsedSpace\x12\"\n" + + "\fminFreeSpace\x18\x06 \x01(\x03R\fminFreeSpace\"a\n" + + "\x0fBuildkitVersion\x12\x18\n" + + "\apackage\x18\x01 \x01(\tR\apackage\x12\x18\n" + + "\aversion\x18\x02 \x01(\tR\aversion\x12\x1a\n" + + "\brevision\x18\x03 \x01(\tR\brevision\"\xef\x01\n" + + "\tCDIDevice\x12\x12\n" + + "\x04Name\x18\x01 \x01(\tR\x04Name\x12\x1c\n" + + "\tAutoAllow\x18\x02 \x01(\bR\tAutoAllow\x12T\n" + + "\vAnnotations\x18\x03 \x03(\v22.moby.buildkit.v1.types.CDIDevice.AnnotationsEntryR\vAnnotations\x12\x1a\n" + + "\bOnDemand\x18\x04 \x01(\bR\bOnDemand\x1a>\n" + + "\x10AnnotationsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01B;Z9github.com/moby/buildkit/api/types;moby_buildkit_v1_typesb\x06proto3" var ( file_github_com_moby_buildkit_api_types_worker_proto_rawDescOnce sync.Once - file_github_com_moby_buildkit_api_types_worker_proto_rawDescData = file_github_com_moby_buildkit_api_types_worker_proto_rawDesc + file_github_com_moby_buildkit_api_types_worker_proto_rawDescData []byte ) func file_github_com_moby_buildkit_api_types_worker_proto_rawDescGZIP() []byte { file_github_com_moby_buildkit_api_types_worker_proto_rawDescOnce.Do(func() { - file_github_com_moby_buildkit_api_types_worker_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_moby_buildkit_api_types_worker_proto_rawDescData) + file_github_com_moby_buildkit_api_types_worker_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_moby_buildkit_api_types_worker_proto_rawDesc), len(file_github_com_moby_buildkit_api_types_worker_proto_rawDesc))) }) return file_github_com_moby_buildkit_api_types_worker_proto_rawDescData } @@ -445,7 +401,7 @@ func file_github_com_moby_buildkit_api_types_worker_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_moby_buildkit_api_types_worker_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_moby_buildkit_api_types_worker_proto_rawDesc), len(file_github_com_moby_buildkit_api_types_worker_proto_rawDesc)), NumEnums: 0, NumMessages: 6, NumExtensions: 0, @@ -456,7 +412,6 @@ func file_github_com_moby_buildkit_api_types_worker_proto_init() { MessageInfos: file_github_com_moby_buildkit_api_types_worker_proto_msgTypes, }.Build() File_github_com_moby_buildkit_api_types_worker_proto = out.File - file_github_com_moby_buildkit_api_types_worker_proto_rawDesc = nil file_github_com_moby_buildkit_api_types_worker_proto_goTypes = nil file_github_com_moby_buildkit_api_types_worker_proto_depIdxs = nil } diff --git a/vendor/github.com/moby/buildkit/cache/contenthash/checksum.pb.go b/vendor/github.com/moby/buildkit/cache/contenthash/checksum.pb.go index a2a41758ef..df4e419039 100644 --- a/vendor/github.com/moby/buildkit/cache/contenthash/checksum.pb.go +++ b/vendor/github.com/moby/buildkit/cache/contenthash/checksum.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 +// protoc-gen-go v1.36.6 // protoc v3.11.4 // source: github.com/moby/buildkit/cache/contenthash/checksum.proto @@ -11,6 +11,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -73,13 +74,12 @@ func (CacheRecordType) EnumDescriptor() ([]byte, []int) { } type CacheRecord struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Digest string `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"` + Type CacheRecordType `protobuf:"varint,2,opt,name=type,proto3,enum=contenthash.CacheRecordType" json:"type,omitempty"` + Linkname string `protobuf:"bytes,3,opt,name=linkname,proto3" json:"linkname,omitempty"` unknownFields protoimpl.UnknownFields - - Digest string `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"` - Type CacheRecordType `protobuf:"varint,2,opt,name=type,proto3,enum=contenthash.CacheRecordType" json:"type,omitempty"` - Linkname string `protobuf:"bytes,3,opt,name=linkname,proto3" json:"linkname,omitempty"` + sizeCache protoimpl.SizeCache } func (x *CacheRecord) Reset() { @@ -134,12 +134,11 @@ func (x *CacheRecord) GetLinkname() string { } type CacheRecordWithPath struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + Record *CacheRecord `protobuf:"bytes,2,opt,name=record,proto3" json:"record,omitempty"` unknownFields protoimpl.UnknownFields - - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - Record *CacheRecord `protobuf:"bytes,2,opt,name=record,proto3" json:"record,omitempty"` + sizeCache protoimpl.SizeCache } func (x *CacheRecordWithPath) Reset() { @@ -187,11 +186,10 @@ func (x *CacheRecordWithPath) GetRecord() *CacheRecord { } type CacheRecords struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Paths []*CacheRecordWithPath `protobuf:"bytes,1,rep,name=paths,proto3" json:"paths,omitempty"` unknownFields protoimpl.UnknownFields - - Paths []*CacheRecordWithPath `protobuf:"bytes,1,rep,name=paths,proto3" json:"paths,omitempty"` + sizeCache protoimpl.SizeCache } func (x *CacheRecords) Reset() { @@ -233,47 +231,33 @@ func (x *CacheRecords) GetPaths() []*CacheRecordWithPath { var File_github_com_moby_buildkit_cache_contenthash_checksum_proto protoreflect.FileDescriptor -var file_github_com_moby_buildkit_cache_contenthash_checksum_proto_rawDesc = []byte{ - 0x0a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, - 0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x63, 0x61, 0x63, 0x68, 0x65, - 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x68, 0x61, 0x73, 0x68, 0x2f, 0x63, 0x68, 0x65, - 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x63, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x74, 0x68, 0x61, 0x73, 0x68, 0x22, 0x73, 0x0a, 0x0b, 0x43, 0x61, 0x63, 0x68, - 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, - 0x30, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x68, 0x61, 0x73, 0x68, 0x2e, 0x43, 0x61, 0x63, 0x68, - 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x69, 0x6e, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x69, 0x6e, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x5b, 0x0a, - 0x13, 0x43, 0x61, 0x63, 0x68, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x57, 0x69, 0x74, 0x68, - 0x50, 0x61, 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x30, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, - 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x68, 0x61, 0x73, 0x68, 0x2e, 0x43, 0x61, 0x63, 0x68, 0x65, 0x52, 0x65, 0x63, 0x6f, - 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, 0x46, 0x0a, 0x0c, 0x43, 0x61, - 0x63, 0x68, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x12, 0x36, 0x0a, 0x05, 0x70, 0x61, - 0x74, 0x68, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x68, 0x61, 0x73, 0x68, 0x2e, 0x43, 0x61, 0x63, 0x68, 0x65, 0x52, 0x65, 0x63, - 0x6f, 0x72, 0x64, 0x57, 0x69, 0x74, 0x68, 0x50, 0x61, 0x74, 0x68, 0x52, 0x05, 0x70, 0x61, 0x74, - 0x68, 0x73, 0x2a, 0x41, 0x0a, 0x0f, 0x43, 0x61, 0x63, 0x68, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, - 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x49, 0x4c, 0x45, 0x10, 0x00, 0x12, - 0x07, 0x0a, 0x03, 0x44, 0x49, 0x52, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x44, 0x49, 0x52, 0x5f, - 0x48, 0x45, 0x41, 0x44, 0x45, 0x52, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x59, 0x4d, 0x4c, - 0x49, 0x4e, 0x4b, 0x10, 0x03, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, 0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, - 0x74, 0x2f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x68, - 0x61, 0x73, 0x68, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_github_com_moby_buildkit_cache_contenthash_checksum_proto_rawDesc = "" + + "\n" + + "9github.com/moby/buildkit/cache/contenthash/checksum.proto\x12\vcontenthash\"s\n" + + "\vCacheRecord\x12\x16\n" + + "\x06digest\x18\x01 \x01(\tR\x06digest\x120\n" + + "\x04type\x18\x02 \x01(\x0e2\x1c.contenthash.CacheRecordTypeR\x04type\x12\x1a\n" + + "\blinkname\x18\x03 \x01(\tR\blinkname\"[\n" + + "\x13CacheRecordWithPath\x12\x12\n" + + "\x04path\x18\x01 \x01(\tR\x04path\x120\n" + + "\x06record\x18\x02 \x01(\v2\x18.contenthash.CacheRecordR\x06record\"F\n" + + "\fCacheRecords\x126\n" + + "\x05paths\x18\x01 \x03(\v2 .contenthash.CacheRecordWithPathR\x05paths*A\n" + + "\x0fCacheRecordType\x12\b\n" + + "\x04FILE\x10\x00\x12\a\n" + + "\x03DIR\x10\x01\x12\x0e\n" + + "\n" + + "DIR_HEADER\x10\x02\x12\v\n" + + "\aSYMLINK\x10\x03B,Z*github.com/moby/buildkit/cache/contenthashb\x06proto3" var ( file_github_com_moby_buildkit_cache_contenthash_checksum_proto_rawDescOnce sync.Once - file_github_com_moby_buildkit_cache_contenthash_checksum_proto_rawDescData = file_github_com_moby_buildkit_cache_contenthash_checksum_proto_rawDesc + file_github_com_moby_buildkit_cache_contenthash_checksum_proto_rawDescData []byte ) func file_github_com_moby_buildkit_cache_contenthash_checksum_proto_rawDescGZIP() []byte { file_github_com_moby_buildkit_cache_contenthash_checksum_proto_rawDescOnce.Do(func() { - file_github_com_moby_buildkit_cache_contenthash_checksum_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_moby_buildkit_cache_contenthash_checksum_proto_rawDescData) + file_github_com_moby_buildkit_cache_contenthash_checksum_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_moby_buildkit_cache_contenthash_checksum_proto_rawDesc), len(file_github_com_moby_buildkit_cache_contenthash_checksum_proto_rawDesc))) }) return file_github_com_moby_buildkit_cache_contenthash_checksum_proto_rawDescData } @@ -306,7 +290,7 @@ func file_github_com_moby_buildkit_cache_contenthash_checksum_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_moby_buildkit_cache_contenthash_checksum_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_moby_buildkit_cache_contenthash_checksum_proto_rawDesc), len(file_github_com_moby_buildkit_cache_contenthash_checksum_proto_rawDesc)), NumEnums: 1, NumMessages: 3, NumExtensions: 0, @@ -318,7 +302,6 @@ func file_github_com_moby_buildkit_cache_contenthash_checksum_proto_init() { MessageInfos: file_github_com_moby_buildkit_cache_contenthash_checksum_proto_msgTypes, }.Build() File_github_com_moby_buildkit_cache_contenthash_checksum_proto = out.File - file_github_com_moby_buildkit_cache_contenthash_checksum_proto_rawDesc = nil file_github_com_moby_buildkit_cache_contenthash_checksum_proto_goTypes = nil file_github_com_moby_buildkit_cache_contenthash_checksum_proto_depIdxs = nil } diff --git a/vendor/github.com/moby/buildkit/cache/contenthash/checksum_windows.go b/vendor/github.com/moby/buildkit/cache/contenthash/checksum_windows.go index be0b539b36..b496427575 100644 --- a/vendor/github.com/moby/buildkit/cache/contenthash/checksum_windows.go +++ b/vendor/github.com/moby/buildkit/cache/contenthash/checksum_windows.go @@ -2,11 +2,16 @@ package contenthash import ( "path/filepath" + "sync" "github.com/Microsoft/go-winio" ) -var privileges = []string{winio.SeBackupPrivilege} +var ( + privileges = []string{winio.SeBackupPrivilege} + privilegeLock sync.Mutex + privilegeRefCount int +) func (cc *cacheContext) walk(scanPath string, walkFunc filepath.WalkFunc) error { // elevating the admin privileges to walk special files/directory @@ -19,11 +24,25 @@ func (cc *cacheContext) walk(scanPath string, walkFunc filepath.WalkFunc) error // Adds the SeBackupPrivilege to the process // to be able to access some special files and directories. func enableProcessPrivileges() { - _ = winio.EnableProcessPrivileges(privileges) + privilegeLock.Lock() + defer privilegeLock.Unlock() + + if privilegeRefCount == 0 { + _ = winio.EnableProcessPrivileges(privileges) + } + privilegeRefCount++ } // Disables the SeBackupPrivilege on the process // once the group of functions that needed it is complete. func disableProcessPrivileges() { - _ = winio.DisableProcessPrivileges(privileges) + privilegeLock.Lock() + defer privilegeLock.Unlock() + + if privilegeRefCount > 0 { + privilegeRefCount-- + if privilegeRefCount == 0 { + _ = winio.DisableProcessPrivileges(privileges) + } + } } diff --git a/vendor/github.com/moby/buildkit/cache/contenthash/filehash.go b/vendor/github.com/moby/buildkit/cache/contenthash/filehash.go index 460efa9ef3..34404871d5 100644 --- a/vendor/github.com/moby/buildkit/cache/contenthash/filehash.go +++ b/vendor/github.com/moby/buildkit/cache/contenthash/filehash.go @@ -41,17 +41,8 @@ func NewFileHash(path string, fi os.FileInfo) (hash.Hash, error) { } func NewFromStat(stat *fstypes.Stat) (hash.Hash, error) { - // Clear the irregular file bit if this is some kind of special - // file. Pre-Go 1.23 behavior would only add the irregular file - // bit to regular files with non-handled reparse points. - // Current versions of Go now apply them to directories too. - // archive/tar.FileInfoHeader does not handle the irregular bit. - if stat.Mode&uint32(os.ModeType&^os.ModeIrregular) != 0 { - stat.Mode &^= uint32(os.ModeIrregular) - } - - // Clear the socket bit since archive/tar.FileInfoHeader does not handle it - stat.Mode &^= uint32(os.ModeSocket) + // Clear the socket and irregular bits since archive/tar.FileInfoHeader does not handle them + stat.Mode &^= uint32(os.ModeSocket | os.ModeIrregular) fi := &statInfo{stat} hdr, err := tar.FileInfoHeader(fi, stat.Linkname) diff --git a/vendor/github.com/moby/buildkit/control/control.go b/vendor/github.com/moby/buildkit/control/control.go index b392c72ee7..15aba411de 100644 --- a/vendor/github.com/moby/buildkit/control/control.go +++ b/vendor/github.com/moby/buildkit/control/control.go @@ -35,6 +35,7 @@ import ( "github.com/moby/buildkit/solver/llbsolver" "github.com/moby/buildkit/solver/llbsolver/cdidevices" "github.com/moby/buildkit/solver/llbsolver/proc" + provenancetypes "github.com/moby/buildkit/solver/llbsolver/provenance/types" "github.com/moby/buildkit/solver/pb" "github.com/moby/buildkit/util/bklog" "github.com/moby/buildkit/util/db" @@ -508,7 +509,19 @@ func (c *Controller) Solve(ctx context.Context, req *controlapi.SolveRequest) (* } if attrs, ok := attests["provenance"]; ok { - procs = append(procs, proc.ProvenanceProcessor(attrs)) + var slsaVersion provenancetypes.ProvenanceSLSA + params := make(map[string]string) + for k, v := range attrs { + if k == "version" { + slsaVersion = provenancetypes.ProvenanceSLSA(v) + if err := slsaVersion.Validate(); err != nil { + return nil, err + } + } else { + params[k] = v + } + } + procs = append(procs, proc.ProvenanceProcessor(slsaVersion, params)) } resp, err := c.solver.Solve(ctx, req.Ref, req.Session, frontend.SolveRequest{ diff --git a/vendor/github.com/moby/buildkit/exporter/local/export.go b/vendor/github.com/moby/buildkit/exporter/local/export.go index 29c6afbac9..10e3a87ce3 100644 --- a/vendor/github.com/moby/buildkit/exporter/local/export.go +++ b/vendor/github.com/moby/buildkit/exporter/local/export.go @@ -117,7 +117,7 @@ func (e *localExporterInstance) Export(ctx context.Context, inp *exporter.Source export := func(ctx context.Context, k string, ref cache.ImmutableRef, attestations []exporter.Attestation) func() error { return func() error { - outputFS, cleanup, err := CreateFS(ctx, sessionID, k, ref, attestations, now, e.opts) + outputFS, cleanup, err := CreateFS(ctx, sessionID, k, ref, attestations, now, isMap, e.opts) if err != nil { return err } @@ -125,9 +125,10 @@ func (e *localExporterInstance) Export(ctx context.Context, inp *exporter.Source defer cleanup() } - if !e.opts.PlatformSplit { + lbl := "copying files" + if !e.opts.UsePlatformSplit(isMap) { // check for duplicate paths - err = outputFS.Walk(ctx, "", func(p string, entry os.DirEntry, err error) error { + err = fsWalk(ctx, outputFS, "", func(p string, entry os.DirEntry, err error) error { if entry.IsDir() { return nil } @@ -145,23 +146,18 @@ func (e *localExporterInstance) Export(ctx context.Context, inp *exporter.Source if err != nil { return err } - } - - lbl := "copying files" - if isMap { + } else { lbl += " " + k - if e.opts.PlatformSplit { - st := &fstypes.Stat{ - Mode: uint32(os.ModeDir | 0755), - Path: strings.ReplaceAll(k, "/", "_"), - } - if e.opts.Epoch != nil { - st.ModTime = e.opts.Epoch.UnixNano() - } - outputFS, err = fsutil.SubDirFS([]fsutil.Dir{{FS: outputFS, Stat: st}}) - if err != nil { - return err - } + st := &fstypes.Stat{ + Mode: uint32(os.ModeDir | 0755), + Path: strings.ReplaceAll(k, "/", "_"), + } + if e.opts.Epoch != nil { + st.ModTime = e.opts.Epoch.UnixNano() + } + outputFS, err = fsutil.SubDirFS([]fsutil.Dir{{FS: outputFS, Stat: st}}) + if err != nil { + return err } } diff --git a/vendor/github.com/moby/buildkit/exporter/local/export_unix.go b/vendor/github.com/moby/buildkit/exporter/local/export_unix.go new file mode 100644 index 0000000000..d2612182fd --- /dev/null +++ b/vendor/github.com/moby/buildkit/exporter/local/export_unix.go @@ -0,0 +1,14 @@ +//go:build !windows + +package local + +import ( + "context" + gofs "io/fs" + + "github.com/tonistiigi/fsutil" +) + +func fsWalk(ctx context.Context, fs fsutil.FS, s string, walkFn gofs.WalkDirFunc) error { + return fs.Walk(ctx, s, walkFn) +} diff --git a/vendor/github.com/moby/buildkit/exporter/local/export_windows.go b/vendor/github.com/moby/buildkit/exporter/local/export_windows.go new file mode 100644 index 0000000000..dea1821a71 --- /dev/null +++ b/vendor/github.com/moby/buildkit/exporter/local/export_windows.go @@ -0,0 +1,17 @@ +package local + +import ( + "context" + gofs "io/fs" + + "github.com/Microsoft/go-winio" + "github.com/tonistiigi/fsutil" +) + +func fsWalk(ctx context.Context, fs fsutil.FS, s string, walkFn gofs.WalkDirFunc) error { + // Windows has some special files that require + // SeBackupPrivilege to be accessed. Ref #4994 + return winio.RunWithPrivilege(winio.SeBackupPrivilege, func() error { + return fs.Walk(ctx, s, walkFn) + }) +} diff --git a/vendor/github.com/moby/buildkit/exporter/local/fs.go b/vendor/github.com/moby/buildkit/exporter/local/fs.go index 1985ed0096..6e68b0aa2a 100644 --- a/vendor/github.com/moby/buildkit/exporter/local/fs.go +++ b/vendor/github.com/moby/buildkit/exporter/local/fs.go @@ -38,12 +38,18 @@ const ( type CreateFSOpts struct { Epoch *time.Time AttestationPrefix string - PlatformSplit bool + PlatformSplit *bool +} + +func (c *CreateFSOpts) UsePlatformSplit(isMap bool) bool { + if c.PlatformSplit == nil { + return isMap + } + return *c.PlatformSplit } func (c *CreateFSOpts) Load(opt map[string]string) (map[string]string, error) { rest := make(map[string]string) - c.PlatformSplit = true var err error c.Epoch, opt, err = epoch.ParseExporterAttrs(opt) @@ -60,7 +66,7 @@ func (c *CreateFSOpts) Load(opt map[string]string) (map[string]string, error) { if err != nil { return nil, errors.Wrapf(err, "non-bool value for %s: %s", keyPlatformSplit, v) } - c.PlatformSplit = b + c.PlatformSplit = &b default: rest[k] = v } @@ -69,7 +75,7 @@ func (c *CreateFSOpts) Load(opt map[string]string) (map[string]string, error) { return rest, nil } -func CreateFS(ctx context.Context, sessionID string, k string, ref cache.ImmutableRef, attestations []exporter.Attestation, defaultTime time.Time, opt CreateFSOpts) (fsutil.FS, func() error, error) { +func CreateFS(ctx context.Context, sessionID string, k string, ref cache.ImmutableRef, attestations []exporter.Attestation, defaultTime time.Time, isMap bool, opt CreateFSOpts) (fsutil.FS, func() error, error) { var cleanup func() error var src string var err error @@ -174,6 +180,7 @@ func CreateFS(ctx context.Context, sessionID string, k string, ref cache.Immutab return nil, nil, err } stmtFS := staticfs.NewFS() + split := opt.UsePlatformSplit(isMap) names := map[string]struct{}{} for i, stmt := range stmts { @@ -183,7 +190,7 @@ func CreateFS(ctx context.Context, sessionID string, k string, ref cache.Immutab } name := opt.AttestationPrefix + path.Base(attestations[i].Path) - if !opt.PlatformSplit { + if !split { nameExt := path.Ext(name) namBase := strings.TrimSuffix(name, nameExt) name = fmt.Sprintf("%s.%s%s", namBase, strings.ReplaceAll(k, "/", "_"), nameExt) diff --git a/vendor/github.com/moby/buildkit/exporter/oci/export.go b/vendor/github.com/moby/buildkit/exporter/oci/export.go index c6650b0a25..0ba04d1231 100644 --- a/vendor/github.com/moby/buildkit/exporter/oci/export.go +++ b/vendor/github.com/moby/buildkit/exporter/oci/export.go @@ -236,6 +236,9 @@ func (e *imageExporterInstance) Export(ctx context.Context, src *exporter.Source mprovider := contentutil.NewMultiProvider(e.opt.ImageWriter.ContentStore()) for _, ref := range refs { eg.Go(func() error { + if ref == nil { + return nil + } remotes, err := ref.GetRemotes(egCtx, false, e.opts.RefCfg, false, session.NewGroup(sessionID)) if err != nil { return err diff --git a/vendor/github.com/moby/buildkit/exporter/tar/export.go b/vendor/github.com/moby/buildkit/exporter/tar/export.go index 770b38254d..57d9eef104 100644 --- a/vendor/github.com/moby/buildkit/exporter/tar/export.go +++ b/vendor/github.com/moby/buildkit/exporter/tar/export.go @@ -95,9 +95,10 @@ func (e *localExporterInstance) Export(ctx context.Context, inp *exporter.Source } now := time.Now().Truncate(time.Second) + isMap := len(inp.Refs) > 0 getDir := func(ctx context.Context, k string, ref cache.ImmutableRef, attestations []exporter.Attestation) (*fsutil.Dir, error) { - outputFS, cleanup, err := local.CreateFS(ctx, sessionID, k, ref, attestations, now, e.opts) + outputFS, cleanup, err := local.CreateFS(ctx, sessionID, k, ref, attestations, now, isMap, e.opts) if err != nil { return nil, err } @@ -119,7 +120,6 @@ func (e *localExporterInstance) Export(ctx context.Context, inp *exporter.Source }, nil } - isMap := len(inp.Refs) > 0 if _, ok := inp.Metadata[exptypes.ExporterPlatformsKey]; isMap && !ok { return nil, nil, errors.Errorf("unable to export multiple refs, missing platforms mapping") } diff --git a/vendor/github.com/moby/buildkit/frontend/attestations/parse.go b/vendor/github.com/moby/buildkit/frontend/attestations/parse.go index 2b2ed24992..6a2b6e1811 100644 --- a/vendor/github.com/moby/buildkit/frontend/attestations/parse.go +++ b/vendor/github.com/moby/buildkit/frontend/attestations/parse.go @@ -3,6 +3,7 @@ package attestations import ( "strings" + provenancetypes "github.com/moby/buildkit/solver/llbsolver/provenance/types" "github.com/pkg/errors" "github.com/tonistiigi/go-csvvalue" ) @@ -14,6 +15,7 @@ const ( const ( defaultSBOMGenerator = "docker/buildkit-syft-scanner:stable-1" + defaultSLSAVersion = string(provenancetypes.ProvenanceSLSA02) ) func Filter(v map[string]string) map[string]string { @@ -57,8 +59,11 @@ func Parse(values map[string]string) (map[string]map[string]string, error) { for k, v := range attests { attrs := make(map[string]string) out[k] = attrs - if k == KeyTypeSbom { + switch k { + case KeyTypeSbom: attrs["generator"] = defaultSBOMGenerator + case KeyTypeProvenance: + attrs["version"] = defaultSLSAVersion } if v == "" { continue diff --git a/vendor/github.com/moby/buildkit/frontend/dockerfile/dockerfile2llb/convert.go b/vendor/github.com/moby/buildkit/frontend/dockerfile/dockerfile2llb/convert.go index b52c03155b..9ba03f66a0 100644 --- a/vendor/github.com/moby/buildkit/frontend/dockerfile/dockerfile2llb/convert.go +++ b/vendor/github.com/moby/buildkit/frontend/dockerfile/dockerfile2llb/convert.go @@ -948,6 +948,7 @@ func dispatch(d *dispatchState, cmd command, opt dispatchOpt) error { link: c.Link, keepGitDir: c.KeepGitDir, checksum: c.Checksum, + unpack: c.Unpack, location: c.Location(), ignoreMatcher: opt.dockerIgnoreMatcher, opt: opt, @@ -1554,9 +1555,15 @@ func dispatchCopy(d *dispatchState, cfg copyConfig) error { st := llb.HTTP(src, llb.Filename(f), llb.WithCustomName(pgName), llb.Checksum(checksum), dfCmd(cfg.params)) + var unpack bool + if cfg.unpack != nil { + unpack = *cfg.unpack + } + opts := append([]llb.CopyOption{&llb.CopyInfo{ Mode: chopt, CreateDestPath: true, + AttemptUnpack: unpack, }}, copyOpt...) if a == nil { @@ -1590,12 +1597,17 @@ func dispatchCopy(d *dispatchState, cfg copyConfig) error { return errors.Wrap(err, "removing drive letter") } + unpack := cfg.isAddCommand + if cfg.unpack != nil { + unpack = *cfg.unpack + } + opts := append([]llb.CopyOption{&llb.CopyInfo{ Mode: chopt, FollowSymlinks: true, CopyDirContentsOnly: true, IncludePatterns: patterns, - AttemptUnpack: cfg.isAddCommand, + AttemptUnpack: unpack, CreateDestPath: true, AllowWildcard: true, AllowEmptyWildcard: true, @@ -1684,6 +1696,7 @@ type copyConfig struct { location []parser.Range ignoreMatcher *patternmatcher.PatternMatcher opt dispatchOpt + unpack *bool } func dispatchMaintainer(d *dispatchState, c *instructions.MaintainerCommand) error { diff --git a/vendor/github.com/moby/buildkit/frontend/dockerfile/instructions/commands.go b/vendor/github.com/moby/buildkit/frontend/dockerfile/instructions/commands.go index bebce6361c..f82f07f9d1 100644 --- a/vendor/github.com/moby/buildkit/frontend/dockerfile/instructions/commands.go +++ b/vendor/github.com/moby/buildkit/frontend/dockerfile/instructions/commands.go @@ -246,6 +246,7 @@ type AddCommand struct { ExcludePatterns []string KeepGitDir bool // whether to keep .git dir, only meaningful for git sources Checksum string + Unpack *bool } func (c *AddCommand) Expand(expander SingleWordExpander) error { diff --git a/vendor/github.com/moby/buildkit/frontend/dockerfile/instructions/parse.go b/vendor/github.com/moby/buildkit/frontend/dockerfile/instructions/parse.go index b44a6a3842..ccb0820fa8 100644 --- a/vendor/github.com/moby/buildkit/frontend/dockerfile/instructions/parse.go +++ b/vendor/github.com/moby/buildkit/frontend/dockerfile/instructions/parse.go @@ -338,6 +338,7 @@ func parseAdd(req parseRequest) (*AddCommand, error) { flLink := req.flags.AddBool("link", false) flKeepGitDir := req.flags.AddBool("keep-git-dir", false) flChecksum := req.flags.AddString("checksum", "") + flUnpack := req.flags.AddBool("unpack", false) if err := req.flags.Parse(); err != nil { return nil, err } @@ -347,6 +348,12 @@ func parseAdd(req parseRequest) (*AddCommand, error) { return nil, err } + var unpack *bool + if _, ok := req.flags.used["unpack"]; ok { + b := flUnpack.Value == "true" + unpack = &b + } + return &AddCommand{ withNameAndCode: newWithNameAndCode(req), SourcesAndDest: *sourcesAndDest, @@ -356,6 +363,7 @@ func parseAdd(req parseRequest) (*AddCommand, error) { KeepGitDir: flKeepGitDir.Value == "true", Checksum: flChecksum.Value, ExcludePatterns: stringValuesFromFlagIfPossible(flExcludes), + Unpack: unpack, }, nil } diff --git a/vendor/github.com/moby/buildkit/frontend/dockerui/config.go b/vendor/github.com/moby/buildkit/frontend/dockerui/config.go index e16c6e0502..6c3f9f5f3d 100644 --- a/vendor/github.com/moby/buildkit/frontend/dockerui/config.go +++ b/vendor/github.com/moby/buildkit/frontend/dockerui/config.go @@ -7,6 +7,7 @@ import ( "path" "strconv" "strings" + "sync" "time" "github.com/containerd/platforms" @@ -85,6 +86,7 @@ type Client struct { localsSessionIDs map[string]string dockerignore []byte + dockerignoreMu sync.Mutex dockerignoreName string } @@ -516,6 +518,8 @@ func WithInternalName(name string) llb.ConstraintsOpt { } func (bc *Client) dockerIgnorePatterns(ctx context.Context, bctx *buildContext) ([]string, error) { + bc.dockerignoreMu.Lock() + defer bc.dockerignoreMu.Unlock() if bc.dockerignore == nil { sessionID := bc.bopts.SessionID if v, ok := bc.localsSessionIDs[bctx.contextLocalName]; ok { diff --git a/vendor/github.com/moby/buildkit/frontend/gateway/pb/gateway.pb.go b/vendor/github.com/moby/buildkit/frontend/gateway/pb/gateway.pb.go index 0890439108..e2252340d3 100644 --- a/vendor/github.com/moby/buildkit/frontend/gateway/pb/gateway.pb.go +++ b/vendor/github.com/moby/buildkit/frontend/gateway/pb/gateway.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 +// protoc-gen-go v1.36.6 // protoc v3.11.4 // source: github.com/moby/buildkit/frontend/gateway/pb/gateway.proto @@ -17,6 +17,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -119,20 +120,19 @@ func (InTotoSubjectKind) EnumDescriptor() ([]byte, []int) { } type Result struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Result: + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Result: // // *Result_RefDeprecated // *Result_RefsDeprecated // *Result_Ref // *Result_Refs Result isResult_Result `protobuf_oneof:"result"` - Metadata map[string][]byte `protobuf:"bytes,10,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Metadata map[string][]byte `protobuf:"bytes,10,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // 11 was used during development and is reserved for old attestation format - Attestations map[string]*Attestations `protobuf:"bytes,12,rep,name=attestations,proto3" json:"attestations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Attestations map[string]*Attestations `protobuf:"bytes,12,rep,name=attestations,proto3" json:"attestations,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Result) Reset() { @@ -165,37 +165,45 @@ func (*Result) Descriptor() ([]byte, []int) { return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP(), []int{0} } -func (m *Result) GetResult() isResult_Result { - if m != nil { - return m.Result +func (x *Result) GetResult() isResult_Result { + if x != nil { + return x.Result } return nil } func (x *Result) GetRefDeprecated() string { - if x, ok := x.GetResult().(*Result_RefDeprecated); ok { - return x.RefDeprecated + if x != nil { + if x, ok := x.Result.(*Result_RefDeprecated); ok { + return x.RefDeprecated + } } return "" } func (x *Result) GetRefsDeprecated() *RefMapDeprecated { - if x, ok := x.GetResult().(*Result_RefsDeprecated); ok { - return x.RefsDeprecated + if x != nil { + if x, ok := x.Result.(*Result_RefsDeprecated); ok { + return x.RefsDeprecated + } } return nil } func (x *Result) GetRef() *Ref { - if x, ok := x.GetResult().(*Result_Ref); ok { - return x.Ref + if x != nil { + if x, ok := x.Result.(*Result_Ref); ok { + return x.Ref + } } return nil } func (x *Result) GetRefs() *RefMap { - if x, ok := x.GetResult().(*Result_Refs); ok { - return x.Refs + if x != nil { + if x, ok := x.Result.(*Result_Refs); ok { + return x.Refs + } } return nil } @@ -244,11 +252,10 @@ func (*Result_Ref) isResult_Result() {} func (*Result_Refs) isResult_Result() {} type RefMapDeprecated struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Refs map[string]string `protobuf:"bytes,1,rep,name=refs,proto3" json:"refs,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` unknownFields protoimpl.UnknownFields - - Refs map[string]string `protobuf:"bytes,1,rep,name=refs,proto3" json:"refs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + sizeCache protoimpl.SizeCache } func (x *RefMapDeprecated) Reset() { @@ -289,12 +296,11 @@ func (x *RefMapDeprecated) GetRefs() map[string]string { } type Ref struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Def *pb.Definition `protobuf:"bytes,2,opt,name=def,proto3" json:"def,omitempty"` unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Def *pb.Definition `protobuf:"bytes,2,opt,name=def,proto3" json:"def,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Ref) Reset() { @@ -342,11 +348,10 @@ func (x *Ref) GetDef() *pb.Definition { } type RefMap struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Refs map[string]*Ref `protobuf:"bytes,1,rep,name=refs,proto3" json:"refs,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` unknownFields protoimpl.UnknownFields - - Refs map[string]*Ref `protobuf:"bytes,1,rep,name=refs,proto3" json:"refs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + sizeCache protoimpl.SizeCache } func (x *RefMap) Reset() { @@ -387,11 +392,10 @@ func (x *RefMap) GetRefs() map[string]*Ref { } type Attestations struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Attestation []*Attestation `protobuf:"bytes,1,rep,name=attestation,proto3" json:"attestation,omitempty"` unknownFields protoimpl.UnknownFields - - Attestation []*Attestation `protobuf:"bytes,1,rep,name=attestation,proto3" json:"attestation,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Attestations) Reset() { @@ -432,16 +436,15 @@ func (x *Attestations) GetAttestation() []*Attestation { } type Attestation struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Kind AttestationKind `protobuf:"varint,1,opt,name=kind,proto3,enum=moby.buildkit.v1.frontend.AttestationKind" json:"kind,omitempty"` - Metadata map[string][]byte `protobuf:"bytes,2,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Ref *Ref `protobuf:"bytes,3,opt,name=ref,proto3" json:"ref,omitempty"` - Path string `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"` - InTotoPredicateType string `protobuf:"bytes,5,opt,name=inTotoPredicateType,proto3" json:"inTotoPredicateType,omitempty"` - InTotoSubjects []*InTotoSubject `protobuf:"bytes,6,rep,name=inTotoSubjects,proto3" json:"inTotoSubjects,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Kind AttestationKind `protobuf:"varint,1,opt,name=kind,proto3,enum=moby.buildkit.v1.frontend.AttestationKind" json:"kind,omitempty"` + Metadata map[string][]byte `protobuf:"bytes,2,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + Ref *Ref `protobuf:"bytes,3,opt,name=ref,proto3" json:"ref,omitempty"` + Path string `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"` + InTotoPredicateType string `protobuf:"bytes,5,opt,name=inTotoPredicateType,proto3" json:"inTotoPredicateType,omitempty"` + InTotoSubjects []*InTotoSubject `protobuf:"bytes,6,rep,name=inTotoSubjects,proto3" json:"inTotoSubjects,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Attestation) Reset() { @@ -517,13 +520,12 @@ func (x *Attestation) GetInTotoSubjects() []*InTotoSubject { } type InTotoSubject struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Kind InTotoSubjectKind `protobuf:"varint,1,opt,name=kind,proto3,enum=moby.buildkit.v1.frontend.InTotoSubjectKind" json:"kind,omitempty"` + Digest []string `protobuf:"bytes,2,rep,name=digest,proto3" json:"digest,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` unknownFields protoimpl.UnknownFields - - Kind InTotoSubjectKind `protobuf:"varint,1,opt,name=kind,proto3,enum=moby.buildkit.v1.frontend.InTotoSubjectKind" json:"kind,omitempty"` - Digest []string `protobuf:"bytes,2,rep,name=digest,proto3" json:"digest,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + sizeCache protoimpl.SizeCache } func (x *InTotoSubject) Reset() { @@ -578,12 +580,11 @@ func (x *InTotoSubject) GetName() string { } type ReturnRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Result *Result `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` + Error *status.Status `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` unknownFields protoimpl.UnknownFields - - Result *Result `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` - Error *status.Status `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ReturnRequest) Reset() { @@ -631,9 +632,9 @@ func (x *ReturnRequest) GetError() *status.Status { } type ReturnResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ReturnResponse) Reset() { @@ -667,9 +668,9 @@ func (*ReturnResponse) Descriptor() ([]byte, []int) { } type InputsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *InputsRequest) Reset() { @@ -703,11 +704,10 @@ func (*InputsRequest) Descriptor() ([]byte, []int) { } type InputsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Definitions map[string]*pb.Definition `protobuf:"bytes,1,rep,name=Definitions,proto3" json:"Definitions,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` unknownFields protoimpl.UnknownFields - - Definitions map[string]*pb.Definition `protobuf:"bytes,1,rep,name=Definitions,proto3" json:"Definitions,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + sizeCache protoimpl.SizeCache } func (x *InputsResponse) Reset() { @@ -748,18 +748,17 @@ func (x *InputsResponse) GetDefinitions() map[string]*pb.Definition { } type ResolveImageConfigRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Ref string `protobuf:"bytes,1,opt,name=Ref,proto3" json:"Ref,omitempty"` - Platform *pb.Platform `protobuf:"bytes,2,opt,name=Platform,proto3" json:"Platform,omitempty"` - ResolveMode string `protobuf:"bytes,3,opt,name=ResolveMode,proto3" json:"ResolveMode,omitempty"` - LogName string `protobuf:"bytes,4,opt,name=LogName,proto3" json:"LogName,omitempty"` - ResolverType int32 `protobuf:"varint,5,opt,name=ResolverType,proto3" json:"ResolverType,omitempty"` - SessionID string `protobuf:"bytes,6,opt,name=SessionID,proto3" json:"SessionID,omitempty"` - StoreID string `protobuf:"bytes,7,opt,name=StoreID,proto3" json:"StoreID,omitempty"` - SourcePolicies []*pb1.Policy `protobuf:"bytes,8,rep,name=SourcePolicies,proto3" json:"SourcePolicies,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Ref string `protobuf:"bytes,1,opt,name=Ref,proto3" json:"Ref,omitempty"` + Platform *pb.Platform `protobuf:"bytes,2,opt,name=Platform,proto3" json:"Platform,omitempty"` + ResolveMode string `protobuf:"bytes,3,opt,name=ResolveMode,proto3" json:"ResolveMode,omitempty"` + LogName string `protobuf:"bytes,4,opt,name=LogName,proto3" json:"LogName,omitempty"` + ResolverType int32 `protobuf:"varint,5,opt,name=ResolverType,proto3" json:"ResolverType,omitempty"` + SessionID string `protobuf:"bytes,6,opt,name=SessionID,proto3" json:"SessionID,omitempty"` + StoreID string `protobuf:"bytes,7,opt,name=StoreID,proto3" json:"StoreID,omitempty"` + SourcePolicies []*pb1.Policy `protobuf:"bytes,8,rep,name=SourcePolicies,proto3" json:"SourcePolicies,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ResolveImageConfigRequest) Reset() { @@ -849,13 +848,12 @@ func (x *ResolveImageConfigRequest) GetSourcePolicies() []*pb1.Policy { } type ResolveImageConfigResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Digest string `protobuf:"bytes,1,opt,name=Digest,proto3" json:"Digest,omitempty"` + Config []byte `protobuf:"bytes,2,opt,name=Config,proto3" json:"Config,omitempty"` + Ref string `protobuf:"bytes,3,opt,name=Ref,proto3" json:"Ref,omitempty"` unknownFields protoimpl.UnknownFields - - Digest string `protobuf:"bytes,1,opt,name=Digest,proto3" json:"Digest,omitempty"` - Config []byte `protobuf:"bytes,2,opt,name=Config,proto3" json:"Config,omitempty"` - Ref string `protobuf:"bytes,3,opt,name=Ref,proto3" json:"Ref,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ResolveImageConfigResponse) Reset() { @@ -910,15 +908,14 @@ func (x *ResolveImageConfigResponse) GetRef() string { } type ResolveSourceMetaRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Source *pb.SourceOp `protobuf:"bytes,1,opt,name=Source,proto3" json:"Source,omitempty"` - Platform *pb.Platform `protobuf:"bytes,2,opt,name=Platform,proto3" json:"Platform,omitempty"` - LogName string `protobuf:"bytes,3,opt,name=LogName,proto3" json:"LogName,omitempty"` - ResolveMode string `protobuf:"bytes,4,opt,name=ResolveMode,proto3" json:"ResolveMode,omitempty"` - SourcePolicies []*pb1.Policy `protobuf:"bytes,8,rep,name=SourcePolicies,proto3" json:"SourcePolicies,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Source *pb.SourceOp `protobuf:"bytes,1,opt,name=Source,proto3" json:"Source,omitempty"` + Platform *pb.Platform `protobuf:"bytes,2,opt,name=Platform,proto3" json:"Platform,omitempty"` + LogName string `protobuf:"bytes,3,opt,name=LogName,proto3" json:"LogName,omitempty"` + ResolveMode string `protobuf:"bytes,4,opt,name=ResolveMode,proto3" json:"ResolveMode,omitempty"` + SourcePolicies []*pb1.Policy `protobuf:"bytes,8,rep,name=SourcePolicies,proto3" json:"SourcePolicies,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ResolveSourceMetaRequest) Reset() { @@ -987,12 +984,11 @@ func (x *ResolveSourceMetaRequest) GetSourcePolicies() []*pb1.Policy { } type ResolveSourceMetaResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Source *pb.SourceOp `protobuf:"bytes,1,opt,name=Source,proto3" json:"Source,omitempty"` + Image *ResolveSourceImageResponse `protobuf:"bytes,2,opt,name=Image,proto3" json:"Image,omitempty"` unknownFields protoimpl.UnknownFields - - Source *pb.SourceOp `protobuf:"bytes,1,opt,name=Source,proto3" json:"Source,omitempty"` - Image *ResolveSourceImageResponse `protobuf:"bytes,2,opt,name=Image,proto3" json:"Image,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ResolveSourceMetaResponse) Reset() { @@ -1040,12 +1036,11 @@ func (x *ResolveSourceMetaResponse) GetImage() *ResolveSourceImageResponse { } type ResolveSourceImageResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Digest string `protobuf:"bytes,1,opt,name=Digest,proto3" json:"Digest,omitempty"` + Config []byte `protobuf:"bytes,2,opt,name=Config,proto3" json:"Config,omitempty"` unknownFields protoimpl.UnknownFields - - Digest string `protobuf:"bytes,1,opt,name=Digest,proto3" json:"Digest,omitempty"` - Config []byte `protobuf:"bytes,2,opt,name=Config,proto3" json:"Config,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ResolveSourceImageResponse) Reset() { @@ -1093,13 +1088,10 @@ func (x *ResolveSourceImageResponse) GetConfig() []byte { } type SolveRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Definition *pb.Definition `protobuf:"bytes,1,opt,name=Definition,proto3" json:"Definition,omitempty"` - Frontend string `protobuf:"bytes,2,opt,name=Frontend,proto3" json:"Frontend,omitempty"` - FrontendOpt map[string]string `protobuf:"bytes,3,rep,name=FrontendOpt,proto3" json:"FrontendOpt,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + state protoimpl.MessageState `protogen:"open.v1"` + Definition *pb.Definition `protobuf:"bytes,1,opt,name=Definition,proto3" json:"Definition,omitempty"` + Frontend string `protobuf:"bytes,2,opt,name=Frontend,proto3" json:"Frontend,omitempty"` + FrontendOpt map[string]string `protobuf:"bytes,3,rep,name=FrontendOpt,proto3" json:"FrontendOpt,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // 4 was removed in BuildKit v0.11.0. AllowResultReturn bool `protobuf:"varint,5,opt,name=allowResultReturn,proto3" json:"allowResultReturn,omitempty"` AllowResultArrayRef bool `protobuf:"varint,6,opt,name=allowResultArrayRef,proto3" json:"allowResultArrayRef,omitempty"` @@ -1110,9 +1102,11 @@ type SolveRequest struct { // apicaps:CapImportCaches CacheImports []*CacheOptionsEntry `protobuf:"bytes,12,rep,name=CacheImports,proto3" json:"CacheImports,omitempty"` // apicaps:CapFrontendInputs - FrontendInputs map[string]*pb.Definition `protobuf:"bytes,13,rep,name=FrontendInputs,proto3" json:"FrontendInputs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + FrontendInputs map[string]*pb.Definition `protobuf:"bytes,13,rep,name=FrontendInputs,proto3" json:"FrontendInputs,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` Evaluate bool `protobuf:"varint,14,opt,name=Evaluate,proto3" json:"Evaluate,omitempty"` SourcePolicies []*pb1.Policy `protobuf:"bytes,15,rep,name=SourcePolicies,proto3" json:"SourcePolicies,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *SolveRequest) Reset() { @@ -1224,12 +1218,11 @@ func (x *SolveRequest) GetSourcePolicies() []*pb1.Policy { // CacheOptionsEntry corresponds to the control.CacheOptionsEntry type CacheOptionsEntry struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Type string `protobuf:"bytes,1,opt,name=Type,proto3" json:"Type,omitempty"` + Attrs map[string]string `protobuf:"bytes,2,rep,name=Attrs,proto3" json:"Attrs,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` unknownFields protoimpl.UnknownFields - - Type string `protobuf:"bytes,1,opt,name=Type,proto3" json:"Type,omitempty"` - Attrs map[string]string `protobuf:"bytes,2,rep,name=Attrs,proto3" json:"Attrs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + sizeCache protoimpl.SizeCache } func (x *CacheOptionsEntry) Reset() { @@ -1277,14 +1270,13 @@ func (x *CacheOptionsEntry) GetAttrs() map[string]string { } type SolveResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // deprecated Ref string `protobuf:"bytes,1,opt,name=ref,proto3" json:"ref,omitempty"` // can be used by readfile request // these fields are returned when allowMapReturn was set - Result *Result `protobuf:"bytes,3,opt,name=result,proto3" json:"result,omitempty"` + Result *Result `protobuf:"bytes,3,opt,name=result,proto3" json:"result,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *SolveResponse) Reset() { @@ -1332,13 +1324,12 @@ func (x *SolveResponse) GetResult() *Result { } type ReadFileRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Ref string `protobuf:"bytes,1,opt,name=Ref,proto3" json:"Ref,omitempty"` + FilePath string `protobuf:"bytes,2,opt,name=FilePath,proto3" json:"FilePath,omitempty"` + Range *FileRange `protobuf:"bytes,3,opt,name=Range,proto3" json:"Range,omitempty"` unknownFields protoimpl.UnknownFields - - Ref string `protobuf:"bytes,1,opt,name=Ref,proto3" json:"Ref,omitempty"` - FilePath string `protobuf:"bytes,2,opt,name=FilePath,proto3" json:"FilePath,omitempty"` - Range *FileRange `protobuf:"bytes,3,opt,name=Range,proto3" json:"Range,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ReadFileRequest) Reset() { @@ -1393,12 +1384,11 @@ func (x *ReadFileRequest) GetRange() *FileRange { } type FileRange struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Offset int64 `protobuf:"varint,1,opt,name=Offset,proto3" json:"Offset,omitempty"` + Length int64 `protobuf:"varint,2,opt,name=Length,proto3" json:"Length,omitempty"` unknownFields protoimpl.UnknownFields - - Offset int64 `protobuf:"varint,1,opt,name=Offset,proto3" json:"Offset,omitempty"` - Length int64 `protobuf:"varint,2,opt,name=Length,proto3" json:"Length,omitempty"` + sizeCache protoimpl.SizeCache } func (x *FileRange) Reset() { @@ -1446,11 +1436,10 @@ func (x *FileRange) GetLength() int64 { } type ReadFileResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Data []byte `protobuf:"bytes,1,opt,name=Data,proto3" json:"Data,omitempty"` unknownFields protoimpl.UnknownFields - - Data []byte `protobuf:"bytes,1,opt,name=Data,proto3" json:"Data,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ReadFileResponse) Reset() { @@ -1491,13 +1480,12 @@ func (x *ReadFileResponse) GetData() []byte { } type ReadDirRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Ref string `protobuf:"bytes,1,opt,name=Ref,proto3" json:"Ref,omitempty"` - DirPath string `protobuf:"bytes,2,opt,name=DirPath,proto3" json:"DirPath,omitempty"` - IncludePattern string `protobuf:"bytes,3,opt,name=IncludePattern,proto3" json:"IncludePattern,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Ref string `protobuf:"bytes,1,opt,name=Ref,proto3" json:"Ref,omitempty"` + DirPath string `protobuf:"bytes,2,opt,name=DirPath,proto3" json:"DirPath,omitempty"` + IncludePattern string `protobuf:"bytes,3,opt,name=IncludePattern,proto3" json:"IncludePattern,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ReadDirRequest) Reset() { @@ -1552,11 +1540,10 @@ func (x *ReadDirRequest) GetIncludePattern() string { } type ReadDirResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Entries []*types.Stat `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` unknownFields protoimpl.UnknownFields - - Entries []*types.Stat `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ReadDirResponse) Reset() { @@ -1597,12 +1584,11 @@ func (x *ReadDirResponse) GetEntries() []*types.Stat { } type StatFileRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Ref string `protobuf:"bytes,1,opt,name=Ref,proto3" json:"Ref,omitempty"` + Path string `protobuf:"bytes,2,opt,name=Path,proto3" json:"Path,omitempty"` unknownFields protoimpl.UnknownFields - - Ref string `protobuf:"bytes,1,opt,name=Ref,proto3" json:"Ref,omitempty"` - Path string `protobuf:"bytes,2,opt,name=Path,proto3" json:"Path,omitempty"` + sizeCache protoimpl.SizeCache } func (x *StatFileRequest) Reset() { @@ -1650,11 +1636,10 @@ func (x *StatFileRequest) GetPath() string { } type StatFileResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Stat *types.Stat `protobuf:"bytes,1,opt,name=stat,proto3" json:"stat,omitempty"` unknownFields protoimpl.UnknownFields - - Stat *types.Stat `protobuf:"bytes,1,opt,name=stat,proto3" json:"stat,omitempty"` + sizeCache protoimpl.SizeCache } func (x *StatFileResponse) Reset() { @@ -1695,11 +1680,10 @@ func (x *StatFileResponse) GetStat() *types.Stat { } type EvaluateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Ref string `protobuf:"bytes,1,opt,name=Ref,proto3" json:"Ref,omitempty"` unknownFields protoimpl.UnknownFields - - Ref string `protobuf:"bytes,1,opt,name=Ref,proto3" json:"Ref,omitempty"` + sizeCache protoimpl.SizeCache } func (x *EvaluateRequest) Reset() { @@ -1740,9 +1724,9 @@ func (x *EvaluateRequest) GetRef() string { } type EvaluateResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *EvaluateResponse) Reset() { @@ -1776,9 +1760,9 @@ func (*EvaluateResponse) Descriptor() ([]byte, []int) { } type PingRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *PingRequest) Reset() { @@ -1812,13 +1796,12 @@ func (*PingRequest) Descriptor() ([]byte, []int) { } type PongResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` FrontendAPICaps []*pb2.APICap `protobuf:"bytes,1,rep,name=FrontendAPICaps,proto3" json:"FrontendAPICaps,omitempty"` LLBCaps []*pb2.APICap `protobuf:"bytes,2,rep,name=LLBCaps,proto3" json:"LLBCaps,omitempty"` Workers []*types1.WorkerRecord `protobuf:"bytes,3,rep,name=Workers,proto3" json:"Workers,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *PongResponse) Reset() { @@ -1873,17 +1856,16 @@ func (x *PongResponse) GetWorkers() []*types1.WorkerRecord { } type WarnRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Digest string `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"` + Level int64 `protobuf:"varint,2,opt,name=level,proto3" json:"level,omitempty"` + Short []byte `protobuf:"bytes,3,opt,name=short,proto3" json:"short,omitempty"` + Detail [][]byte `protobuf:"bytes,4,rep,name=detail,proto3" json:"detail,omitempty"` + Url string `protobuf:"bytes,5,opt,name=url,proto3" json:"url,omitempty"` + Info *pb.SourceInfo `protobuf:"bytes,6,opt,name=info,proto3" json:"info,omitempty"` + Ranges []*pb.Range `protobuf:"bytes,7,rep,name=ranges,proto3" json:"ranges,omitempty"` unknownFields protoimpl.UnknownFields - - Digest string `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"` - Level int64 `protobuf:"varint,2,opt,name=level,proto3" json:"level,omitempty"` - Short []byte `protobuf:"bytes,3,opt,name=short,proto3" json:"short,omitempty"` - Detail [][]byte `protobuf:"bytes,4,rep,name=detail,proto3" json:"detail,omitempty"` - Url string `protobuf:"bytes,5,opt,name=url,proto3" json:"url,omitempty"` - Info *pb.SourceInfo `protobuf:"bytes,6,opt,name=info,proto3" json:"info,omitempty"` - Ranges []*pb.Range `protobuf:"bytes,7,rep,name=ranges,proto3" json:"ranges,omitempty"` + sizeCache protoimpl.SizeCache } func (x *WarnRequest) Reset() { @@ -1966,9 +1948,9 @@ func (x *WarnRequest) GetRanges() []*pb.Range { } type WarnResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *WarnResponse) Reset() { @@ -2002,18 +1984,17 @@ func (*WarnResponse) Descriptor() ([]byte, []int) { } type NewContainerRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ContainerID string `protobuf:"bytes,1,opt,name=ContainerID,proto3" json:"ContainerID,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + ContainerID string `protobuf:"bytes,1,opt,name=ContainerID,proto3" json:"ContainerID,omitempty"` // For mount input values we can use random identifiers passed with ref - Mounts []*pb.Mount `protobuf:"bytes,2,rep,name=Mounts,proto3" json:"Mounts,omitempty"` - Network pb.NetMode `protobuf:"varint,3,opt,name=Network,proto3,enum=pb.NetMode" json:"Network,omitempty"` - Platform *pb.Platform `protobuf:"bytes,4,opt,name=platform,proto3" json:"platform,omitempty"` - Constraints *pb.WorkerConstraints `protobuf:"bytes,5,opt,name=constraints,proto3" json:"constraints,omitempty"` - ExtraHosts []*pb.HostIP `protobuf:"bytes,6,rep,name=extraHosts,proto3" json:"extraHosts,omitempty"` - Hostname string `protobuf:"bytes,7,opt,name=hostname,proto3" json:"hostname,omitempty"` + Mounts []*pb.Mount `protobuf:"bytes,2,rep,name=Mounts,proto3" json:"Mounts,omitempty"` + Network pb.NetMode `protobuf:"varint,3,opt,name=Network,proto3,enum=pb.NetMode" json:"Network,omitempty"` + Platform *pb.Platform `protobuf:"bytes,4,opt,name=platform,proto3" json:"platform,omitempty"` + Constraints *pb.WorkerConstraints `protobuf:"bytes,5,opt,name=constraints,proto3" json:"constraints,omitempty"` + ExtraHosts []*pb.HostIP `protobuf:"bytes,6,rep,name=extraHosts,proto3" json:"extraHosts,omitempty"` + Hostname string `protobuf:"bytes,7,opt,name=hostname,proto3" json:"hostname,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *NewContainerRequest) Reset() { @@ -2096,9 +2077,9 @@ func (x *NewContainerRequest) GetHostname() string { } type NewContainerResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *NewContainerResponse) Reset() { @@ -2132,11 +2113,10 @@ func (*NewContainerResponse) Descriptor() ([]byte, []int) { } type ReleaseContainerRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ContainerID string `protobuf:"bytes,1,opt,name=ContainerID,proto3" json:"ContainerID,omitempty"` unknownFields protoimpl.UnknownFields - - ContainerID string `protobuf:"bytes,1,opt,name=ContainerID,proto3" json:"ContainerID,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ReleaseContainerRequest) Reset() { @@ -2177,9 +2157,9 @@ func (x *ReleaseContainerRequest) GetContainerID() string { } type ReleaseContainerResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ReleaseContainerResponse) Reset() { @@ -2213,12 +2193,9 @@ func (*ReleaseContainerResponse) Descriptor() ([]byte, []int) { } type ExecMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ProcessID string `protobuf:"bytes,1,opt,name=ProcessID,proto3" json:"ProcessID,omitempty"` - // Types that are assignable to Input: + state protoimpl.MessageState `protogen:"open.v1"` + ProcessID string `protobuf:"bytes,1,opt,name=ProcessID,proto3" json:"ProcessID,omitempty"` + // Types that are valid to be assigned to Input: // // *ExecMessage_Init // *ExecMessage_File @@ -2227,7 +2204,9 @@ type ExecMessage struct { // *ExecMessage_Exit // *ExecMessage_Done // *ExecMessage_Signal - Input isExecMessage_Input `protobuf_oneof:"Input"` + Input isExecMessage_Input `protobuf_oneof:"Input"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ExecMessage) Reset() { @@ -2267,58 +2246,72 @@ func (x *ExecMessage) GetProcessID() string { return "" } -func (m *ExecMessage) GetInput() isExecMessage_Input { - if m != nil { - return m.Input +func (x *ExecMessage) GetInput() isExecMessage_Input { + if x != nil { + return x.Input } return nil } func (x *ExecMessage) GetInit() *InitMessage { - if x, ok := x.GetInput().(*ExecMessage_Init); ok { - return x.Init + if x != nil { + if x, ok := x.Input.(*ExecMessage_Init); ok { + return x.Init + } } return nil } func (x *ExecMessage) GetFile() *FdMessage { - if x, ok := x.GetInput().(*ExecMessage_File); ok { - return x.File + if x != nil { + if x, ok := x.Input.(*ExecMessage_File); ok { + return x.File + } } return nil } func (x *ExecMessage) GetResize() *ResizeMessage { - if x, ok := x.GetInput().(*ExecMessage_Resize); ok { - return x.Resize + if x != nil { + if x, ok := x.Input.(*ExecMessage_Resize); ok { + return x.Resize + } } return nil } func (x *ExecMessage) GetStarted() *StartedMessage { - if x, ok := x.GetInput().(*ExecMessage_Started); ok { - return x.Started + if x != nil { + if x, ok := x.Input.(*ExecMessage_Started); ok { + return x.Started + } } return nil } func (x *ExecMessage) GetExit() *ExitMessage { - if x, ok := x.GetInput().(*ExecMessage_Exit); ok { - return x.Exit + if x != nil { + if x, ok := x.Input.(*ExecMessage_Exit); ok { + return x.Exit + } } return nil } func (x *ExecMessage) GetDone() *DoneMessage { - if x, ok := x.GetInput().(*ExecMessage_Done); ok { - return x.Done + if x != nil { + if x, ok := x.Input.(*ExecMessage_Done); ok { + return x.Done + } } return nil } func (x *ExecMessage) GetSignal() *SignalMessage { - if x, ok := x.GetInput().(*ExecMessage_Signal); ok { - return x.Signal + if x != nil { + if x, ok := x.Input.(*ExecMessage_Signal); ok { + return x.Signal + } } return nil } @@ -2382,16 +2375,15 @@ func (*ExecMessage_Done) isExecMessage_Input() {} func (*ExecMessage_Signal) isExecMessage_Input() {} type InitMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ContainerID string `protobuf:"bytes,1,opt,name=ContainerID,proto3" json:"ContainerID,omitempty"` + Meta *pb.Meta `protobuf:"bytes,2,opt,name=Meta,proto3" json:"Meta,omitempty"` + Fds []uint32 `protobuf:"varint,3,rep,packed,name=Fds,proto3" json:"Fds,omitempty"` + Tty bool `protobuf:"varint,4,opt,name=Tty,proto3" json:"Tty,omitempty"` + Security pb.SecurityMode `protobuf:"varint,5,opt,name=Security,proto3,enum=pb.SecurityMode" json:"Security,omitempty"` + Secretenv []*pb.SecretEnv `protobuf:"bytes,6,rep,name=secretenv,proto3" json:"secretenv,omitempty"` unknownFields protoimpl.UnknownFields - - ContainerID string `protobuf:"bytes,1,opt,name=ContainerID,proto3" json:"ContainerID,omitempty"` - Meta *pb.Meta `protobuf:"bytes,2,opt,name=Meta,proto3" json:"Meta,omitempty"` - Fds []uint32 `protobuf:"varint,3,rep,packed,name=Fds,proto3" json:"Fds,omitempty"` - Tty bool `protobuf:"varint,4,opt,name=Tty,proto3" json:"Tty,omitempty"` - Security pb.SecurityMode `protobuf:"varint,5,opt,name=Security,proto3,enum=pb.SecurityMode" json:"Security,omitempty"` - Secretenv []*pb.SecretEnv `protobuf:"bytes,6,rep,name=secretenv,proto3" json:"secretenv,omitempty"` + sizeCache protoimpl.SizeCache } func (x *InitMessage) Reset() { @@ -2467,12 +2459,11 @@ func (x *InitMessage) GetSecretenv() []*pb.SecretEnv { } type ExitMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Code uint32 `protobuf:"varint,1,opt,name=Code,proto3" json:"Code,omitempty"` + Error *status.Status `protobuf:"bytes,2,opt,name=Error,proto3" json:"Error,omitempty"` unknownFields protoimpl.UnknownFields - - Code uint32 `protobuf:"varint,1,opt,name=Code,proto3" json:"Code,omitempty"` - Error *status.Status `protobuf:"bytes,2,opt,name=Error,proto3" json:"Error,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ExitMessage) Reset() { @@ -2520,9 +2511,9 @@ func (x *ExitMessage) GetError() *status.Status { } type StartedMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *StartedMessage) Reset() { @@ -2556,9 +2547,9 @@ func (*StartedMessage) Descriptor() ([]byte, []int) { } type DoneMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *DoneMessage) Reset() { @@ -2592,13 +2583,12 @@ func (*DoneMessage) Descriptor() ([]byte, []int) { } type FdMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Fd uint32 `protobuf:"varint,1,opt,name=Fd,proto3" json:"Fd,omitempty"` // what fd the data was from + EOF bool `protobuf:"varint,2,opt,name=EOF,proto3" json:"EOF,omitempty"` // true if eof was reached + Data []byte `protobuf:"bytes,3,opt,name=Data,proto3" json:"Data,omitempty"` unknownFields protoimpl.UnknownFields - - Fd uint32 `protobuf:"varint,1,opt,name=Fd,proto3" json:"Fd,omitempty"` // what fd the data was from - EOF bool `protobuf:"varint,2,opt,name=EOF,proto3" json:"EOF,omitempty"` // true if eof was reached - Data []byte `protobuf:"bytes,3,opt,name=Data,proto3" json:"Data,omitempty"` + sizeCache protoimpl.SizeCache } func (x *FdMessage) Reset() { @@ -2653,12 +2643,11 @@ func (x *FdMessage) GetData() []byte { } type ResizeMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Rows uint32 `protobuf:"varint,1,opt,name=Rows,proto3" json:"Rows,omitempty"` + Cols uint32 `protobuf:"varint,2,opt,name=Cols,proto3" json:"Cols,omitempty"` unknownFields protoimpl.UnknownFields - - Rows uint32 `protobuf:"varint,1,opt,name=Rows,proto3" json:"Rows,omitempty"` - Cols uint32 `protobuf:"varint,2,opt,name=Cols,proto3" json:"Cols,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ResizeMessage) Reset() { @@ -2706,13 +2695,12 @@ func (x *ResizeMessage) GetCols() uint32 { } type SignalMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // we only send name (ie HUP, INT) because the int values // are platform dependent. - Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` + Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *SignalMessage) Reset() { @@ -2754,536 +2742,234 @@ func (x *SignalMessage) GetName() string { var File_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto protoreflect.FileDescriptor -var file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDesc = []byte{ - 0x0a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, - 0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x66, 0x72, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x64, 0x2f, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2f, 0x70, 0x62, 0x2f, 0x67, - 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x6d, 0x6f, - 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, - 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x1a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, 0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, - 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x77, 0x6f, 0x72, 0x6b, - 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, 0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, - 0x69, 0x74, 0x2f, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x62, 0x2f, 0x6f, 0x70, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, 0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, - 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2f, 0x70, 0x62, - 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x33, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, 0x79, 0x2f, 0x62, - 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x75, 0x74, 0x69, 0x6c, 0x2f, 0x61, 0x70, 0x69, - 0x63, 0x61, 0x70, 0x73, 0x2f, 0x70, 0x62, 0x2f, 0x63, 0x61, 0x70, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, - 0x6f, 0x6e, 0x69, 0x73, 0x74, 0x69, 0x69, 0x67, 0x69, 0x2f, 0x66, 0x73, 0x75, 0x74, 0x69, 0x6c, - 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcb, 0x04, 0x0a, 0x06, 0x52, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x26, 0x0a, 0x0d, 0x72, 0x65, 0x66, 0x44, 0x65, 0x70, 0x72, - 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0d, - 0x72, 0x65, 0x66, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x55, 0x0a, - 0x0e, 0x72, 0x65, 0x66, 0x73, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, - 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, - 0x64, 0x2e, 0x52, 0x65, 0x66, 0x4d, 0x61, 0x70, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, - 0x65, 0x64, 0x48, 0x00, 0x52, 0x0e, 0x72, 0x65, 0x66, 0x73, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, - 0x61, 0x74, 0x65, 0x64, 0x12, 0x32, 0x0a, 0x03, 0x72, 0x65, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1e, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, - 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x52, 0x65, - 0x66, 0x48, 0x00, 0x52, 0x03, 0x72, 0x65, 0x66, 0x12, 0x37, 0x0a, 0x04, 0x72, 0x65, 0x66, 0x73, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, - 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x66, 0x4d, 0x61, 0x70, 0x48, 0x00, 0x52, 0x04, 0x72, 0x65, 0x66, - 0x73, 0x12, 0x4b, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0a, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, - 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, - 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x57, - 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0c, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, - 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, - 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x68, 0x0a, 0x11, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x3d, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6d, 0x6f, 0x62, - 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x08, - 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x96, 0x01, 0x0a, 0x10, 0x52, 0x65, 0x66, - 0x4d, 0x61, 0x70, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x49, 0x0a, - 0x04, 0x72, 0x65, 0x66, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x6d, 0x6f, - 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, - 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x66, 0x4d, 0x61, 0x70, 0x44, 0x65, - 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x52, 0x65, 0x66, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x04, 0x72, 0x65, 0x66, 0x73, 0x1a, 0x37, 0x0a, 0x09, 0x52, 0x65, 0x66, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x22, 0x37, 0x0a, 0x03, 0x52, 0x65, 0x66, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x03, 0x64, 0x65, 0x66, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x66, 0x69, 0x6e, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x03, 0x64, 0x65, 0x66, 0x22, 0xa2, 0x01, 0x0a, 0x06, 0x52, - 0x65, 0x66, 0x4d, 0x61, 0x70, 0x12, 0x3f, 0x0a, 0x04, 0x72, 0x65, 0x66, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, - 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, - 0x52, 0x65, 0x66, 0x4d, 0x61, 0x70, 0x2e, 0x52, 0x65, 0x66, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x52, 0x04, 0x72, 0x65, 0x66, 0x73, 0x1a, 0x57, 0x0a, 0x09, 0x52, 0x65, 0x66, 0x73, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x34, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, - 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, - 0x2e, 0x52, 0x65, 0x66, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, - 0x58, 0x0a, 0x0c, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x48, 0x0a, 0x0b, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, - 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, - 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x61, 0x74, - 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xa6, 0x03, 0x0a, 0x0b, 0x41, 0x74, - 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x04, 0x6b, 0x69, 0x6e, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, - 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x64, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, - 0x69, 0x6e, 0x64, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x50, 0x0a, 0x08, 0x6d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x6d, 0x6f, - 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, - 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x30, 0x0a, 0x03, 0x72, - 0x65, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, - 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x66, 0x52, 0x03, 0x72, 0x65, 0x66, 0x12, 0x12, 0x0a, - 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, - 0x68, 0x12, 0x30, 0x0a, 0x13, 0x69, 0x6e, 0x54, 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x65, 0x64, 0x69, - 0x63, 0x61, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, - 0x69, 0x6e, 0x54, 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x50, 0x0a, 0x0e, 0x69, 0x6e, 0x54, 0x6f, 0x74, 0x6f, 0x53, 0x75, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6d, 0x6f, - 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, - 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x49, 0x6e, 0x54, 0x6f, 0x74, 0x6f, 0x53, 0x75, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x0e, 0x69, 0x6e, 0x54, 0x6f, 0x74, 0x6f, 0x53, 0x75, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x73, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, - 0x38, 0x01, 0x22, 0x7d, 0x0a, 0x0d, 0x49, 0x6e, 0x54, 0x6f, 0x74, 0x6f, 0x53, 0x75, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x12, 0x40, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x2c, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, - 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x49, 0x6e, - 0x54, 0x6f, 0x74, 0x6f, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4b, 0x69, 0x6e, 0x64, 0x52, - 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x22, 0x74, 0x0a, 0x0d, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x39, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, - 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x52, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x28, 0x0a, - 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x10, 0x0a, 0x0e, 0x52, 0x65, 0x74, 0x75, 0x72, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0f, 0x0a, 0x0d, 0x49, 0x6e, 0x70, - 0x75, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xbe, 0x01, 0x0a, 0x0e, 0x49, - 0x6e, 0x70, 0x75, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, - 0x0b, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, - 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x49, - 0x6e, 0x70, 0x75, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x44, 0x65, - 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, - 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x4e, 0x0a, 0x10, 0x44, - 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x24, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xbe, 0x02, 0x0a, 0x19, - 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x52, 0x65, 0x66, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x52, 0x65, 0x66, 0x12, 0x28, 0x0a, 0x08, 0x50, - 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, - 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x08, 0x50, 0x6c, 0x61, - 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x20, 0x0a, 0x0b, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, - 0x4d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x52, 0x65, 0x73, 0x6f, - 0x6c, 0x76, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x4c, 0x6f, 0x67, 0x4e, 0x61, - 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x4c, 0x6f, 0x67, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x54, 0x79, 0x70, - 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, - 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x49, 0x44, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x44, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x44, 0x12, 0x4d, 0x0a, - 0x0e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x18, - 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, - 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x70, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x0e, 0x53, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x22, 0x5e, 0x0a, 0x1a, - 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x44, 0x69, - 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x44, 0x69, 0x67, 0x65, - 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x52, 0x65, - 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x52, 0x65, 0x66, 0x22, 0xf5, 0x01, 0x0a, - 0x18, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, - 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x06, 0x53, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x53, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x70, 0x52, 0x06, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, - 0x28, 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, - 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x4c, 0x6f, 0x67, - 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x4c, 0x6f, 0x67, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x4d, 0x6f, - 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, - 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x4d, 0x0a, 0x0e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, - 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, - 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, - 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x50, 0x6f, - 0x6c, 0x69, 0x63, 0x79, 0x52, 0x0e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x6c, 0x69, - 0x63, 0x69, 0x65, 0x73, 0x22, 0x8e, 0x01, 0x0a, 0x19, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, - 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x24, 0x0a, 0x06, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x70, - 0x52, 0x06, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x4b, 0x0a, 0x05, 0x49, 0x6d, 0x61, 0x67, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, - 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x05, - 0x49, 0x6d, 0x61, 0x67, 0x65, 0x22, 0x4c, 0x0a, 0x1a, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, - 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x22, 0x85, 0x06, 0x0a, 0x0c, 0x53, 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x0a, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, - 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, - 0x12, 0x5a, 0x0a, 0x0b, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x4f, 0x70, 0x74, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, - 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, - 0x64, 0x2e, 0x53, 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, - 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x4f, 0x70, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x0b, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x4f, 0x70, 0x74, 0x12, 0x2c, 0x0a, 0x11, - 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x74, 0x75, 0x72, - 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x52, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x12, 0x30, 0x0a, 0x13, 0x61, 0x6c, - 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x41, 0x72, 0x72, 0x61, 0x79, 0x52, 0x65, - 0x66, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x52, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x41, 0x72, 0x72, 0x61, 0x79, 0x52, 0x65, 0x66, 0x12, 0x14, 0x0a, 0x05, - 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x46, 0x69, 0x6e, - 0x61, 0x6c, 0x12, 0x22, 0x0a, 0x0c, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x41, 0x74, - 0x74, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, - 0x65, 0x72, 0x41, 0x74, 0x74, 0x72, 0x12, 0x50, 0x0a, 0x0c, 0x43, 0x61, 0x63, 0x68, 0x65, 0x49, - 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6d, - 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, - 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x43, 0x61, 0x63, 0x68, 0x65, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x43, 0x61, 0x63, 0x68, - 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x12, 0x63, 0x0a, 0x0e, 0x46, 0x72, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x3b, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, - 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x53, 0x6f, 0x6c, - 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x64, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x46, - 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x12, 0x1a, 0x0a, - 0x08, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x08, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x12, 0x4d, 0x0a, 0x0e, 0x53, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x25, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, - 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x70, 0x6f, 0x6c, 0x69, 0x63, - 0x79, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x0e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x1a, 0x3e, 0x0a, 0x10, 0x46, 0x72, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x64, 0x4f, 0x70, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x51, 0x0a, 0x13, 0x46, 0x72, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x24, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xb0, 0x01, 0x0a, 0x11, - 0x43, 0x61, 0x63, 0x68, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x4d, 0x0a, 0x05, 0x41, 0x74, 0x74, 0x72, 0x73, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, - 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, - 0x2e, 0x43, 0x61, 0x63, 0x68, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x41, - 0x74, 0x74, 0x72, 0x73, 0x1a, 0x38, 0x0a, 0x0a, 0x41, 0x74, 0x74, 0x72, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x5c, - 0x0a, 0x0d, 0x53, 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x10, 0x0a, 0x03, 0x72, 0x65, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x65, - 0x66, 0x12, 0x39, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x21, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, - 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x52, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x7b, 0x0a, 0x0f, - 0x52, 0x65, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x10, 0x0a, 0x03, 0x52, 0x65, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x52, 0x65, - 0x66, 0x12, 0x1a, 0x0a, 0x08, 0x46, 0x69, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x46, 0x69, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x3a, 0x0a, - 0x05, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6d, - 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, - 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x61, 0x6e, - 0x67, 0x65, 0x52, 0x05, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x22, 0x3b, 0x0a, 0x09, 0x46, 0x69, 0x6c, - 0x65, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x16, - 0x0a, 0x06, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, - 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x22, 0x26, 0x0a, 0x10, 0x52, 0x65, 0x61, 0x64, 0x46, 0x69, - 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x44, 0x61, - 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x22, 0x64, - 0x0a, 0x0e, 0x52, 0x65, 0x61, 0x64, 0x44, 0x69, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x10, 0x0a, 0x03, 0x52, 0x65, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x52, - 0x65, 0x66, 0x12, 0x18, 0x0a, 0x07, 0x44, 0x69, 0x72, 0x50, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x44, 0x69, 0x72, 0x50, 0x61, 0x74, 0x68, 0x12, 0x26, 0x0a, 0x0e, - 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x50, 0x61, 0x74, - 0x74, 0x65, 0x72, 0x6e, 0x22, 0x3f, 0x0a, 0x0f, 0x52, 0x65, 0x61, 0x64, 0x44, 0x69, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x66, 0x73, 0x75, 0x74, 0x69, - 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x52, 0x07, 0x65, 0x6e, - 0x74, 0x72, 0x69, 0x65, 0x73, 0x22, 0x37, 0x0a, 0x0f, 0x53, 0x74, 0x61, 0x74, 0x46, 0x69, 0x6c, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x52, 0x65, 0x66, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x52, 0x65, 0x66, 0x12, 0x12, 0x0a, 0x04, 0x50, 0x61, - 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x50, 0x61, 0x74, 0x68, 0x22, 0x3a, - 0x0a, 0x10, 0x53, 0x74, 0x61, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x73, 0x74, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x12, 0x2e, 0x66, 0x73, 0x75, 0x74, 0x69, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x53, 0x74, 0x61, 0x74, 0x52, 0x04, 0x73, 0x74, 0x61, 0x74, 0x22, 0x23, 0x0a, 0x0f, 0x45, 0x76, - 0x61, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, - 0x03, 0x52, 0x65, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x52, 0x65, 0x66, 0x22, - 0x12, 0x0a, 0x10, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x0d, 0x0a, 0x0b, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x22, 0xd6, 0x01, 0x0a, 0x0c, 0x50, 0x6f, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x0f, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x41, - 0x50, 0x49, 0x43, 0x61, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6d, - 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, - 0x61, 0x70, 0x69, 0x63, 0x61, 0x70, 0x73, 0x2e, 0x41, 0x50, 0x49, 0x43, 0x61, 0x70, 0x52, 0x0f, - 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x41, 0x50, 0x49, 0x43, 0x61, 0x70, 0x73, 0x12, - 0x3a, 0x0a, 0x07, 0x4c, 0x4c, 0x42, 0x43, 0x61, 0x70, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x20, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, - 0x2e, 0x76, 0x31, 0x2e, 0x61, 0x70, 0x69, 0x63, 0x61, 0x70, 0x73, 0x2e, 0x41, 0x50, 0x49, 0x43, - 0x61, 0x70, 0x52, 0x07, 0x4c, 0x4c, 0x42, 0x43, 0x61, 0x70, 0x73, 0x12, 0x3e, 0x0a, 0x07, 0x57, - 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6d, - 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x52, 0x65, 0x63, 0x6f, - 0x72, 0x64, 0x52, 0x07, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x73, 0x22, 0xc2, 0x01, 0x0a, 0x0b, - 0x57, 0x61, 0x72, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x64, - 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x69, 0x67, - 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x68, 0x6f, - 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x12, - 0x16, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, 0x52, - 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x22, 0x0a, 0x04, 0x69, 0x6e, 0x66, - 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x21, 0x0a, - 0x06, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, - 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x06, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, - 0x22, 0x0e, 0x0a, 0x0c, 0x57, 0x61, 0x72, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0xac, 0x02, 0x0a, 0x13, 0x4e, 0x65, 0x77, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x43, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x12, 0x21, 0x0a, 0x06, 0x4d, 0x6f, - 0x75, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x70, 0x62, 0x2e, - 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x06, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x25, 0x0a, - 0x07, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, - 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x07, 0x4e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x28, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x74, - 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x37, - 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x43, - 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x73, - 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x2a, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, - 0x48, 0x6f, 0x73, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, - 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x49, 0x50, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x48, 0x6f, - 0x73, 0x74, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x22, - 0x16, 0x0a, 0x14, 0x4e, 0x65, 0x77, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x0a, 0x17, 0x52, 0x65, 0x6c, 0x65, 0x61, - 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, - 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x49, 0x44, 0x22, 0x1a, 0x0a, 0x18, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x43, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0xf9, 0x03, 0x0a, 0x0b, 0x45, 0x78, 0x65, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x12, 0x1c, 0x0a, 0x09, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x49, 0x44, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x49, 0x44, 0x12, 0x3c, - 0x0a, 0x04, 0x49, 0x6e, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6d, - 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, - 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x04, 0x49, 0x6e, 0x69, 0x74, 0x12, 0x3a, 0x0a, 0x04, - 0x46, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6d, 0x6f, 0x62, - 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x46, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x48, 0x00, 0x52, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x42, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x69, - 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, - 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x48, 0x00, 0x52, 0x06, 0x52, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x45, 0x0a, 0x07, - 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, - 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, - 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, - 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x07, 0x53, 0x74, 0x61, 0x72, - 0x74, 0x65, 0x64, 0x12, 0x3c, 0x0a, 0x04, 0x45, 0x78, 0x69, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x26, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, - 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x45, 0x78, - 0x69, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x04, 0x45, 0x78, 0x69, - 0x74, 0x12, 0x3c, 0x0a, 0x04, 0x44, 0x6f, 0x6e, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x26, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, - 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x44, 0x6f, 0x6e, 0x65, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x04, 0x44, 0x6f, 0x6e, 0x65, 0x12, - 0x42, 0x0a, 0x06, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x28, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, - 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x53, 0x69, 0x67, 0x6e, - 0x61, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x06, 0x53, 0x69, 0x67, - 0x6e, 0x61, 0x6c, 0x42, 0x07, 0x0a, 0x05, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x22, 0xcc, 0x01, 0x0a, - 0x0b, 0x49, 0x6e, 0x69, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x20, 0x0a, 0x0b, - 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1c, - 0x0a, 0x04, 0x4d, 0x65, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, - 0x62, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, - 0x46, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x03, 0x46, 0x64, 0x73, 0x12, 0x10, - 0x0a, 0x03, 0x54, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x54, 0x74, 0x79, - 0x12, 0x2c, 0x0a, 0x08, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, - 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x08, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x2b, - 0x0a, 0x09, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x76, 0x18, 0x06, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x45, 0x6e, 0x76, - 0x52, 0x09, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x76, 0x22, 0x4b, 0x0a, 0x0b, 0x45, - 0x78, 0x69, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x6f, - 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x28, - 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x52, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x10, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x72, - 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x0d, 0x0a, 0x0b, 0x44, 0x6f, - 0x6e, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x41, 0x0a, 0x09, 0x46, 0x64, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x46, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x02, 0x46, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x45, 0x4f, 0x46, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x03, 0x45, 0x4f, 0x46, 0x12, 0x12, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x22, 0x37, 0x0a, 0x0d, - 0x52, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, - 0x04, 0x52, 0x6f, 0x77, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x52, 0x6f, 0x77, - 0x73, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x6f, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x04, 0x43, 0x6f, 0x6c, 0x73, 0x22, 0x23, 0x0a, 0x0d, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x2a, 0x29, 0x0a, 0x0f, 0x41, 0x74, - 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x0a, 0x0a, - 0x06, 0x49, 0x6e, 0x54, 0x6f, 0x74, 0x6f, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x42, 0x75, 0x6e, - 0x64, 0x6c, 0x65, 0x10, 0x01, 0x2a, 0x26, 0x0a, 0x11, 0x49, 0x6e, 0x54, 0x6f, 0x74, 0x6f, 0x53, - 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x65, - 0x6c, 0x66, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x52, 0x61, 0x77, 0x10, 0x01, 0x32, 0xbd, 0x0b, - 0x0a, 0x09, 0x4c, 0x4c, 0x42, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x12, 0x81, 0x01, 0x0a, 0x12, - 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x12, 0x34, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, - 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x52, - 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, - 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x49, 0x6d, 0x61, 0x67, - 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x7e, 0x0a, 0x11, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x4d, 0x65, 0x74, 0x61, 0x12, 0x33, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, - 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, - 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, - 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x6d, 0x6f, 0x62, 0x79, - 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x53, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x5a, 0x0a, 0x05, 0x53, 0x6f, 0x6c, 0x76, 0x65, 0x12, 0x27, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, - 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x53, 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x28, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, - 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x53, 0x6f, - 0x6c, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x63, 0x0a, 0x08, 0x52, - 0x65, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x2a, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, - 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, - 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, - 0x52, 0x65, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x60, 0x0a, 0x07, 0x52, 0x65, 0x61, 0x64, 0x44, 0x69, 0x72, 0x12, 0x29, 0x2e, 0x6d, 0x6f, - 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, - 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x44, 0x69, 0x72, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, - 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x44, 0x69, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x63, 0x0a, 0x08, 0x53, 0x74, 0x61, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x2a, - 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, - 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x46, - 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6d, 0x6f, 0x62, - 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x63, 0x0a, 0x08, 0x45, 0x76, 0x61, 0x6c, 0x75, - 0x61, 0x74, 0x65, 0x12, 0x2a, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, - 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, - 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2b, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, - 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x45, 0x76, 0x61, 0x6c, - 0x75, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x04, - 0x50, 0x69, 0x6e, 0x67, 0x12, 0x26, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, - 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, - 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6d, - 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, - 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x50, 0x6f, 0x6e, 0x67, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5d, 0x0a, 0x06, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x12, - 0x28, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, - 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x74, 0x75, - 0x72, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x6d, 0x6f, 0x62, 0x79, - 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5d, 0x0a, 0x06, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x12, 0x28, - 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, - 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, - 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x6f, 0x0a, 0x0c, 0x4e, 0x65, 0x77, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x12, 0x2e, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, - 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, - 0x4e, 0x65, 0x77, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, - 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, - 0x4e, 0x65, 0x77, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7b, 0x0a, 0x10, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x43, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x32, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, - 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x6d, - 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, - 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x61, 0x0a, 0x0b, 0x45, 0x78, 0x65, 0x63, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, - 0x12, 0x26, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, - 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x45, 0x78, 0x65, - 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x26, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, - 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x28, 0x01, 0x30, 0x01, 0x12, 0x57, 0x0a, 0x04, 0x57, 0x61, 0x72, 0x6e, 0x12, 0x26, 0x2e, 0x6d, - 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, - 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x2e, 0x57, 0x61, 0x72, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, - 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, - 0x2e, 0x57, 0x61, 0x72, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x48, 0x5a, - 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, 0x79, - 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x64, 0x2f, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2f, 0x70, 0x62, 0x3b, 0x6d, 0x6f, - 0x62, 0x79, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x5f, 0x76, 0x31, 0x5f, 0x66, - 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDesc = "" + + "\n" + + ":github.com/moby/buildkit/frontend/gateway/pb/gateway.proto\x12\x19moby.buildkit.v1.frontend\x1a/github.com/moby/buildkit/api/types/worker.proto\x1a,github.com/moby/buildkit/solver/pb/ops.proto\x1a5github.com/moby/buildkit/sourcepolicy/pb/policy.proto\x1a3github.com/moby/buildkit/util/apicaps/pb/caps.proto\x1a-github.com/tonistiigi/fsutil/types/stat.proto\x1a\x17google/rpc/status.proto\"\xcb\x04\n" + + "\x06Result\x12&\n" + + "\rrefDeprecated\x18\x01 \x01(\tH\x00R\rrefDeprecated\x12U\n" + + "\x0erefsDeprecated\x18\x02 \x01(\v2+.moby.buildkit.v1.frontend.RefMapDeprecatedH\x00R\x0erefsDeprecated\x122\n" + + "\x03ref\x18\x03 \x01(\v2\x1e.moby.buildkit.v1.frontend.RefH\x00R\x03ref\x127\n" + + "\x04refs\x18\x04 \x01(\v2!.moby.buildkit.v1.frontend.RefMapH\x00R\x04refs\x12K\n" + + "\bmetadata\x18\n" + + " \x03(\v2/.moby.buildkit.v1.frontend.Result.MetadataEntryR\bmetadata\x12W\n" + + "\fattestations\x18\f \x03(\v23.moby.buildkit.v1.frontend.Result.AttestationsEntryR\fattestations\x1a;\n" + + "\rMetadataEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\fR\x05value:\x028\x01\x1ah\n" + + "\x11AttestationsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12=\n" + + "\x05value\x18\x02 \x01(\v2'.moby.buildkit.v1.frontend.AttestationsR\x05value:\x028\x01B\b\n" + + "\x06result\"\x96\x01\n" + + "\x10RefMapDeprecated\x12I\n" + + "\x04refs\x18\x01 \x03(\v25.moby.buildkit.v1.frontend.RefMapDeprecated.RefsEntryR\x04refs\x1a7\n" + + "\tRefsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"7\n" + + "\x03Ref\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12 \n" + + "\x03def\x18\x02 \x01(\v2\x0e.pb.DefinitionR\x03def\"\xa2\x01\n" + + "\x06RefMap\x12?\n" + + "\x04refs\x18\x01 \x03(\v2+.moby.buildkit.v1.frontend.RefMap.RefsEntryR\x04refs\x1aW\n" + + "\tRefsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x124\n" + + "\x05value\x18\x02 \x01(\v2\x1e.moby.buildkit.v1.frontend.RefR\x05value:\x028\x01\"X\n" + + "\fAttestations\x12H\n" + + "\vattestation\x18\x01 \x03(\v2&.moby.buildkit.v1.frontend.AttestationR\vattestation\"\xa6\x03\n" + + "\vAttestation\x12>\n" + + "\x04kind\x18\x01 \x01(\x0e2*.moby.buildkit.v1.frontend.AttestationKindR\x04kind\x12P\n" + + "\bmetadata\x18\x02 \x03(\v24.moby.buildkit.v1.frontend.Attestation.MetadataEntryR\bmetadata\x120\n" + + "\x03ref\x18\x03 \x01(\v2\x1e.moby.buildkit.v1.frontend.RefR\x03ref\x12\x12\n" + + "\x04path\x18\x04 \x01(\tR\x04path\x120\n" + + "\x13inTotoPredicateType\x18\x05 \x01(\tR\x13inTotoPredicateType\x12P\n" + + "\x0einTotoSubjects\x18\x06 \x03(\v2(.moby.buildkit.v1.frontend.InTotoSubjectR\x0einTotoSubjects\x1a;\n" + + "\rMetadataEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\fR\x05value:\x028\x01\"}\n" + + "\rInTotoSubject\x12@\n" + + "\x04kind\x18\x01 \x01(\x0e2,.moby.buildkit.v1.frontend.InTotoSubjectKindR\x04kind\x12\x16\n" + + "\x06digest\x18\x02 \x03(\tR\x06digest\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\"t\n" + + "\rReturnRequest\x129\n" + + "\x06result\x18\x01 \x01(\v2!.moby.buildkit.v1.frontend.ResultR\x06result\x12(\n" + + "\x05error\x18\x02 \x01(\v2\x12.google.rpc.StatusR\x05error\"\x10\n" + + "\x0eReturnResponse\"\x0f\n" + + "\rInputsRequest\"\xbe\x01\n" + + "\x0eInputsResponse\x12\\\n" + + "\vDefinitions\x18\x01 \x03(\v2:.moby.buildkit.v1.frontend.InputsResponse.DefinitionsEntryR\vDefinitions\x1aN\n" + + "\x10DefinitionsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12$\n" + + "\x05value\x18\x02 \x01(\v2\x0e.pb.DefinitionR\x05value:\x028\x01\"\xbe\x02\n" + + "\x19ResolveImageConfigRequest\x12\x10\n" + + "\x03Ref\x18\x01 \x01(\tR\x03Ref\x12(\n" + + "\bPlatform\x18\x02 \x01(\v2\f.pb.PlatformR\bPlatform\x12 \n" + + "\vResolveMode\x18\x03 \x01(\tR\vResolveMode\x12\x18\n" + + "\aLogName\x18\x04 \x01(\tR\aLogName\x12\"\n" + + "\fResolverType\x18\x05 \x01(\x05R\fResolverType\x12\x1c\n" + + "\tSessionID\x18\x06 \x01(\tR\tSessionID\x12\x18\n" + + "\aStoreID\x18\a \x01(\tR\aStoreID\x12M\n" + + "\x0eSourcePolicies\x18\b \x03(\v2%.moby.buildkit.v1.sourcepolicy.PolicyR\x0eSourcePolicies\"^\n" + + "\x1aResolveImageConfigResponse\x12\x16\n" + + "\x06Digest\x18\x01 \x01(\tR\x06Digest\x12\x16\n" + + "\x06Config\x18\x02 \x01(\fR\x06Config\x12\x10\n" + + "\x03Ref\x18\x03 \x01(\tR\x03Ref\"\xf5\x01\n" + + "\x18ResolveSourceMetaRequest\x12$\n" + + "\x06Source\x18\x01 \x01(\v2\f.pb.SourceOpR\x06Source\x12(\n" + + "\bPlatform\x18\x02 \x01(\v2\f.pb.PlatformR\bPlatform\x12\x18\n" + + "\aLogName\x18\x03 \x01(\tR\aLogName\x12 \n" + + "\vResolveMode\x18\x04 \x01(\tR\vResolveMode\x12M\n" + + "\x0eSourcePolicies\x18\b \x03(\v2%.moby.buildkit.v1.sourcepolicy.PolicyR\x0eSourcePolicies\"\x8e\x01\n" + + "\x19ResolveSourceMetaResponse\x12$\n" + + "\x06Source\x18\x01 \x01(\v2\f.pb.SourceOpR\x06Source\x12K\n" + + "\x05Image\x18\x02 \x01(\v25.moby.buildkit.v1.frontend.ResolveSourceImageResponseR\x05Image\"L\n" + + "\x1aResolveSourceImageResponse\x12\x16\n" + + "\x06Digest\x18\x01 \x01(\tR\x06Digest\x12\x16\n" + + "\x06Config\x18\x02 \x01(\fR\x06Config\"\x85\x06\n" + + "\fSolveRequest\x12.\n" + + "\n" + + "Definition\x18\x01 \x01(\v2\x0e.pb.DefinitionR\n" + + "Definition\x12\x1a\n" + + "\bFrontend\x18\x02 \x01(\tR\bFrontend\x12Z\n" + + "\vFrontendOpt\x18\x03 \x03(\v28.moby.buildkit.v1.frontend.SolveRequest.FrontendOptEntryR\vFrontendOpt\x12,\n" + + "\x11allowResultReturn\x18\x05 \x01(\bR\x11allowResultReturn\x120\n" + + "\x13allowResultArrayRef\x18\x06 \x01(\bR\x13allowResultArrayRef\x12\x14\n" + + "\x05Final\x18\n" + + " \x01(\bR\x05Final\x12\"\n" + + "\fExporterAttr\x18\v \x01(\fR\fExporterAttr\x12P\n" + + "\fCacheImports\x18\f \x03(\v2,.moby.buildkit.v1.frontend.CacheOptionsEntryR\fCacheImports\x12c\n" + + "\x0eFrontendInputs\x18\r \x03(\v2;.moby.buildkit.v1.frontend.SolveRequest.FrontendInputsEntryR\x0eFrontendInputs\x12\x1a\n" + + "\bEvaluate\x18\x0e \x01(\bR\bEvaluate\x12M\n" + + "\x0eSourcePolicies\x18\x0f \x03(\v2%.moby.buildkit.v1.sourcepolicy.PolicyR\x0eSourcePolicies\x1a>\n" + + "\x10FrontendOptEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1aQ\n" + + "\x13FrontendInputsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12$\n" + + "\x05value\x18\x02 \x01(\v2\x0e.pb.DefinitionR\x05value:\x028\x01\"\xb0\x01\n" + + "\x11CacheOptionsEntry\x12\x12\n" + + "\x04Type\x18\x01 \x01(\tR\x04Type\x12M\n" + + "\x05Attrs\x18\x02 \x03(\v27.moby.buildkit.v1.frontend.CacheOptionsEntry.AttrsEntryR\x05Attrs\x1a8\n" + + "\n" + + "AttrsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\\\n" + + "\rSolveResponse\x12\x10\n" + + "\x03ref\x18\x01 \x01(\tR\x03ref\x129\n" + + "\x06result\x18\x03 \x01(\v2!.moby.buildkit.v1.frontend.ResultR\x06result\"{\n" + + "\x0fReadFileRequest\x12\x10\n" + + "\x03Ref\x18\x01 \x01(\tR\x03Ref\x12\x1a\n" + + "\bFilePath\x18\x02 \x01(\tR\bFilePath\x12:\n" + + "\x05Range\x18\x03 \x01(\v2$.moby.buildkit.v1.frontend.FileRangeR\x05Range\";\n" + + "\tFileRange\x12\x16\n" + + "\x06Offset\x18\x01 \x01(\x03R\x06Offset\x12\x16\n" + + "\x06Length\x18\x02 \x01(\x03R\x06Length\"&\n" + + "\x10ReadFileResponse\x12\x12\n" + + "\x04Data\x18\x01 \x01(\fR\x04Data\"d\n" + + "\x0eReadDirRequest\x12\x10\n" + + "\x03Ref\x18\x01 \x01(\tR\x03Ref\x12\x18\n" + + "\aDirPath\x18\x02 \x01(\tR\aDirPath\x12&\n" + + "\x0eIncludePattern\x18\x03 \x01(\tR\x0eIncludePattern\"?\n" + + "\x0fReadDirResponse\x12,\n" + + "\aentries\x18\x01 \x03(\v2\x12.fsutil.types.StatR\aentries\"7\n" + + "\x0fStatFileRequest\x12\x10\n" + + "\x03Ref\x18\x01 \x01(\tR\x03Ref\x12\x12\n" + + "\x04Path\x18\x02 \x01(\tR\x04Path\":\n" + + "\x10StatFileResponse\x12&\n" + + "\x04stat\x18\x01 \x01(\v2\x12.fsutil.types.StatR\x04stat\"#\n" + + "\x0fEvaluateRequest\x12\x10\n" + + "\x03Ref\x18\x01 \x01(\tR\x03Ref\"\x12\n" + + "\x10EvaluateResponse\"\r\n" + + "\vPingRequest\"\xd6\x01\n" + + "\fPongResponse\x12J\n" + + "\x0fFrontendAPICaps\x18\x01 \x03(\v2 .moby.buildkit.v1.apicaps.APICapR\x0fFrontendAPICaps\x12:\n" + + "\aLLBCaps\x18\x02 \x03(\v2 .moby.buildkit.v1.apicaps.APICapR\aLLBCaps\x12>\n" + + "\aWorkers\x18\x03 \x03(\v2$.moby.buildkit.v1.types.WorkerRecordR\aWorkers\"\xc2\x01\n" + + "\vWarnRequest\x12\x16\n" + + "\x06digest\x18\x01 \x01(\tR\x06digest\x12\x14\n" + + "\x05level\x18\x02 \x01(\x03R\x05level\x12\x14\n" + + "\x05short\x18\x03 \x01(\fR\x05short\x12\x16\n" + + "\x06detail\x18\x04 \x03(\fR\x06detail\x12\x10\n" + + "\x03url\x18\x05 \x01(\tR\x03url\x12\"\n" + + "\x04info\x18\x06 \x01(\v2\x0e.pb.SourceInfoR\x04info\x12!\n" + + "\x06ranges\x18\a \x03(\v2\t.pb.RangeR\x06ranges\"\x0e\n" + + "\fWarnResponse\"\xac\x02\n" + + "\x13NewContainerRequest\x12 \n" + + "\vContainerID\x18\x01 \x01(\tR\vContainerID\x12!\n" + + "\x06Mounts\x18\x02 \x03(\v2\t.pb.MountR\x06Mounts\x12%\n" + + "\aNetwork\x18\x03 \x01(\x0e2\v.pb.NetModeR\aNetwork\x12(\n" + + "\bplatform\x18\x04 \x01(\v2\f.pb.PlatformR\bplatform\x127\n" + + "\vconstraints\x18\x05 \x01(\v2\x15.pb.WorkerConstraintsR\vconstraints\x12*\n" + + "\n" + + "extraHosts\x18\x06 \x03(\v2\n" + + ".pb.HostIPR\n" + + "extraHosts\x12\x1a\n" + + "\bhostname\x18\a \x01(\tR\bhostname\"\x16\n" + + "\x14NewContainerResponse\";\n" + + "\x17ReleaseContainerRequest\x12 \n" + + "\vContainerID\x18\x01 \x01(\tR\vContainerID\"\x1a\n" + + "\x18ReleaseContainerResponse\"\xf9\x03\n" + + "\vExecMessage\x12\x1c\n" + + "\tProcessID\x18\x01 \x01(\tR\tProcessID\x12<\n" + + "\x04Init\x18\x02 \x01(\v2&.moby.buildkit.v1.frontend.InitMessageH\x00R\x04Init\x12:\n" + + "\x04File\x18\x03 \x01(\v2$.moby.buildkit.v1.frontend.FdMessageH\x00R\x04File\x12B\n" + + "\x06Resize\x18\x04 \x01(\v2(.moby.buildkit.v1.frontend.ResizeMessageH\x00R\x06Resize\x12E\n" + + "\aStarted\x18\x05 \x01(\v2).moby.buildkit.v1.frontend.StartedMessageH\x00R\aStarted\x12<\n" + + "\x04Exit\x18\x06 \x01(\v2&.moby.buildkit.v1.frontend.ExitMessageH\x00R\x04Exit\x12<\n" + + "\x04Done\x18\a \x01(\v2&.moby.buildkit.v1.frontend.DoneMessageH\x00R\x04Done\x12B\n" + + "\x06Signal\x18\b \x01(\v2(.moby.buildkit.v1.frontend.SignalMessageH\x00R\x06SignalB\a\n" + + "\x05Input\"\xcc\x01\n" + + "\vInitMessage\x12 \n" + + "\vContainerID\x18\x01 \x01(\tR\vContainerID\x12\x1c\n" + + "\x04Meta\x18\x02 \x01(\v2\b.pb.MetaR\x04Meta\x12\x10\n" + + "\x03Fds\x18\x03 \x03(\rR\x03Fds\x12\x10\n" + + "\x03Tty\x18\x04 \x01(\bR\x03Tty\x12,\n" + + "\bSecurity\x18\x05 \x01(\x0e2\x10.pb.SecurityModeR\bSecurity\x12+\n" + + "\tsecretenv\x18\x06 \x03(\v2\r.pb.SecretEnvR\tsecretenv\"K\n" + + "\vExitMessage\x12\x12\n" + + "\x04Code\x18\x01 \x01(\rR\x04Code\x12(\n" + + "\x05Error\x18\x02 \x01(\v2\x12.google.rpc.StatusR\x05Error\"\x10\n" + + "\x0eStartedMessage\"\r\n" + + "\vDoneMessage\"A\n" + + "\tFdMessage\x12\x0e\n" + + "\x02Fd\x18\x01 \x01(\rR\x02Fd\x12\x10\n" + + "\x03EOF\x18\x02 \x01(\bR\x03EOF\x12\x12\n" + + "\x04Data\x18\x03 \x01(\fR\x04Data\"7\n" + + "\rResizeMessage\x12\x12\n" + + "\x04Rows\x18\x01 \x01(\rR\x04Rows\x12\x12\n" + + "\x04Cols\x18\x02 \x01(\rR\x04Cols\"#\n" + + "\rSignalMessage\x12\x12\n" + + "\x04Name\x18\x01 \x01(\tR\x04Name*)\n" + + "\x0fAttestationKind\x12\n" + + "\n" + + "\x06InToto\x10\x00\x12\n" + + "\n" + + "\x06Bundle\x10\x01*&\n" + + "\x11InTotoSubjectKind\x12\b\n" + + "\x04Self\x10\x00\x12\a\n" + + "\x03Raw\x10\x012\xbd\v\n" + + "\tLLBBridge\x12\x81\x01\n" + + "\x12ResolveImageConfig\x124.moby.buildkit.v1.frontend.ResolveImageConfigRequest\x1a5.moby.buildkit.v1.frontend.ResolveImageConfigResponse\x12~\n" + + "\x11ResolveSourceMeta\x123.moby.buildkit.v1.frontend.ResolveSourceMetaRequest\x1a4.moby.buildkit.v1.frontend.ResolveSourceMetaResponse\x12Z\n" + + "\x05Solve\x12'.moby.buildkit.v1.frontend.SolveRequest\x1a(.moby.buildkit.v1.frontend.SolveResponse\x12c\n" + + "\bReadFile\x12*.moby.buildkit.v1.frontend.ReadFileRequest\x1a+.moby.buildkit.v1.frontend.ReadFileResponse\x12`\n" + + "\aReadDir\x12).moby.buildkit.v1.frontend.ReadDirRequest\x1a*.moby.buildkit.v1.frontend.ReadDirResponse\x12c\n" + + "\bStatFile\x12*.moby.buildkit.v1.frontend.StatFileRequest\x1a+.moby.buildkit.v1.frontend.StatFileResponse\x12c\n" + + "\bEvaluate\x12*.moby.buildkit.v1.frontend.EvaluateRequest\x1a+.moby.buildkit.v1.frontend.EvaluateResponse\x12W\n" + + "\x04Ping\x12&.moby.buildkit.v1.frontend.PingRequest\x1a'.moby.buildkit.v1.frontend.PongResponse\x12]\n" + + "\x06Return\x12(.moby.buildkit.v1.frontend.ReturnRequest\x1a).moby.buildkit.v1.frontend.ReturnResponse\x12]\n" + + "\x06Inputs\x12(.moby.buildkit.v1.frontend.InputsRequest\x1a).moby.buildkit.v1.frontend.InputsResponse\x12o\n" + + "\fNewContainer\x12..moby.buildkit.v1.frontend.NewContainerRequest\x1a/.moby.buildkit.v1.frontend.NewContainerResponse\x12{\n" + + "\x10ReleaseContainer\x122.moby.buildkit.v1.frontend.ReleaseContainerRequest\x1a3.moby.buildkit.v1.frontend.ReleaseContainerResponse\x12a\n" + + "\vExecProcess\x12&.moby.buildkit.v1.frontend.ExecMessage\x1a&.moby.buildkit.v1.frontend.ExecMessage(\x010\x01\x12W\n" + + "\x04Warn\x12&.moby.buildkit.v1.frontend.WarnRequest\x1a'.moby.buildkit.v1.frontend.WarnResponseBHZFgithub.com/moby/buildkit/frontend/gateway/pb;moby_buildkit_v1_frontendb\x06proto3" var ( file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescOnce sync.Once - file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescData = file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDesc + file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescData []byte ) func file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescGZIP() []byte { file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescOnce.Do(func() { - file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescData) + file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDesc), len(file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDesc))) }) return file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDescData } @@ -3483,7 +3169,7 @@ func file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDesc), len(file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDesc)), NumEnums: 2, NumMessages: 53, NumExtensions: 0, @@ -3495,7 +3181,6 @@ func file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_init() { MessageInfos: file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_msgTypes, }.Build() File_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto = out.File - file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_rawDesc = nil file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_goTypes = nil file_github_com_moby_buildkit_frontend_gateway_pb_gateway_proto_depIdxs = nil } diff --git a/vendor/github.com/moby/buildkit/session/auth/auth.pb.go b/vendor/github.com/moby/buildkit/session/auth/auth.pb.go index 30913d3e85..27dbd98612 100644 --- a/vendor/github.com/moby/buildkit/session/auth/auth.pb.go +++ b/vendor/github.com/moby/buildkit/session/auth/auth.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 +// protoc-gen-go v1.36.6 // protoc v3.11.4 // source: github.com/moby/buildkit/session/auth/auth.proto @@ -11,6 +11,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -21,11 +22,10 @@ const ( ) type CredentialsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Host string `protobuf:"bytes,1,opt,name=Host,proto3" json:"Host,omitempty"` unknownFields protoimpl.UnknownFields - - Host string `protobuf:"bytes,1,opt,name=Host,proto3" json:"Host,omitempty"` + sizeCache protoimpl.SizeCache } func (x *CredentialsRequest) Reset() { @@ -66,12 +66,11 @@ func (x *CredentialsRequest) GetHost() string { } type CredentialsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Username string `protobuf:"bytes,1,opt,name=Username,proto3" json:"Username,omitempty"` + Secret string `protobuf:"bytes,2,opt,name=Secret,proto3" json:"Secret,omitempty"` unknownFields protoimpl.UnknownFields - - Username string `protobuf:"bytes,1,opt,name=Username,proto3" json:"Username,omitempty"` - Secret string `protobuf:"bytes,2,opt,name=Secret,proto3" json:"Secret,omitempty"` + sizeCache protoimpl.SizeCache } func (x *CredentialsResponse) Reset() { @@ -119,15 +118,14 @@ func (x *CredentialsResponse) GetSecret() string { } type FetchTokenRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ClientID string `protobuf:"bytes,1,opt,name=ClientID,proto3" json:"ClientID,omitempty"` + Host string `protobuf:"bytes,2,opt,name=Host,proto3" json:"Host,omitempty"` + Realm string `protobuf:"bytes,3,opt,name=Realm,proto3" json:"Realm,omitempty"` + Service string `protobuf:"bytes,4,opt,name=Service,proto3" json:"Service,omitempty"` + Scopes []string `protobuf:"bytes,5,rep,name=Scopes,proto3" json:"Scopes,omitempty"` unknownFields protoimpl.UnknownFields - - ClientID string `protobuf:"bytes,1,opt,name=ClientID,proto3" json:"ClientID,omitempty"` - Host string `protobuf:"bytes,2,opt,name=Host,proto3" json:"Host,omitempty"` - Realm string `protobuf:"bytes,3,opt,name=Realm,proto3" json:"Realm,omitempty"` - Service string `protobuf:"bytes,4,opt,name=Service,proto3" json:"Service,omitempty"` - Scopes []string `protobuf:"bytes,5,rep,name=Scopes,proto3" json:"Scopes,omitempty"` + sizeCache protoimpl.SizeCache } func (x *FetchTokenRequest) Reset() { @@ -196,13 +194,12 @@ func (x *FetchTokenRequest) GetScopes() []string { } type FetchTokenResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Token string `protobuf:"bytes,1,opt,name=Token,proto3" json:"Token,omitempty"` + ExpiresIn int64 `protobuf:"varint,2,opt,name=ExpiresIn,proto3" json:"ExpiresIn,omitempty"` // seconds + IssuedAt int64 `protobuf:"varint,3,opt,name=IssuedAt,proto3" json:"IssuedAt,omitempty"` // timestamp unknownFields protoimpl.UnknownFields - - Token string `protobuf:"bytes,1,opt,name=Token,proto3" json:"Token,omitempty"` - ExpiresIn int64 `protobuf:"varint,2,opt,name=ExpiresIn,proto3" json:"ExpiresIn,omitempty"` // seconds - IssuedAt int64 `protobuf:"varint,3,opt,name=IssuedAt,proto3" json:"IssuedAt,omitempty"` // timestamp + sizeCache protoimpl.SizeCache } func (x *FetchTokenResponse) Reset() { @@ -257,12 +254,11 @@ func (x *FetchTokenResponse) GetIssuedAt() int64 { } type GetTokenAuthorityRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Host string `protobuf:"bytes,1,opt,name=Host,proto3" json:"Host,omitempty"` + Salt []byte `protobuf:"bytes,2,opt,name=Salt,proto3" json:"Salt,omitempty"` unknownFields protoimpl.UnknownFields - - Host string `protobuf:"bytes,1,opt,name=Host,proto3" json:"Host,omitempty"` - Salt []byte `protobuf:"bytes,2,opt,name=Salt,proto3" json:"Salt,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetTokenAuthorityRequest) Reset() { @@ -310,11 +306,10 @@ func (x *GetTokenAuthorityRequest) GetSalt() []byte { } type GetTokenAuthorityResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + PublicKey []byte `protobuf:"bytes,1,opt,name=PublicKey,proto3" json:"PublicKey,omitempty"` unknownFields protoimpl.UnknownFields - - PublicKey []byte `protobuf:"bytes,1,opt,name=PublicKey,proto3" json:"PublicKey,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetTokenAuthorityResponse) Reset() { @@ -355,13 +350,12 @@ func (x *GetTokenAuthorityResponse) GetPublicKey() []byte { } type VerifyTokenAuthorityRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Host string `protobuf:"bytes,1,opt,name=Host,proto3" json:"Host,omitempty"` + Payload []byte `protobuf:"bytes,2,opt,name=Payload,proto3" json:"Payload,omitempty"` + Salt []byte `protobuf:"bytes,3,opt,name=Salt,proto3" json:"Salt,omitempty"` unknownFields protoimpl.UnknownFields - - Host string `protobuf:"bytes,1,opt,name=Host,proto3" json:"Host,omitempty"` - Payload []byte `protobuf:"bytes,2,opt,name=Payload,proto3" json:"Payload,omitempty"` - Salt []byte `protobuf:"bytes,3,opt,name=Salt,proto3" json:"Salt,omitempty"` + sizeCache protoimpl.SizeCache } func (x *VerifyTokenAuthorityRequest) Reset() { @@ -416,11 +410,10 @@ func (x *VerifyTokenAuthorityRequest) GetSalt() []byte { } type VerifyTokenAuthorityResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Signed []byte `protobuf:"bytes,1,opt,name=Signed,proto3" json:"Signed,omitempty"` unknownFields protoimpl.UnknownFields - - Signed []byte `protobuf:"bytes,1,opt,name=Signed,proto3" json:"Signed,omitempty"` + sizeCache protoimpl.SizeCache } func (x *VerifyTokenAuthorityResponse) Reset() { @@ -462,91 +455,50 @@ func (x *VerifyTokenAuthorityResponse) GetSigned() []byte { var File_github_com_moby_buildkit_session_auth_auth_proto protoreflect.FileDescriptor -var file_github_com_moby_buildkit_session_auth_auth_proto_rawDesc = []byte{ - 0x0a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, - 0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x10, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x6e, - 0x63, 0x2e, 0x76, 0x31, 0x22, 0x28, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x61, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x48, 0x6f, - 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x48, 0x6f, 0x73, 0x74, 0x22, 0x49, - 0x0a, 0x13, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x22, 0x8b, 0x01, 0x0a, 0x11, 0x46, 0x65, - 0x74, 0x63, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1a, 0x0a, 0x08, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x48, - 0x6f, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x48, 0x6f, 0x73, 0x74, 0x12, - 0x14, 0x0a, 0x05, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0x16, 0x0a, 0x06, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x06, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x22, 0x64, 0x0a, 0x12, 0x46, 0x65, 0x74, 0x63, 0x68, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, - 0x05, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x49, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x49, - 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x49, 0x73, 0x73, 0x75, 0x65, 0x64, 0x41, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x08, 0x49, 0x73, 0x73, 0x75, 0x65, 0x64, 0x41, 0x74, 0x22, 0x42, 0x0a, - 0x18, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, - 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x48, 0x6f, 0x73, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, - 0x04, 0x53, 0x61, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x53, 0x61, 0x6c, - 0x74, 0x22, 0x39, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x41, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, - 0x0a, 0x09, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x09, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x22, 0x5f, 0x0a, 0x1b, - 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x41, 0x75, 0x74, 0x68, 0x6f, - 0x72, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x48, - 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x48, 0x6f, 0x73, 0x74, 0x12, - 0x18, 0x0a, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x61, 0x6c, - 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x53, 0x61, 0x6c, 0x74, 0x22, 0x36, 0x0a, - 0x1c, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x41, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, - 0x06, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x53, - 0x69, 0x67, 0x6e, 0x65, 0x64, 0x32, 0xa0, 0x03, 0x0a, 0x04, 0x41, 0x75, 0x74, 0x68, 0x12, 0x5a, - 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x24, 0x2e, - 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, - 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, - 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, - 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x0a, 0x46, 0x65, - 0x74, 0x63, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x23, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, - 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x74, 0x63, - 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, - 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, - 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x6c, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x41, - 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x2a, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, - 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x66, 0x69, 0x6c, 0x65, - 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x75, 0x0a, 0x14, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x2d, 0x2e, 0x6d, 0x6f, 0x62, 0x79, - 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, - 0x69, 0x66, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, - 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, - 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x69, - 0x66, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x27, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, 0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, - 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x61, 0x75, 0x74, - 0x68, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_github_com_moby_buildkit_session_auth_auth_proto_rawDesc = "" + + "\n" + + "0github.com/moby/buildkit/session/auth/auth.proto\x12\x10moby.filesync.v1\"(\n" + + "\x12CredentialsRequest\x12\x12\n" + + "\x04Host\x18\x01 \x01(\tR\x04Host\"I\n" + + "\x13CredentialsResponse\x12\x1a\n" + + "\bUsername\x18\x01 \x01(\tR\bUsername\x12\x16\n" + + "\x06Secret\x18\x02 \x01(\tR\x06Secret\"\x8b\x01\n" + + "\x11FetchTokenRequest\x12\x1a\n" + + "\bClientID\x18\x01 \x01(\tR\bClientID\x12\x12\n" + + "\x04Host\x18\x02 \x01(\tR\x04Host\x12\x14\n" + + "\x05Realm\x18\x03 \x01(\tR\x05Realm\x12\x18\n" + + "\aService\x18\x04 \x01(\tR\aService\x12\x16\n" + + "\x06Scopes\x18\x05 \x03(\tR\x06Scopes\"d\n" + + "\x12FetchTokenResponse\x12\x14\n" + + "\x05Token\x18\x01 \x01(\tR\x05Token\x12\x1c\n" + + "\tExpiresIn\x18\x02 \x01(\x03R\tExpiresIn\x12\x1a\n" + + "\bIssuedAt\x18\x03 \x01(\x03R\bIssuedAt\"B\n" + + "\x18GetTokenAuthorityRequest\x12\x12\n" + + "\x04Host\x18\x01 \x01(\tR\x04Host\x12\x12\n" + + "\x04Salt\x18\x02 \x01(\fR\x04Salt\"9\n" + + "\x19GetTokenAuthorityResponse\x12\x1c\n" + + "\tPublicKey\x18\x01 \x01(\fR\tPublicKey\"_\n" + + "\x1bVerifyTokenAuthorityRequest\x12\x12\n" + + "\x04Host\x18\x01 \x01(\tR\x04Host\x12\x18\n" + + "\aPayload\x18\x02 \x01(\fR\aPayload\x12\x12\n" + + "\x04Salt\x18\x03 \x01(\fR\x04Salt\"6\n" + + "\x1cVerifyTokenAuthorityResponse\x12\x16\n" + + "\x06Signed\x18\x01 \x01(\fR\x06Signed2\xa0\x03\n" + + "\x04Auth\x12Z\n" + + "\vCredentials\x12$.moby.filesync.v1.CredentialsRequest\x1a%.moby.filesync.v1.CredentialsResponse\x12W\n" + + "\n" + + "FetchToken\x12#.moby.filesync.v1.FetchTokenRequest\x1a$.moby.filesync.v1.FetchTokenResponse\x12l\n" + + "\x11GetTokenAuthority\x12*.moby.filesync.v1.GetTokenAuthorityRequest\x1a+.moby.filesync.v1.GetTokenAuthorityResponse\x12u\n" + + "\x14VerifyTokenAuthority\x12-.moby.filesync.v1.VerifyTokenAuthorityRequest\x1a..moby.filesync.v1.VerifyTokenAuthorityResponseB'Z%github.com/moby/buildkit/session/authb\x06proto3" var ( file_github_com_moby_buildkit_session_auth_auth_proto_rawDescOnce sync.Once - file_github_com_moby_buildkit_session_auth_auth_proto_rawDescData = file_github_com_moby_buildkit_session_auth_auth_proto_rawDesc + file_github_com_moby_buildkit_session_auth_auth_proto_rawDescData []byte ) func file_github_com_moby_buildkit_session_auth_auth_proto_rawDescGZIP() []byte { file_github_com_moby_buildkit_session_auth_auth_proto_rawDescOnce.Do(func() { - file_github_com_moby_buildkit_session_auth_auth_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_moby_buildkit_session_auth_auth_proto_rawDescData) + file_github_com_moby_buildkit_session_auth_auth_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_moby_buildkit_session_auth_auth_proto_rawDesc), len(file_github_com_moby_buildkit_session_auth_auth_proto_rawDesc))) }) return file_github_com_moby_buildkit_session_auth_auth_proto_rawDescData } @@ -587,7 +539,7 @@ func file_github_com_moby_buildkit_session_auth_auth_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_moby_buildkit_session_auth_auth_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_moby_buildkit_session_auth_auth_proto_rawDesc), len(file_github_com_moby_buildkit_session_auth_auth_proto_rawDesc)), NumEnums: 0, NumMessages: 8, NumExtensions: 0, @@ -598,7 +550,6 @@ func file_github_com_moby_buildkit_session_auth_auth_proto_init() { MessageInfos: file_github_com_moby_buildkit_session_auth_auth_proto_msgTypes, }.Build() File_github_com_moby_buildkit_session_auth_auth_proto = out.File - file_github_com_moby_buildkit_session_auth_auth_proto_rawDesc = nil file_github_com_moby_buildkit_session_auth_auth_proto_goTypes = nil file_github_com_moby_buildkit_session_auth_auth_proto_depIdxs = nil } diff --git a/vendor/github.com/moby/buildkit/session/exporter/exporter.pb.go b/vendor/github.com/moby/buildkit/session/exporter/exporter.pb.go index fd52ca6c43..80008f8793 100644 --- a/vendor/github.com/moby/buildkit/session/exporter/exporter.pb.go +++ b/vendor/github.com/moby/buildkit/session/exporter/exporter.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 +// protoc-gen-go v1.36.6 // protoc v3.11.4 // source: github.com/moby/buildkit/session/exporter/exporter.proto @@ -11,6 +11,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -21,12 +22,11 @@ const ( ) type FindExportersRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Metadata map[string][]byte `protobuf:"bytes,1,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + Refs []string `protobuf:"bytes,2,rep,name=refs,proto3" json:"refs,omitempty"` unknownFields protoimpl.UnknownFields - - Metadata map[string][]byte `protobuf:"bytes,1,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Refs []string `protobuf:"bytes,2,rep,name=refs,proto3" json:"refs,omitempty"` + sizeCache protoimpl.SizeCache } func (x *FindExportersRequest) Reset() { @@ -74,11 +74,10 @@ func (x *FindExportersRequest) GetRefs() []string { } type FindExportersResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Exporters []*ExporterRequest `protobuf:"bytes,1,rep,name=exporters,proto3" json:"exporters,omitempty"` unknownFields protoimpl.UnknownFields - - Exporters []*ExporterRequest `protobuf:"bytes,1,rep,name=exporters,proto3" json:"exporters,omitempty"` + sizeCache protoimpl.SizeCache } func (x *FindExportersResponse) Reset() { @@ -119,12 +118,11 @@ func (x *FindExportersResponse) GetExporters() []*ExporterRequest { } type ExporterRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Type string `protobuf:"bytes,1,opt,name=Type,proto3" json:"Type,omitempty"` + Attrs map[string]string `protobuf:"bytes,2,rep,name=Attrs,proto3" json:"Attrs,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` unknownFields protoimpl.UnknownFields - - Type string `protobuf:"bytes,1,opt,name=Type,proto3" json:"Type,omitempty"` - Attrs map[string]string `protobuf:"bytes,2,rep,name=Attrs,proto3" json:"Attrs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + sizeCache protoimpl.SizeCache } func (x *ExporterRequest) Reset() { @@ -173,60 +171,35 @@ func (x *ExporterRequest) GetAttrs() map[string]string { var File_github_com_moby_buildkit_session_exporter_exporter_proto protoreflect.FileDescriptor -var file_github_com_moby_buildkit_session_exporter_exporter_proto_rawDesc = []byte{ - 0x0a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, - 0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x2f, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x2f, 0x65, 0x78, 0x70, 0x6f, - 0x72, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x6d, 0x6f, 0x62, 0x79, - 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x22, 0xb9, 0x01, 0x0a, - 0x14, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x50, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x65, - 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, - 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x65, 0x66, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x72, 0x65, 0x66, 0x73, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x58, 0x0a, 0x15, 0x46, 0x69, 0x6e, 0x64, - 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x3f, 0x0a, 0x09, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6f, - 0x72, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x09, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, - 0x72, 0x73, 0x22, 0xa3, 0x01, 0x0a, 0x0f, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x42, 0x0a, 0x05, 0x41, 0x74, - 0x74, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6d, 0x6f, 0x62, 0x79, - 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, - 0x6f, 0x72, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x41, 0x74, 0x74, - 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x41, 0x74, 0x74, 0x72, 0x73, 0x1a, 0x38, - 0x0a, 0x0a, 0x41, 0x74, 0x74, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x32, 0x6c, 0x0a, 0x08, 0x45, 0x78, 0x70, 0x6f, - 0x72, 0x74, 0x65, 0x72, 0x12, 0x60, 0x0a, 0x0d, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x78, 0x70, 0x6f, - 0x72, 0x74, 0x65, 0x72, 0x73, 0x12, 0x26, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x65, 0x78, 0x70, - 0x6f, 0x72, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x78, 0x70, - 0x6f, 0x72, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, - 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, - 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x2b, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, 0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, - 0x69, 0x74, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x65, 0x78, 0x70, 0x6f, 0x72, - 0x74, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_github_com_moby_buildkit_session_exporter_exporter_proto_rawDesc = "" + + "\n" + + "8github.com/moby/buildkit/session/exporter/exporter.proto\x12\x10moby.exporter.v1\"\xb9\x01\n" + + "\x14FindExportersRequest\x12P\n" + + "\bmetadata\x18\x01 \x03(\v24.moby.exporter.v1.FindExportersRequest.MetadataEntryR\bmetadata\x12\x12\n" + + "\x04refs\x18\x02 \x03(\tR\x04refs\x1a;\n" + + "\rMetadataEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\fR\x05value:\x028\x01\"X\n" + + "\x15FindExportersResponse\x12?\n" + + "\texporters\x18\x01 \x03(\v2!.moby.exporter.v1.ExporterRequestR\texporters\"\xa3\x01\n" + + "\x0fExporterRequest\x12\x12\n" + + "\x04Type\x18\x01 \x01(\tR\x04Type\x12B\n" + + "\x05Attrs\x18\x02 \x03(\v2,.moby.exporter.v1.ExporterRequest.AttrsEntryR\x05Attrs\x1a8\n" + + "\n" + + "AttrsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x012l\n" + + "\bExporter\x12`\n" + + "\rFindExporters\x12&.moby.exporter.v1.FindExportersRequest\x1a'.moby.exporter.v1.FindExportersResponseB+Z)github.com/moby/buildkit/session/exporterb\x06proto3" var ( file_github_com_moby_buildkit_session_exporter_exporter_proto_rawDescOnce sync.Once - file_github_com_moby_buildkit_session_exporter_exporter_proto_rawDescData = file_github_com_moby_buildkit_session_exporter_exporter_proto_rawDesc + file_github_com_moby_buildkit_session_exporter_exporter_proto_rawDescData []byte ) func file_github_com_moby_buildkit_session_exporter_exporter_proto_rawDescGZIP() []byte { file_github_com_moby_buildkit_session_exporter_exporter_proto_rawDescOnce.Do(func() { - file_github_com_moby_buildkit_session_exporter_exporter_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_moby_buildkit_session_exporter_exporter_proto_rawDescData) + file_github_com_moby_buildkit_session_exporter_exporter_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_moby_buildkit_session_exporter_exporter_proto_rawDesc), len(file_github_com_moby_buildkit_session_exporter_exporter_proto_rawDesc))) }) return file_github_com_moby_buildkit_session_exporter_exporter_proto_rawDescData } @@ -261,7 +234,7 @@ func file_github_com_moby_buildkit_session_exporter_exporter_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_moby_buildkit_session_exporter_exporter_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_moby_buildkit_session_exporter_exporter_proto_rawDesc), len(file_github_com_moby_buildkit_session_exporter_exporter_proto_rawDesc)), NumEnums: 0, NumMessages: 5, NumExtensions: 0, @@ -272,7 +245,6 @@ func file_github_com_moby_buildkit_session_exporter_exporter_proto_init() { MessageInfos: file_github_com_moby_buildkit_session_exporter_exporter_proto_msgTypes, }.Build() File_github_com_moby_buildkit_session_exporter_exporter_proto = out.File - file_github_com_moby_buildkit_session_exporter_exporter_proto_rawDesc = nil file_github_com_moby_buildkit_session_exporter_exporter_proto_goTypes = nil file_github_com_moby_buildkit_session_exporter_exporter_proto_depIdxs = nil } diff --git a/vendor/github.com/moby/buildkit/session/filesync/filesync.pb.go b/vendor/github.com/moby/buildkit/session/filesync/filesync.pb.go index 2a51550b77..7f98c7d3e9 100644 --- a/vendor/github.com/moby/buildkit/session/filesync/filesync.pb.go +++ b/vendor/github.com/moby/buildkit/session/filesync/filesync.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 +// protoc-gen-go v1.36.6 // protoc v3.11.4 // source: github.com/moby/buildkit/session/filesync/filesync.proto @@ -12,6 +12,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -23,11 +24,10 @@ const ( // BytesMessage contains a chunk of byte data type BytesMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` unknownFields protoimpl.UnknownFields - - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + sizeCache protoimpl.SizeCache } func (x *BytesMessage) Reset() { @@ -69,45 +69,25 @@ func (x *BytesMessage) GetData() []byte { var File_github_com_moby_buildkit_session_filesync_filesync_proto protoreflect.FileDescriptor -var file_github_com_moby_buildkit_session_filesync_filesync_proto_rawDesc = []byte{ - 0x0a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, - 0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x6e, 0x63, 0x2f, 0x66, 0x69, 0x6c, 0x65, - 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x6d, 0x6f, 0x62, 0x79, - 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x1a, 0x2d, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x6f, 0x6e, 0x69, 0x73, 0x74, 0x69, - 0x69, 0x67, 0x69, 0x2f, 0x66, 0x73, 0x75, 0x74, 0x69, 0x6c, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x22, 0x0a, 0x0c, 0x42, - 0x79, 0x74, 0x65, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, - 0x83, 0x01, 0x0a, 0x08, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x3a, 0x0a, 0x08, - 0x44, 0x69, 0x66, 0x66, 0x43, 0x6f, 0x70, 0x79, 0x12, 0x14, 0x2e, 0x66, 0x73, 0x75, 0x74, 0x69, - 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x1a, 0x14, - 0x2e, 0x66, 0x73, 0x75, 0x74, 0x69, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x61, - 0x63, 0x6b, 0x65, 0x74, 0x28, 0x01, 0x30, 0x01, 0x12, 0x3b, 0x0a, 0x09, 0x54, 0x61, 0x72, 0x53, - 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x14, 0x2e, 0x66, 0x73, 0x75, 0x74, 0x69, 0x6c, 0x2e, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x1a, 0x14, 0x2e, 0x66, 0x73, - 0x75, 0x74, 0x69, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x65, - 0x74, 0x28, 0x01, 0x30, 0x01, 0x32, 0x5a, 0x0a, 0x08, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x65, 0x6e, - 0x64, 0x12, 0x4e, 0x0a, 0x08, 0x44, 0x69, 0x66, 0x66, 0x43, 0x6f, 0x70, 0x79, 0x12, 0x1e, 0x2e, - 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, - 0x2e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x1e, 0x2e, - 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, - 0x2e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x28, 0x01, 0x30, - 0x01, 0x42, 0x2b, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x6d, 0x6f, 0x62, 0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x73, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x6e, 0x63, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_github_com_moby_buildkit_session_filesync_filesync_proto_rawDesc = "" + + "\n" + + "8github.com/moby/buildkit/session/filesync/filesync.proto\x12\x10moby.filesync.v1\x1a-github.com/tonistiigi/fsutil/types/wire.proto\"\"\n" + + "\fBytesMessage\x12\x12\n" + + "\x04data\x18\x01 \x01(\fR\x04data2\x83\x01\n" + + "\bFileSync\x12:\n" + + "\bDiffCopy\x12\x14.fsutil.types.Packet\x1a\x14.fsutil.types.Packet(\x010\x01\x12;\n" + + "\tTarStream\x12\x14.fsutil.types.Packet\x1a\x14.fsutil.types.Packet(\x010\x012Z\n" + + "\bFileSend\x12N\n" + + "\bDiffCopy\x12\x1e.moby.filesync.v1.BytesMessage\x1a\x1e.moby.filesync.v1.BytesMessage(\x010\x01B+Z)github.com/moby/buildkit/session/filesyncb\x06proto3" var ( file_github_com_moby_buildkit_session_filesync_filesync_proto_rawDescOnce sync.Once - file_github_com_moby_buildkit_session_filesync_filesync_proto_rawDescData = file_github_com_moby_buildkit_session_filesync_filesync_proto_rawDesc + file_github_com_moby_buildkit_session_filesync_filesync_proto_rawDescData []byte ) func file_github_com_moby_buildkit_session_filesync_filesync_proto_rawDescGZIP() []byte { file_github_com_moby_buildkit_session_filesync_filesync_proto_rawDescOnce.Do(func() { - file_github_com_moby_buildkit_session_filesync_filesync_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_moby_buildkit_session_filesync_filesync_proto_rawDescData) + file_github_com_moby_buildkit_session_filesync_filesync_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_moby_buildkit_session_filesync_filesync_proto_rawDesc), len(file_github_com_moby_buildkit_session_filesync_filesync_proto_rawDesc))) }) return file_github_com_moby_buildkit_session_filesync_filesync_proto_rawDescData } @@ -140,7 +120,7 @@ func file_github_com_moby_buildkit_session_filesync_filesync_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_moby_buildkit_session_filesync_filesync_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_moby_buildkit_session_filesync_filesync_proto_rawDesc), len(file_github_com_moby_buildkit_session_filesync_filesync_proto_rawDesc)), NumEnums: 0, NumMessages: 1, NumExtensions: 0, @@ -151,7 +131,6 @@ func file_github_com_moby_buildkit_session_filesync_filesync_proto_init() { MessageInfos: file_github_com_moby_buildkit_session_filesync_filesync_proto_msgTypes, }.Build() File_github_com_moby_buildkit_session_filesync_filesync_proto = out.File - file_github_com_moby_buildkit_session_filesync_filesync_proto_rawDesc = nil file_github_com_moby_buildkit_session_filesync_filesync_proto_goTypes = nil file_github_com_moby_buildkit_session_filesync_filesync_proto_depIdxs = nil } diff --git a/vendor/github.com/moby/buildkit/session/secrets/secrets.pb.go b/vendor/github.com/moby/buildkit/session/secrets/secrets.pb.go index aa89213b73..950517b2e8 100644 --- a/vendor/github.com/moby/buildkit/session/secrets/secrets.pb.go +++ b/vendor/github.com/moby/buildkit/session/secrets/secrets.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 +// protoc-gen-go v1.36.6 // protoc v3.11.4 // source: github.com/moby/buildkit/session/secrets/secrets.proto @@ -11,6 +11,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -21,12 +22,11 @@ const ( ) type GetSecretRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` + Annotations map[string]string `protobuf:"bytes,2,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` unknownFields protoimpl.UnknownFields - - ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` - Annotations map[string]string `protobuf:"bytes,2,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + sizeCache protoimpl.SizeCache } func (x *GetSecretRequest) Reset() { @@ -74,11 +74,10 @@ func (x *GetSecretRequest) GetAnnotations() map[string]string { } type GetSecretResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` unknownFields protoimpl.UnknownFields - - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetSecretResponse) Reset() { @@ -120,48 +119,28 @@ func (x *GetSecretResponse) GetData() []byte { var File_github_com_moby_buildkit_session_secrets_secrets_proto protoreflect.FileDescriptor -var file_github_com_moby_buildkit_session_secrets_secrets_proto_rawDesc = []byte{ - 0x0a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, - 0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x2f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x2f, 0x73, 0x65, 0x63, 0x72, 0x65, - 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x18, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, - 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x2e, - 0x76, 0x31, 0x22, 0xc1, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x44, 0x12, 0x5d, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x6d, - 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x73, 0x65, 0x63, - 0x72, 0x65, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x3e, 0x0a, 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x27, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x53, 0x65, 0x63, - 0x72, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, - 0x6f, 0x0a, 0x07, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x12, 0x64, 0x0a, 0x09, 0x47, 0x65, - 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x2a, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, - 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x2e, - 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, - 0x6b, 0x69, 0x74, 0x2e, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, - 0x65, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x42, 0x2a, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, - 0x6f, 0x62, 0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x73, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -} +const file_github_com_moby_buildkit_session_secrets_secrets_proto_rawDesc = "" + + "\n" + + "6github.com/moby/buildkit/session/secrets/secrets.proto\x12\x18moby.buildkit.secrets.v1\"\xc1\x01\n" + + "\x10GetSecretRequest\x12\x0e\n" + + "\x02ID\x18\x01 \x01(\tR\x02ID\x12]\n" + + "\vannotations\x18\x02 \x03(\v2;.moby.buildkit.secrets.v1.GetSecretRequest.AnnotationsEntryR\vannotations\x1a>\n" + + "\x10AnnotationsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"'\n" + + "\x11GetSecretResponse\x12\x12\n" + + "\x04data\x18\x01 \x01(\fR\x04data2o\n" + + "\aSecrets\x12d\n" + + "\tGetSecret\x12*.moby.buildkit.secrets.v1.GetSecretRequest\x1a+.moby.buildkit.secrets.v1.GetSecretResponseB*Z(github.com/moby/buildkit/session/secretsb\x06proto3" var ( file_github_com_moby_buildkit_session_secrets_secrets_proto_rawDescOnce sync.Once - file_github_com_moby_buildkit_session_secrets_secrets_proto_rawDescData = file_github_com_moby_buildkit_session_secrets_secrets_proto_rawDesc + file_github_com_moby_buildkit_session_secrets_secrets_proto_rawDescData []byte ) func file_github_com_moby_buildkit_session_secrets_secrets_proto_rawDescGZIP() []byte { file_github_com_moby_buildkit_session_secrets_secrets_proto_rawDescOnce.Do(func() { - file_github_com_moby_buildkit_session_secrets_secrets_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_moby_buildkit_session_secrets_secrets_proto_rawDescData) + file_github_com_moby_buildkit_session_secrets_secrets_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_moby_buildkit_session_secrets_secrets_proto_rawDesc), len(file_github_com_moby_buildkit_session_secrets_secrets_proto_rawDesc))) }) return file_github_com_moby_buildkit_session_secrets_secrets_proto_rawDescData } @@ -192,7 +171,7 @@ func file_github_com_moby_buildkit_session_secrets_secrets_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_moby_buildkit_session_secrets_secrets_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_moby_buildkit_session_secrets_secrets_proto_rawDesc), len(file_github_com_moby_buildkit_session_secrets_secrets_proto_rawDesc)), NumEnums: 0, NumMessages: 3, NumExtensions: 0, @@ -203,7 +182,6 @@ func file_github_com_moby_buildkit_session_secrets_secrets_proto_init() { MessageInfos: file_github_com_moby_buildkit_session_secrets_secrets_proto_msgTypes, }.Build() File_github_com_moby_buildkit_session_secrets_secrets_proto = out.File - file_github_com_moby_buildkit_session_secrets_secrets_proto_rawDesc = nil file_github_com_moby_buildkit_session_secrets_secrets_proto_goTypes = nil file_github_com_moby_buildkit_session_secrets_secrets_proto_depIdxs = nil } diff --git a/vendor/github.com/moby/buildkit/session/sshforward/ssh.pb.go b/vendor/github.com/moby/buildkit/session/sshforward/ssh.pb.go index 330645a670..a696377577 100644 --- a/vendor/github.com/moby/buildkit/session/sshforward/ssh.pb.go +++ b/vendor/github.com/moby/buildkit/session/sshforward/ssh.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 +// protoc-gen-go v1.36.6 // protoc v3.11.4 // source: github.com/moby/buildkit/session/sshforward/ssh.proto @@ -11,6 +11,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -22,11 +23,10 @@ const ( // BytesMessage contains a chunk of byte data type BytesMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` unknownFields protoimpl.UnknownFields - - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + sizeCache protoimpl.SizeCache } func (x *BytesMessage) Reset() { @@ -67,11 +67,10 @@ func (x *BytesMessage) GetData() []byte { } type CheckAgentRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` unknownFields protoimpl.UnknownFields - - ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` + sizeCache protoimpl.SizeCache } func (x *CheckAgentRequest) Reset() { @@ -112,9 +111,9 @@ func (x *CheckAgentRequest) GetID() string { } type CheckAgentResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *CheckAgentResponse) Reset() { @@ -149,43 +148,27 @@ func (*CheckAgentResponse) Descriptor() ([]byte, []int) { var File_github_com_moby_buildkit_session_sshforward_ssh_proto protoreflect.FileDescriptor -var file_github_com_moby_buildkit_session_sshforward_ssh_proto_rawDesc = []byte{ - 0x0a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, - 0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x2f, 0x73, 0x73, 0x68, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x2f, 0x73, 0x73, - 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x73, 0x73, - 0x68, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x2e, 0x76, 0x31, 0x22, 0x22, 0x0a, 0x0c, 0x42, - 0x79, 0x74, 0x65, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, - 0x23, 0x0a, 0x11, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x02, 0x49, 0x44, 0x22, 0x14, 0x0a, 0x12, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x67, 0x65, - 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xba, 0x01, 0x0a, 0x03, 0x53, - 0x53, 0x48, 0x12, 0x5b, 0x0a, 0x0a, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x67, 0x65, 0x6e, 0x74, - 0x12, 0x25, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x73, 0x73, 0x68, 0x66, 0x6f, 0x72, 0x77, 0x61, - 0x72, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x67, 0x65, 0x6e, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x73, - 0x73, 0x68, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x56, 0x0a, 0x0c, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, - 0x20, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x73, 0x73, 0x68, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x1a, 0x20, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x73, 0x73, 0x68, 0x66, 0x6f, 0x72, 0x77, - 0x61, 0x72, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x28, 0x01, 0x30, 0x01, 0x42, 0x2d, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, 0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, - 0x6b, 0x69, 0x74, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x73, 0x68, 0x66, - 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_github_com_moby_buildkit_session_sshforward_ssh_proto_rawDesc = "" + + "\n" + + "5github.com/moby/buildkit/session/sshforward/ssh.proto\x12\x12moby.sshforward.v1\"\"\n" + + "\fBytesMessage\x12\x12\n" + + "\x04data\x18\x01 \x01(\fR\x04data\"#\n" + + "\x11CheckAgentRequest\x12\x0e\n" + + "\x02ID\x18\x01 \x01(\tR\x02ID\"\x14\n" + + "\x12CheckAgentResponse2\xba\x01\n" + + "\x03SSH\x12[\n" + + "\n" + + "CheckAgent\x12%.moby.sshforward.v1.CheckAgentRequest\x1a&.moby.sshforward.v1.CheckAgentResponse\x12V\n" + + "\fForwardAgent\x12 .moby.sshforward.v1.BytesMessage\x1a .moby.sshforward.v1.BytesMessage(\x010\x01B-Z+github.com/moby/buildkit/session/sshforwardb\x06proto3" var ( file_github_com_moby_buildkit_session_sshforward_ssh_proto_rawDescOnce sync.Once - file_github_com_moby_buildkit_session_sshforward_ssh_proto_rawDescData = file_github_com_moby_buildkit_session_sshforward_ssh_proto_rawDesc + file_github_com_moby_buildkit_session_sshforward_ssh_proto_rawDescData []byte ) func file_github_com_moby_buildkit_session_sshforward_ssh_proto_rawDescGZIP() []byte { file_github_com_moby_buildkit_session_sshforward_ssh_proto_rawDescOnce.Do(func() { - file_github_com_moby_buildkit_session_sshforward_ssh_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_moby_buildkit_session_sshforward_ssh_proto_rawDescData) + file_github_com_moby_buildkit_session_sshforward_ssh_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_moby_buildkit_session_sshforward_ssh_proto_rawDesc), len(file_github_com_moby_buildkit_session_sshforward_ssh_proto_rawDesc))) }) return file_github_com_moby_buildkit_session_sshforward_ssh_proto_rawDescData } @@ -217,7 +200,7 @@ func file_github_com_moby_buildkit_session_sshforward_ssh_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_moby_buildkit_session_sshforward_ssh_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_moby_buildkit_session_sshforward_ssh_proto_rawDesc), len(file_github_com_moby_buildkit_session_sshforward_ssh_proto_rawDesc)), NumEnums: 0, NumMessages: 3, NumExtensions: 0, @@ -228,7 +211,6 @@ func file_github_com_moby_buildkit_session_sshforward_ssh_proto_init() { MessageInfos: file_github_com_moby_buildkit_session_sshforward_ssh_proto_msgTypes, }.Build() File_github_com_moby_buildkit_session_sshforward_ssh_proto = out.File - file_github_com_moby_buildkit_session_sshforward_ssh_proto_rawDesc = nil file_github_com_moby_buildkit_session_sshforward_ssh_proto_goTypes = nil file_github_com_moby_buildkit_session_sshforward_ssh_proto_depIdxs = nil } diff --git a/vendor/github.com/moby/buildkit/session/upload/upload.pb.go b/vendor/github.com/moby/buildkit/session/upload/upload.pb.go index 3a9d8bb77c..f1d0ba1ec0 100644 --- a/vendor/github.com/moby/buildkit/session/upload/upload.pb.go +++ b/vendor/github.com/moby/buildkit/session/upload/upload.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 +// protoc-gen-go v1.36.6 // protoc v3.11.4 // source: github.com/moby/buildkit/session/upload/upload.proto @@ -11,6 +11,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -22,11 +23,10 @@ const ( // BytesMessage contains a chunk of byte data type BytesMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` unknownFields protoimpl.UnknownFields - - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + sizeCache protoimpl.SizeCache } func (x *BytesMessage) Reset() { @@ -68,32 +68,22 @@ func (x *BytesMessage) GetData() []byte { var File_github_com_moby_buildkit_session_upload_upload_proto protoreflect.FileDescriptor -var file_github_com_moby_buildkit_session_upload_upload_proto_rawDesc = []byte{ - 0x0a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, - 0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x2f, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x2f, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x75, 0x70, 0x6c, - 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x22, 0x22, 0x0a, 0x0c, 0x42, 0x79, 0x74, 0x65, 0x73, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0x50, 0x0a, 0x06, 0x55, 0x70, - 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x46, 0x0a, 0x04, 0x50, 0x75, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x6d, - 0x6f, 0x62, 0x79, 0x2e, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x79, - 0x74, 0x65, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x1c, 0x2e, 0x6d, 0x6f, 0x62, - 0x79, 0x2e, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x79, 0x74, 0x65, - 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x28, 0x01, 0x30, 0x01, 0x42, 0x29, 0x5a, 0x27, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, 0x79, 0x2f, - 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x2f, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_github_com_moby_buildkit_session_upload_upload_proto_rawDesc = "" + + "\n" + + "4github.com/moby/buildkit/session/upload/upload.proto\x12\x0emoby.upload.v1\"\"\n" + + "\fBytesMessage\x12\x12\n" + + "\x04data\x18\x01 \x01(\fR\x04data2P\n" + + "\x06Upload\x12F\n" + + "\x04Pull\x12\x1c.moby.upload.v1.BytesMessage\x1a\x1c.moby.upload.v1.BytesMessage(\x010\x01B)Z'github.com/moby/buildkit/session/uploadb\x06proto3" var ( file_github_com_moby_buildkit_session_upload_upload_proto_rawDescOnce sync.Once - file_github_com_moby_buildkit_session_upload_upload_proto_rawDescData = file_github_com_moby_buildkit_session_upload_upload_proto_rawDesc + file_github_com_moby_buildkit_session_upload_upload_proto_rawDescData []byte ) func file_github_com_moby_buildkit_session_upload_upload_proto_rawDescGZIP() []byte { file_github_com_moby_buildkit_session_upload_upload_proto_rawDescOnce.Do(func() { - file_github_com_moby_buildkit_session_upload_upload_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_moby_buildkit_session_upload_upload_proto_rawDescData) + file_github_com_moby_buildkit_session_upload_upload_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_moby_buildkit_session_upload_upload_proto_rawDesc), len(file_github_com_moby_buildkit_session_upload_upload_proto_rawDesc))) }) return file_github_com_moby_buildkit_session_upload_upload_proto_rawDescData } @@ -121,7 +111,7 @@ func file_github_com_moby_buildkit_session_upload_upload_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_moby_buildkit_session_upload_upload_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_moby_buildkit_session_upload_upload_proto_rawDesc), len(file_github_com_moby_buildkit_session_upload_upload_proto_rawDesc)), NumEnums: 0, NumMessages: 1, NumExtensions: 0, @@ -132,7 +122,6 @@ func file_github_com_moby_buildkit_session_upload_upload_proto_init() { MessageInfos: file_github_com_moby_buildkit_session_upload_upload_proto_msgTypes, }.Build() File_github_com_moby_buildkit_session_upload_upload_proto = out.File - file_github_com_moby_buildkit_session_upload_upload_proto_rawDesc = nil file_github_com_moby_buildkit_session_upload_upload_proto_goTypes = nil file_github_com_moby_buildkit_session_upload_upload_proto_depIdxs = nil } diff --git a/vendor/github.com/moby/buildkit/solver/errdefs/errdefs.pb.go b/vendor/github.com/moby/buildkit/solver/errdefs/errdefs.pb.go index ff9298e309..d19593d755 100644 --- a/vendor/github.com/moby/buildkit/solver/errdefs/errdefs.pb.go +++ b/vendor/github.com/moby/buildkit/solver/errdefs/errdefs.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 +// protoc-gen-go v1.36.6 // protoc v3.11.4 // source: github.com/moby/buildkit/solver/errdefs/errdefs.proto @@ -12,6 +12,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -22,11 +23,10 @@ const ( ) type Vertex struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Digest string `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"` unknownFields protoimpl.UnknownFields - - Digest string `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Vertex) Reset() { @@ -67,12 +67,11 @@ func (x *Vertex) GetDigest() string { } type Source struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Info *pb.SourceInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"` + Ranges []*pb.Range `protobuf:"bytes,2,rep,name=ranges,proto3" json:"ranges,omitempty"` unknownFields protoimpl.UnknownFields - - Info *pb.SourceInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"` - Ranges []*pb.Range `protobuf:"bytes,2,rep,name=ranges,proto3" json:"ranges,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Source) Reset() { @@ -120,12 +119,11 @@ func (x *Source) GetRanges() []*pb.Range { } type Frontend struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // frontend name e.g. dockerfile.v0 or gateway.v0 + Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` // used by the gateway frontend to identify the source, which corresponds to the image name unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // frontend name e.g. dockerfile.v0 or gateway.v0 - Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` // used by the gateway frontend to identify the source, which corresponds to the image name + sizeCache protoimpl.SizeCache } func (x *Frontend) Reset() { @@ -173,11 +171,10 @@ func (x *Frontend) GetSource() string { } type FrontendCap struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + sizeCache protoimpl.SizeCache } func (x *FrontendCap) Reset() { @@ -218,11 +215,10 @@ func (x *FrontendCap) GetName() string { } type Subrequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Subrequest) Reset() { @@ -263,19 +259,18 @@ func (x *Subrequest) GetName() string { } type Solve struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - InputIDs []string `protobuf:"bytes,1,rep,name=inputIDs,proto3" json:"inputIDs,omitempty"` - MountIDs []string `protobuf:"bytes,2,rep,name=mountIDs,proto3" json:"mountIDs,omitempty"` - Op *pb.Op `protobuf:"bytes,3,opt,name=op,proto3" json:"op,omitempty"` - // Types that are assignable to Subject: + state protoimpl.MessageState `protogen:"open.v1"` + InputIDs []string `protobuf:"bytes,1,rep,name=inputIDs,proto3" json:"inputIDs,omitempty"` + MountIDs []string `protobuf:"bytes,2,rep,name=mountIDs,proto3" json:"mountIDs,omitempty"` + Op *pb.Op `protobuf:"bytes,3,opt,name=op,proto3" json:"op,omitempty"` + // Types that are valid to be assigned to Subject: // // *Solve_File // *Solve_Cache - Subject isSolve_Subject `protobuf_oneof:"subject"` - Description map[string]string `protobuf:"bytes,6,rep,name=description,proto3" json:"description,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Subject isSolve_Subject `protobuf_oneof:"subject"` + Description map[string]string `protobuf:"bytes,6,rep,name=description,proto3" json:"description,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Solve) Reset() { @@ -329,23 +324,27 @@ func (x *Solve) GetOp() *pb.Op { return nil } -func (m *Solve) GetSubject() isSolve_Subject { - if m != nil { - return m.Subject +func (x *Solve) GetSubject() isSolve_Subject { + if x != nil { + return x.Subject } return nil } func (x *Solve) GetFile() *FileAction { - if x, ok := x.GetSubject().(*Solve_File); ok { - return x.File + if x != nil { + if x, ok := x.Subject.(*Solve_File); ok { + return x.File + } } return nil } func (x *Solve) GetCache() *ContentCache { - if x, ok := x.GetSubject().(*Solve_Cache); ok { - return x.Cache + if x != nil { + if x, ok := x.Subject.(*Solve_Cache); ok { + return x.Cache + } } return nil } @@ -374,12 +373,11 @@ func (*Solve_File) isSolve_Subject() {} func (*Solve_Cache) isSolve_Subject() {} type FileAction struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Index of the file action that failed the exec. - Index int64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` + Index int64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *FileAction) Reset() { @@ -420,12 +418,11 @@ func (x *FileAction) GetIndex() int64 { } type ContentCache struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Original index of result that failed the slow cache calculation. - Index int64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` + Index int64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ContentCache) Reset() { @@ -467,67 +464,47 @@ func (x *ContentCache) GetIndex() int64 { var File_github_com_moby_buildkit_solver_errdefs_errdefs_proto protoreflect.FileDescriptor -var file_github_com_moby_buildkit_solver_errdefs_errdefs_proto_rawDesc = []byte{ - 0x0a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, - 0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x73, 0x6f, 0x6c, 0x76, 0x65, - 0x72, 0x2f, 0x65, 0x72, 0x72, 0x64, 0x65, 0x66, 0x73, 0x2f, 0x65, 0x72, 0x72, 0x64, 0x65, 0x66, - 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x65, 0x72, 0x72, 0x64, 0x65, 0x66, 0x73, - 0x1a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, - 0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x73, 0x6f, 0x6c, 0x76, 0x65, - 0x72, 0x2f, 0x70, 0x62, 0x2f, 0x6f, 0x70, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x20, - 0x0a, 0x06, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, - 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, - 0x22, 0x4f, 0x0a, 0x06, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x22, 0x0a, 0x04, 0x69, 0x6e, - 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x21, - 0x0a, 0x06, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, - 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x06, 0x72, 0x61, 0x6e, 0x67, 0x65, - 0x73, 0x22, 0x36, 0x0a, 0x08, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x21, 0x0a, 0x0b, 0x46, 0x72, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x43, 0x61, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x20, 0x0a, 0x0a, - 0x53, 0x75, 0x62, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xbf, - 0x02, 0x0a, 0x05, 0x53, 0x6f, 0x6c, 0x76, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x70, 0x75, - 0x74, 0x49, 0x44, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x69, 0x6e, 0x70, 0x75, - 0x74, 0x49, 0x44, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x44, 0x73, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x44, 0x73, - 0x12, 0x16, 0x0a, 0x02, 0x6f, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x70, - 0x62, 0x2e, 0x4f, 0x70, 0x52, 0x02, 0x6f, 0x70, 0x12, 0x29, 0x0a, 0x04, 0x66, 0x69, 0x6c, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x65, 0x72, 0x72, 0x64, 0x65, 0x66, 0x73, - 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x04, 0x66, - 0x69, 0x6c, 0x65, 0x12, 0x2d, 0x0a, 0x05, 0x63, 0x61, 0x63, 0x68, 0x65, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x65, 0x72, 0x72, 0x64, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x48, 0x00, 0x52, 0x05, 0x63, 0x61, 0x63, - 0x68, 0x65, 0x12, 0x41, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x72, 0x72, 0x64, 0x65, 0x66, - 0x73, 0x2e, 0x53, 0x6f, 0x6c, 0x76, 0x65, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x3e, 0x0a, 0x10, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x09, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x22, 0x22, 0x0a, 0x0a, 0x46, 0x69, 0x6c, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, - 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x69, - 0x6e, 0x64, 0x65, 0x78, 0x22, 0x24, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x43, - 0x61, 0x63, 0x68, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x42, 0x29, 0x5a, 0x27, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, 0x79, 0x2f, 0x62, 0x75, - 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2f, 0x65, 0x72, - 0x72, 0x64, 0x65, 0x66, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_github_com_moby_buildkit_solver_errdefs_errdefs_proto_rawDesc = "" + + "\n" + + "5github.com/moby/buildkit/solver/errdefs/errdefs.proto\x12\aerrdefs\x1a,github.com/moby/buildkit/solver/pb/ops.proto\" \n" + + "\x06Vertex\x12\x16\n" + + "\x06digest\x18\x01 \x01(\tR\x06digest\"O\n" + + "\x06Source\x12\"\n" + + "\x04info\x18\x01 \x01(\v2\x0e.pb.SourceInfoR\x04info\x12!\n" + + "\x06ranges\x18\x02 \x03(\v2\t.pb.RangeR\x06ranges\"6\n" + + "\bFrontend\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x16\n" + + "\x06source\x18\x02 \x01(\tR\x06source\"!\n" + + "\vFrontendCap\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\" \n" + + "\n" + + "Subrequest\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\"\xbf\x02\n" + + "\x05Solve\x12\x1a\n" + + "\binputIDs\x18\x01 \x03(\tR\binputIDs\x12\x1a\n" + + "\bmountIDs\x18\x02 \x03(\tR\bmountIDs\x12\x16\n" + + "\x02op\x18\x03 \x01(\v2\x06.pb.OpR\x02op\x12)\n" + + "\x04file\x18\x04 \x01(\v2\x13.errdefs.FileActionH\x00R\x04file\x12-\n" + + "\x05cache\x18\x05 \x01(\v2\x15.errdefs.ContentCacheH\x00R\x05cache\x12A\n" + + "\vdescription\x18\x06 \x03(\v2\x1f.errdefs.Solve.DescriptionEntryR\vdescription\x1a>\n" + + "\x10DescriptionEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01B\t\n" + + "\asubject\"\"\n" + + "\n" + + "FileAction\x12\x14\n" + + "\x05index\x18\x01 \x01(\x03R\x05index\"$\n" + + "\fContentCache\x12\x14\n" + + "\x05index\x18\x01 \x01(\x03R\x05indexB)Z'github.com/moby/buildkit/solver/errdefsb\x06proto3" var ( file_github_com_moby_buildkit_solver_errdefs_errdefs_proto_rawDescOnce sync.Once - file_github_com_moby_buildkit_solver_errdefs_errdefs_proto_rawDescData = file_github_com_moby_buildkit_solver_errdefs_errdefs_proto_rawDesc + file_github_com_moby_buildkit_solver_errdefs_errdefs_proto_rawDescData []byte ) func file_github_com_moby_buildkit_solver_errdefs_errdefs_proto_rawDescGZIP() []byte { file_github_com_moby_buildkit_solver_errdefs_errdefs_proto_rawDescOnce.Do(func() { - file_github_com_moby_buildkit_solver_errdefs_errdefs_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_moby_buildkit_solver_errdefs_errdefs_proto_rawDescData) + file_github_com_moby_buildkit_solver_errdefs_errdefs_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_moby_buildkit_solver_errdefs_errdefs_proto_rawDesc), len(file_github_com_moby_buildkit_solver_errdefs_errdefs_proto_rawDesc))) }) return file_github_com_moby_buildkit_solver_errdefs_errdefs_proto_rawDescData } @@ -574,7 +551,7 @@ func file_github_com_moby_buildkit_solver_errdefs_errdefs_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_moby_buildkit_solver_errdefs_errdefs_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_moby_buildkit_solver_errdefs_errdefs_proto_rawDesc), len(file_github_com_moby_buildkit_solver_errdefs_errdefs_proto_rawDesc)), NumEnums: 0, NumMessages: 9, NumExtensions: 0, @@ -585,7 +562,6 @@ func file_github_com_moby_buildkit_solver_errdefs_errdefs_proto_init() { MessageInfos: file_github_com_moby_buildkit_solver_errdefs_errdefs_proto_msgTypes, }.Build() File_github_com_moby_buildkit_solver_errdefs_errdefs_proto = out.File - file_github_com_moby_buildkit_solver_errdefs_errdefs_proto_rawDesc = nil file_github_com_moby_buildkit_solver_errdefs_errdefs_proto_goTypes = nil file_github_com_moby_buildkit_solver_errdefs_errdefs_proto_depIdxs = nil } diff --git a/vendor/github.com/moby/buildkit/solver/exporter.go b/vendor/github.com/moby/buildkit/solver/exporter.go index 5f040f75d0..b1f758f92f 100644 --- a/vendor/github.com/moby/buildkit/solver/exporter.go +++ b/vendor/github.com/moby/buildkit/solver/exporter.go @@ -2,6 +2,8 @@ package solver import ( "context" + "errors" + "slices" digest "github.com/opencontainers/go-digest" ) @@ -102,18 +104,29 @@ func (e *exporter) ExportTo(ctx context.Context, t CacheExporterTarget, opt Cach exportRecord = true } - if e.record == nil && exportRecord { - e.record = getBestResult(e.records) - } + records := slices.Clone(e.records) + slices.SortStableFunc(records, compareCacheRecord) var remote *Remote - if v := e.record; v != nil && exportRecord && addRecord { + var i int + for exportRecord && addRecord { var variants []CacheExporterRecord - + v := e.record + if v == nil { + if i < len(records) { + v = records[i] + i++ + } else { + break + } + } cm := v.cacheManager key := cm.getID(v.key) res, err := cm.backend.Load(key, v.ID) if err != nil { + if errors.Is(err, ErrNotFound) { + continue + } return nil, err } @@ -160,6 +173,7 @@ func (e *exporter) ExportTo(ctx context.Context, t CacheExporterTarget, opt Cach } } allRec = append(allRec, variants...) + break } if remote != nil && opt.Mode == CacheExportModeMin { @@ -228,13 +242,28 @@ func (e *exporter) ExportTo(ctx context.Context, t CacheExporterTarget, opt Cach } func getBestResult(records []*CacheRecord) *CacheRecord { - var rec *CacheRecord - for _, r := range records { - if rec == nil || rec.CreatedAt.Before(r.CreatedAt) || (rec.CreatedAt.Equal(r.CreatedAt) && rec.Priority < r.Priority) { - rec = r - } + records = slices.Clone(records) + slices.SortStableFunc(records, compareCacheRecord) + if len(records) == 0 { + return nil } - return rec + return records[0] +} + +func compareCacheRecord(a, b *CacheRecord) int { + if a == nil && b == nil { + return 0 + } + if a == nil { + return 1 + } + if b == nil { + return -1 + } + if v := b.CreatedAt.Compare(a.CreatedAt); v != 0 { + return v + } + return a.Priority - b.Priority } type mergedExporter struct { diff --git a/vendor/github.com/moby/buildkit/solver/jobs.go b/vendor/github.com/moby/buildkit/solver/jobs.go index 2e4a95475b..cffe360afc 100644 --- a/vendor/github.com/moby/buildkit/solver/jobs.go +++ b/vendor/github.com/moby/buildkit/solver/jobs.go @@ -54,6 +54,7 @@ type state struct { mpw *progress.MultiWriter allPw map[progress.Writer]struct{} + allPwMu sync.Mutex // protects allPw mspan *tracing.MultiSpan execSpan trace.Span @@ -180,10 +181,12 @@ func (s *state) setEdge(index Index, targetEdge *edge, targetState *state) { if targetState != nil { targetState.addJobs(s, map[*state]struct{}{}) + targetState.allPwMu.Lock() if _, ok := targetState.allPw[s.mpw]; !ok { targetState.mpw.Add(s.mpw) targetState.allPw[s.mpw] = struct{}{} } + targetState.allPwMu.Unlock() } } @@ -297,6 +300,7 @@ func (sb *subBuilder) EachValue(ctx context.Context, key string, fn func(any) er } type Job struct { + mu sync.Mutex // protects completedTime, pw, span list *Solver pr *progress.MultiReader pw progress.Writer @@ -580,14 +584,20 @@ func (jl *Solver) loadUnlocked(ctx context.Context, v, parent Vertex, j *Job, ca func (jl *Solver) connectProgressFromState(target, src *state) { for j := range src.jobs { - if _, ok := target.allPw[j.pw]; !ok { - target.mpw.Add(j.pw) - target.allPw[j.pw] = struct{}{} - j.pw.Write(identity.NewID(), target.clientVertex) - if j.span != nil && j.span.SpanContext().IsValid() { - target.mspan.Add(j.span) + j.mu.Lock() + pw := j.pw + span := j.span + j.mu.Unlock() + target.allPwMu.Lock() + if _, ok := target.allPw[pw]; !ok { + target.mpw.Add(pw) + target.allPw[pw] = struct{}{} + pw.Write(identity.NewID(), target.clientVertex) + if span != nil && span.SpanContext().IsValid() { + target.mspan.Add(span) } } + target.allPwMu.Unlock() } for p := range src.parents { jl.connectProgressFromState(target, jl.actives[p]) @@ -693,7 +703,9 @@ func (jl *Solver) deleteIfUnreferenced(k digest.Digest, st *state) { func (j *Job) Build(ctx context.Context, e Edge) (CachedResultWithProvenance, error) { if span := trace.SpanFromContext(ctx); span.SpanContext().IsValid() { + j.mu.Lock() j.span = span + j.mu.Unlock() } v, err := j.list.load(ctx, e.Vertex, nil, j) @@ -796,6 +808,8 @@ func (j *Job) StartedTime() time.Time { } func (j *Job) RegisterCompleteTime() time.Time { + j.mu.Lock() + defer j.mu.Unlock() if j.completedTime.IsZero() { j.completedTime = time.Now() } diff --git a/vendor/github.com/moby/buildkit/solver/llbsolver/file/backend.go b/vendor/github.com/moby/buildkit/solver/llbsolver/file/backend.go index 61550b84fb..c4a512ffba 100644 --- a/vendor/github.com/moby/buildkit/solver/llbsolver/file/backend.go +++ b/vendor/github.com/moby/buildkit/solver/llbsolver/file/backend.go @@ -255,7 +255,7 @@ func docopy(ctx context.Context, src, dest string, action *pb.FileActionCopy, u for _, s := range m { if action.AttemptUnpackDockerCompatibility { - if ok, err := unpack(src, s, dest, destPath, ch, timestampToTime(action.Timestamp), idmap); err != nil { + if ok, err := unpack(src, s, dest, destPath, ch, u, timestampToTime(action.Timestamp), idmap); err != nil { return errors.WithStack(err) } else if ok { continue diff --git a/vendor/github.com/moby/buildkit/solver/llbsolver/file/unpack.go b/vendor/github.com/moby/buildkit/solver/llbsolver/file/unpack.go index d8698b7800..de27705004 100644 --- a/vendor/github.com/moby/buildkit/solver/llbsolver/file/unpack.go +++ b/vendor/github.com/moby/buildkit/solver/llbsolver/file/unpack.go @@ -13,7 +13,7 @@ import ( copy "github.com/tonistiigi/fsutil/copy" ) -func unpack(srcRoot string, src string, destRoot string, dest string, ch copy.Chowner, tm *time.Time, idmap *user.IdentityMapping) (bool, error) { +func unpack(srcRoot string, src string, destRoot string, dest string, ch copy.Chowner, u *copy.User, tm *time.Time, idmap *user.IdentityMapping) (bool, error) { src, err := fs.RootPath(srcRoot, src) if err != nil { return false, err @@ -42,6 +42,12 @@ func unpack(srcRoot string, src string, destRoot string, dest string, ch copy.Ch if idmap != nil { opts.IDMap = *idmap } + if u != nil { + opts.ChownOpts = &archive.ChownOpts{ + UID: u.UID, + GID: u.GID, + } + } return true, chrootarchive.Untar(file, dest, opts) } diff --git a/vendor/github.com/moby/buildkit/solver/llbsolver/proc/provenance.go b/vendor/github.com/moby/buildkit/solver/llbsolver/proc/provenance.go index 618906866c..f32ab4fd96 100644 --- a/vendor/github.com/moby/buildkit/solver/llbsolver/proc/provenance.go +++ b/vendor/github.com/moby/buildkit/solver/llbsolver/proc/provenance.go @@ -5,18 +5,18 @@ import ( "encoding/json" "strconv" - slsa02 "github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/v0.2" "github.com/moby/buildkit/executor/resources" "github.com/moby/buildkit/exporter/containerimage/exptypes" gatewaypb "github.com/moby/buildkit/frontend/gateway/pb" "github.com/moby/buildkit/solver" "github.com/moby/buildkit/solver/llbsolver" + provenancetypes "github.com/moby/buildkit/solver/llbsolver/provenance/types" "github.com/moby/buildkit/solver/result" "github.com/moby/buildkit/util/tracing" "github.com/pkg/errors" ) -func ProvenanceProcessor(attrs map[string]string) llbsolver.Processor { +func ProvenanceProcessor(slsaVersion provenancetypes.ProvenanceSLSA, attrs map[string]string) llbsolver.Processor { return func(ctx context.Context, res *llbsolver.Result, s *llbsolver.Solver, j *solver.Job, usage *resources.SysSampler) (*llbsolver.Result, error) { span, ctx := tracing.StartSpan(ctx, "create provenance attestation") defer span.End() @@ -46,7 +46,7 @@ func ProvenanceProcessor(attrs map[string]string) llbsolver.Processor { return nil, errors.Errorf("could not find ref %s", p.ID) } - pc, err := llbsolver.NewProvenanceCreator(ctx, cp, ref, attrs, j, usage) + pc, err := llbsolver.NewProvenanceCreator(ctx, slsaVersion, cp, ref, attrs, j, usage) if err != nil { return nil, err } @@ -63,7 +63,7 @@ func ProvenanceProcessor(attrs map[string]string) llbsolver.Processor { result.AttestationInlineOnlyKey: []byte(strconv.FormatBool(inlineOnly)), }, InToto: result.InTotoAttestation{ - PredicateType: slsa02.PredicateSLSAProvenance, + PredicateType: pc.PredicateType(), }, Path: filename, ContentFunc: func(ctx context.Context) ([]byte, error) { diff --git a/vendor/github.com/moby/buildkit/solver/llbsolver/provenance.go b/vendor/github.com/moby/buildkit/solver/llbsolver/provenance.go index e3423a764f..627b3a0e95 100644 --- a/vendor/github.com/moby/buildkit/solver/llbsolver/provenance.go +++ b/vendor/github.com/moby/buildkit/solver/llbsolver/provenance.go @@ -9,6 +9,8 @@ import ( "time" "github.com/containerd/platforms" + slsa02 "github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/v0.2" + slsa1 "github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/v1" "github.com/moby/buildkit/cache" "github.com/moby/buildkit/cache/config" "github.com/moby/buildkit/client/llb/sourceresolver" @@ -330,13 +332,14 @@ func captureProvenance(ctx context.Context, res solver.CachedResultWithProvenanc } type ProvenanceCreator struct { - pr *provenancetypes.ProvenancePredicate - j *solver.Job - sampler *resources.SysSampler - addLayers func(context.Context) error + pr *provenancetypes.ProvenancePredicateSLSA02 + slsaVersion provenancetypes.ProvenanceSLSA + j *solver.Job + sampler *resources.SysSampler + addLayers func(context.Context) error } -func NewProvenanceCreator(ctx context.Context, cp *provenance.Capture, res solver.ResultProxy, attrs map[string]string, j *solver.Job, usage *resources.SysSampler) (*ProvenanceCreator, error) { +func NewProvenanceCreator(ctx context.Context, slsaVersion provenancetypes.ProvenanceSLSA, cp *provenance.Capture, res solver.ResultProxy, attrs map[string]string, j *solver.Job, usage *resources.SysSampler) (*ProvenanceCreator, error) { var reproducible bool if v, ok := attrs["reproducible"]; ok { b, err := strconv.ParseBool(v) @@ -437,9 +440,8 @@ func NewProvenanceCreator(ctx context.Context, cp *provenance.Capture, res solve if len(m) != 0 { if pr.Metadata == nil { - pr.Metadata = &provenancetypes.ProvenanceMetadata{} + pr.Metadata = &provenancetypes.ProvenanceMetadataSLSA02{} } - pr.Metadata.BuildKitMetadata.Layers = m } @@ -450,9 +452,10 @@ func NewProvenanceCreator(ctx context.Context, cp *provenance.Capture, res solve } pc := &ProvenanceCreator{ - pr: pr, - j: j, - addLayers: addLayers, + pr: pr, + slsaVersion: slsaVersion, + j: j, + addLayers: addLayers, } if withUsage { pc.sampler = usage @@ -460,7 +463,14 @@ func NewProvenanceCreator(ctx context.Context, cp *provenance.Capture, res solve return pc, nil } -func (p *ProvenanceCreator) Predicate(ctx context.Context) (*provenancetypes.ProvenancePredicate, error) { +func (p *ProvenanceCreator) PredicateType() string { + if p.slsaVersion == provenancetypes.ProvenanceSLSA1 { + return slsa1.PredicateSLSAProvenance + } + return slsa02.PredicateSLSAProvenance +} + +func (p *ProvenanceCreator) Predicate(ctx context.Context) (any, error) { end := p.j.RegisterCompleteTime() p.pr.Metadata.BuildFinishedOn = &end @@ -478,6 +488,10 @@ func (p *ProvenanceCreator) Predicate(ctx context.Context) (*provenancetypes.Pro p.pr.Metadata.BuildKitMetadata.SysUsage = sysSamples } + if p.slsaVersion == provenancetypes.ProvenanceSLSA1 { + return provenancetypes.ConvertSLSA02ToSLSA1(p.pr), nil + } + return p.pr, nil } @@ -553,7 +567,7 @@ func resolveRemotes(ctx context.Context, res solver.Result) ([]*solver.Remote, e return remotes, nil } -func AddBuildConfig(ctx context.Context, p *provenancetypes.ProvenancePredicate, c *provenance.Capture, rp solver.ResultProxy, withUsage bool) (map[digest.Digest]int, error) { +func AddBuildConfig(ctx context.Context, p *provenancetypes.ProvenancePredicateSLSA02, c *provenance.Capture, rp solver.ResultProxy, withUsage bool) (map[digest.Digest]int, error) { def := rp.Definition() steps, indexes, err := toBuildSteps(def, c, withUsage) if err != nil { @@ -595,7 +609,7 @@ func AddBuildConfig(ctx context.Context, p *provenancetypes.ProvenancePredicate, } if p.Metadata == nil { - p.Metadata = &provenancetypes.ProvenanceMetadata{} + p.Metadata = &provenancetypes.ProvenanceMetadataSLSA02{} } p.Metadata.BuildKitMetadata.Source = &provenancetypes.Source{ Infos: sis, diff --git a/vendor/github.com/moby/buildkit/solver/llbsolver/provenance/predicate.go b/vendor/github.com/moby/buildkit/solver/llbsolver/provenance/predicate.go index 365ad2c7c2..9dbdec6fd7 100644 --- a/vendor/github.com/moby/buildkit/solver/llbsolver/provenance/predicate.go +++ b/vendor/github.com/moby/buildkit/solver/llbsolver/provenance/predicate.go @@ -83,12 +83,12 @@ func findMaterial(srcs provenancetypes.Sources, uri string) (*slsa.ProvenanceMat return nil, false } -func NewPredicate(c *Capture) (*provenancetypes.ProvenancePredicate, error) { +func NewPredicate(c *Capture) (*provenancetypes.ProvenancePredicateSLSA02, error) { materials, err := slsaMaterials(c.Sources) if err != nil { return nil, err } - inv := provenancetypes.ProvenanceInvocation{} + inv := provenancetypes.ProvenanceInvocationSLSA02{} contextKey := "context" if v, ok := c.Args["contextkey"]; ok && v != "" { @@ -154,13 +154,13 @@ func NewPredicate(c *Capture) (*provenancetypes.ProvenancePredicate, error) { } } - pr := &provenancetypes.ProvenancePredicate{ + pr := &provenancetypes.ProvenancePredicateSLSA02{ Invocation: inv, ProvenancePredicate: slsa02.ProvenancePredicate{ BuildType: provenancetypes.BuildKitBuildType, Materials: materials, }, - Metadata: &provenancetypes.ProvenanceMetadata{ + Metadata: &provenancetypes.ProvenanceMetadataSLSA02{ ProvenanceMetadata: slsa02.ProvenanceMetadata{ Completeness: slsa02.ProvenanceComplete{ Parameters: c.Frontend != "", diff --git a/vendor/github.com/moby/buildkit/solver/llbsolver/provenance/types/types.go b/vendor/github.com/moby/buildkit/solver/llbsolver/provenance/types/types.go index debc74587f..869ad0b5b1 100644 --- a/vendor/github.com/moby/buildkit/solver/llbsolver/provenance/types/types.go +++ b/vendor/github.com/moby/buildkit/solver/llbsolver/provenance/types/types.go @@ -1,11 +1,16 @@ package types import ( + "slices" + + slsa "github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/common" slsa02 "github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/v0.2" + slsa1 "github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/v1" resourcestypes "github.com/moby/buildkit/executor/resources/types" "github.com/moby/buildkit/solver/pb" digest "github.com/opencontainers/go-digest" ocispecs "github.com/opencontainers/image-spec/specs-go/v1" + "github.com/pkg/errors" ) const ( @@ -75,19 +80,88 @@ type Sources struct { Local []LocalSource } -type ProvenancePredicate struct { - slsa02.ProvenancePredicate - Invocation ProvenanceInvocation `json:"invocation,omitempty"` - BuildConfig *BuildConfig `json:"buildConfig,omitempty"` - Metadata *ProvenanceMetadata `json:"metadata,omitempty"` +const ( + ProvenanceSLSA1 = ProvenanceSLSA("v1") + ProvenanceSLSA02 = ProvenanceSLSA("v0.2") +) + +type ProvenanceSLSA string + +var provenanceSLSAs = []ProvenanceSLSA{ + ProvenanceSLSA1, + ProvenanceSLSA02, } -type ProvenanceInvocation struct { +func (ps *ProvenanceSLSA) Validate() error { + if *ps == "" { + return errors.New("provenance SLSA version cannot be empty") + } + if slices.Contains(provenanceSLSAs, *ps) { + return nil + } + return errors.New("invalid provenance SLSA version: " + string(*ps)) +} + +type ProvenancePredicateSLSA02 struct { + slsa02.ProvenancePredicate + Invocation ProvenanceInvocationSLSA02 `json:"invocation,omitempty"` + BuildConfig *BuildConfig `json:"buildConfig,omitempty"` + Metadata *ProvenanceMetadataSLSA02 `json:"metadata,omitempty"` +} + +type ProvenanceInvocationSLSA02 struct { ConfigSource slsa02.ConfigSource `json:"configSource,omitempty"` Parameters Parameters `json:"parameters,omitempty"` Environment Environment `json:"environment,omitempty"` } +type ProvenanceMetadataSLSA02 struct { + slsa02.ProvenanceMetadata + BuildKitMetadata BuildKitMetadata `json:"https://mobyproject.org/buildkit@v1#metadata,omitempty"` + Hermetic bool `json:"https://mobyproject.org/buildkit@v1#hermetic,omitempty"` +} + +type ProvenancePredicateSLSA1 struct { + slsa1.ProvenancePredicate + BuildDefinition ProvenanceBuildDefinitionSLSA1 `json:"buildDefinition,omitempty"` + RunDetails ProvenanceRunDetailsSLSA1 `json:"runDetails,omitempty"` +} + +type ProvenanceBuildDefinitionSLSA1 struct { + slsa1.ProvenanceBuildDefinition + ExternalParameters ProvenanceExternalParametersSLSA1 `json:"externalParameters,omitempty"` + InternalParameters ProvenanceInternalParametersSLSA1 `json:"internalParameters,omitempty"` +} + +type ProvenanceRunDetailsSLSA1 struct { + slsa1.ProvenanceRunDetails + Metadata *ProvenanceMetadataSLSA1 `json:"metadata,omitempty"` +} + +type ProvenanceExternalParametersSLSA1 struct { + ConfigSource ProvenanceConfigSourceSLSA1 `json:"configSource,omitempty"` + Request Parameters `json:"request,omitempty"` +} + +type ProvenanceConfigSourceSLSA1 struct { + URI string `json:"uri,omitempty"` + Digest slsa.DigestSet `json:"digest,omitempty"` + Path string `json:"path,omitempty"` +} + +type ProvenanceInternalParametersSLSA1 struct { + BuildConfig *BuildConfig `json:"buildConfig,omitempty"` + BuilderPlatform string `json:"builderPlatform"` +} + +type ProvenanceMetadataSLSA1 struct { + slsa1.BuildMetadata + BuildKitMetadata BuildKitMetadata `json:"buildkit_metadata,omitempty"` + Hermetic bool `json:"buildkit_hermetic,omitempty"` + Completeness BuildKitComplete `json:"buildkit_completeness,omitempty"` + Reproducible bool `json:"buildkit_reproducible,omitempty"` +} + type Parameters struct { Frontend string `json:"frontend,omitempty"` Args map[string]string `json:"args,omitempty"` @@ -102,15 +176,86 @@ type Environment struct { Platform string `json:"platform"` } -type ProvenanceMetadata struct { - slsa02.ProvenanceMetadata - BuildKitMetadata BuildKitMetadata `json:"https://mobyproject.org/buildkit@v1#metadata,omitempty"` - Hermetic bool `json:"https://mobyproject.org/buildkit@v1#hermetic,omitempty"` -} - type BuildKitMetadata struct { VCS map[string]string `json:"vcs,omitempty"` Source *Source `json:"source,omitempty"` Layers map[string][][]ocispecs.Descriptor `json:"layers,omitempty"` SysUsage []*resourcestypes.SysSample `json:"sysUsage,omitempty"` } + +type BuildKitComplete struct { + Request bool `json:"request"` + ResolvedDependencies bool `json:"resolvedDependencies"` +} + +// ConvertSLSA02ToSLSA1 converts a SLSA 0.2 provenance predicate to a SLSA 1.0 +// provenance predicate. +// FIXME: It should be the other way around when v1 is the default. +func ConvertSLSA02ToSLSA1(p02 *ProvenancePredicateSLSA02) *ProvenancePredicateSLSA1 { + if p02 == nil { + return nil + } + + var resolvedDeps []slsa1.ResourceDescriptor + for _, m := range p02.Materials { + resolvedDeps = append(resolvedDeps, slsa1.ResourceDescriptor{ + URI: m.URI, + Digest: m.Digest, + }) + } + + buildDef := ProvenanceBuildDefinitionSLSA1{ + ProvenanceBuildDefinition: slsa1.ProvenanceBuildDefinition{ + BuildType: "https://github.com/moby/buildkit/blob/master/docs/attestations/slsa-definitions.md", + ResolvedDependencies: resolvedDeps, + }, + ExternalParameters: ProvenanceExternalParametersSLSA1{ + ConfigSource: ProvenanceConfigSourceSLSA1{ + URI: p02.Invocation.ConfigSource.URI, + Digest: p02.Invocation.ConfigSource.Digest, + Path: p02.Invocation.ConfigSource.EntryPoint, + }, + Request: p02.Invocation.Parameters, + }, + InternalParameters: ProvenanceInternalParametersSLSA1{ + BuildConfig: p02.BuildConfig, + BuilderPlatform: p02.Invocation.Environment.Platform, + }, + } + + var meta *ProvenanceMetadataSLSA1 + if p02.Metadata != nil { + meta = &ProvenanceMetadataSLSA1{ + BuildMetadata: slsa1.BuildMetadata{ + InvocationID: p02.Metadata.BuildInvocationID, + StartedOn: p02.Metadata.BuildStartedOn, + FinishedOn: p02.Metadata.BuildFinishedOn, + }, + BuildKitMetadata: p02.Metadata.BuildKitMetadata, + Hermetic: p02.Metadata.Hermetic, + Completeness: BuildKitComplete{ + Request: p02.Metadata.Completeness.Parameters, + ResolvedDependencies: p02.Metadata.Completeness.Materials, + }, + Reproducible: p02.Metadata.Reproducible, + } + } + + runDetails := ProvenanceRunDetailsSLSA1{ + ProvenanceRunDetails: slsa1.ProvenanceRunDetails{ + Builder: slsa1.Builder{ + ID: p02.Builder.ID, + // TODO: handle builder components versions + // Version: map[string]string{ + // "buildkit": version.Version, + // }, + }, + }, + Metadata: meta, + } + + return &ProvenancePredicateSLSA1{ + BuildDefinition: buildDef, + RunDetails: runDetails, + } +} diff --git a/vendor/github.com/moby/buildkit/solver/llbsolver/solver.go b/vendor/github.com/moby/buildkit/solver/llbsolver/solver.go index 36fc7fd085..11b100780c 100644 --- a/vendor/github.com/moby/buildkit/solver/llbsolver/solver.go +++ b/vendor/github.com/moby/buildkit/solver/llbsolver/solver.go @@ -6,12 +6,12 @@ import ( "fmt" "maps" "os" + "strconv" "strings" "sync" "time" intoto "github.com/in-toto/in-toto-golang/in_toto" - slsa02 "github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/v0.2" controlapi "github.com/moby/buildkit/api/services/control" "github.com/moby/buildkit/cache" cacheconfig "github.com/moby/buildkit/cache/config" @@ -32,6 +32,7 @@ import ( sessionexporter "github.com/moby/buildkit/session/exporter" "github.com/moby/buildkit/solver" "github.com/moby/buildkit/solver/llbsolver/provenance" + provenancetypes "github.com/moby/buildkit/solver/llbsolver/provenance/types" "github.com/moby/buildkit/solver/result" spb "github.com/moby/buildkit/sourcepolicy/pb" "github.com/moby/buildkit/util/bklog" @@ -229,15 +230,22 @@ func (s *Solver) recordBuildHistory(ctx context.Context, id string, req frontend } } + slsaVersion := provenancetypes.ProvenanceSLSA02 + if v, ok := req.FrontendOpt["build-arg:BUILDKIT_HISTORY_PROVENANCE_V1"]; ok { + if b, err := strconv.ParseBool(v); err == nil && b { + slsaVersion = provenancetypes.ProvenanceSLSA1 + } + } + makeProvenance := func(name string, res solver.ResultProxy, cap *provenance.Capture) (*controlapi.Descriptor, func(), error) { span, ctx := tracing.StartSpan(ctx, fmt.Sprintf("create %s history provenance", name)) defer span.End() - prc, err := NewProvenanceCreator(ctx2, cap, res, attrs, j, usage) + pc, err := NewProvenanceCreator(ctx2, slsaVersion, cap, res, attrs, j, usage) if err != nil { return nil, nil, err } - pr, err := prc.Predicate(ctx) + pr, err := pc.Predicate(ctx) if err != nil { return nil, nil, err } @@ -267,7 +275,7 @@ func (s *Solver) recordBuildHistory(ctx context.Context, id string, req frontend Size: desc.Size, MediaType: desc.MediaType, Annotations: map[string]string{ - "in-toto.io/predicate-type": slsa02.PredicateSLSAProvenance, + "in-toto.io/predicate-type": pc.PredicateType(), }, }, release, nil } @@ -933,6 +941,7 @@ func addProvenanceToResult(res *frontend.Result, br *provenanceBridge) (*Result, } for k, ref := range res.Refs { if ref == nil { + out.Provenance.Refs[k] = nil continue } cp, err := getProvenance(ref, reqs.refs[k].bridge, k, reqs) diff --git a/vendor/github.com/moby/buildkit/solver/pb/ops.pb.go b/vendor/github.com/moby/buildkit/solver/pb/ops.pb.go index 4acac63c24..db85d91c24 100644 --- a/vendor/github.com/moby/buildkit/solver/pb/ops.pb.go +++ b/vendor/github.com/moby/buildkit/solver/pb/ops.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 +// protoc-gen-go v1.36.6 // protoc v3.11.4 // source: github.com/moby/buildkit/solver/pb/ops.proto @@ -14,6 +14,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -279,14 +280,11 @@ func (CacheSharingOpt) EnumDescriptor() ([]byte, []int) { // Op represents a vertex of the LLB DAG. type Op struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // changes to this structure must be represented in json.go. // inputs is a set of input edges. Inputs []*Input `protobuf:"bytes,1,rep,name=inputs,proto3" json:"inputs,omitempty"` - // Types that are assignable to Op: + // Types that are valid to be assigned to Op: // // *Op_Exec // *Op_Source @@ -294,9 +292,11 @@ type Op struct { // *Op_Build // *Op_Merge // *Op_Diff - Op isOp_Op `protobuf_oneof:"op"` - Platform *Platform `protobuf:"bytes,10,opt,name=platform,proto3" json:"platform,omitempty"` - Constraints *WorkerConstraints `protobuf:"bytes,11,opt,name=constraints,proto3" json:"constraints,omitempty"` + Op isOp_Op `protobuf_oneof:"op"` + Platform *Platform `protobuf:"bytes,10,opt,name=platform,proto3" json:"platform,omitempty"` + Constraints *WorkerConstraints `protobuf:"bytes,11,opt,name=constraints,proto3" json:"constraints,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Op) Reset() { @@ -336,51 +336,63 @@ func (x *Op) GetInputs() []*Input { return nil } -func (m *Op) GetOp() isOp_Op { - if m != nil { - return m.Op +func (x *Op) GetOp() isOp_Op { + if x != nil { + return x.Op } return nil } func (x *Op) GetExec() *ExecOp { - if x, ok := x.GetOp().(*Op_Exec); ok { - return x.Exec + if x != nil { + if x, ok := x.Op.(*Op_Exec); ok { + return x.Exec + } } return nil } func (x *Op) GetSource() *SourceOp { - if x, ok := x.GetOp().(*Op_Source); ok { - return x.Source + if x != nil { + if x, ok := x.Op.(*Op_Source); ok { + return x.Source + } } return nil } func (x *Op) GetFile() *FileOp { - if x, ok := x.GetOp().(*Op_File); ok { - return x.File + if x != nil { + if x, ok := x.Op.(*Op_File); ok { + return x.File + } } return nil } func (x *Op) GetBuild() *BuildOp { - if x, ok := x.GetOp().(*Op_Build); ok { - return x.Build + if x != nil { + if x, ok := x.Op.(*Op_Build); ok { + return x.Build + } } return nil } func (x *Op) GetMerge() *MergeOp { - if x, ok := x.GetOp().(*Op_Merge); ok { - return x.Merge + if x != nil { + if x, ok := x.Op.(*Op_Merge); ok { + return x.Merge + } } return nil } func (x *Op) GetDiff() *DiffOp { - if x, ok := x.GetOp().(*Op_Diff); ok { - return x.Diff + if x != nil { + if x, ok := x.Op.(*Op_Diff); ok { + return x.Diff + } } return nil } @@ -441,15 +453,14 @@ func (*Op_Diff) isOp_Op() {} // Platform is github.com/opencontainers/image-spec/specs-go/v1.Platform type Platform struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Architecture string `protobuf:"bytes,1,opt,name=Architecture,proto3" json:"Architecture,omitempty"` + OS string `protobuf:"bytes,2,opt,name=OS,proto3" json:"OS,omitempty"` + Variant string `protobuf:"bytes,3,opt,name=Variant,proto3" json:"Variant,omitempty"` + OSVersion string `protobuf:"bytes,4,opt,name=OSVersion,proto3" json:"OSVersion,omitempty"` + OSFeatures []string `protobuf:"bytes,5,rep,name=OSFeatures,proto3" json:"OSFeatures,omitempty"` // unused unknownFields protoimpl.UnknownFields - - Architecture string `protobuf:"bytes,1,opt,name=Architecture,proto3" json:"Architecture,omitempty"` - OS string `protobuf:"bytes,2,opt,name=OS,proto3" json:"OS,omitempty"` - Variant string `protobuf:"bytes,3,opt,name=Variant,proto3" json:"Variant,omitempty"` - OSVersion string `protobuf:"bytes,4,opt,name=OSVersion,proto3" json:"OSVersion,omitempty"` - OSFeatures []string `protobuf:"bytes,5,rep,name=OSFeatures,proto3" json:"OSFeatures,omitempty"` // unused + sizeCache protoimpl.SizeCache } func (x *Platform) Reset() { @@ -519,14 +530,13 @@ func (x *Platform) GetOSFeatures() []string { // Input represents an input edge for an Op. type Input struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // digest of the marshaled input Op Digest string `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"` // output index of the input Op - Index int64 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` + Index int64 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Input) Reset() { @@ -575,16 +585,15 @@ func (x *Input) GetIndex() int64 { // ExecOp executes a command in a container. type ExecOp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Meta *Meta `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta,omitempty"` + Mounts []*Mount `protobuf:"bytes,2,rep,name=mounts,proto3" json:"mounts,omitempty"` + Network NetMode `protobuf:"varint,3,opt,name=network,proto3,enum=pb.NetMode" json:"network,omitempty"` + Security SecurityMode `protobuf:"varint,4,opt,name=security,proto3,enum=pb.SecurityMode" json:"security,omitempty"` + Secretenv []*SecretEnv `protobuf:"bytes,5,rep,name=secretenv,proto3" json:"secretenv,omitempty"` + CdiDevices []*CDIDevice `protobuf:"bytes,6,rep,name=cdiDevices,proto3" json:"cdiDevices,omitempty"` unknownFields protoimpl.UnknownFields - - Meta *Meta `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta,omitempty"` - Mounts []*Mount `protobuf:"bytes,2,rep,name=mounts,proto3" json:"mounts,omitempty"` - Network NetMode `protobuf:"varint,3,opt,name=network,proto3,enum=pb.NetMode" json:"network,omitempty"` - Security SecurityMode `protobuf:"varint,4,opt,name=security,proto3,enum=pb.SecurityMode" json:"security,omitempty"` - Secretenv []*SecretEnv `protobuf:"bytes,5,rep,name=secretenv,proto3" json:"secretenv,omitempty"` - CdiDevices []*CDIDevice `protobuf:"bytes,6,rep,name=cdiDevices,proto3" json:"cdiDevices,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ExecOp) Reset() { @@ -663,21 +672,20 @@ func (x *ExecOp) GetCdiDevices() []*CDIDevice { // Meta is unrelated to LLB metadata. // FIXME: rename (ExecContext? ExecArgs?) type Meta struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Args []string `protobuf:"bytes,1,rep,name=args,proto3" json:"args,omitempty"` - Env []string `protobuf:"bytes,2,rep,name=env,proto3" json:"env,omitempty"` - Cwd string `protobuf:"bytes,3,opt,name=cwd,proto3" json:"cwd,omitempty"` - User string `protobuf:"bytes,4,opt,name=user,proto3" json:"user,omitempty"` - ProxyEnv *ProxyEnv `protobuf:"bytes,5,opt,name=proxy_env,json=proxyEnv,proto3" json:"proxy_env,omitempty"` - ExtraHosts []*HostIP `protobuf:"bytes,6,rep,name=extraHosts,proto3" json:"extraHosts,omitempty"` - Hostname string `protobuf:"bytes,7,opt,name=hostname,proto3" json:"hostname,omitempty"` - Ulimit []*Ulimit `protobuf:"bytes,9,rep,name=ulimit,proto3" json:"ulimit,omitempty"` - CgroupParent string `protobuf:"bytes,10,opt,name=cgroupParent,proto3" json:"cgroupParent,omitempty"` - RemoveMountStubsRecursive bool `protobuf:"varint,11,opt,name=removeMountStubsRecursive,proto3" json:"removeMountStubsRecursive,omitempty"` - ValidExitCodes []int32 `protobuf:"varint,12,rep,packed,name=validExitCodes,proto3" json:"validExitCodes,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Args []string `protobuf:"bytes,1,rep,name=args,proto3" json:"args,omitempty"` + Env []string `protobuf:"bytes,2,rep,name=env,proto3" json:"env,omitempty"` + Cwd string `protobuf:"bytes,3,opt,name=cwd,proto3" json:"cwd,omitempty"` + User string `protobuf:"bytes,4,opt,name=user,proto3" json:"user,omitempty"` + ProxyEnv *ProxyEnv `protobuf:"bytes,5,opt,name=proxy_env,json=proxyEnv,proto3" json:"proxy_env,omitempty"` + ExtraHosts []*HostIP `protobuf:"bytes,6,rep,name=extraHosts,proto3" json:"extraHosts,omitempty"` + Hostname string `protobuf:"bytes,7,opt,name=hostname,proto3" json:"hostname,omitempty"` + Ulimit []*Ulimit `protobuf:"bytes,9,rep,name=ulimit,proto3" json:"ulimit,omitempty"` + CgroupParent string `protobuf:"bytes,10,opt,name=cgroupParent,proto3" json:"cgroupParent,omitempty"` + RemoveMountStubsRecursive bool `protobuf:"varint,11,opt,name=removeMountStubsRecursive,proto3" json:"removeMountStubsRecursive,omitempty"` + ValidExitCodes []int32 `protobuf:"varint,12,rep,packed,name=validExitCodes,proto3" json:"validExitCodes,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Meta) Reset() { @@ -788,12 +796,11 @@ func (x *Meta) GetValidExitCodes() []int32 { } type HostIP struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Host string `protobuf:"bytes,1,opt,name=Host,proto3" json:"Host,omitempty"` + IP string `protobuf:"bytes,2,opt,name=IP,proto3" json:"IP,omitempty"` unknownFields protoimpl.UnknownFields - - Host string `protobuf:"bytes,1,opt,name=Host,proto3" json:"Host,omitempty"` - IP string `protobuf:"bytes,2,opt,name=IP,proto3" json:"IP,omitempty"` + sizeCache protoimpl.SizeCache } func (x *HostIP) Reset() { @@ -841,13 +848,12 @@ func (x *HostIP) GetIP() string { } type Ulimit struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` + Soft int64 `protobuf:"varint,2,opt,name=Soft,proto3" json:"Soft,omitempty"` + Hard int64 `protobuf:"varint,3,opt,name=Hard,proto3" json:"Hard,omitempty"` unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` - Soft int64 `protobuf:"varint,2,opt,name=Soft,proto3" json:"Soft,omitempty"` - Hard int64 `protobuf:"varint,3,opt,name=Hard,proto3" json:"Hard,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Ulimit) Reset() { @@ -903,13 +909,12 @@ func (x *Ulimit) GetHard() int64 { // SecretEnv is an environment variable that is backed by a secret. type SecretEnv struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Optional bool `protobuf:"varint,3,opt,name=optional,proto3" json:"optional,omitempty"` unknownFields protoimpl.UnknownFields - - ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Optional bool `protobuf:"varint,3,opt,name=optional,proto3" json:"optional,omitempty"` + sizeCache protoimpl.SizeCache } func (x *SecretEnv) Reset() { @@ -965,15 +970,14 @@ func (x *SecretEnv) GetOptional() bool { // CDIDevice specifies a CDI device information. type CDIDevice struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Fully qualified CDI device name (e.g., vendor.com/gpu=gpudevice1) // https://github.com/cncf-tags/container-device-interface/blob/main/SPEC.md Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Optional defines if CDI device is required. - Optional bool `protobuf:"varint,2,opt,name=optional,proto3" json:"optional,omitempty"` + Optional bool `protobuf:"varint,2,opt,name=optional,proto3" json:"optional,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *CDIDevice) Reset() { @@ -1022,22 +1026,21 @@ func (x *CDIDevice) GetOptional() bool { // Mount specifies how to mount an input Op as a filesystem. type Mount struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Input int64 `protobuf:"varint,1,opt,name=input,proto3" json:"input,omitempty"` + Selector string `protobuf:"bytes,2,opt,name=selector,proto3" json:"selector,omitempty"` + Dest string `protobuf:"bytes,3,opt,name=dest,proto3" json:"dest,omitempty"` + Output int64 `protobuf:"varint,4,opt,name=output,proto3" json:"output,omitempty"` + Readonly bool `protobuf:"varint,5,opt,name=readonly,proto3" json:"readonly,omitempty"` + MountType MountType `protobuf:"varint,6,opt,name=mountType,proto3,enum=pb.MountType" json:"mountType,omitempty"` + TmpfsOpt *TmpfsOpt `protobuf:"bytes,19,opt,name=TmpfsOpt,proto3" json:"TmpfsOpt,omitempty"` + CacheOpt *CacheOpt `protobuf:"bytes,20,opt,name=cacheOpt,proto3" json:"cacheOpt,omitempty"` + SecretOpt *SecretOpt `protobuf:"bytes,21,opt,name=secretOpt,proto3" json:"secretOpt,omitempty"` + SSHOpt *SSHOpt `protobuf:"bytes,22,opt,name=SSHOpt,proto3" json:"SSHOpt,omitempty"` + ResultID string `protobuf:"bytes,23,opt,name=resultID,proto3" json:"resultID,omitempty"` + ContentCache MountContentCache `protobuf:"varint,24,opt,name=contentCache,proto3,enum=pb.MountContentCache" json:"contentCache,omitempty"` unknownFields protoimpl.UnknownFields - - Input int64 `protobuf:"varint,1,opt,name=input,proto3" json:"input,omitempty"` - Selector string `protobuf:"bytes,2,opt,name=selector,proto3" json:"selector,omitempty"` - Dest string `protobuf:"bytes,3,opt,name=dest,proto3" json:"dest,omitempty"` - Output int64 `protobuf:"varint,4,opt,name=output,proto3" json:"output,omitempty"` - Readonly bool `protobuf:"varint,5,opt,name=readonly,proto3" json:"readonly,omitempty"` - MountType MountType `protobuf:"varint,6,opt,name=mountType,proto3,enum=pb.MountType" json:"mountType,omitempty"` - TmpfsOpt *TmpfsOpt `protobuf:"bytes,19,opt,name=TmpfsOpt,proto3" json:"TmpfsOpt,omitempty"` - CacheOpt *CacheOpt `protobuf:"bytes,20,opt,name=cacheOpt,proto3" json:"cacheOpt,omitempty"` - SecretOpt *SecretOpt `protobuf:"bytes,21,opt,name=secretOpt,proto3" json:"secretOpt,omitempty"` - SSHOpt *SSHOpt `protobuf:"bytes,22,opt,name=SSHOpt,proto3" json:"SSHOpt,omitempty"` - ResultID string `protobuf:"bytes,23,opt,name=resultID,proto3" json:"resultID,omitempty"` - ContentCache MountContentCache `protobuf:"varint,24,opt,name=contentCache,proto3,enum=pb.MountContentCache" json:"contentCache,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Mount) Reset() { @@ -1156,12 +1159,11 @@ func (x *Mount) GetContentCache() MountContentCache { // TmpfsOpt defines options describing tpmfs mounts type TmpfsOpt struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Specify an upper limit on the size of the filesystem. - Size int64 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"` + Size int64 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TmpfsOpt) Reset() { @@ -1203,14 +1205,13 @@ func (x *TmpfsOpt) GetSize() int64 { // CacheOpt defines options specific to cache mounts type CacheOpt struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // ID is an optional namespace for the mount ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` // Sharing is the sharing mode for the mount - Sharing CacheSharingOpt `protobuf:"varint,2,opt,name=sharing,proto3,enum=pb.CacheSharingOpt" json:"sharing,omitempty"` + Sharing CacheSharingOpt `protobuf:"varint,2,opt,name=sharing,proto3,enum=pb.CacheSharingOpt" json:"sharing,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *CacheOpt) Reset() { @@ -1259,10 +1260,7 @@ func (x *CacheOpt) GetSharing() CacheSharingOpt { // SecretOpt defines options describing secret mounts type SecretOpt struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // ID of secret. Used for quering the value. ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` // UID of secret file @@ -1273,7 +1271,9 @@ type SecretOpt struct { Mode uint32 `protobuf:"varint,4,opt,name=mode,proto3" json:"mode,omitempty"` // Optional defines if secret value is required. Error is produced // if value is not found and optional is false. - Optional bool `protobuf:"varint,5,opt,name=optional,proto3" json:"optional,omitempty"` + Optional bool `protobuf:"varint,5,opt,name=optional,proto3" json:"optional,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *SecretOpt) Reset() { @@ -1343,10 +1343,7 @@ func (x *SecretOpt) GetOptional() bool { // SSHOpt defines options describing ssh mounts type SSHOpt struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // ID of exposed ssh rule. Used for quering the value. ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` // UID of agent socket @@ -1357,7 +1354,9 @@ type SSHOpt struct { Mode uint32 `protobuf:"varint,4,opt,name=mode,proto3" json:"mode,omitempty"` // Optional defines if ssh socket is required. Error is produced // if client does not expose ssh. - Optional bool `protobuf:"varint,5,opt,name=optional,proto3" json:"optional,omitempty"` + Optional bool `protobuf:"varint,5,opt,name=optional,proto3" json:"optional,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *SSHOpt) Reset() { @@ -1427,15 +1426,14 @@ func (x *SSHOpt) GetOptional() bool { // SourceOp specifies a source such as build contexts and images. type SourceOp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // TODO: use source type or any type instead of URL protocol. // identifier e.g. local://, docker-image://, git://, https://... Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` // attrs are defined in attr.go - Attrs map[string]string `protobuf:"bytes,2,rep,name=attrs,proto3" json:"attrs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Attrs map[string]string `protobuf:"bytes,2,rep,name=attrs,proto3" json:"attrs,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *SourceOp) Reset() { @@ -1485,14 +1483,13 @@ func (x *SourceOp) GetAttrs() map[string]string { // BuildOp is used for nested build invocation. // BuildOp is experimental and can break without backwards compatibility type BuildOp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Builder int64 `protobuf:"varint,1,opt,name=builder,proto3" json:"builder,omitempty"` + Inputs map[string]*BuildInput `protobuf:"bytes,2,rep,name=inputs,proto3" json:"inputs,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + Def *Definition `protobuf:"bytes,3,opt,name=def,proto3" json:"def,omitempty"` + Attrs map[string]string `protobuf:"bytes,4,rep,name=attrs,proto3" json:"attrs,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // outputs unknownFields protoimpl.UnknownFields - - Builder int64 `protobuf:"varint,1,opt,name=builder,proto3" json:"builder,omitempty"` - Inputs map[string]*BuildInput `protobuf:"bytes,2,rep,name=inputs,proto3" json:"inputs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Def *Definition `protobuf:"bytes,3,opt,name=def,proto3" json:"def,omitempty"` - Attrs map[string]string `protobuf:"bytes,4,rep,name=attrs,proto3" json:"attrs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // outputs + sizeCache protoimpl.SizeCache } func (x *BuildOp) Reset() { @@ -1555,11 +1552,10 @@ func (x *BuildOp) GetAttrs() map[string]string { // BuildInput is used for BuildOp. type BuildInput struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Input int64 `protobuf:"varint,1,opt,name=input,proto3" json:"input,omitempty"` unknownFields protoimpl.UnknownFields - - Input int64 `protobuf:"varint,1,opt,name=input,proto3" json:"input,omitempty"` + sizeCache protoimpl.SizeCache } func (x *BuildInput) Reset() { @@ -1601,19 +1597,18 @@ func (x *BuildInput) GetInput() int64 { // OpMetadata is a per-vertex metadata entry, which can be defined for arbitrary Op vertex and overridable on the run time. type OpMetadata struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // ignore_cache specifies to ignore the cache for this Op. IgnoreCache bool `protobuf:"varint,1,opt,name=ignore_cache,json=ignoreCache,proto3" json:"ignore_cache,omitempty"` // Description can be used for keeping any text fields that builder doesn't parse - Description map[string]string `protobuf:"bytes,2,rep,name=description,proto3" json:"description,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Description map[string]string `protobuf:"bytes,2,rep,name=description,proto3" json:"description,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // index 3 reserved for WorkerConstraint in previous versions // WorkerConstraint worker_constraint = 3; ExportCache *ExportCache `protobuf:"bytes,4,opt,name=export_cache,json=exportCache,proto3" json:"export_cache,omitempty"` - Caps map[string]bool `protobuf:"bytes,5,rep,name=caps,proto3" json:"caps,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + Caps map[string]bool `protobuf:"bytes,5,rep,name=caps,proto3" json:"caps,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` ProgressGroup *ProgressGroup `protobuf:"bytes,6,opt,name=progress_group,json=progressGroup,proto3" json:"progress_group,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *OpMetadata) Reset() { @@ -1683,12 +1678,11 @@ func (x *OpMetadata) GetProgressGroup() *ProgressGroup { // Source is a source mapping description for a file type Source struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Locations map[string]*Locations `protobuf:"bytes,1,rep,name=locations,proto3" json:"locations,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + Infos []*SourceInfo `protobuf:"bytes,2,rep,name=infos,proto3" json:"infos,omitempty"` unknownFields protoimpl.UnknownFields - - Locations map[string]*Locations `protobuf:"bytes,1,rep,name=locations,proto3" json:"locations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Infos []*SourceInfo `protobuf:"bytes,2,rep,name=infos,proto3" json:"infos,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Source) Reset() { @@ -1737,11 +1731,10 @@ func (x *Source) GetInfos() []*SourceInfo { // Locations is a list of ranges with a index to its source map. type Locations struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Locations []*Location `protobuf:"bytes,1,rep,name=locations,proto3" json:"locations,omitempty"` unknownFields protoimpl.UnknownFields - - Locations []*Location `protobuf:"bytes,1,rep,name=locations,proto3" json:"locations,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Locations) Reset() { @@ -1783,14 +1776,13 @@ func (x *Locations) GetLocations() []*Location { // Source info contains the shared metadata of a source mapping type SourceInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Filename string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Definition *Definition `protobuf:"bytes,3,opt,name=definition,proto3" json:"definition,omitempty"` + Language string `protobuf:"bytes,4,opt,name=language,proto3" json:"language,omitempty"` unknownFields protoimpl.UnknownFields - - Filename string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Definition *Definition `protobuf:"bytes,3,opt,name=definition,proto3" json:"definition,omitempty"` - Language string `protobuf:"bytes,4,opt,name=language,proto3" json:"language,omitempty"` + sizeCache protoimpl.SizeCache } func (x *SourceInfo) Reset() { @@ -1853,12 +1845,11 @@ func (x *SourceInfo) GetLanguage() string { // Location defines list of areas in to source file type Location struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + SourceIndex int32 `protobuf:"varint,1,opt,name=sourceIndex,proto3" json:"sourceIndex,omitempty"` + Ranges []*Range `protobuf:"bytes,2,rep,name=ranges,proto3" json:"ranges,omitempty"` unknownFields protoimpl.UnknownFields - - SourceIndex int32 `protobuf:"varint,1,opt,name=sourceIndex,proto3" json:"sourceIndex,omitempty"` - Ranges []*Range `protobuf:"bytes,2,rep,name=ranges,proto3" json:"ranges,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Location) Reset() { @@ -1907,12 +1898,11 @@ func (x *Location) GetRanges() []*Range { // Range is an area in the source file type Range struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Start *Position `protobuf:"bytes,1,opt,name=start,proto3" json:"start,omitempty"` + End *Position `protobuf:"bytes,2,opt,name=end,proto3" json:"end,omitempty"` unknownFields protoimpl.UnknownFields - - Start *Position `protobuf:"bytes,1,opt,name=start,proto3" json:"start,omitempty"` - End *Position `protobuf:"bytes,2,opt,name=end,proto3" json:"end,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Range) Reset() { @@ -1961,12 +1951,11 @@ func (x *Range) GetEnd() *Position { // Position is single location in a source file type Position struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Line int32 `protobuf:"varint,1,opt,name=line,proto3" json:"line,omitempty"` + Character int32 `protobuf:"varint,2,opt,name=character,proto3" json:"character,omitempty"` unknownFields protoimpl.UnknownFields - - Line int32 `protobuf:"varint,1,opt,name=line,proto3" json:"line,omitempty"` - Character int32 `protobuf:"varint,2,opt,name=character,proto3" json:"character,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Position) Reset() { @@ -2014,11 +2003,10 @@ func (x *Position) GetCharacter() int32 { } type ExportCache struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Value bool `protobuf:"varint,1,opt,name=Value,proto3" json:"Value,omitempty"` unknownFields protoimpl.UnknownFields - - Value bool `protobuf:"varint,1,opt,name=Value,proto3" json:"Value,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ExportCache) Reset() { @@ -2059,13 +2047,12 @@ func (x *ExportCache) GetValue() bool { } type ProgressGroup struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Weak bool `protobuf:"varint,3,opt,name=weak,proto3" json:"weak,omitempty"` unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Weak bool `protobuf:"varint,3,opt,name=weak,proto3" json:"weak,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ProgressGroup) Reset() { @@ -2120,15 +2107,14 @@ func (x *ProgressGroup) GetWeak() bool { } type ProxyEnv struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + HttpProxy string `protobuf:"bytes,1,opt,name=http_proxy,json=httpProxy,proto3" json:"http_proxy,omitempty"` + HttpsProxy string `protobuf:"bytes,2,opt,name=https_proxy,json=httpsProxy,proto3" json:"https_proxy,omitempty"` + FtpProxy string `protobuf:"bytes,3,opt,name=ftp_proxy,json=ftpProxy,proto3" json:"ftp_proxy,omitempty"` + NoProxy string `protobuf:"bytes,4,opt,name=no_proxy,json=noProxy,proto3" json:"no_proxy,omitempty"` + AllProxy string `protobuf:"bytes,5,opt,name=all_proxy,json=allProxy,proto3" json:"all_proxy,omitempty"` unknownFields protoimpl.UnknownFields - - HttpProxy string `protobuf:"bytes,1,opt,name=http_proxy,json=httpProxy,proto3" json:"http_proxy,omitempty"` - HttpsProxy string `protobuf:"bytes,2,opt,name=https_proxy,json=httpsProxy,proto3" json:"https_proxy,omitempty"` - FtpProxy string `protobuf:"bytes,3,opt,name=ftp_proxy,json=ftpProxy,proto3" json:"ftp_proxy,omitempty"` - NoProxy string `protobuf:"bytes,4,opt,name=no_proxy,json=noProxy,proto3" json:"no_proxy,omitempty"` - AllProxy string `protobuf:"bytes,5,opt,name=all_proxy,json=allProxy,proto3" json:"all_proxy,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ProxyEnv) Reset() { @@ -2198,11 +2184,10 @@ func (x *ProxyEnv) GetAllProxy() string { // WorkerConstraints defines conditions for the worker type WorkerConstraints struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Filter []string `protobuf:"bytes,1,rep,name=filter,proto3" json:"filter,omitempty"` // containerd-style filter unknownFields protoimpl.UnknownFields - - Filter []string `protobuf:"bytes,1,rep,name=filter,proto3" json:"filter,omitempty"` // containerd-style filter + sizeCache protoimpl.SizeCache } func (x *WorkerConstraints) Reset() { @@ -2244,17 +2229,16 @@ func (x *WorkerConstraints) GetFilter() []string { // Definition is the LLB definition structure with per-vertex metadata entries type Definition struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // def is a list of marshaled Op messages Def [][]byte `protobuf:"bytes,1,rep,name=def,proto3" json:"def,omitempty"` // metadata contains metadata for the each of the Op messages. // A key must be an LLB op digest string. Currently, empty string is not expected as a key, but it may change in the future. - Metadata map[string]*OpMetadata `protobuf:"bytes,2,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Metadata map[string]*OpMetadata `protobuf:"bytes,2,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // Source contains the source mapping information for the vertexes in the definition - Source *Source `protobuf:"bytes,3,opt,name=Source,proto3" json:"Source,omitempty"` + Source *Source `protobuf:"bytes,3,opt,name=Source,proto3" json:"Source,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Definition) Reset() { @@ -2309,11 +2293,10 @@ func (x *Definition) GetSource() *Source { } type FileOp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Actions []*FileAction `protobuf:"bytes,2,rep,name=actions,proto3" json:"actions,omitempty"` unknownFields protoimpl.UnknownFields - - Actions []*FileAction `protobuf:"bytes,2,rep,name=actions,proto3" json:"actions,omitempty"` + sizeCache protoimpl.SizeCache } func (x *FileOp) Reset() { @@ -2354,22 +2337,21 @@ func (x *FileOp) GetActions() []*FileAction { } type FileAction struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // changes to this structure must be represented in json.go. Input int64 `protobuf:"varint,1,opt,name=input,proto3" json:"input,omitempty"` // could be real input or target (target index + max input index) SecondaryInput int64 `protobuf:"varint,2,opt,name=secondaryInput,proto3" json:"secondaryInput,omitempty"` // --//-- Output int64 `protobuf:"varint,3,opt,name=output,proto3" json:"output,omitempty"` - // Types that are assignable to Action: + // Types that are valid to be assigned to Action: // // *FileAction_Copy // *FileAction_Mkfile // *FileAction_Mkdir // *FileAction_Rm // *FileAction_Symlink - Action isFileAction_Action `protobuf_oneof:"action"` + Action isFileAction_Action `protobuf_oneof:"action"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *FileAction) Reset() { @@ -2423,44 +2405,54 @@ func (x *FileAction) GetOutput() int64 { return 0 } -func (m *FileAction) GetAction() isFileAction_Action { - if m != nil { - return m.Action +func (x *FileAction) GetAction() isFileAction_Action { + if x != nil { + return x.Action } return nil } func (x *FileAction) GetCopy() *FileActionCopy { - if x, ok := x.GetAction().(*FileAction_Copy); ok { - return x.Copy + if x != nil { + if x, ok := x.Action.(*FileAction_Copy); ok { + return x.Copy + } } return nil } func (x *FileAction) GetMkfile() *FileActionMkFile { - if x, ok := x.GetAction().(*FileAction_Mkfile); ok { - return x.Mkfile + if x != nil { + if x, ok := x.Action.(*FileAction_Mkfile); ok { + return x.Mkfile + } } return nil } func (x *FileAction) GetMkdir() *FileActionMkDir { - if x, ok := x.GetAction().(*FileAction_Mkdir); ok { - return x.Mkdir + if x != nil { + if x, ok := x.Action.(*FileAction_Mkdir); ok { + return x.Mkdir + } } return nil } func (x *FileAction) GetRm() *FileActionRm { - if x, ok := x.GetAction().(*FileAction_Rm); ok { - return x.Rm + if x != nil { + if x, ok := x.Action.(*FileAction_Rm); ok { + return x.Rm + } } return nil } func (x *FileAction) GetSymlink() *FileActionSymlink { - if x, ok := x.GetAction().(*FileAction_Symlink); ok { - return x.Symlink + if x != nil { + if x, ok := x.Action.(*FileAction_Symlink); ok { + return x.Symlink + } } return nil } @@ -2505,10 +2497,7 @@ func (*FileAction_Rm) isFileAction_Action() {} func (*FileAction_Symlink) isFileAction_Action() {} type FileActionCopy struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // src is the source path Src string `protobuf:"bytes,1,opt,name=src,proto3" json:"src,omitempty"` // dest path @@ -2538,7 +2527,9 @@ type FileActionCopy struct { // alwaysReplaceExistingDestPaths results in an existing dest path that differs in type from the src path being replaced rather than the default of returning an error AlwaysReplaceExistingDestPaths bool `protobuf:"varint,14,opt,name=alwaysReplaceExistingDestPaths,proto3" json:"alwaysReplaceExistingDestPaths,omitempty"` // mode in non-octal format - ModeStr string `protobuf:"bytes,15,opt,name=modeStr,proto3" json:"modeStr,omitempty"` + ModeStr string `protobuf:"bytes,15,opt,name=modeStr,proto3" json:"modeStr,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *FileActionCopy) Reset() { @@ -2677,10 +2668,7 @@ func (x *FileActionCopy) GetModeStr() string { } type FileActionMkFile struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // path for the new file Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` // permission bits @@ -2690,7 +2678,9 @@ type FileActionMkFile struct { // optional owner for the new file Owner *ChownOpt `protobuf:"bytes,4,opt,name=owner,proto3" json:"owner,omitempty"` // optional created time override - Timestamp int64 `protobuf:"varint,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Timestamp int64 `protobuf:"varint,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *FileActionMkFile) Reset() { @@ -2759,10 +2749,7 @@ func (x *FileActionMkFile) GetTimestamp() int64 { } type FileActionSymlink struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // destination path for the new file representing the link Oldpath string `protobuf:"bytes,1,opt,name=oldpath,proto3" json:"oldpath,omitempty"` // source path for the link @@ -2770,7 +2757,9 @@ type FileActionSymlink struct { // optional owner for the new file Owner *ChownOpt `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"` // optional created time override - Timestamp int64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Timestamp int64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *FileActionSymlink) Reset() { @@ -2832,10 +2821,7 @@ func (x *FileActionSymlink) GetTimestamp() int64 { } type FileActionMkDir struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // path for the new directory Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` // permission bits @@ -2845,7 +2831,9 @@ type FileActionMkDir struct { // optional owner for the new directory Owner *ChownOpt `protobuf:"bytes,4,opt,name=owner,proto3" json:"owner,omitempty"` // optional created time override - Timestamp int64 `protobuf:"varint,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Timestamp int64 `protobuf:"varint,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *FileActionMkDir) Reset() { @@ -2914,16 +2902,15 @@ func (x *FileActionMkDir) GetTimestamp() int64 { } type FileActionRm struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // path to remove Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` // allowNotFound doesn't fail the rm if file is not found AllowNotFound bool `protobuf:"varint,2,opt,name=allowNotFound,proto3" json:"allowNotFound,omitempty"` // allowWildcard allows filepath.Match wildcards in path AllowWildcard bool `protobuf:"varint,3,opt,name=allowWildcard,proto3" json:"allowWildcard,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *FileActionRm) Reset() { @@ -2978,12 +2965,11 @@ func (x *FileActionRm) GetAllowWildcard() bool { } type ChownOpt struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + User *UserOpt `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` + Group *UserOpt `protobuf:"bytes,2,opt,name=group,proto3" json:"group,omitempty"` unknownFields protoimpl.UnknownFields - - User *UserOpt `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` - Group *UserOpt `protobuf:"bytes,2,opt,name=group,proto3" json:"group,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ChownOpt) Reset() { @@ -3031,17 +3017,16 @@ func (x *ChownOpt) GetGroup() *UserOpt { } type UserOpt struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // changes to this structure must be represented in json.go. // - // Types that are assignable to User: + // Types that are valid to be assigned to User: // // *UserOpt_ByName // *UserOpt_ByID - User isUserOpt_User `protobuf_oneof:"user"` + User isUserOpt_User `protobuf_oneof:"user"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *UserOpt) Reset() { @@ -3074,23 +3059,27 @@ func (*UserOpt) Descriptor() ([]byte, []int) { return file_github_com_moby_buildkit_solver_pb_ops_proto_rawDescGZIP(), []int{37} } -func (m *UserOpt) GetUser() isUserOpt_User { - if m != nil { - return m.User +func (x *UserOpt) GetUser() isUserOpt_User { + if x != nil { + return x.User } return nil } func (x *UserOpt) GetByName() *NamedUserOpt { - if x, ok := x.GetUser().(*UserOpt_ByName); ok { - return x.ByName + if x != nil { + if x, ok := x.User.(*UserOpt_ByName); ok { + return x.ByName + } } return nil } func (x *UserOpt) GetByID() uint32 { - if x, ok := x.GetUser().(*UserOpt_ByID); ok { - return x.ByID + if x != nil { + if x, ok := x.User.(*UserOpt_ByID); ok { + return x.ByID + } } return 0 } @@ -3112,12 +3101,11 @@ func (*UserOpt_ByName) isUserOpt_User() {} func (*UserOpt_ByID) isUserOpt_User() {} type NamedUserOpt struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Input int64 `protobuf:"varint,2,opt,name=input,proto3" json:"input,omitempty"` unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Input int64 `protobuf:"varint,2,opt,name=input,proto3" json:"input,omitempty"` + sizeCache protoimpl.SizeCache } func (x *NamedUserOpt) Reset() { @@ -3165,11 +3153,10 @@ func (x *NamedUserOpt) GetInput() int64 { } type MergeInput struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Input int64 `protobuf:"varint,1,opt,name=input,proto3" json:"input,omitempty"` unknownFields protoimpl.UnknownFields - - Input int64 `protobuf:"varint,1,opt,name=input,proto3" json:"input,omitempty"` + sizeCache protoimpl.SizeCache } func (x *MergeInput) Reset() { @@ -3210,11 +3197,10 @@ func (x *MergeInput) GetInput() int64 { } type MergeOp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Inputs []*MergeInput `protobuf:"bytes,1,rep,name=inputs,proto3" json:"inputs,omitempty"` unknownFields protoimpl.UnknownFields - - Inputs []*MergeInput `protobuf:"bytes,1,rep,name=inputs,proto3" json:"inputs,omitempty"` + sizeCache protoimpl.SizeCache } func (x *MergeOp) Reset() { @@ -3255,11 +3241,10 @@ func (x *MergeOp) GetInputs() []*MergeInput { } type LowerDiffInput struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Input int64 `protobuf:"varint,1,opt,name=input,proto3" json:"input,omitempty"` unknownFields protoimpl.UnknownFields - - Input int64 `protobuf:"varint,1,opt,name=input,proto3" json:"input,omitempty"` + sizeCache protoimpl.SizeCache } func (x *LowerDiffInput) Reset() { @@ -3300,11 +3285,10 @@ func (x *LowerDiffInput) GetInput() int64 { } type UpperDiffInput struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Input int64 `protobuf:"varint,1,opt,name=input,proto3" json:"input,omitempty"` unknownFields protoimpl.UnknownFields - - Input int64 `protobuf:"varint,1,opt,name=input,proto3" json:"input,omitempty"` + sizeCache protoimpl.SizeCache } func (x *UpperDiffInput) Reset() { @@ -3345,12 +3329,11 @@ func (x *UpperDiffInput) GetInput() int64 { } type DiffOp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Lower *LowerDiffInput `protobuf:"bytes,1,opt,name=lower,proto3" json:"lower,omitempty"` + Upper *UpperDiffInput `protobuf:"bytes,2,opt,name=upper,proto3" json:"upper,omitempty"` unknownFields protoimpl.UnknownFields - - Lower *LowerDiffInput `protobuf:"bytes,1,opt,name=lower,proto3" json:"lower,omitempty"` - Upper *UpperDiffInput `protobuf:"bytes,2,opt,name=upper,proto3" json:"upper,omitempty"` + sizeCache protoimpl.SizeCache } func (x *DiffOp) Reset() { @@ -3399,430 +3382,299 @@ func (x *DiffOp) GetUpper() *UpperDiffInput { var File_github_com_moby_buildkit_solver_pb_ops_proto protoreflect.FileDescriptor -var file_github_com_moby_buildkit_solver_pb_ops_proto_rawDesc = []byte{ - 0x0a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, - 0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x73, 0x6f, 0x6c, 0x76, 0x65, - 0x72, 0x2f, 0x70, 0x62, 0x2f, 0x6f, 0x70, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, - 0x70, 0x62, 0x22, 0xe8, 0x02, 0x0a, 0x02, 0x4f, 0x70, 0x12, 0x21, 0x0a, 0x06, 0x69, 0x6e, 0x70, - 0x75, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x49, - 0x6e, 0x70, 0x75, 0x74, 0x52, 0x06, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x12, 0x20, 0x0a, 0x04, - 0x65, 0x78, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, - 0x45, 0x78, 0x65, 0x63, 0x4f, 0x70, 0x48, 0x00, 0x52, 0x04, 0x65, 0x78, 0x65, 0x63, 0x12, 0x26, - 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, - 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x70, 0x48, 0x00, 0x52, 0x06, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x20, 0x0a, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, - 0x48, 0x00, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x23, 0x0a, 0x05, 0x62, 0x75, 0x69, 0x6c, - 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x75, 0x69, - 0x6c, 0x64, 0x4f, 0x70, 0x48, 0x00, 0x52, 0x05, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x12, 0x23, 0x0a, - 0x05, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, - 0x62, 0x2e, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x4f, 0x70, 0x48, 0x00, 0x52, 0x05, 0x6d, 0x65, 0x72, - 0x67, 0x65, 0x12, 0x20, 0x0a, 0x04, 0x64, 0x69, 0x66, 0x66, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x69, 0x66, 0x66, 0x4f, 0x70, 0x48, 0x00, 0x52, 0x04, - 0x64, 0x69, 0x66, 0x66, 0x12, 0x28, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, - 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x74, - 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x37, - 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x0b, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x43, - 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x73, - 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x42, 0x04, 0x0a, 0x02, 0x6f, 0x70, 0x22, 0x96, 0x01, - 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x22, 0x0a, 0x0c, 0x41, 0x72, - 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0c, 0x41, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x12, 0x0e, - 0x0a, 0x02, 0x4f, 0x53, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x4f, 0x53, 0x12, 0x18, - 0x0a, 0x07, 0x56, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x56, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x4f, 0x53, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x4f, 0x53, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x4f, 0x53, 0x46, 0x65, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x4f, 0x53, 0x46, 0x65, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x35, 0x0a, 0x05, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, - 0x16, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0xfa, 0x01, - 0x0a, 0x06, 0x45, 0x78, 0x65, 0x63, 0x4f, 0x70, 0x12, 0x1c, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x74, 0x61, - 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x12, 0x21, 0x0a, 0x06, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x73, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x6f, 0x75, 0x6e, - 0x74, 0x52, 0x06, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x25, 0x0a, 0x07, 0x6e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, - 0x4e, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, - 0x12, 0x2c, 0x0a, 0x08, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, - 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x08, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x2b, - 0x0a, 0x09, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x76, 0x18, 0x05, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x45, 0x6e, 0x76, - 0x52, 0x09, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x76, 0x12, 0x2d, 0x0a, 0x0a, 0x63, - 0x64, 0x69, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x44, 0x49, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x0a, - 0x63, 0x64, 0x69, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x22, 0xf3, 0x02, 0x0a, 0x04, 0x4d, - 0x65, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x77, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x77, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x75, - 0x73, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, - 0x29, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x65, 0x6e, 0x76, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x45, 0x6e, 0x76, - 0x52, 0x08, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x45, 0x6e, 0x76, 0x12, 0x2a, 0x0a, 0x0a, 0x65, 0x78, - 0x74, 0x72, 0x61, 0x48, 0x6f, 0x73, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, - 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x49, 0x50, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x72, - 0x61, 0x48, 0x6f, 0x73, 0x74, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x06, 0x75, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x09, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x06, - 0x75, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, - 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x67, - 0x72, 0x6f, 0x75, 0x70, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x3c, 0x0a, 0x19, 0x72, 0x65, - 0x6d, 0x6f, 0x76, 0x65, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x74, 0x75, 0x62, 0x73, 0x52, 0x65, - 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x19, 0x72, - 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x74, 0x75, 0x62, 0x73, 0x52, - 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x45, 0x78, 0x69, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x05, - 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x45, 0x78, 0x69, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x73, - 0x22, 0x2c, 0x0a, 0x06, 0x48, 0x6f, 0x73, 0x74, 0x49, 0x50, 0x12, 0x12, 0x0a, 0x04, 0x48, 0x6f, - 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x0e, - 0x0a, 0x02, 0x49, 0x50, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x50, 0x22, 0x44, - 0x0a, 0x06, 0x55, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x53, 0x6f, 0x66, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x53, 0x6f, 0x66, 0x74, - 0x12, 0x12, 0x0a, 0x04, 0x48, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, - 0x48, 0x61, 0x72, 0x64, 0x22, 0x4b, 0x0a, 0x09, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x45, 0x6e, - 0x76, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, - 0x44, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, - 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, - 0x6c, 0x22, 0x3b, 0x0a, 0x09, 0x43, 0x44, 0x49, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x22, 0xaa, - 0x03, 0x0a, 0x05, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x70, 0x75, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x1a, - 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, - 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x74, 0x12, 0x16, - 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, - 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x61, 0x64, 0x6f, 0x6e, - 0x6c, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x6f, 0x6e, - 0x6c, 0x79, 0x12, 0x2b, 0x0a, 0x09, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x6f, 0x75, 0x6e, 0x74, - 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x28, 0x0a, 0x08, 0x54, 0x6d, 0x70, 0x66, 0x73, 0x4f, 0x70, 0x74, 0x18, 0x13, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x54, 0x6d, 0x70, 0x66, 0x73, 0x4f, 0x70, 0x74, 0x52, - 0x08, 0x54, 0x6d, 0x70, 0x66, 0x73, 0x4f, 0x70, 0x74, 0x12, 0x28, 0x0a, 0x08, 0x63, 0x61, 0x63, - 0x68, 0x65, 0x4f, 0x70, 0x74, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, - 0x2e, 0x43, 0x61, 0x63, 0x68, 0x65, 0x4f, 0x70, 0x74, 0x52, 0x08, 0x63, 0x61, 0x63, 0x68, 0x65, - 0x4f, 0x70, 0x74, 0x12, 0x2b, 0x0a, 0x09, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x4f, 0x70, 0x74, - 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x63, 0x72, - 0x65, 0x74, 0x4f, 0x70, 0x74, 0x52, 0x09, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x4f, 0x70, 0x74, - 0x12, 0x22, 0x0a, 0x06, 0x53, 0x53, 0x48, 0x4f, 0x70, 0x74, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x53, 0x48, 0x4f, 0x70, 0x74, 0x52, 0x06, 0x53, 0x53, - 0x48, 0x4f, 0x70, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x44, - 0x18, 0x17, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x44, - 0x12, 0x39, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, - 0x18, 0x18, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x6f, 0x75, 0x6e, - 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x52, 0x0c, 0x63, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x22, 0x1e, 0x0a, 0x08, 0x54, - 0x6d, 0x70, 0x66, 0x73, 0x4f, 0x70, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x49, 0x0a, 0x08, 0x43, - 0x61, 0x63, 0x68, 0x65, 0x4f, 0x70, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x44, 0x12, 0x2d, 0x0a, 0x07, 0x73, 0x68, 0x61, 0x72, 0x69, - 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x61, - 0x63, 0x68, 0x65, 0x53, 0x68, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x4f, 0x70, 0x74, 0x52, 0x07, 0x73, - 0x68, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x6f, 0x0a, 0x09, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, - 0x4f, 0x70, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x02, 0x49, 0x44, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x03, 0x67, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x22, 0x6c, 0x0a, 0x06, 0x53, 0x53, 0x48, 0x4f, 0x70, - 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, - 0x44, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, - 0x75, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x03, 0x67, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x22, 0x93, 0x01, 0x0a, 0x08, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x4f, 0x70, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, - 0x65, 0x72, 0x12, 0x2d, 0x0a, 0x05, 0x61, 0x74, 0x74, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x70, 0x2e, - 0x41, 0x74, 0x74, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x61, 0x74, 0x74, 0x72, - 0x73, 0x1a, 0x38, 0x0a, 0x0a, 0x41, 0x74, 0x74, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xa9, 0x02, 0x0a, 0x07, - 0x42, 0x75, 0x69, 0x6c, 0x64, 0x4f, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x75, 0x69, 0x6c, 0x64, - 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, - 0x72, 0x12, 0x2f, 0x0a, 0x06, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x4f, 0x70, 0x2e, 0x49, - 0x6e, 0x70, 0x75, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x69, 0x6e, 0x70, 0x75, - 0x74, 0x73, 0x12, 0x20, 0x0a, 0x03, 0x64, 0x65, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x03, 0x64, 0x65, 0x66, 0x12, 0x2c, 0x0a, 0x05, 0x61, 0x74, 0x74, 0x72, 0x73, 0x18, 0x04, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x4f, 0x70, - 0x2e, 0x41, 0x74, 0x74, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x61, 0x74, 0x74, - 0x72, 0x73, 0x1a, 0x49, 0x0a, 0x0b, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x24, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x6e, 0x70, - 0x75, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x38, 0x0a, - 0x0a, 0x41, 0x74, 0x74, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x22, 0x0a, 0x0a, 0x42, 0x75, 0x69, 0x6c, 0x64, - 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x22, 0x87, 0x03, 0x0a, 0x0a, - 0x4f, 0x70, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x67, - 0x6e, 0x6f, 0x72, 0x65, 0x5f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0b, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x43, 0x61, 0x63, 0x68, 0x65, 0x12, 0x41, 0x0a, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x4f, 0x70, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x32, 0x0a, 0x0c, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x63, 0x61, 0x63, 0x68, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x78, 0x70, 0x6f, - 0x72, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x43, - 0x61, 0x63, 0x68, 0x65, 0x12, 0x2c, 0x0a, 0x04, 0x63, 0x61, 0x70, 0x73, 0x18, 0x05, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4f, 0x70, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x2e, 0x43, 0x61, 0x70, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x63, 0x61, - 0x70, 0x73, 0x12, 0x38, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x67, - 0x72, 0x6f, 0x75, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x62, 0x2e, - 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x0d, 0x70, - 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x1a, 0x3e, 0x0a, 0x10, - 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x37, 0x0a, 0x09, - 0x43, 0x61, 0x70, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xb4, 0x01, 0x0a, 0x06, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x12, 0x37, 0x0a, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, - 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, - 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x24, 0x0a, 0x05, 0x69, 0x6e, 0x66, - 0x6f, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x69, 0x6e, 0x66, 0x6f, 0x73, 0x1a, - 0x4b, 0x0a, 0x0e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x37, 0x0a, 0x09, - 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2a, 0x0a, 0x09, 0x6c, 0x6f, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, - 0x62, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6c, 0x6f, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x88, 0x01, 0x0a, 0x0a, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, - 0x64, 0x61, 0x74, 0x61, 0x12, 0x2e, 0x0a, 0x0a, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, - 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, - 0x22, 0x4f, 0x0a, 0x08, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x21, - 0x0a, 0x06, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, - 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x06, 0x72, 0x61, 0x6e, 0x67, 0x65, - 0x73, 0x22, 0x4b, 0x0a, 0x05, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x22, 0x0a, 0x05, 0x73, 0x74, - 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x50, - 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1e, - 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, - 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x22, 0x3c, - 0x0a, 0x08, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, - 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x1c, - 0x0a, 0x09, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x09, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x22, 0x23, 0x0a, 0x0b, - 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x22, 0x47, 0x0a, 0x0d, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x77, 0x65, 0x61, 0x6b, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x77, 0x65, 0x61, 0x6b, 0x22, 0x9f, 0x01, 0x0a, 0x08, 0x50, - 0x72, 0x6f, 0x78, 0x79, 0x45, 0x6e, 0x76, 0x12, 0x1d, 0x0a, 0x0a, 0x68, 0x74, 0x74, 0x70, 0x5f, - 0x70, 0x72, 0x6f, 0x78, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x68, 0x74, 0x74, - 0x70, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x68, 0x74, 0x74, 0x70, 0x73, 0x5f, - 0x70, 0x72, 0x6f, 0x78, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x68, 0x74, 0x74, - 0x70, 0x73, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x74, 0x70, 0x5f, 0x70, - 0x72, 0x6f, 0x78, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x74, 0x70, 0x50, - 0x72, 0x6f, 0x78, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x12, - 0x1b, 0x0a, 0x09, 0x61, 0x6c, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x61, 0x6c, 0x6c, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x22, 0x2b, 0x0a, 0x11, - 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, - 0x73, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xc9, 0x01, 0x0a, 0x0a, 0x44, 0x65, - 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x65, 0x66, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x03, 0x64, 0x65, 0x66, 0x12, 0x38, 0x0a, 0x08, 0x6d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, - 0x62, 0x2e, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x06, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x52, 0x06, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x1a, 0x4b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x24, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, - 0x4f, 0x70, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x32, 0x0a, 0x06, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x12, - 0x28, 0x0a, 0x07, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x07, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xca, 0x02, 0x0a, 0x0a, 0x46, 0x69, - 0x6c, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x70, 0x75, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x26, - 0x0a, 0x0e, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x61, 0x72, 0x79, 0x49, 0x6e, 0x70, 0x75, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x61, 0x72, - 0x79, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x28, - 0x0a, 0x04, 0x63, 0x6f, 0x70, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, - 0x62, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x70, 0x79, - 0x48, 0x00, 0x52, 0x04, 0x63, 0x6f, 0x70, 0x79, 0x12, 0x2e, 0x0a, 0x06, 0x6d, 0x6b, 0x66, 0x69, - 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, - 0x6c, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6b, 0x46, 0x69, 0x6c, 0x65, 0x48, 0x00, - 0x52, 0x06, 0x6d, 0x6b, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x6d, 0x6b, 0x64, 0x69, - 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6c, - 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6b, 0x44, 0x69, 0x72, 0x48, 0x00, 0x52, 0x05, - 0x6d, 0x6b, 0x64, 0x69, 0x72, 0x12, 0x22, 0x0a, 0x02, 0x72, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x6d, 0x48, 0x00, 0x52, 0x02, 0x72, 0x6d, 0x12, 0x31, 0x0a, 0x07, 0x73, 0x79, 0x6d, - 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x62, 0x2e, - 0x46, 0x69, 0x6c, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x79, 0x6d, 0x6c, 0x69, 0x6e, - 0x6b, 0x48, 0x00, 0x52, 0x07, 0x73, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x42, 0x08, 0x0a, 0x06, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xde, 0x04, 0x0a, 0x0e, 0x46, 0x69, 0x6c, 0x65, 0x41, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x70, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x72, 0x63, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x72, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x64, - 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x74, 0x12, - 0x22, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, - 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x6f, 0x77, 0x6e, 0x4f, 0x70, 0x74, 0x52, 0x05, 0x6f, 0x77, - 0x6e, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, - 0x77, 0x53, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, - 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x53, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x28, 0x0a, - 0x0f, 0x64, 0x69, 0x72, 0x43, 0x6f, 0x70, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x64, 0x69, 0x72, 0x43, 0x6f, 0x70, 0x79, 0x43, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x4a, 0x0a, 0x20, 0x61, 0x74, 0x74, 0x65, 0x6d, - 0x70, 0x74, 0x55, 0x6e, 0x70, 0x61, 0x63, 0x6b, 0x44, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x43, 0x6f, - 0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x20, 0x61, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x55, 0x6e, 0x70, 0x61, 0x63, 0x6b, - 0x44, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, 0x69, 0x6c, - 0x69, 0x74, 0x79, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x73, - 0x74, 0x50, 0x61, 0x74, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x44, 0x65, 0x73, 0x74, 0x50, 0x61, 0x74, 0x68, 0x12, 0x24, 0x0a, 0x0d, 0x61, - 0x6c, 0x6c, 0x6f, 0x77, 0x57, 0x69, 0x6c, 0x64, 0x63, 0x61, 0x72, 0x64, 0x18, 0x09, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0d, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x57, 0x69, 0x6c, 0x64, 0x63, 0x61, 0x72, - 0x64, 0x12, 0x2e, 0x0a, 0x12, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x57, - 0x69, 0x6c, 0x64, 0x63, 0x61, 0x72, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x61, - 0x6c, 0x6c, 0x6f, 0x77, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x57, 0x69, 0x6c, 0x64, 0x63, 0x61, 0x72, - 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0b, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, - 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x74, 0x65, - 0x72, 0x6e, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x69, 0x6e, 0x63, 0x6c, 0x75, - 0x64, 0x65, 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x65, 0x78, - 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x73, 0x18, 0x0d, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x50, 0x61, 0x74, - 0x74, 0x65, 0x72, 0x6e, 0x73, 0x12, 0x46, 0x0a, 0x1e, 0x61, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x52, - 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x45, 0x78, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x44, 0x65, - 0x73, 0x74, 0x50, 0x61, 0x74, 0x68, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1e, 0x61, - 0x6c, 0x77, 0x61, 0x79, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x45, 0x78, 0x69, 0x73, - 0x74, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x73, 0x74, 0x50, 0x61, 0x74, 0x68, 0x73, 0x12, 0x18, 0x0a, - 0x07, 0x6d, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x72, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x6d, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x72, 0x22, 0x90, 0x01, 0x0a, 0x10, 0x46, 0x69, 0x6c, 0x65, - 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6b, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, - 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, - 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, - 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x6f, - 0x77, 0x6e, 0x4f, 0x70, 0x74, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x89, 0x01, 0x0a, 0x11, 0x46, - 0x69, 0x6c, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, - 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x6c, 0x64, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x6f, 0x6c, 0x64, 0x70, 0x61, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, - 0x77, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x77, - 0x70, 0x61, 0x74, 0x68, 0x12, 0x22, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x6f, 0x77, 0x6e, 0x4f, 0x70, - 0x74, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x9d, 0x01, 0x0a, 0x0f, 0x46, 0x69, 0x6c, 0x65, 0x41, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6b, 0x44, 0x69, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, - 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x12, - 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6d, 0x6f, - 0x64, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x6d, 0x61, 0x6b, 0x65, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x6d, 0x61, 0x6b, 0x65, 0x50, 0x61, 0x72, - 0x65, 0x6e, 0x74, 0x73, 0x12, 0x22, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x6f, 0x77, 0x6e, 0x4f, 0x70, - 0x74, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x6e, 0x0a, 0x0c, 0x46, 0x69, 0x6c, 0x65, 0x41, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x24, 0x0a, 0x0d, 0x61, 0x6c, - 0x6c, 0x6f, 0x77, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0d, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, - 0x12, 0x24, 0x0a, 0x0d, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x57, 0x69, 0x6c, 0x64, 0x63, 0x61, 0x72, - 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x57, 0x69, - 0x6c, 0x64, 0x63, 0x61, 0x72, 0x64, 0x22, 0x4e, 0x0a, 0x08, 0x43, 0x68, 0x6f, 0x77, 0x6e, 0x4f, - 0x70, 0x74, 0x12, 0x1f, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x52, 0x04, 0x75, - 0x73, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x52, - 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x53, 0x0a, 0x07, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x70, - 0x74, 0x12, 0x2a, 0x0a, 0x06, 0x62, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, - 0x4f, 0x70, 0x74, 0x48, 0x00, 0x52, 0x06, 0x62, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, - 0x04, 0x62, 0x79, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x04, 0x62, - 0x79, 0x49, 0x44, 0x42, 0x06, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x38, 0x0a, 0x0c, 0x4e, - 0x61, 0x6d, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, - 0x69, 0x6e, 0x70, 0x75, 0x74, 0x22, 0x22, 0x0a, 0x0a, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x49, 0x6e, - 0x70, 0x75, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x22, 0x31, 0x0a, 0x07, 0x4d, 0x65, 0x72, - 0x67, 0x65, 0x4f, 0x70, 0x12, 0x26, 0x0a, 0x06, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x49, - 0x6e, 0x70, 0x75, 0x74, 0x52, 0x06, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x22, 0x26, 0x0a, 0x0e, - 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x44, 0x69, 0x66, 0x66, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x14, - 0x0a, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x69, - 0x6e, 0x70, 0x75, 0x74, 0x22, 0x26, 0x0a, 0x0e, 0x55, 0x70, 0x70, 0x65, 0x72, 0x44, 0x69, 0x66, - 0x66, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x22, 0x5c, 0x0a, 0x06, - 0x44, 0x69, 0x66, 0x66, 0x4f, 0x70, 0x12, 0x28, 0x0a, 0x05, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x77, 0x65, 0x72, - 0x44, 0x69, 0x66, 0x66, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x05, 0x6c, 0x6f, 0x77, 0x65, 0x72, - 0x12, 0x28, 0x0a, 0x05, 0x75, 0x70, 0x70, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x70, 0x65, 0x72, 0x44, 0x69, 0x66, 0x66, 0x49, 0x6e, - 0x70, 0x75, 0x74, 0x52, 0x05, 0x75, 0x70, 0x70, 0x65, 0x72, 0x2a, 0x28, 0x0a, 0x07, 0x4e, 0x65, - 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x55, 0x4e, 0x53, 0x45, 0x54, 0x10, 0x00, - 0x12, 0x08, 0x0a, 0x04, 0x48, 0x4f, 0x53, 0x54, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, - 0x4e, 0x45, 0x10, 0x02, 0x2a, 0x29, 0x0a, 0x0c, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, - 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x41, 0x4e, 0x44, 0x42, 0x4f, 0x58, 0x10, - 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x49, 0x4e, 0x53, 0x45, 0x43, 0x55, 0x52, 0x45, 0x10, 0x01, 0x2a, - 0x40, 0x0a, 0x09, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, - 0x42, 0x49, 0x4e, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x45, 0x43, 0x52, 0x45, 0x54, - 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x53, 0x48, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x43, - 0x41, 0x43, 0x48, 0x45, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x54, 0x4d, 0x50, 0x46, 0x53, 0x10, - 0x04, 0x2a, 0x31, 0x0a, 0x11, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, - 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, - 0x54, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x4f, - 0x46, 0x46, 0x10, 0x02, 0x2a, 0x36, 0x0a, 0x0f, 0x43, 0x61, 0x63, 0x68, 0x65, 0x53, 0x68, 0x61, - 0x72, 0x69, 0x6e, 0x67, 0x4f, 0x70, 0x74, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x48, 0x41, 0x52, 0x45, - 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x10, 0x01, - 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, 0x10, 0x02, 0x42, 0x24, 0x5a, 0x22, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, 0x79, 0x2f, - 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2f, - 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_github_com_moby_buildkit_solver_pb_ops_proto_rawDesc = "" + + "\n" + + ",github.com/moby/buildkit/solver/pb/ops.proto\x12\x02pb\"\xe8\x02\n" + + "\x02Op\x12!\n" + + "\x06inputs\x18\x01 \x03(\v2\t.pb.InputR\x06inputs\x12 \n" + + "\x04exec\x18\x02 \x01(\v2\n" + + ".pb.ExecOpH\x00R\x04exec\x12&\n" + + "\x06source\x18\x03 \x01(\v2\f.pb.SourceOpH\x00R\x06source\x12 \n" + + "\x04file\x18\x04 \x01(\v2\n" + + ".pb.FileOpH\x00R\x04file\x12#\n" + + "\x05build\x18\x05 \x01(\v2\v.pb.BuildOpH\x00R\x05build\x12#\n" + + "\x05merge\x18\x06 \x01(\v2\v.pb.MergeOpH\x00R\x05merge\x12 \n" + + "\x04diff\x18\a \x01(\v2\n" + + ".pb.DiffOpH\x00R\x04diff\x12(\n" + + "\bplatform\x18\n" + + " \x01(\v2\f.pb.PlatformR\bplatform\x127\n" + + "\vconstraints\x18\v \x01(\v2\x15.pb.WorkerConstraintsR\vconstraintsB\x04\n" + + "\x02op\"\x96\x01\n" + + "\bPlatform\x12\"\n" + + "\fArchitecture\x18\x01 \x01(\tR\fArchitecture\x12\x0e\n" + + "\x02OS\x18\x02 \x01(\tR\x02OS\x12\x18\n" + + "\aVariant\x18\x03 \x01(\tR\aVariant\x12\x1c\n" + + "\tOSVersion\x18\x04 \x01(\tR\tOSVersion\x12\x1e\n" + + "\n" + + "OSFeatures\x18\x05 \x03(\tR\n" + + "OSFeatures\"5\n" + + "\x05Input\x12\x16\n" + + "\x06digest\x18\x01 \x01(\tR\x06digest\x12\x14\n" + + "\x05index\x18\x02 \x01(\x03R\x05index\"\xfa\x01\n" + + "\x06ExecOp\x12\x1c\n" + + "\x04meta\x18\x01 \x01(\v2\b.pb.MetaR\x04meta\x12!\n" + + "\x06mounts\x18\x02 \x03(\v2\t.pb.MountR\x06mounts\x12%\n" + + "\anetwork\x18\x03 \x01(\x0e2\v.pb.NetModeR\anetwork\x12,\n" + + "\bsecurity\x18\x04 \x01(\x0e2\x10.pb.SecurityModeR\bsecurity\x12+\n" + + "\tsecretenv\x18\x05 \x03(\v2\r.pb.SecretEnvR\tsecretenv\x12-\n" + + "\n" + + "cdiDevices\x18\x06 \x03(\v2\r.pb.CDIDeviceR\n" + + "cdiDevices\"\xf3\x02\n" + + "\x04Meta\x12\x12\n" + + "\x04args\x18\x01 \x03(\tR\x04args\x12\x10\n" + + "\x03env\x18\x02 \x03(\tR\x03env\x12\x10\n" + + "\x03cwd\x18\x03 \x01(\tR\x03cwd\x12\x12\n" + + "\x04user\x18\x04 \x01(\tR\x04user\x12)\n" + + "\tproxy_env\x18\x05 \x01(\v2\f.pb.ProxyEnvR\bproxyEnv\x12*\n" + + "\n" + + "extraHosts\x18\x06 \x03(\v2\n" + + ".pb.HostIPR\n" + + "extraHosts\x12\x1a\n" + + "\bhostname\x18\a \x01(\tR\bhostname\x12\"\n" + + "\x06ulimit\x18\t \x03(\v2\n" + + ".pb.UlimitR\x06ulimit\x12\"\n" + + "\fcgroupParent\x18\n" + + " \x01(\tR\fcgroupParent\x12<\n" + + "\x19removeMountStubsRecursive\x18\v \x01(\bR\x19removeMountStubsRecursive\x12&\n" + + "\x0evalidExitCodes\x18\f \x03(\x05R\x0evalidExitCodes\",\n" + + "\x06HostIP\x12\x12\n" + + "\x04Host\x18\x01 \x01(\tR\x04Host\x12\x0e\n" + + "\x02IP\x18\x02 \x01(\tR\x02IP\"D\n" + + "\x06Ulimit\x12\x12\n" + + "\x04Name\x18\x01 \x01(\tR\x04Name\x12\x12\n" + + "\x04Soft\x18\x02 \x01(\x03R\x04Soft\x12\x12\n" + + "\x04Hard\x18\x03 \x01(\x03R\x04Hard\"K\n" + + "\tSecretEnv\x12\x0e\n" + + "\x02ID\x18\x01 \x01(\tR\x02ID\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x1a\n" + + "\boptional\x18\x03 \x01(\bR\boptional\";\n" + + "\tCDIDevice\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x1a\n" + + "\boptional\x18\x02 \x01(\bR\boptional\"\xaa\x03\n" + + "\x05Mount\x12\x14\n" + + "\x05input\x18\x01 \x01(\x03R\x05input\x12\x1a\n" + + "\bselector\x18\x02 \x01(\tR\bselector\x12\x12\n" + + "\x04dest\x18\x03 \x01(\tR\x04dest\x12\x16\n" + + "\x06output\x18\x04 \x01(\x03R\x06output\x12\x1a\n" + + "\breadonly\x18\x05 \x01(\bR\breadonly\x12+\n" + + "\tmountType\x18\x06 \x01(\x0e2\r.pb.MountTypeR\tmountType\x12(\n" + + "\bTmpfsOpt\x18\x13 \x01(\v2\f.pb.TmpfsOptR\bTmpfsOpt\x12(\n" + + "\bcacheOpt\x18\x14 \x01(\v2\f.pb.CacheOptR\bcacheOpt\x12+\n" + + "\tsecretOpt\x18\x15 \x01(\v2\r.pb.SecretOptR\tsecretOpt\x12\"\n" + + "\x06SSHOpt\x18\x16 \x01(\v2\n" + + ".pb.SSHOptR\x06SSHOpt\x12\x1a\n" + + "\bresultID\x18\x17 \x01(\tR\bresultID\x129\n" + + "\fcontentCache\x18\x18 \x01(\x0e2\x15.pb.MountContentCacheR\fcontentCache\"\x1e\n" + + "\bTmpfsOpt\x12\x12\n" + + "\x04size\x18\x01 \x01(\x03R\x04size\"I\n" + + "\bCacheOpt\x12\x0e\n" + + "\x02ID\x18\x01 \x01(\tR\x02ID\x12-\n" + + "\asharing\x18\x02 \x01(\x0e2\x13.pb.CacheSharingOptR\asharing\"o\n" + + "\tSecretOpt\x12\x0e\n" + + "\x02ID\x18\x01 \x01(\tR\x02ID\x12\x10\n" + + "\x03uid\x18\x02 \x01(\rR\x03uid\x12\x10\n" + + "\x03gid\x18\x03 \x01(\rR\x03gid\x12\x12\n" + + "\x04mode\x18\x04 \x01(\rR\x04mode\x12\x1a\n" + + "\boptional\x18\x05 \x01(\bR\boptional\"l\n" + + "\x06SSHOpt\x12\x0e\n" + + "\x02ID\x18\x01 \x01(\tR\x02ID\x12\x10\n" + + "\x03uid\x18\x02 \x01(\rR\x03uid\x12\x10\n" + + "\x03gid\x18\x03 \x01(\rR\x03gid\x12\x12\n" + + "\x04mode\x18\x04 \x01(\rR\x04mode\x12\x1a\n" + + "\boptional\x18\x05 \x01(\bR\boptional\"\x93\x01\n" + + "\bSourceOp\x12\x1e\n" + + "\n" + + "identifier\x18\x01 \x01(\tR\n" + + "identifier\x12-\n" + + "\x05attrs\x18\x02 \x03(\v2\x17.pb.SourceOp.AttrsEntryR\x05attrs\x1a8\n" + + "\n" + + "AttrsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xa9\x02\n" + + "\aBuildOp\x12\x18\n" + + "\abuilder\x18\x01 \x01(\x03R\abuilder\x12/\n" + + "\x06inputs\x18\x02 \x03(\v2\x17.pb.BuildOp.InputsEntryR\x06inputs\x12 \n" + + "\x03def\x18\x03 \x01(\v2\x0e.pb.DefinitionR\x03def\x12,\n" + + "\x05attrs\x18\x04 \x03(\v2\x16.pb.BuildOp.AttrsEntryR\x05attrs\x1aI\n" + + "\vInputsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12$\n" + + "\x05value\x18\x02 \x01(\v2\x0e.pb.BuildInputR\x05value:\x028\x01\x1a8\n" + + "\n" + + "AttrsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\"\n" + + "\n" + + "BuildInput\x12\x14\n" + + "\x05input\x18\x01 \x01(\x03R\x05input\"\x87\x03\n" + + "\n" + + "OpMetadata\x12!\n" + + "\fignore_cache\x18\x01 \x01(\bR\vignoreCache\x12A\n" + + "\vdescription\x18\x02 \x03(\v2\x1f.pb.OpMetadata.DescriptionEntryR\vdescription\x122\n" + + "\fexport_cache\x18\x04 \x01(\v2\x0f.pb.ExportCacheR\vexportCache\x12,\n" + + "\x04caps\x18\x05 \x03(\v2\x18.pb.OpMetadata.CapsEntryR\x04caps\x128\n" + + "\x0eprogress_group\x18\x06 \x01(\v2\x11.pb.ProgressGroupR\rprogressGroup\x1a>\n" + + "\x10DescriptionEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1a7\n" + + "\tCapsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\bR\x05value:\x028\x01\"\xb4\x01\n" + + "\x06Source\x127\n" + + "\tlocations\x18\x01 \x03(\v2\x19.pb.Source.LocationsEntryR\tlocations\x12$\n" + + "\x05infos\x18\x02 \x03(\v2\x0e.pb.SourceInfoR\x05infos\x1aK\n" + + "\x0eLocationsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12#\n" + + "\x05value\x18\x02 \x01(\v2\r.pb.LocationsR\x05value:\x028\x01\"7\n" + + "\tLocations\x12*\n" + + "\tlocations\x18\x01 \x03(\v2\f.pb.LocationR\tlocations\"\x88\x01\n" + + "\n" + + "SourceInfo\x12\x1a\n" + + "\bfilename\x18\x01 \x01(\tR\bfilename\x12\x12\n" + + "\x04data\x18\x02 \x01(\fR\x04data\x12.\n" + + "\n" + + "definition\x18\x03 \x01(\v2\x0e.pb.DefinitionR\n" + + "definition\x12\x1a\n" + + "\blanguage\x18\x04 \x01(\tR\blanguage\"O\n" + + "\bLocation\x12 \n" + + "\vsourceIndex\x18\x01 \x01(\x05R\vsourceIndex\x12!\n" + + "\x06ranges\x18\x02 \x03(\v2\t.pb.RangeR\x06ranges\"K\n" + + "\x05Range\x12\"\n" + + "\x05start\x18\x01 \x01(\v2\f.pb.PositionR\x05start\x12\x1e\n" + + "\x03end\x18\x02 \x01(\v2\f.pb.PositionR\x03end\"<\n" + + "\bPosition\x12\x12\n" + + "\x04line\x18\x01 \x01(\x05R\x04line\x12\x1c\n" + + "\tcharacter\x18\x02 \x01(\x05R\tcharacter\"#\n" + + "\vExportCache\x12\x14\n" + + "\x05Value\x18\x01 \x01(\bR\x05Value\"G\n" + + "\rProgressGroup\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x12\n" + + "\x04weak\x18\x03 \x01(\bR\x04weak\"\x9f\x01\n" + + "\bProxyEnv\x12\x1d\n" + + "\n" + + "http_proxy\x18\x01 \x01(\tR\thttpProxy\x12\x1f\n" + + "\vhttps_proxy\x18\x02 \x01(\tR\n" + + "httpsProxy\x12\x1b\n" + + "\tftp_proxy\x18\x03 \x01(\tR\bftpProxy\x12\x19\n" + + "\bno_proxy\x18\x04 \x01(\tR\anoProxy\x12\x1b\n" + + "\tall_proxy\x18\x05 \x01(\tR\ballProxy\"+\n" + + "\x11WorkerConstraints\x12\x16\n" + + "\x06filter\x18\x01 \x03(\tR\x06filter\"\xc9\x01\n" + + "\n" + + "Definition\x12\x10\n" + + "\x03def\x18\x01 \x03(\fR\x03def\x128\n" + + "\bmetadata\x18\x02 \x03(\v2\x1c.pb.Definition.MetadataEntryR\bmetadata\x12\"\n" + + "\x06Source\x18\x03 \x01(\v2\n" + + ".pb.SourceR\x06Source\x1aK\n" + + "\rMetadataEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12$\n" + + "\x05value\x18\x02 \x01(\v2\x0e.pb.OpMetadataR\x05value:\x028\x01\"2\n" + + "\x06FileOp\x12(\n" + + "\aactions\x18\x02 \x03(\v2\x0e.pb.FileActionR\aactions\"\xca\x02\n" + + "\n" + + "FileAction\x12\x14\n" + + "\x05input\x18\x01 \x01(\x03R\x05input\x12&\n" + + "\x0esecondaryInput\x18\x02 \x01(\x03R\x0esecondaryInput\x12\x16\n" + + "\x06output\x18\x03 \x01(\x03R\x06output\x12(\n" + + "\x04copy\x18\x04 \x01(\v2\x12.pb.FileActionCopyH\x00R\x04copy\x12.\n" + + "\x06mkfile\x18\x05 \x01(\v2\x14.pb.FileActionMkFileH\x00R\x06mkfile\x12+\n" + + "\x05mkdir\x18\x06 \x01(\v2\x13.pb.FileActionMkDirH\x00R\x05mkdir\x12\"\n" + + "\x02rm\x18\a \x01(\v2\x10.pb.FileActionRmH\x00R\x02rm\x121\n" + + "\asymlink\x18\b \x01(\v2\x15.pb.FileActionSymlinkH\x00R\asymlinkB\b\n" + + "\x06action\"\xde\x04\n" + + "\x0eFileActionCopy\x12\x10\n" + + "\x03src\x18\x01 \x01(\tR\x03src\x12\x12\n" + + "\x04dest\x18\x02 \x01(\tR\x04dest\x12\"\n" + + "\x05owner\x18\x03 \x01(\v2\f.pb.ChownOptR\x05owner\x12\x12\n" + + "\x04mode\x18\x04 \x01(\x05R\x04mode\x12$\n" + + "\rfollowSymlink\x18\x05 \x01(\bR\rfollowSymlink\x12(\n" + + "\x0fdirCopyContents\x18\x06 \x01(\bR\x0fdirCopyContents\x12J\n" + + " attemptUnpackDockerCompatibility\x18\a \x01(\bR attemptUnpackDockerCompatibility\x12&\n" + + "\x0ecreateDestPath\x18\b \x01(\bR\x0ecreateDestPath\x12$\n" + + "\rallowWildcard\x18\t \x01(\bR\rallowWildcard\x12.\n" + + "\x12allowEmptyWildcard\x18\n" + + " \x01(\bR\x12allowEmptyWildcard\x12\x1c\n" + + "\ttimestamp\x18\v \x01(\x03R\ttimestamp\x12)\n" + + "\x10include_patterns\x18\f \x03(\tR\x0fincludePatterns\x12)\n" + + "\x10exclude_patterns\x18\r \x03(\tR\x0fexcludePatterns\x12F\n" + + "\x1ealwaysReplaceExistingDestPaths\x18\x0e \x01(\bR\x1ealwaysReplaceExistingDestPaths\x12\x18\n" + + "\amodeStr\x18\x0f \x01(\tR\amodeStr\"\x90\x01\n" + + "\x10FileActionMkFile\x12\x12\n" + + "\x04path\x18\x01 \x01(\tR\x04path\x12\x12\n" + + "\x04mode\x18\x02 \x01(\x05R\x04mode\x12\x12\n" + + "\x04data\x18\x03 \x01(\fR\x04data\x12\"\n" + + "\x05owner\x18\x04 \x01(\v2\f.pb.ChownOptR\x05owner\x12\x1c\n" + + "\ttimestamp\x18\x05 \x01(\x03R\ttimestamp\"\x89\x01\n" + + "\x11FileActionSymlink\x12\x18\n" + + "\aoldpath\x18\x01 \x01(\tR\aoldpath\x12\x18\n" + + "\anewpath\x18\x02 \x01(\tR\anewpath\x12\"\n" + + "\x05owner\x18\x03 \x01(\v2\f.pb.ChownOptR\x05owner\x12\x1c\n" + + "\ttimestamp\x18\x04 \x01(\x03R\ttimestamp\"\x9d\x01\n" + + "\x0fFileActionMkDir\x12\x12\n" + + "\x04path\x18\x01 \x01(\tR\x04path\x12\x12\n" + + "\x04mode\x18\x02 \x01(\x05R\x04mode\x12 \n" + + "\vmakeParents\x18\x03 \x01(\bR\vmakeParents\x12\"\n" + + "\x05owner\x18\x04 \x01(\v2\f.pb.ChownOptR\x05owner\x12\x1c\n" + + "\ttimestamp\x18\x05 \x01(\x03R\ttimestamp\"n\n" + + "\fFileActionRm\x12\x12\n" + + "\x04path\x18\x01 \x01(\tR\x04path\x12$\n" + + "\rallowNotFound\x18\x02 \x01(\bR\rallowNotFound\x12$\n" + + "\rallowWildcard\x18\x03 \x01(\bR\rallowWildcard\"N\n" + + "\bChownOpt\x12\x1f\n" + + "\x04user\x18\x01 \x01(\v2\v.pb.UserOptR\x04user\x12!\n" + + "\x05group\x18\x02 \x01(\v2\v.pb.UserOptR\x05group\"S\n" + + "\aUserOpt\x12*\n" + + "\x06byName\x18\x01 \x01(\v2\x10.pb.NamedUserOptH\x00R\x06byName\x12\x14\n" + + "\x04byID\x18\x02 \x01(\rH\x00R\x04byIDB\x06\n" + + "\x04user\"8\n" + + "\fNamedUserOpt\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" + + "\x05input\x18\x02 \x01(\x03R\x05input\"\"\n" + + "\n" + + "MergeInput\x12\x14\n" + + "\x05input\x18\x01 \x01(\x03R\x05input\"1\n" + + "\aMergeOp\x12&\n" + + "\x06inputs\x18\x01 \x03(\v2\x0e.pb.MergeInputR\x06inputs\"&\n" + + "\x0eLowerDiffInput\x12\x14\n" + + "\x05input\x18\x01 \x01(\x03R\x05input\"&\n" + + "\x0eUpperDiffInput\x12\x14\n" + + "\x05input\x18\x01 \x01(\x03R\x05input\"\\\n" + + "\x06DiffOp\x12(\n" + + "\x05lower\x18\x01 \x01(\v2\x12.pb.LowerDiffInputR\x05lower\x12(\n" + + "\x05upper\x18\x02 \x01(\v2\x12.pb.UpperDiffInputR\x05upper*(\n" + + "\aNetMode\x12\t\n" + + "\x05UNSET\x10\x00\x12\b\n" + + "\x04HOST\x10\x01\x12\b\n" + + "\x04NONE\x10\x02*)\n" + + "\fSecurityMode\x12\v\n" + + "\aSANDBOX\x10\x00\x12\f\n" + + "\bINSECURE\x10\x01*@\n" + + "\tMountType\x12\b\n" + + "\x04BIND\x10\x00\x12\n" + + "\n" + + "\x06SECRET\x10\x01\x12\a\n" + + "\x03SSH\x10\x02\x12\t\n" + + "\x05CACHE\x10\x03\x12\t\n" + + "\x05TMPFS\x10\x04*1\n" + + "\x11MountContentCache\x12\v\n" + + "\aDEFAULT\x10\x00\x12\x06\n" + + "\x02ON\x10\x01\x12\a\n" + + "\x03OFF\x10\x02*6\n" + + "\x0fCacheSharingOpt\x12\n" + + "\n" + + "\x06SHARED\x10\x00\x12\v\n" + + "\aPRIVATE\x10\x01\x12\n" + + "\n" + + "\x06LOCKED\x10\x02B$Z\"github.com/moby/buildkit/solver/pbb\x06proto3" var ( file_github_com_moby_buildkit_solver_pb_ops_proto_rawDescOnce sync.Once - file_github_com_moby_buildkit_solver_pb_ops_proto_rawDescData = file_github_com_moby_buildkit_solver_pb_ops_proto_rawDesc + file_github_com_moby_buildkit_solver_pb_ops_proto_rawDescData []byte ) func file_github_com_moby_buildkit_solver_pb_ops_proto_rawDescGZIP() []byte { file_github_com_moby_buildkit_solver_pb_ops_proto_rawDescOnce.Do(func() { - file_github_com_moby_buildkit_solver_pb_ops_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_moby_buildkit_solver_pb_ops_proto_rawDescData) + file_github_com_moby_buildkit_solver_pb_ops_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_moby_buildkit_solver_pb_ops_proto_rawDesc), len(file_github_com_moby_buildkit_solver_pb_ops_proto_rawDesc))) }) return file_github_com_moby_buildkit_solver_pb_ops_proto_rawDescData } @@ -3984,7 +3836,7 @@ func file_github_com_moby_buildkit_solver_pb_ops_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_moby_buildkit_solver_pb_ops_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_moby_buildkit_solver_pb_ops_proto_rawDesc), len(file_github_com_moby_buildkit_solver_pb_ops_proto_rawDesc)), NumEnums: 5, NumMessages: 51, NumExtensions: 0, @@ -3996,7 +3848,6 @@ func file_github_com_moby_buildkit_solver_pb_ops_proto_init() { MessageInfos: file_github_com_moby_buildkit_solver_pb_ops_proto_msgTypes, }.Build() File_github_com_moby_buildkit_solver_pb_ops_proto = out.File - file_github_com_moby_buildkit_solver_pb_ops_proto_rawDesc = nil file_github_com_moby_buildkit_solver_pb_ops_proto_goTypes = nil file_github_com_moby_buildkit_solver_pb_ops_proto_depIdxs = nil } diff --git a/vendor/github.com/moby/buildkit/source/git/identifier.go b/vendor/github.com/moby/buildkit/source/git/identifier.go index ac2b0dbe6c..5cfe39e6bb 100644 --- a/vendor/github.com/moby/buildkit/source/git/identifier.go +++ b/vendor/github.com/moby/buildkit/source/git/identifier.go @@ -32,9 +32,9 @@ func NewGitIdentifier(remoteURL string) (*GitIdentifier, error) { } repo := GitIdentifier{Remote: u.Remote} - if u.Fragment != nil { - repo.Ref = u.Fragment.Ref - repo.Subdir = u.Fragment.Subdir + if u.Opts != nil { + repo.Ref = u.Opts.Ref + repo.Subdir = u.Opts.Subdir } if sd := path.Clean(repo.Subdir); sd == "/" || sd == "." { repo.Subdir = "" diff --git a/vendor/github.com/moby/buildkit/source/http/source.go b/vendor/github.com/moby/buildkit/source/http/source.go index 574ef95f30..06666be7a7 100644 --- a/vendor/github.com/moby/buildkit/source/http/source.go +++ b/vendor/github.com/moby/buildkit/source/http/source.go @@ -34,6 +34,11 @@ import ( "github.com/pkg/errors" ) +const ( + HTTPAuthHeaderSecretPrefix = "HTTP_AUTH_HEADER_" + HTTPAuthTokenSecretPrefix = "HTTP_AUTH_TOKEN_" +) + // supportedUserHeaders defines supported user-defined header fields. Fields // not included here will be silently dropped. var supportedUserDefinedHeaders = map[string]bool{ @@ -506,18 +511,36 @@ func (hs *httpSourceHandler) newHTTPRequest(ctx context.Context, g session.Group req.Header.Set(field.Name, field.Value) } + type authSecret struct { + name string + token bool + } + + var secretNames []authSecret if hs.src.AuthHeaderSecret != "" { + secretNames = append(secretNames, authSecret{name: hs.src.AuthHeaderSecret}) + } else { + u, err := url.Parse(hs.src.URL) + if err == nil { + secretNames = append(secretNames, authSecret{name: HTTPAuthHeaderSecretPrefix + u.Hostname()}) + secretNames = append(secretNames, authSecret{name: HTTPAuthTokenSecretPrefix + u.Hostname(), token: true}) + } + } + + for _, secret := range secretNames { err := hs.sm.Any(ctx, g, func(ctx context.Context, _ string, caller session.Caller) error { - dt, err := secrets.GetSecret(ctx, caller, hs.src.AuthHeaderSecret) + dt, err := secrets.GetSecret(ctx, caller, secret.name) if err != nil { return err } - - req.Header.Set("Authorization", string(dt)) - + v := string(dt) + if secret.token { + v = "Bearer " + v + } + req.Header.Set("Authorization", v) return nil }) - if err != nil { + if err != nil && hs.src.AuthHeaderSecret != "" { return nil, errors.Wrapf(err, "failed to retrieve HTTP auth secret %s", hs.src.AuthHeaderSecret) } } diff --git a/vendor/github.com/moby/buildkit/sourcepolicy/pb/policy.pb.go b/vendor/github.com/moby/buildkit/sourcepolicy/pb/policy.pb.go index 7f88a34725..4ae587160f 100644 --- a/vendor/github.com/moby/buildkit/sourcepolicy/pb/policy.pb.go +++ b/vendor/github.com/moby/buildkit/sourcepolicy/pb/policy.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 +// protoc-gen-go v1.36.6 // protoc v3.11.4 // source: github.com/moby/buildkit/sourcepolicy/pb/policy.proto @@ -11,6 +11,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -178,13 +179,12 @@ func (MatchType) EnumDescriptor() ([]byte, []int) { // Rule defines the action(s) to take when a source is matched type Rule struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Action PolicyAction `protobuf:"varint,1,opt,name=action,proto3,enum=moby.buildkit.v1.sourcepolicy.PolicyAction" json:"action,omitempty"` + Selector *Selector `protobuf:"bytes,2,opt,name=selector,proto3" json:"selector,omitempty"` + Updates *Update `protobuf:"bytes,3,opt,name=updates,proto3" json:"updates,omitempty"` unknownFields protoimpl.UnknownFields - - Action PolicyAction `protobuf:"varint,1,opt,name=action,proto3,enum=moby.buildkit.v1.sourcepolicy.PolicyAction" json:"action,omitempty"` - Selector *Selector `protobuf:"bytes,2,opt,name=selector,proto3" json:"selector,omitempty"` - Updates *Update `protobuf:"bytes,3,opt,name=updates,proto3" json:"updates,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Rule) Reset() { @@ -240,12 +240,11 @@ func (x *Rule) GetUpdates() *Update { // Update contains updates to the matched build step after rule is applied type Update struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` + Attrs map[string]string `protobuf:"bytes,2,rep,name=attrs,proto3" json:"attrs,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` unknownFields protoimpl.UnknownFields - - Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` - Attrs map[string]string `protobuf:"bytes,2,rep,name=attrs,proto3" json:"attrs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + sizeCache protoimpl.SizeCache } func (x *Update) Reset() { @@ -294,14 +293,13 @@ func (x *Update) GetAttrs() map[string]string { // Selector identifies a source to match a policy to type Selector struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` // MatchType is the type of match to perform on the source identifier - MatchType MatchType `protobuf:"varint,2,opt,name=match_type,json=matchType,proto3,enum=moby.buildkit.v1.sourcepolicy.MatchType" json:"match_type,omitempty"` - Constraints []*AttrConstraint `protobuf:"bytes,3,rep,name=constraints,proto3" json:"constraints,omitempty"` + MatchType MatchType `protobuf:"varint,2,opt,name=match_type,json=matchType,proto3,enum=moby.buildkit.v1.sourcepolicy.MatchType" json:"match_type,omitempty"` + Constraints []*AttrConstraint `protobuf:"bytes,3,rep,name=constraints,proto3" json:"constraints,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Selector) Reset() { @@ -357,13 +355,12 @@ func (x *Selector) GetConstraints() []*AttrConstraint { // AttrConstraint defines a constraint on a source attribute type AttrConstraint struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + Condition AttrMatch `protobuf:"varint,3,opt,name=condition,proto3,enum=moby.buildkit.v1.sourcepolicy.AttrMatch" json:"condition,omitempty"` unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - Condition AttrMatch `protobuf:"varint,3,opt,name=condition,proto3,enum=moby.buildkit.v1.sourcepolicy.AttrMatch" json:"condition,omitempty"` + sizeCache protoimpl.SizeCache } func (x *AttrConstraint) Reset() { @@ -419,12 +416,11 @@ func (x *AttrConstraint) GetCondition() AttrMatch { // Policy is the list of rules the policy engine will perform type Policy struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Version int64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` // Currently 1 + Rules []*Rule `protobuf:"bytes,2,rep,name=rules,proto3" json:"rules,omitempty"` unknownFields protoimpl.UnknownFields - - Version int64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` // Currently 1 - Rules []*Rule `protobuf:"bytes,2,rep,name=rules,proto3" json:"rules,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Policy) Reset() { @@ -473,88 +469,57 @@ func (x *Policy) GetRules() []*Rule { var File_github_com_moby_buildkit_sourcepolicy_pb_policy_proto protoreflect.FileDescriptor -var file_github_com_moby_buildkit_sourcepolicy_pb_policy_proto_rawDesc = []byte{ - 0x0a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, - 0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2f, 0x70, 0x62, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, - 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1d, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, - 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0xd1, 0x01, 0x0a, 0x04, 0x52, 0x75, 0x6c, 0x65, 0x12, - 0x43, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x2b, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, - 0x76, 0x31, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, - 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x43, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, - 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, - 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x3f, 0x0a, 0x07, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6d, 0x6f, 0x62, - 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x52, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x22, 0xaa, 0x01, 0x0a, 0x06, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, - 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x46, 0x0a, 0x05, 0x61, 0x74, 0x74, 0x72, 0x73, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, - 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x70, 0x6f, - 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x41, 0x74, 0x74, 0x72, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x61, 0x74, 0x74, 0x72, 0x73, 0x1a, 0x38, 0x0a, - 0x0a, 0x41, 0x74, 0x74, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xc4, 0x01, 0x0a, 0x08, 0x53, 0x65, 0x6c, 0x65, - 0x63, 0x74, 0x6f, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, - 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x66, 0x69, 0x65, 0x72, 0x12, 0x47, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, - 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, - 0x70, 0x65, 0x52, 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x4f, 0x0a, - 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, - 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x70, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, - 0x74, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x22, 0x80, - 0x01, 0x0a, 0x0e, 0x41, 0x74, 0x74, 0x72, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, - 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x46, 0x0a, 0x09, 0x63, 0x6f, 0x6e, - 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, 0x6d, - 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x41, 0x74, 0x74, - 0x72, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x22, 0x5d, 0x0a, 0x06, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, - 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x70, 0x6f, - 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, - 0x2a, 0x30, 0x0a, 0x0c, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x09, 0x0a, 0x05, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x44, - 0x45, 0x4e, 0x59, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x4f, 0x4e, 0x56, 0x45, 0x52, 0x54, - 0x10, 0x02, 0x2a, 0x31, 0x0a, 0x09, 0x41, 0x74, 0x74, 0x72, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, - 0x09, 0x0a, 0x05, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x4e, 0x4f, - 0x54, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x4d, 0x41, 0x54, 0x43, - 0x48, 0x45, 0x53, 0x10, 0x02, 0x2a, 0x2f, 0x0a, 0x09, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x57, 0x49, 0x4c, 0x44, 0x43, 0x41, 0x52, 0x44, 0x10, 0x00, - 0x12, 0x09, 0x0a, 0x05, 0x45, 0x58, 0x41, 0x43, 0x54, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x52, - 0x45, 0x47, 0x45, 0x58, 0x10, 0x02, 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, 0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, - 0x69, 0x74, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2f, - 0x70, 0x62, 0x3b, 0x6d, 0x6f, 0x62, 0x79, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, - 0x5f, 0x76, 0x31, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_github_com_moby_buildkit_sourcepolicy_pb_policy_proto_rawDesc = "" + + "\n" + + "5github.com/moby/buildkit/sourcepolicy/pb/policy.proto\x12\x1dmoby.buildkit.v1.sourcepolicy\"\xd1\x01\n" + + "\x04Rule\x12C\n" + + "\x06action\x18\x01 \x01(\x0e2+.moby.buildkit.v1.sourcepolicy.PolicyActionR\x06action\x12C\n" + + "\bselector\x18\x02 \x01(\v2'.moby.buildkit.v1.sourcepolicy.SelectorR\bselector\x12?\n" + + "\aupdates\x18\x03 \x01(\v2%.moby.buildkit.v1.sourcepolicy.UpdateR\aupdates\"\xaa\x01\n" + + "\x06Update\x12\x1e\n" + + "\n" + + "identifier\x18\x01 \x01(\tR\n" + + "identifier\x12F\n" + + "\x05attrs\x18\x02 \x03(\v20.moby.buildkit.v1.sourcepolicy.Update.AttrsEntryR\x05attrs\x1a8\n" + + "\n" + + "AttrsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xc4\x01\n" + + "\bSelector\x12\x1e\n" + + "\n" + + "identifier\x18\x01 \x01(\tR\n" + + "identifier\x12G\n" + + "\n" + + "match_type\x18\x02 \x01(\x0e2(.moby.buildkit.v1.sourcepolicy.MatchTypeR\tmatchType\x12O\n" + + "\vconstraints\x18\x03 \x03(\v2-.moby.buildkit.v1.sourcepolicy.AttrConstraintR\vconstraints\"\x80\x01\n" + + "\x0eAttrConstraint\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value\x12F\n" + + "\tcondition\x18\x03 \x01(\x0e2(.moby.buildkit.v1.sourcepolicy.AttrMatchR\tcondition\"]\n" + + "\x06Policy\x12\x18\n" + + "\aversion\x18\x01 \x01(\x03R\aversion\x129\n" + + "\x05rules\x18\x02 \x03(\v2#.moby.buildkit.v1.sourcepolicy.RuleR\x05rules*0\n" + + "\fPolicyAction\x12\t\n" + + "\x05ALLOW\x10\x00\x12\b\n" + + "\x04DENY\x10\x01\x12\v\n" + + "\aCONVERT\x10\x02*1\n" + + "\tAttrMatch\x12\t\n" + + "\x05EQUAL\x10\x00\x12\f\n" + + "\bNOTEQUAL\x10\x01\x12\v\n" + + "\aMATCHES\x10\x02*/\n" + + "\tMatchType\x12\f\n" + + "\bWILDCARD\x10\x00\x12\t\n" + + "\x05EXACT\x10\x01\x12\t\n" + + "\x05REGEX\x10\x02BHZFgithub.com/moby/buildkit/sourcepolicy/pb;moby_buildkit_v1_sourcepolicyb\x06proto3" var ( file_github_com_moby_buildkit_sourcepolicy_pb_policy_proto_rawDescOnce sync.Once - file_github_com_moby_buildkit_sourcepolicy_pb_policy_proto_rawDescData = file_github_com_moby_buildkit_sourcepolicy_pb_policy_proto_rawDesc + file_github_com_moby_buildkit_sourcepolicy_pb_policy_proto_rawDescData []byte ) func file_github_com_moby_buildkit_sourcepolicy_pb_policy_proto_rawDescGZIP() []byte { file_github_com_moby_buildkit_sourcepolicy_pb_policy_proto_rawDescOnce.Do(func() { - file_github_com_moby_buildkit_sourcepolicy_pb_policy_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_moby_buildkit_sourcepolicy_pb_policy_proto_rawDescData) + file_github_com_moby_buildkit_sourcepolicy_pb_policy_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_moby_buildkit_sourcepolicy_pb_policy_proto_rawDesc), len(file_github_com_moby_buildkit_sourcepolicy_pb_policy_proto_rawDesc))) }) return file_github_com_moby_buildkit_sourcepolicy_pb_policy_proto_rawDescData } @@ -597,7 +562,7 @@ func file_github_com_moby_buildkit_sourcepolicy_pb_policy_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_moby_buildkit_sourcepolicy_pb_policy_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_moby_buildkit_sourcepolicy_pb_policy_proto_rawDesc), len(file_github_com_moby_buildkit_sourcepolicy_pb_policy_proto_rawDesc)), NumEnums: 3, NumMessages: 6, NumExtensions: 0, @@ -609,7 +574,6 @@ func file_github_com_moby_buildkit_sourcepolicy_pb_policy_proto_init() { MessageInfos: file_github_com_moby_buildkit_sourcepolicy_pb_policy_proto_msgTypes, }.Build() File_github_com_moby_buildkit_sourcepolicy_pb_policy_proto = out.File - file_github_com_moby_buildkit_sourcepolicy_pb_policy_proto_rawDesc = nil file_github_com_moby_buildkit_sourcepolicy_pb_policy_proto_goTypes = nil file_github_com_moby_buildkit_sourcepolicy_pb_policy_proto_depIdxs = nil } diff --git a/vendor/github.com/moby/buildkit/util/apicaps/pb/caps.pb.go b/vendor/github.com/moby/buildkit/util/apicaps/pb/caps.pb.go index 0d2fb580df..a68d493676 100644 --- a/vendor/github.com/moby/buildkit/util/apicaps/pb/caps.pb.go +++ b/vendor/github.com/moby/buildkit/util/apicaps/pb/caps.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 +// protoc-gen-go v1.36.6 // protoc v3.11.4 // source: github.com/moby/buildkit/util/apicaps/pb/caps.proto @@ -11,6 +11,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -22,16 +23,15 @@ const ( // APICap defines a capability supported by the service type APICap struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` - Enabled bool `protobuf:"varint,2,opt,name=Enabled,proto3" json:"Enabled,omitempty"` - Deprecated bool `protobuf:"varint,3,opt,name=Deprecated,proto3" json:"Deprecated,omitempty"` // Unused. May be used for warnings in the future - DisabledReason string `protobuf:"bytes,4,opt,name=DisabledReason,proto3" json:"DisabledReason,omitempty"` // Reason key for detection code - DisabledReasonMsg string `protobuf:"bytes,5,opt,name=DisabledReasonMsg,proto3" json:"DisabledReasonMsg,omitempty"` // Message to the user - DisabledAlternative string `protobuf:"bytes,6,opt,name=DisabledAlternative,proto3" json:"DisabledAlternative,omitempty"` // Identifier that updated client could catch. + state protoimpl.MessageState `protogen:"open.v1"` + ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` + Enabled bool `protobuf:"varint,2,opt,name=Enabled,proto3" json:"Enabled,omitempty"` + Deprecated bool `protobuf:"varint,3,opt,name=Deprecated,proto3" json:"Deprecated,omitempty"` // Unused. May be used for warnings in the future + DisabledReason string `protobuf:"bytes,4,opt,name=DisabledReason,proto3" json:"DisabledReason,omitempty"` // Reason key for detection code + DisabledReasonMsg string `protobuf:"bytes,5,opt,name=DisabledReasonMsg,proto3" json:"DisabledReasonMsg,omitempty"` // Message to the user + DisabledAlternative string `protobuf:"bytes,6,opt,name=DisabledAlternative,proto3" json:"DisabledAlternative,omitempty"` // Identifier that updated client could catch. + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *APICap) Reset() { @@ -108,41 +108,27 @@ func (x *APICap) GetDisabledAlternative() string { var File_github_com_moby_buildkit_util_apicaps_pb_caps_proto protoreflect.FileDescriptor -var file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_rawDesc = []byte{ - 0x0a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, - 0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x75, 0x74, 0x69, 0x6c, 0x2f, - 0x61, 0x70, 0x69, 0x63, 0x61, 0x70, 0x73, 0x2f, 0x70, 0x62, 0x2f, 0x63, 0x61, 0x70, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x18, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, - 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x61, 0x70, 0x69, 0x63, 0x61, 0x70, 0x73, 0x22, - 0xda, 0x01, 0x0a, 0x06, 0x41, 0x50, 0x49, 0x43, 0x61, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x45, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x45, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, - 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, - 0x61, 0x74, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0e, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x44, 0x69, - 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x11, - 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x4d, 0x73, - 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x4d, 0x73, 0x67, 0x12, 0x30, 0x0a, 0x13, 0x44, 0x69, - 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x6c, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x69, 0x76, - 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x41, 0x6c, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x42, 0x43, 0x5a, 0x41, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, 0x79, 0x2f, - 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x75, 0x74, 0x69, 0x6c, 0x2f, 0x61, 0x70, - 0x69, 0x63, 0x61, 0x70, 0x73, 0x2f, 0x70, 0x62, 0x3b, 0x6d, 0x6f, 0x62, 0x79, 0x5f, 0x62, 0x75, - 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x5f, 0x76, 0x31, 0x5f, 0x61, 0x70, 0x69, 0x63, 0x61, 0x70, - 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_rawDesc = "" + + "\n" + + "3github.com/moby/buildkit/util/apicaps/pb/caps.proto\x12\x18moby.buildkit.v1.apicaps\"\xda\x01\n" + + "\x06APICap\x12\x0e\n" + + "\x02ID\x18\x01 \x01(\tR\x02ID\x12\x18\n" + + "\aEnabled\x18\x02 \x01(\bR\aEnabled\x12\x1e\n" + + "\n" + + "Deprecated\x18\x03 \x01(\bR\n" + + "Deprecated\x12&\n" + + "\x0eDisabledReason\x18\x04 \x01(\tR\x0eDisabledReason\x12,\n" + + "\x11DisabledReasonMsg\x18\x05 \x01(\tR\x11DisabledReasonMsg\x120\n" + + "\x13DisabledAlternative\x18\x06 \x01(\tR\x13DisabledAlternativeBCZAgithub.com/moby/buildkit/util/apicaps/pb;moby_buildkit_v1_apicapsb\x06proto3" var ( file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_rawDescOnce sync.Once - file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_rawDescData = file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_rawDesc + file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_rawDescData []byte ) func file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_rawDescGZIP() []byte { file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_rawDescOnce.Do(func() { - file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_rawDescData) + file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_rawDesc), len(file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_rawDesc))) }) return file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_rawDescData } @@ -168,7 +154,7 @@ func file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_rawDesc), len(file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_rawDesc)), NumEnums: 0, NumMessages: 1, NumExtensions: 0, @@ -179,7 +165,6 @@ func file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_init() { MessageInfos: file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_msgTypes, }.Build() File_github_com_moby_buildkit_util_apicaps_pb_caps_proto = out.File - file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_rawDesc = nil file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_goTypes = nil file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_depIdxs = nil } diff --git a/vendor/github.com/moby/buildkit/util/gitutil/git_ref.go b/vendor/github.com/moby/buildkit/util/gitutil/git_ref.go index 59d6582641..cb562acf54 100644 --- a/vendor/github.com/moby/buildkit/util/gitutil/git_ref.go +++ b/vendor/github.com/moby/buildkit/util/gitutil/git_ref.go @@ -93,8 +93,8 @@ func ParseGitRef(ref string) (*GitRef, error) { if res.IndistinguishableFromLocal { _, res.Remote, _ = strings.Cut(res.Remote, "://") } - if remote.Fragment != nil { - res.Commit, res.SubDir = remote.Fragment.Ref, remote.Fragment.Subdir + if remote.Opts != nil { + res.Commit, res.SubDir = remote.Opts.Ref, remote.Opts.Subdir } repoSplitBySlash := strings.Split(res.Remote, "/") diff --git a/vendor/github.com/moby/buildkit/util/gitutil/git_url.go b/vendor/github.com/moby/buildkit/util/gitutil/git_url.go index 0f1ff505c7..338893b279 100644 --- a/vendor/github.com/moby/buildkit/util/gitutil/git_url.go +++ b/vendor/github.com/moby/buildkit/util/gitutil/git_url.go @@ -47,31 +47,31 @@ type GitURL struct { Path string // User is the username/password to access the host User *url.Userinfo - // Fragment can contain additional metadata - Fragment *GitURLFragment + // Opts can contain additional metadata + Opts *GitURLOpts // Remote is a valid URL remote to pass into the Git CLI tooling (i.e. // without the fragment metadata) Remote string } -// GitURLFragment is the buildkit-specific metadata extracted from the fragment +// GitURLOpts is the buildkit-specific metadata extracted from the fragment // of a remote URL. -type GitURLFragment struct { +type GitURLOpts struct { // Ref is the git reference Ref string // Subdir is the sub-directory inside the git repository to use Subdir string } -// splitGitFragment splits a git URL fragment into its respective git +// parseOpts splits a git URL fragment into its respective git // reference and subdirectory components. -func splitGitFragment(fragment string) *GitURLFragment { +func parseOpts(fragment string) *GitURLOpts { if fragment == "" { return nil } ref, subdir, _ := strings.Cut(fragment, ":") - return &GitURLFragment{Ref: ref, Subdir: subdir} + return &GitURLOpts{Ref: ref, Subdir: subdir} } // ParseURL parses a BuildKit-style Git URL (that may contain additional @@ -106,27 +106,27 @@ func IsGitTransport(remote string) bool { } func fromURL(url *url.URL) *GitURL { - withoutFragment := *url - withoutFragment.Fragment = "" + withoutOpts := *url + withoutOpts.Fragment = "" return &GitURL{ - Scheme: url.Scheme, - User: url.User, - Host: url.Host, - Path: url.Path, - Fragment: splitGitFragment(url.Fragment), - Remote: withoutFragment.String(), + Scheme: url.Scheme, + User: url.User, + Host: url.Host, + Path: url.Path, + Opts: parseOpts(url.Fragment), + Remote: withoutOpts.String(), } } func fromSCPStyleURL(url *sshutil.SCPStyleURL) *GitURL { - withoutFragment := *url - withoutFragment.Fragment = "" + withoutOpts := *url + withoutOpts.Fragment = "" return &GitURL{ - Scheme: SSHProtocol, - User: url.User, - Host: url.Host, - Path: url.Path, - Fragment: splitGitFragment(url.Fragment), - Remote: withoutFragment.String(), + Scheme: SSHProtocol, + User: url.User, + Host: url.Host, + Path: url.Path, + Opts: parseOpts(url.Fragment), + Remote: withoutOpts.String(), } } diff --git a/vendor/github.com/moby/buildkit/util/imageutil/config.go b/vendor/github.com/moby/buildkit/util/imageutil/config.go index ba1c6852e1..db543eafc3 100644 --- a/vendor/github.com/moby/buildkit/util/imageutil/config.go +++ b/vendor/github.com/moby/buildkit/util/imageutil/config.go @@ -13,6 +13,7 @@ import ( "github.com/containerd/containerd/v2/core/remotes" "github.com/containerd/containerd/v2/core/remotes/docker" "github.com/containerd/containerd/v2/pkg/reference" + cerrdefs "github.com/containerd/errdefs" "github.com/containerd/platforms" intoto "github.com/in-toto/in-toto-golang/in_toto" srctypes "github.com/moby/buildkit/source/types" @@ -115,8 +116,9 @@ func Config(ctx context.Context, str string, resolver remotes.Resolver, cache Co } if desc.MediaType == images.MediaTypeDockerSchema1Manifest { - dgst, dt, err := readSchema1Config(ctx, desc, fetcher) - return dgst, dt, err + errMsg := "support Docker Image manifest version 2, schema 1 has been removed. " + + "More information at https://docs.docker.com/go/deprecated-image-specs/" + return "", nil, errors.WithStack(cerrdefs.ErrConflict.WithMessage(errMsg)) } children := childrenConfigHandler(cache, platform) @@ -198,10 +200,7 @@ func childrenConfigHandler(provider content.Provider, platform platforms.MatchCo } } -// specs.MediaTypeImageManifest, // TODO: detect schema1/manifest-list func DetectManifestMediaType(ra content.ReaderAt) (string, error) { - // TODO: schema1 - dt := make([]byte, ra.Size()) if _, err := ra.ReadAt(dt, 0); err != nil { return "", err diff --git a/vendor/github.com/moby/buildkit/util/imageutil/schema1.go b/vendor/github.com/moby/buildkit/util/imageutil/schema1.go deleted file mode 100644 index 72bee0c8f2..0000000000 --- a/vendor/github.com/moby/buildkit/util/imageutil/schema1.go +++ /dev/null @@ -1,88 +0,0 @@ -package imageutil - -import ( - "context" - "encoding/json" - "io" - "strings" - "time" - - "github.com/containerd/containerd/v2/core/remotes" - dockerspec "github.com/moby/docker-image-spec/specs-go/v1" - digest "github.com/opencontainers/go-digest" - ocispecs "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/pkg/errors" -) - -func readSchema1Config(ctx context.Context, desc ocispecs.Descriptor, fetcher remotes.Fetcher) (digest.Digest, []byte, error) { - rc, err := fetcher.Fetch(ctx, desc) - if err != nil { - return "", nil, err - } - defer rc.Close() - dt, err := io.ReadAll(rc) - if err != nil { - return "", nil, errors.Wrap(err, "failed to fetch schema1 manifest") - } - dt, err = convertSchema1ConfigMeta(dt) - if err != nil { - return "", nil, err - } - return desc.Digest, dt, nil -} - -func convertSchema1ConfigMeta(in []byte) ([]byte, error) { - type history struct { - V1Compatibility string `json:"v1Compatibility"` - } - var m struct { - History []history `json:"history"` - } - if err := json.Unmarshal(in, &m); err != nil { - return nil, errors.Wrap(err, "failed to unmarshal schema1 manifest") - } - if len(m.History) == 0 { - return nil, errors.Errorf("invalid schema1 manifest") - } - - var img dockerspec.DockerOCIImage - if err := json.Unmarshal([]byte(m.History[0].V1Compatibility), &img); err != nil { - return nil, errors.Wrap(err, "failed to unmarshal image from schema 1 history") - } - - img.RootFS = ocispecs.RootFS{ - Type: "layers", // filled in by exporter - } - img.History = make([]ocispecs.History, len(m.History)) - - for i := range m.History { - var h v1History - if err := json.Unmarshal([]byte(m.History[i].V1Compatibility), &h); err != nil { - return nil, errors.Wrap(err, "failed to unmarshal history") - } - img.History[len(m.History)-i-1] = ocispecs.History{ - Author: h.Author, - Comment: h.Comment, - Created: &h.Created, - CreatedBy: strings.Join(h.ContainerConfig.Cmd, " "), - EmptyLayer: (h.ThrowAway != nil && *h.ThrowAway) || (h.Size != nil && *h.Size == 0), - } - } - - dt, err := json.MarshalIndent(img, "", " ") - if err != nil { - return nil, errors.Wrap(err, "failed to marshal schema1 config") - } - return dt, nil -} - -type v1History struct { - Author string `json:"author,omitempty"` - Created time.Time `json:"created"` - Comment string `json:"comment,omitempty"` - ThrowAway *bool `json:"throwaway,omitempty"` - Size *int `json:"Size,omitempty"` // used before ThrowAway field - ContainerConfig struct { - Cmd []string `json:"Cmd,omitempty"` - } `json:"container_config,omitempty"` -} diff --git a/vendor/github.com/moby/buildkit/util/pull/pull.go b/vendor/github.com/moby/buildkit/util/pull/pull.go index b3982a3400..cc86d27630 100644 --- a/vendor/github.com/moby/buildkit/util/pull/pull.go +++ b/vendor/github.com/moby/buildkit/util/pull/pull.go @@ -8,16 +8,15 @@ import ( "github.com/containerd/containerd/v2/core/images" "github.com/containerd/containerd/v2/core/remotes" "github.com/containerd/containerd/v2/core/remotes/docker" - "github.com/containerd/containerd/v2/core/remotes/docker/schema1" //nolint:staticcheck // SA1019 deprecated "github.com/containerd/containerd/v2/pkg/labels" "github.com/containerd/containerd/v2/pkg/reference" + cerrdefs "github.com/containerd/errdefs" "github.com/containerd/platforms" "github.com/moby/buildkit/session" "github.com/moby/buildkit/util/contentutil" "github.com/moby/buildkit/util/flightcontrol" "github.com/moby/buildkit/util/imageutil" "github.com/moby/buildkit/util/progress/logs" - "github.com/moby/buildkit/util/pull/pullprogress" "github.com/moby/buildkit/util/resolver/limited" "github.com/moby/buildkit/util/resolver/retryhandler" digest "github.com/opencontainers/go-digest" @@ -133,58 +132,33 @@ func (p *Puller) PullManifests(ctx context.Context, getResolver SessionResolver) return nil, err } - var schema1Converter *schema1.Converter if p.desc.MediaType == images.MediaTypeDockerSchema1Manifest { - // schema1 images are not lazy at this time, the converter will pull the whole image - // including layer blobs - schema1Converter, err = schema1.NewConverter(p.ContentStore, &pullprogress.FetcherWithProgress{ - Fetcher: fetcher, - Manager: p.ContentStore, - }) - if err != nil { - return nil, err - } - handlers = append(handlers, schema1Converter) - } else { - // Get all the children for a descriptor - childrenHandler := images.ChildrenHandler(p.ContentStore) - // Filter the children by the platform - childrenHandler = images.FilterPlatforms(childrenHandler, platform) - // Limit manifests pulled to the best match in an index - childrenHandler = images.LimitManifests(childrenHandler, platform, 1) - - dslHandler, err := docker.AppendDistributionSourceLabel(p.ContentStore, p.ref) - if err != nil { - return nil, err - } - handlers = append(handlers, - filterLayerBlobs(metadata, &mu), - retryhandler.New(limited.FetchHandler(p.ContentStore, fetcher, p.ref), logs.LoggerFromContext(ctx)), - childrenHandler, - dslHandler, - ) + errMsg := "support Docker Image manifest version 2, schema 1 has been removed. " + + "More information at https://docs.docker.com/go/deprecated-image-specs/" + return nil, errors.WithStack(cerrdefs.ErrConflict.WithMessage(errMsg)) } + // Get all the children for a descriptor + childrenHandler := images.ChildrenHandler(p.ContentStore) + // Filter the children by the platform + childrenHandler = images.FilterPlatforms(childrenHandler, platform) + // Limit manifests pulled to the best match in an index + childrenHandler = images.LimitManifests(childrenHandler, platform, 1) + + dslHandler, err := docker.AppendDistributionSourceLabel(p.ContentStore, p.ref) + if err != nil { + return nil, err + } + handlers = append(handlers, + filterLayerBlobs(metadata, &mu), + retryhandler.New(limited.FetchHandler(p.ContentStore, fetcher, p.ref), logs.LoggerFromContext(ctx)), + childrenHandler, + dslHandler, + ) if err := images.Dispatch(ctx, images.Handlers(handlers...), nil, p.desc); err != nil { return nil, err } - if schema1Converter != nil { - p.desc, err = schema1Converter.Convert(ctx) - if err != nil { - return nil, err - } - - // this just gathers metadata about the converted descriptors making up the image, does - // not fetch anything - if err := images.Dispatch(ctx, images.Handlers( - filterLayerBlobs(metadata, &mu), - images.FilterPlatforms(images.ChildrenHandler(p.ContentStore), platform), - ), nil, p.desc); err != nil { - return nil, err - } - } - for _, desc := range metadata { p.nonlayers = append(p.nonlayers, desc) switch desc.MediaType { diff --git a/vendor/github.com/moby/buildkit/util/stack/stack.pb.go b/vendor/github.com/moby/buildkit/util/stack/stack.pb.go index 452dbd15f0..ef36670a89 100644 --- a/vendor/github.com/moby/buildkit/util/stack/stack.pb.go +++ b/vendor/github.com/moby/buildkit/util/stack/stack.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 +// protoc-gen-go v1.36.6 // protoc v3.11.4 // source: github.com/moby/buildkit/util/stack/stack.proto @@ -11,6 +11,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -21,15 +22,14 @@ const ( ) type Stack struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Frames []*Frame `protobuf:"bytes,1,rep,name=frames,proto3" json:"frames,omitempty"` + Cmdline []string `protobuf:"bytes,2,rep,name=cmdline,proto3" json:"cmdline,omitempty"` + Pid int32 `protobuf:"varint,3,opt,name=pid,proto3" json:"pid,omitempty"` + Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` + Revision string `protobuf:"bytes,5,opt,name=revision,proto3" json:"revision,omitempty"` unknownFields protoimpl.UnknownFields - - Frames []*Frame `protobuf:"bytes,1,rep,name=frames,proto3" json:"frames,omitempty"` - Cmdline []string `protobuf:"bytes,2,rep,name=cmdline,proto3" json:"cmdline,omitempty"` - Pid int32 `protobuf:"varint,3,opt,name=pid,proto3" json:"pid,omitempty"` - Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` - Revision string `protobuf:"bytes,5,opt,name=revision,proto3" json:"revision,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Stack) Reset() { @@ -98,13 +98,12 @@ func (x *Stack) GetRevision() string { } type Frame struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` + File string `protobuf:"bytes,2,opt,name=File,proto3" json:"File,omitempty"` + Line int32 `protobuf:"varint,3,opt,name=Line,proto3" json:"Line,omitempty"` unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` - File string `protobuf:"bytes,2,opt,name=File,proto3" json:"File,omitempty"` - Line int32 `protobuf:"varint,3,opt,name=Line,proto3" json:"Line,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Frame) Reset() { @@ -160,37 +159,28 @@ func (x *Frame) GetLine() int32 { var File_github_com_moby_buildkit_util_stack_stack_proto protoreflect.FileDescriptor -var file_github_com_moby_buildkit_util_stack_stack_proto_rawDesc = []byte{ - 0x0a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, - 0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x75, 0x74, 0x69, 0x6c, 0x2f, - 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2f, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x05, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x22, 0x8f, 0x01, 0x0a, 0x05, 0x53, 0x74, 0x61, - 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x06, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x46, 0x72, 0x61, 0x6d, 0x65, - 0x52, 0x06, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6d, 0x64, 0x6c, - 0x69, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6d, 0x64, 0x6c, 0x69, - 0x6e, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x03, 0x70, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, - 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x43, 0x0a, 0x05, 0x46, 0x72, - 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x4c, - 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x4c, 0x69, 0x6e, 0x65, 0x42, - 0x25, 0x5a, 0x23, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, - 0x62, 0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x75, 0x74, 0x69, 0x6c, - 0x2f, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_github_com_moby_buildkit_util_stack_stack_proto_rawDesc = "" + + "\n" + + "/github.com/moby/buildkit/util/stack/stack.proto\x12\x05stack\"\x8f\x01\n" + + "\x05Stack\x12$\n" + + "\x06frames\x18\x01 \x03(\v2\f.stack.FrameR\x06frames\x12\x18\n" + + "\acmdline\x18\x02 \x03(\tR\acmdline\x12\x10\n" + + "\x03pid\x18\x03 \x01(\x05R\x03pid\x12\x18\n" + + "\aversion\x18\x04 \x01(\tR\aversion\x12\x1a\n" + + "\brevision\x18\x05 \x01(\tR\brevision\"C\n" + + "\x05Frame\x12\x12\n" + + "\x04Name\x18\x01 \x01(\tR\x04Name\x12\x12\n" + + "\x04File\x18\x02 \x01(\tR\x04File\x12\x12\n" + + "\x04Line\x18\x03 \x01(\x05R\x04LineB%Z#github.com/moby/buildkit/util/stackb\x06proto3" var ( file_github_com_moby_buildkit_util_stack_stack_proto_rawDescOnce sync.Once - file_github_com_moby_buildkit_util_stack_stack_proto_rawDescData = file_github_com_moby_buildkit_util_stack_stack_proto_rawDesc + file_github_com_moby_buildkit_util_stack_stack_proto_rawDescData []byte ) func file_github_com_moby_buildkit_util_stack_stack_proto_rawDescGZIP() []byte { file_github_com_moby_buildkit_util_stack_stack_proto_rawDescOnce.Do(func() { - file_github_com_moby_buildkit_util_stack_stack_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_moby_buildkit_util_stack_stack_proto_rawDescData) + file_github_com_moby_buildkit_util_stack_stack_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_moby_buildkit_util_stack_stack_proto_rawDesc), len(file_github_com_moby_buildkit_util_stack_stack_proto_rawDesc))) }) return file_github_com_moby_buildkit_util_stack_stack_proto_rawDescData } @@ -218,7 +208,7 @@ func file_github_com_moby_buildkit_util_stack_stack_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_moby_buildkit_util_stack_stack_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_moby_buildkit_util_stack_stack_proto_rawDesc), len(file_github_com_moby_buildkit_util_stack_stack_proto_rawDesc)), NumEnums: 0, NumMessages: 2, NumExtensions: 0, @@ -229,7 +219,6 @@ func file_github_com_moby_buildkit_util_stack_stack_proto_init() { MessageInfos: file_github_com_moby_buildkit_util_stack_stack_proto_msgTypes, }.Build() File_github_com_moby_buildkit_util_stack_stack_proto = out.File - file_github_com_moby_buildkit_util_stack_stack_proto_rawDesc = nil file_github_com_moby_buildkit_util_stack_stack_proto_goTypes = nil file_github_com_moby_buildkit_util_stack_stack_proto_depIdxs = nil } diff --git a/vendor/github.com/secure-systems-lab/go-securesystemslib/cjson/canonicaljson.go b/vendor/github.com/secure-systems-lab/go-securesystemslib/cjson/canonicaljson.go index fb1d5918b2..abc860a491 100644 --- a/vendor/github.com/secure-systems-lab/go-securesystemslib/cjson/canonicaljson.go +++ b/vendor/github.com/secure-systems-lab/go-securesystemslib/cjson/canonicaljson.go @@ -6,8 +6,8 @@ import ( "errors" "fmt" "reflect" - "regexp" "sort" + "strings" ) /* @@ -18,8 +18,12 @@ escaping backslashes ("\") and double quotes (") and wrapping the resulting string in double quotes ("). */ func encodeCanonicalString(s string) string { - re := regexp.MustCompile(`([\"\\])`) - return fmt.Sprintf("\"%s\"", re.ReplaceAllString(s, "\\$1")) + // Escape backslashes + s = strings.ReplaceAll(s, "\\", "\\\\") + // Escape double quotes + s = strings.ReplaceAll(s, "\"", "\\\"") + // Wrap with double quotes + return fmt.Sprintf("\"%s\"", s) } /* @@ -28,16 +32,7 @@ object according to the OLPC canonical JSON specification (see http://wiki.laptop.org/go/Canonical_JSON) and write it to the passed *bytes.Buffer. If canonicalization fails it returns an error. */ -func encodeCanonical(obj interface{}, result *bytes.Buffer) (err error) { - // Since this function is called recursively, we use panic if an error occurs - // and recover in a deferred function, which is always called before - // returning. There we set the error that is returned eventually. - defer func() { - if r := recover(); r != nil { - err = errors.New(r.(string)) - } - }() - +func encodeCanonical(obj interface{}, result *strings.Builder) (err error) { switch objAsserted := obj.(type) { case string: result.WriteString(encodeCanonicalString(objAsserted)) @@ -90,10 +85,9 @@ func encodeCanonical(obj interface{}, result *bytes.Buffer) (err error) { // Canonicalize map for i, key := range mapKeys { - // Note: `key` must be a `string` (see `case map[string]interface{}`) and - // canonicalization of strings cannot err out (see `case string`), thus - // no error handling is needed here. - encodeCanonical(key, result) + if err := encodeCanonical(key, result); err != nil { + return err + } result.WriteString(":") if err := encodeCanonical(objAsserted[key], result); err != nil { @@ -120,7 +114,16 @@ slice. It uses the OLPC canonical JSON specification (see http://wiki.laptop.org/go/Canonical_JSON). If canonicalization fails the byte slice is nil and the second return value contains the error. */ -func EncodeCanonical(obj interface{}) ([]byte, error) { +func EncodeCanonical(obj interface{}) (out []byte, err error) { + // We use panic if an error occurs and recover in a deferred function, + // which is always called before returning. + // There we set the error that is returned eventually. + defer func() { + if r := recover(); r != nil { + err = errors.New(r.(string)) + } + }() + // FIXME: Terrible hack to turn the passed struct into a map, converting // the struct's variable names to the json key names defined in the struct data, err := json.Marshal(obj) @@ -136,10 +139,13 @@ func EncodeCanonical(obj interface{}) ([]byte, error) { } // Create a buffer and write the canonicalized JSON bytes to it - var result bytes.Buffer + var result strings.Builder + // Allocate output result buffer with the input size. + result.Grow(len(data)) + // Recursively encode the jsonmap if err := encodeCanonical(jsonMap, &result); err != nil { return nil, err } - return result.Bytes(), nil + return []byte(result.String()), nil } diff --git a/vendor/github.com/secure-systems-lab/go-securesystemslib/dsse/envelope.go b/vendor/github.com/secure-systems-lab/go-securesystemslib/dsse/envelope.go new file mode 100644 index 0000000000..ed223e90b5 --- /dev/null +++ b/vendor/github.com/secure-systems-lab/go-securesystemslib/dsse/envelope.go @@ -0,0 +1,64 @@ +package dsse + +import ( + "encoding/base64" + "fmt" +) + +/* +Envelope captures an envelope as described by the DSSE specification. See here: +https://github.com/secure-systems-lab/dsse/blob/master/envelope.md +*/ +type Envelope struct { + PayloadType string `json:"payloadType"` + Payload string `json:"payload"` + Signatures []Signature `json:"signatures"` +} + +/* +DecodeB64Payload returns the serialized body, decoded from the envelope's +payload field. A flexible decoder is used, first trying standard base64, then +URL-encoded base64. +*/ +func (e *Envelope) DecodeB64Payload() ([]byte, error) { + return b64Decode(e.Payload) +} + +/* +Signature represents a generic in-toto signature that contains the identifier +of the key which was used to create the signature. +The used signature scheme has to be agreed upon by the signer and verifer +out of band. +The signature is a base64 encoding of the raw bytes from the signature +algorithm. +*/ +type Signature struct { + KeyID string `json:"keyid"` + Sig string `json:"sig"` +} + +/* +PAE implementes the DSSE Pre-Authentic Encoding +https://github.com/secure-systems-lab/dsse/blob/master/protocol.md#signature-definition +*/ +func PAE(payloadType string, payload []byte) []byte { + return []byte(fmt.Sprintf("DSSEv1 %d %s %d %s", + len(payloadType), payloadType, + len(payload), payload)) +} + +/* +Both standard and url encoding are allowed: +https://github.com/secure-systems-lab/dsse/blob/master/envelope.md +*/ +func b64Decode(s string) ([]byte, error) { + b, err := base64.StdEncoding.DecodeString(s) + if err != nil { + b, err = base64.URLEncoding.DecodeString(s) + if err != nil { + return nil, fmt.Errorf("unable to base64 decode payload (is payload in the right format?)") + } + } + + return b, nil +} diff --git a/vendor/github.com/secure-systems-lab/go-securesystemslib/dsse/sign.go b/vendor/github.com/secure-systems-lab/go-securesystemslib/dsse/sign.go index 3dc05a4294..85aed102d4 100644 --- a/vendor/github.com/secure-systems-lab/go-securesystemslib/dsse/sign.go +++ b/vendor/github.com/secure-systems-lab/go-securesystemslib/dsse/sign.go @@ -5,111 +5,35 @@ https://github.com/secure-systems-lab/dsse package dsse import ( + "context" "encoding/base64" "errors" - "fmt" ) -// ErrUnknownKey indicates that the implementation does not recognize the -// key. -var ErrUnknownKey = errors.New("unknown key") - -// ErrNoSignature indicates that an envelope did not contain any signatures. -var ErrNoSignature = errors.New("no signature found") - // ErrNoSigners indicates that no signer was provided. var ErrNoSigners = errors.New("no signers provided") -/* -Envelope captures an envelope as described by the Secure Systems Lab -Signing Specification. See here: -https://github.com/secure-systems-lab/signing-spec/blob/master/envelope.md -*/ -type Envelope struct { - PayloadType string `json:"payloadType"` - Payload string `json:"payload"` - Signatures []Signature `json:"signatures"` -} - -/* -DecodeB64Payload returns the serialized body, decoded -from the envelope's payload field. A flexible -decoder is used, first trying standard base64, then -URL-encoded base64. -*/ -func (e *Envelope) DecodeB64Payload() ([]byte, error) { - return b64Decode(e.Payload) -} - -/* -Signature represents a generic in-toto signature that contains the identifier -of the key which was used to create the signature. -The used signature scheme has to be agreed upon by the signer and verifer -out of band. -The signature is a base64 encoding of the raw bytes from the signature -algorithm. -*/ -type Signature struct { - KeyID string `json:"keyid"` - Sig string `json:"sig"` -} - -/* -PAE implementes the DSSE Pre-Authentic Encoding -https://github.com/secure-systems-lab/dsse/blob/master/protocol.md#signature-definition -*/ -func PAE(payloadType string, payload []byte) []byte { - return []byte(fmt.Sprintf("DSSEv1 %d %s %d %s", - len(payloadType), payloadType, - len(payload), payload)) -} - -/* -Signer defines the interface for an abstract signing algorithm. -The Signer interface is used to inject signature algorithm implementations -into the EnevelopeSigner. This decoupling allows for any signing algorithm -and key management system can be used. -The full message is provided as the parameter. If the signature algorithm -depends on hashing of the message prior to signature calculation, the -implementor of this interface must perform such hashing. -The function must return raw bytes representing the calculated signature -using the current algorithm, and the key used (if applicable). -For an example see EcdsaSigner in sign_test.go. -*/ -type Signer interface { - Sign(data []byte) ([]byte, error) - KeyID() (string, error) -} - -// SignVerifer provides both the signing and verification interface. -type SignVerifier interface { - Signer - Verifier -} - // EnvelopeSigner creates signed Envelopes. type EnvelopeSigner struct { - providers []SignVerifier - ev *EnvelopeVerifier + providers []SignerVerifier } /* -NewEnvelopeSigner creates an EnvelopeSigner that uses 1+ Signer -algorithms to sign the data. -Creates a verifier with threshold=1, at least one of the providers must validate signitures successfully. +NewEnvelopeSigner creates an EnvelopeSigner that uses 1+ Signer algorithms to +sign the data. Creates a verifier with threshold=1, at least one of the +providers must validate signatures successfully. */ -func NewEnvelopeSigner(p ...SignVerifier) (*EnvelopeSigner, error) { +func NewEnvelopeSigner(p ...SignerVerifier) (*EnvelopeSigner, error) { return NewMultiEnvelopeSigner(1, p...) } /* NewMultiEnvelopeSigner creates an EnvelopeSigner that uses 1+ Signer -algorithms to sign the data. -Creates a verifier with threshold. -threashold indicates the amount of providers that must validate the envelope. +algorithms to sign the data. Creates a verifier with threshold. Threshold +indicates the amount of providers that must validate the envelope. */ -func NewMultiEnvelopeSigner(threshold int, p ...SignVerifier) (*EnvelopeSigner, error) { - var providers []SignVerifier +func NewMultiEnvelopeSigner(threshold int, p ...SignerVerifier) (*EnvelopeSigner, error) { + var providers []SignerVerifier for _, sv := range p { if sv != nil { @@ -121,19 +45,8 @@ func NewMultiEnvelopeSigner(threshold int, p ...SignVerifier) (*EnvelopeSigner, return nil, ErrNoSigners } - evps := []Verifier{} - for _, p := range providers { - evps = append(evps, p.(Verifier)) - } - - ev, err := NewMultiEnvelopeVerifier(threshold, evps...) - if err != nil { - return nil, err - } - return &EnvelopeSigner{ providers: providers, - ev: ev, }, nil } @@ -143,7 +56,7 @@ Returned is an envelope as defined here: https://github.com/secure-systems-lab/dsse/blob/master/envelope.md One signature will be added for each Signer in the EnvelopeSigner. */ -func (es *EnvelopeSigner) SignPayload(payloadType string, body []byte) (*Envelope, error) { +func (es *EnvelopeSigner) SignPayload(ctx context.Context, payloadType string, body []byte) (*Envelope, error) { var e = Envelope{ Payload: base64.StdEncoding.EncodeToString(body), PayloadType: payloadType, @@ -152,7 +65,7 @@ func (es *EnvelopeSigner) SignPayload(payloadType string, body []byte) (*Envelop paeEnc := PAE(payloadType, body) for _, signer := range es.providers { - sig, err := signer.Sign(paeEnc) + sig, err := signer.Sign(ctx, paeEnc) if err != nil { return nil, err } @@ -169,29 +82,3 @@ func (es *EnvelopeSigner) SignPayload(payloadType string, body []byte) (*Envelop return &e, nil } - -/* -Verify decodes the payload and verifies the signature. -Any domain specific validation such as parsing the decoded body and -validating the payload type is left out to the caller. -Verify returns a list of accepted keys each including a keyid, public and signiture of the accepted provider keys. -*/ -func (es *EnvelopeSigner) Verify(e *Envelope) ([]AcceptedKey, error) { - return es.ev.Verify(e) -} - -/* -Both standard and url encoding are allowed: -https://github.com/secure-systems-lab/dsse/blob/master/envelope.md -*/ -func b64Decode(s string) ([]byte, error) { - b, err := base64.StdEncoding.DecodeString(s) - if err != nil { - b, err = base64.URLEncoding.DecodeString(s) - if err != nil { - return nil, err - } - } - - return b, nil -} diff --git a/vendor/github.com/secure-systems-lab/go-securesystemslib/dsse/signerverifier.go b/vendor/github.com/secure-systems-lab/go-securesystemslib/dsse/signerverifier.go new file mode 100644 index 0000000000..99d03c7df9 --- /dev/null +++ b/vendor/github.com/secure-systems-lab/go-securesystemslib/dsse/signerverifier.go @@ -0,0 +1,43 @@ +package dsse + +import ( + "context" + "crypto" +) + +/* +Signer defines the interface for an abstract signing algorithm. The Signer +interface is used to inject signature algorithm implementations into the +EnvelopeSigner. This decoupling allows for any signing algorithm and key +management system can be used. The full message is provided as the parameter. +If the signature algorithm depends on hashing of the message prior to signature +calculation, the implementor of this interface must perform such hashing. The +function must return raw bytes representing the calculated signature using the +current algorithm, and the key used (if applicable). +*/ +type Signer interface { + Sign(ctx context.Context, data []byte) ([]byte, error) + KeyID() (string, error) +} + +/* +Verifier verifies a complete message against a signature and key. If the message +was hashed prior to signature generation, the verifier must perform the same +steps. If KeyID returns successfully, only signature matching the key ID will be +verified. +*/ +type Verifier interface { + Verify(ctx context.Context, data, sig []byte) error + KeyID() (string, error) + Public() crypto.PublicKey +} + +// SignerVerifier provides both the signing and verification interface. +type SignerVerifier interface { + Signer + Verifier +} + +// Deprecated: switch to renamed SignerVerifier. This is currently aliased for +// backwards compatibility. +type SignVerifier = SignerVerifier diff --git a/vendor/github.com/secure-systems-lab/go-securesystemslib/dsse/verify.go b/vendor/github.com/secure-systems-lab/go-securesystemslib/dsse/verify.go index ead1c32ca8..a36146b82a 100644 --- a/vendor/github.com/secure-systems-lab/go-securesystemslib/dsse/verify.go +++ b/vendor/github.com/secure-systems-lab/go-securesystemslib/dsse/verify.go @@ -1,6 +1,7 @@ package dsse import ( + "context" "crypto" "errors" "fmt" @@ -8,17 +9,8 @@ import ( "golang.org/x/crypto/ssh" ) -/* -Verifier verifies a complete message against a signature and key. -If the message was hashed prior to signature generation, the verifier -must perform the same steps. -If KeyID returns successfully, only signature matching the key ID will be verified. -*/ -type Verifier interface { - Verify(data, sig []byte) error - KeyID() (string, error) - Public() crypto.PublicKey -} +// ErrNoSignature indicates that an envelope did not contain any signatures. +var ErrNoSignature = errors.New("no signature found") type EnvelopeVerifier struct { providers []Verifier @@ -31,7 +23,7 @@ type AcceptedKey struct { Sig Signature } -func (ev *EnvelopeVerifier) Verify(e *Envelope) ([]AcceptedKey, error) { +func (ev *EnvelopeVerifier) Verify(ctx context.Context, e *Envelope) ([]AcceptedKey, error) { if e == nil { return nil, errors.New("cannot verify a nil envelope") } @@ -78,7 +70,7 @@ func (ev *EnvelopeVerifier) Verify(e *Envelope) ([]AcceptedKey, error) { continue } - err = v.Verify(paeEnc, sig) + err = v.Verify(ctx, paeEnc, sig) if err != nil { continue } @@ -104,11 +96,11 @@ func (ev *EnvelopeVerifier) Verify(e *Envelope) ([]AcceptedKey, error) { // Sanity if with some reflect magic this happens. if ev.threshold <= 0 || ev.threshold > len(ev.providers) { - return nil, errors.New("Invalid threshold") + return nil, errors.New("invalid threshold") } if len(usedKeyids) < ev.threshold { - return acceptedKeys, errors.New(fmt.Sprintf("Accepted signatures do not match threshold, Found: %d, Expected %d", len(acceptedKeys), ev.threshold)) + return acceptedKeys, fmt.Errorf("accepted signatures do not match threshold, Found: %d, Expected %d", len(acceptedKeys), ev.threshold) } return acceptedKeys, nil @@ -119,15 +111,15 @@ func NewEnvelopeVerifier(v ...Verifier) (*EnvelopeVerifier, error) { } func NewMultiEnvelopeVerifier(threshold int, p ...Verifier) (*EnvelopeVerifier, error) { - if threshold <= 0 || threshold > len(p) { - return nil, errors.New("Invalid threshold") + return nil, errors.New("invalid threshold") } ev := EnvelopeVerifier{ providers: p, threshold: threshold, } + return &ev, nil } diff --git a/vendor/github.com/secure-systems-lab/go-securesystemslib/signerverifier/ecdsa.go b/vendor/github.com/secure-systems-lab/go-securesystemslib/signerverifier/ecdsa.go new file mode 100644 index 0000000000..578d6a5483 --- /dev/null +++ b/vendor/github.com/secure-systems-lab/go-securesystemslib/signerverifier/ecdsa.go @@ -0,0 +1,111 @@ +package signerverifier + +import ( + "context" + "crypto" + "crypto/ecdsa" + "crypto/rand" + "crypto/sha256" + "crypto/sha512" + "fmt" + "os" +) + +const ECDSAKeyType = "ecdsa" + +// ECDSASignerVerifier is a dsse.SignerVerifier compliant interface to sign and +// verify signatures using ECDSA keys. +type ECDSASignerVerifier struct { + keyID string + curveSize int + private *ecdsa.PrivateKey + public *ecdsa.PublicKey +} + +// NewECDSASignerVerifierFromSSLibKey creates an ECDSASignerVerifier from an +// SSLibKey. +func NewECDSASignerVerifierFromSSLibKey(key *SSLibKey) (*ECDSASignerVerifier, error) { + if len(key.KeyVal.Public) == 0 { + return nil, ErrInvalidKey + } + + _, publicParsedKey, err := decodeAndParsePEM([]byte(key.KeyVal.Public)) + if err != nil { + return nil, fmt.Errorf("unable to create ECDSA signerverifier: %w", err) + } + + sv := &ECDSASignerVerifier{ + keyID: key.KeyID, + curveSize: publicParsedKey.(*ecdsa.PublicKey).Params().BitSize, + public: publicParsedKey.(*ecdsa.PublicKey), + private: nil, + } + + if len(key.KeyVal.Private) > 0 { + _, privateParsedKey, err := decodeAndParsePEM([]byte(key.KeyVal.Private)) + if err != nil { + return nil, fmt.Errorf("unable to create ECDSA signerverifier: %w", err) + } + + sv.private = privateParsedKey.(*ecdsa.PrivateKey) + } + + return sv, nil +} + +// Sign creates a signature for `data`. +func (sv *ECDSASignerVerifier) Sign(ctx context.Context, data []byte) ([]byte, error) { + if sv.private == nil { + return nil, ErrNotPrivateKey + } + + hashedData := getECDSAHashedData(data, sv.curveSize) + + return ecdsa.SignASN1(rand.Reader, sv.private, hashedData) +} + +// Verify verifies the `sig` value passed in against `data`. +func (sv *ECDSASignerVerifier) Verify(ctx context.Context, data []byte, sig []byte) error { + hashedData := getECDSAHashedData(data, sv.curveSize) + + if ok := ecdsa.VerifyASN1(sv.public, hashedData, sig); !ok { + return ErrSignatureVerificationFailed + } + + return nil +} + +// KeyID returns the identifier of the key used to create the +// ECDSASignerVerifier instance. +func (sv *ECDSASignerVerifier) KeyID() (string, error) { + return sv.keyID, nil +} + +// Public returns the public portion of the key used to create the +// ECDSASignerVerifier instance. +func (sv *ECDSASignerVerifier) Public() crypto.PublicKey { + return sv.public +} + +// LoadECDSAKeyFromFile returns an SSLibKey instance for an ECDSA key stored in +// a file in the custom securesystemslib format. +func LoadECDSAKeyFromFile(path string) (*SSLibKey, error) { + contents, err := os.ReadFile(path) + if err != nil { + return nil, fmt.Errorf("unable to load ECDSA key from file: %w", err) + } + + return loadKeyFromSSLibBytes(contents) +} + +func getECDSAHashedData(data []byte, curveSize int) []byte { + switch { + case curveSize <= 256: + return hashBeforeSigning(data, sha256.New()) + case 256 < curveSize && curveSize <= 384: + return hashBeforeSigning(data, sha512.New384()) + case curveSize > 384: + return hashBeforeSigning(data, sha512.New()) + } + return []byte{} +} diff --git a/vendor/github.com/secure-systems-lab/go-securesystemslib/signerverifier/ed25519.go b/vendor/github.com/secure-systems-lab/go-securesystemslib/signerverifier/ed25519.go new file mode 100644 index 0000000000..c71d313a75 --- /dev/null +++ b/vendor/github.com/secure-systems-lab/go-securesystemslib/signerverifier/ed25519.go @@ -0,0 +1,98 @@ +package signerverifier + +import ( + "context" + "crypto" + "crypto/ed25519" + "encoding/hex" + "fmt" + "os" +) + +const ED25519KeyType = "ed25519" + +// ED25519SignerVerifier is a dsse.SignerVerifier compliant interface to sign +// and verify signatures using ED25519 keys. +type ED25519SignerVerifier struct { + keyID string + private ed25519.PrivateKey + public ed25519.PublicKey +} + +// NewED25519SignerVerifierFromSSLibKey creates an Ed25519SignerVerifier from an +// SSLibKey. +func NewED25519SignerVerifierFromSSLibKey(key *SSLibKey) (*ED25519SignerVerifier, error) { + if len(key.KeyVal.Public) == 0 { + return nil, ErrInvalidKey + } + + public, err := hex.DecodeString(key.KeyVal.Public) + if err != nil { + return nil, fmt.Errorf("unable to create ED25519 signerverifier: %w", err) + } + + var private []byte + if len(key.KeyVal.Private) > 0 { + private, err = hex.DecodeString(key.KeyVal.Private) + if err != nil { + return nil, fmt.Errorf("unable to create ED25519 signerverifier: %w", err) + } + + // python-securesystemslib provides an interface to generate ed25519 + // keys but it differs slightly in how it serializes the key to disk. + // Specifically, the keyval.private field includes _only_ the private + // portion of the key while libraries such as crypto/ed25519 also expect + // the public portion. So, if the private portion is half of what we + // expect, we append the public portion as well. + if len(private) == ed25519.PrivateKeySize/2 { + private = append(private, public...) + } + } + + return &ED25519SignerVerifier{ + keyID: key.KeyID, + public: ed25519.PublicKey(public), + private: ed25519.PrivateKey(private), + }, nil +} + +// Sign creates a signature for `data`. +func (sv *ED25519SignerVerifier) Sign(ctx context.Context, data []byte) ([]byte, error) { + if len(sv.private) == 0 { + return nil, ErrNotPrivateKey + } + + signature := ed25519.Sign(sv.private, data) + return signature, nil +} + +// Verify verifies the `sig` value passed in against `data`. +func (sv *ED25519SignerVerifier) Verify(ctx context.Context, data []byte, sig []byte) error { + if ok := ed25519.Verify(sv.public, data, sig); ok { + return nil + } + return ErrSignatureVerificationFailed +} + +// KeyID returns the identifier of the key used to create the +// ED25519SignerVerifier instance. +func (sv *ED25519SignerVerifier) KeyID() (string, error) { + return sv.keyID, nil +} + +// Public returns the public portion of the key used to create the +// ED25519SignerVerifier instance. +func (sv *ED25519SignerVerifier) Public() crypto.PublicKey { + return sv.public +} + +// LoadED25519KeyFromFile returns an SSLibKey instance for an ED25519 key stored +// in a file in the custom securesystemslib format. +func LoadED25519KeyFromFile(path string) (*SSLibKey, error) { + contents, err := os.ReadFile(path) + if err != nil { + return nil, fmt.Errorf("unable to load ED25519 key from file: %w", err) + } + + return loadKeyFromSSLibBytes(contents) +} diff --git a/vendor/github.com/secure-systems-lab/go-securesystemslib/signerverifier/rsa.go b/vendor/github.com/secure-systems-lab/go-securesystemslib/signerverifier/rsa.go new file mode 100644 index 0000000000..3612f28a4b --- /dev/null +++ b/vendor/github.com/secure-systems-lab/go-securesystemslib/signerverifier/rsa.go @@ -0,0 +1,141 @@ +package signerverifier + +import ( + "context" + "crypto" + "crypto/rand" + "crypto/rsa" + "crypto/sha256" + "crypto/x509" + "fmt" + "os" + "strings" +) + +const ( + RSAKeyType = "rsa" + RSAKeyScheme = "rsassa-pss-sha256" + RSAPrivateKeyPEM = "RSA PRIVATE KEY" +) + +// RSAPSSSignerVerifier is a dsse.SignerVerifier compliant interface to sign and +// verify signatures using RSA keys following the RSA-PSS scheme. +type RSAPSSSignerVerifier struct { + keyID string + private *rsa.PrivateKey + public *rsa.PublicKey +} + +// NewRSAPSSSignerVerifierFromSSLibKey creates an RSAPSSSignerVerifier from an +// SSLibKey. +func NewRSAPSSSignerVerifierFromSSLibKey(key *SSLibKey) (*RSAPSSSignerVerifier, error) { + if len(key.KeyVal.Public) == 0 { + return nil, ErrInvalidKey + } + + _, publicParsedKey, err := decodeAndParsePEM([]byte(key.KeyVal.Public)) + if err != nil { + return nil, fmt.Errorf("unable to create RSA-PSS signerverifier: %w", err) + } + + if len(key.KeyVal.Private) > 0 { + _, privateParsedKey, err := decodeAndParsePEM([]byte(key.KeyVal.Private)) + if err != nil { + return nil, fmt.Errorf("unable to create RSA-PSS signerverifier: %w", err) + } + + return &RSAPSSSignerVerifier{ + keyID: key.KeyID, + public: publicParsedKey.(*rsa.PublicKey), + private: privateParsedKey.(*rsa.PrivateKey), + }, nil + } + + return &RSAPSSSignerVerifier{ + keyID: key.KeyID, + public: publicParsedKey.(*rsa.PublicKey), + private: nil, + }, nil +} + +// Sign creates a signature for `data`. +func (sv *RSAPSSSignerVerifier) Sign(ctx context.Context, data []byte) ([]byte, error) { + if sv.private == nil { + return nil, ErrNotPrivateKey + } + + hashedData := hashBeforeSigning(data, sha256.New()) + + return rsa.SignPSS(rand.Reader, sv.private, crypto.SHA256, hashedData, &rsa.PSSOptions{SaltLength: sha256.Size, Hash: crypto.SHA256}) +} + +// Verify verifies the `sig` value passed in against `data`. +func (sv *RSAPSSSignerVerifier) Verify(ctx context.Context, data []byte, sig []byte) error { + hashedData := hashBeforeSigning(data, sha256.New()) + + if err := rsa.VerifyPSS(sv.public, crypto.SHA256, hashedData, sig, &rsa.PSSOptions{SaltLength: sha256.Size, Hash: crypto.SHA256}); err != nil { + return ErrSignatureVerificationFailed + } + + return nil +} + +// KeyID returns the identifier of the key used to create the +// RSAPSSSignerVerifier instance. +func (sv *RSAPSSSignerVerifier) KeyID() (string, error) { + return sv.keyID, nil +} + +// Public returns the public portion of the key used to create the +// RSAPSSSignerVerifier instance. +func (sv *RSAPSSSignerVerifier) Public() crypto.PublicKey { + return sv.public +} + +// LoadRSAPSSKeyFromFile returns an SSLibKey instance for an RSA key stored in a +// file. +func LoadRSAPSSKeyFromFile(path string) (*SSLibKey, error) { + contents, err := os.ReadFile(path) + if err != nil { + return nil, fmt.Errorf("unable to load RSA key from file: %w", err) + } + + pemData, keyObj, err := decodeAndParsePEM(contents) + if err != nil { + return nil, fmt.Errorf("unable to load RSA key from file: %w", err) + } + + key := &SSLibKey{ + KeyType: RSAKeyType, + Scheme: RSAKeyScheme, + KeyIDHashAlgorithms: KeyIDHashAlgorithms, + KeyVal: KeyVal{}, + } + + switch k := keyObj.(type) { + case *rsa.PublicKey: + pubKeyBytes, err := x509.MarshalPKIXPublicKey(k) + if err != nil { + return nil, fmt.Errorf("unable to load RSA key from file: %w", err) + } + key.KeyVal.Public = strings.TrimSpace(string(generatePEMBlock(pubKeyBytes, PublicKeyPEM))) + + case *rsa.PrivateKey: + pubKeyBytes, err := x509.MarshalPKIXPublicKey(k.Public()) + if err != nil { + return nil, fmt.Errorf("unable to load RSA key from file: %w", err) + } + key.KeyVal.Public = strings.TrimSpace(string(generatePEMBlock(pubKeyBytes, PublicKeyPEM))) + key.KeyVal.Private = strings.TrimSpace(string(generatePEMBlock(pemData.Bytes, RSAPrivateKeyPEM))) + } + + if len(key.KeyID) == 0 { + keyID, err := calculateKeyID(key) + if err != nil { + return nil, fmt.Errorf("unable to load RSA key from file: %w", err) + } + key.KeyID = keyID + } + + return key, nil +} diff --git a/vendor/github.com/secure-systems-lab/go-securesystemslib/signerverifier/signerverifier.go b/vendor/github.com/secure-systems-lab/go-securesystemslib/signerverifier/signerverifier.go new file mode 100644 index 0000000000..5f510f7be5 --- /dev/null +++ b/vendor/github.com/secure-systems-lab/go-securesystemslib/signerverifier/signerverifier.go @@ -0,0 +1,34 @@ +package signerverifier + +import ( + "errors" +) + +var KeyIDHashAlgorithms = []string{"sha256", "sha512"} + +var ( + ErrNotPrivateKey = errors.New("loaded key is not a private key") + ErrSignatureVerificationFailed = errors.New("failed to verify signature") + ErrUnknownKeyType = errors.New("unknown key type") + ErrInvalidThreshold = errors.New("threshold is either less than 1 or greater than number of provided public keys") + ErrInvalidKey = errors.New("key object has no value") +) + +const ( + PublicKeyPEM = "PUBLIC KEY" + PrivateKeyPEM = "PRIVATE KEY" +) + +type SSLibKey struct { + KeyIDHashAlgorithms []string `json:"keyid_hash_algorithms"` + KeyType string `json:"keytype"` + KeyVal KeyVal `json:"keyval"` + Scheme string `json:"scheme"` + KeyID string `json:"keyid"` +} + +type KeyVal struct { + Private string `json:"private,omitempty"` + Public string `json:"public"` + Certificate string `json:"certificate,omitempty"` +} diff --git a/vendor/github.com/secure-systems-lab/go-securesystemslib/signerverifier/utils.go b/vendor/github.com/secure-systems-lab/go-securesystemslib/signerverifier/utils.go new file mode 100644 index 0000000000..73aaa77d46 --- /dev/null +++ b/vendor/github.com/secure-systems-lab/go-securesystemslib/signerverifier/utils.go @@ -0,0 +1,150 @@ +package signerverifier + +import ( + "crypto/sha256" + "crypto/x509" + "encoding/hex" + "encoding/json" + "encoding/pem" + "errors" + "hash" + "testing" + + "github.com/secure-systems-lab/go-securesystemslib/cjson" +) + +/* +Credits: Parts of this file were originally authored for in-toto-golang. +*/ + +var ( + // ErrNoPEMBlock gets triggered when there is no PEM block in the provided file + ErrNoPEMBlock = errors.New("failed to decode the data as PEM block (are you sure this is a pem file?)") + // ErrFailedPEMParsing gets returned when PKCS1, PKCS8 or PKIX key parsing fails + ErrFailedPEMParsing = errors.New("failed parsing the PEM block: unsupported PEM type") +) + +// loadKeyFromSSLibBytes returns a pointer to a Key instance created from the +// contents of the bytes. The key contents are expected to be in the custom +// securesystemslib format. +func loadKeyFromSSLibBytes(contents []byte) (*SSLibKey, error) { + var key *SSLibKey + if err := json.Unmarshal(contents, &key); err != nil { + return nil, err + } + + if len(key.KeyID) == 0 { + keyID, err := calculateKeyID(key) + if err != nil { + return nil, err + } + key.KeyID = keyID + } + + return key, nil +} + +func calculateKeyID(k *SSLibKey) (string, error) { + key := map[string]any{ + "keytype": k.KeyType, + "scheme": k.Scheme, + "keyid_hash_algorithms": k.KeyIDHashAlgorithms, + "keyval": map[string]string{ + "public": k.KeyVal.Public, + }, + } + canonical, err := cjson.EncodeCanonical(key) + if err != nil { + return "", err + } + digest := sha256.Sum256(canonical) + return hex.EncodeToString(digest[:]), nil +} + +/* +generatePEMBlock creates a PEM block from scratch via the keyBytes and the pemType. +If successful it returns a PEM block as []byte slice. This function should always +succeed, if keyBytes is empty the PEM block will have an empty byte block. +Therefore only header and footer will exist. +*/ +func generatePEMBlock(keyBytes []byte, pemType string) []byte { + // construct PEM block + pemBlock := &pem.Block{ + Type: pemType, + Headers: nil, + Bytes: keyBytes, + } + return pem.EncodeToMemory(pemBlock) +} + +/* +decodeAndParsePEM receives potential PEM bytes decodes them via pem.Decode +and pushes them to parseKey. If any error occurs during this process, +the function will return nil and an error (either ErrFailedPEMParsing +or ErrNoPEMBlock). On success it will return the decoded pemData, the +key object interface and nil as error. We need the decoded pemData, +because LoadKey relies on decoded pemData for operating system +interoperability. +*/ +func decodeAndParsePEM(pemBytes []byte) (*pem.Block, any, error) { + // pem.Decode returns the parsed pem block and a rest. + // The rest is everything, that could not be parsed as PEM block. + // Therefore we can drop this via using the blank identifier "_" + data, _ := pem.Decode(pemBytes) + if data == nil { + return nil, nil, ErrNoPEMBlock + } + + // Try to load private key, if this fails try to load + // key as public key + key, err := parsePEMKey(data.Bytes) + if err != nil { + return nil, nil, err + } + return data, key, nil +} + +/* +parseKey tries to parse a PEM []byte slice. Using the following standards +in the given order: + + - PKCS8 + - PKCS1 + - PKIX + +On success it returns the parsed key and nil. +On failure it returns nil and the error ErrFailedPEMParsing +*/ +func parsePEMKey(data []byte) (any, error) { + key, err := x509.ParsePKCS8PrivateKey(data) + if err == nil { + return key, nil + } + key, err = x509.ParsePKCS1PrivateKey(data) + if err == nil { + return key, nil + } + key, err = x509.ParsePKIXPublicKey(data) + if err == nil { + return key, nil + } + key, err = x509.ParseECPrivateKey(data) + if err == nil { + return key, nil + } + return nil, ErrFailedPEMParsing +} + +func hashBeforeSigning(data []byte, h hash.Hash) []byte { + h.Write(data) + return h.Sum(nil) +} + +func hexDecode(t *testing.T, data string) []byte { + t.Helper() + b, err := hex.DecodeString(data) + if err != nil { + t.Fatal(err) + } + return b +} diff --git a/vendor/github.com/spdx/tools-golang/json/marshal/json.go b/vendor/github.com/spdx/tools-golang/json/marshal/json.go new file mode 100644 index 0000000000..b5baefecc3 --- /dev/null +++ b/vendor/github.com/spdx/tools-golang/json/marshal/json.go @@ -0,0 +1,15 @@ +package marshal + +import ( + "bytes" + "encoding/json" +) + +// JSON marshals the object _without_ escaping HTML +func JSON(obj interface{}) ([]byte, error) { + buf := &bytes.Buffer{} + enc := json.NewEncoder(buf) + enc.SetEscapeHTML(false) + err := enc.Encode(obj) + return bytes.TrimSpace(buf.Bytes()), err +} diff --git a/vendor/github.com/spdx/tools-golang/spdx/model.go b/vendor/github.com/spdx/tools-golang/spdx/model.go index e91856b0e5..7d1105ebf3 100644 --- a/vendor/github.com/spdx/tools-golang/spdx/model.go +++ b/vendor/github.com/spdx/tools-golang/spdx/model.go @@ -85,6 +85,9 @@ const ( TypePersistentIdSwh = common.TypePersistentIdSwh TypePersistentIdGitoid = common.TypePersistentIdGitoid + // F.5 Other + CategoryOther = common.CategoryOther + // 11.1 Relationship field types RelationshipDescribes = common.TypeRelationshipDescribe RelationshipDescribedBy = common.TypeRelationshipDescribeBy diff --git a/vendor/github.com/spdx/tools-golang/spdx/v2/common/annotation.go b/vendor/github.com/spdx/tools-golang/spdx/v2/common/annotation.go index e77d7b780a..645aa92499 100644 --- a/vendor/github.com/spdx/tools-golang/spdx/v2/common/annotation.go +++ b/vendor/github.com/spdx/tools-golang/spdx/v2/common/annotation.go @@ -3,9 +3,10 @@ package common import ( - "encoding/json" "fmt" "strings" + + "github.com/spdx/tools-golang/json/marshal" ) type Annotator struct { @@ -37,7 +38,7 @@ func (a *Annotator) UnmarshalJSON(data []byte) error { // This function is also used when marshalling to YAML func (a Annotator) MarshalJSON() ([]byte, error) { if a.Annotator != "" { - return json.Marshal(fmt.Sprintf("%s: %s", a.AnnotatorType, a.Annotator)) + return marshal.JSON(fmt.Sprintf("%s: %s", a.AnnotatorType, a.Annotator)) } return []byte{}, nil diff --git a/vendor/github.com/spdx/tools-golang/spdx/v2/common/creation_info.go b/vendor/github.com/spdx/tools-golang/spdx/v2/common/creation_info.go index c87ae7be92..77b24ee0d6 100644 --- a/vendor/github.com/spdx/tools-golang/spdx/v2/common/creation_info.go +++ b/vendor/github.com/spdx/tools-golang/spdx/v2/common/creation_info.go @@ -3,9 +3,10 @@ package common import ( - "encoding/json" "fmt" "strings" + + "github.com/spdx/tools-golang/json/marshal" ) // Creator is a wrapper around the Creator SPDX field. The SPDX field contains two values, which requires special @@ -37,7 +38,7 @@ func (c *Creator) UnmarshalJSON(data []byte) error { // This function is also used with marshalling to YAML func (c Creator) MarshalJSON() ([]byte, error) { if c.Creator != "" { - return json.Marshal(fmt.Sprintf("%s: %s", c.CreatorType, c.Creator)) + return marshal.JSON(fmt.Sprintf("%s: %s", c.CreatorType, c.Creator)) } return []byte{}, nil diff --git a/vendor/github.com/spdx/tools-golang/spdx/v2/common/external.go b/vendor/github.com/spdx/tools-golang/spdx/v2/common/external.go index 8344ac6162..2715815e70 100644 --- a/vendor/github.com/spdx/tools-golang/spdx/v2/common/external.go +++ b/vendor/github.com/spdx/tools-golang/spdx/v2/common/external.go @@ -21,11 +21,15 @@ const ( TypePackageManagerNuGet string = "nuget" TypePackageManagerBower string = "bower" TypePackageManagerPURL string = "purl" + // F.4 Persistent-Id types CategoryPersistentId string = "PERSISTENT-ID" TypePersistentIdSwh string = "swh" TypePersistentIdGitoid string = "gitoid" + // F.5 Other + CategoryOther string = "OTHER" + // 11.1 Relationship field types TypeRelationshipDescribe string = "DESCRIBES" TypeRelationshipDescribeBy string = "DESCRIBED_BY" diff --git a/vendor/github.com/spdx/tools-golang/spdx/v2/common/identifier.go b/vendor/github.com/spdx/tools-golang/spdx/v2/common/identifier.go index 806a8157e2..929e42fa45 100644 --- a/vendor/github.com/spdx/tools-golang/spdx/v2/common/identifier.go +++ b/vendor/github.com/spdx/tools-golang/spdx/v2/common/identifier.go @@ -3,9 +3,10 @@ package common import ( - "encoding/json" "fmt" "strings" + + "github.com/spdx/tools-golang/json/marshal" ) const ( @@ -21,7 +22,7 @@ type ElementID string // MarshalJSON returns an SPDXRef- prefixed JSON string func (d ElementID) MarshalJSON() ([]byte, error) { - return json.Marshal(prefixElementId(d)) + return marshal.JSON(prefixElementId(d)) } // UnmarshalJSON validates SPDXRef- prefixes and removes them when processing ElementIDs @@ -85,11 +86,11 @@ type DocElementID struct { func (d DocElementID) MarshalJSON() ([]byte, error) { if d.DocumentRefID != "" && d.ElementRefID != "" { idStr := prefixElementId(d.ElementRefID) - return json.Marshal(fmt.Sprintf("%s%s:%s", documentRefPrefix, d.DocumentRefID, idStr)) + return marshal.JSON(fmt.Sprintf("%s%s:%s", documentRefPrefix, d.DocumentRefID, idStr)) } else if d.ElementRefID != "" { - return json.Marshal(prefixElementId(d.ElementRefID)) + return marshal.JSON(prefixElementId(d.ElementRefID)) } else if d.SpecialID != "" { - return json.Marshal(d.SpecialID) + return marshal.JSON(d.SpecialID) } return []byte{}, fmt.Errorf("failed to marshal empty DocElementID") diff --git a/vendor/github.com/spdx/tools-golang/spdx/v2/common/package.go b/vendor/github.com/spdx/tools-golang/spdx/v2/common/package.go index 349cef2549..45c73677ed 100644 --- a/vendor/github.com/spdx/tools-golang/spdx/v2/common/package.go +++ b/vendor/github.com/spdx/tools-golang/spdx/v2/common/package.go @@ -3,9 +3,10 @@ package common import ( - "encoding/json" "fmt" "strings" + + "github.com/spdx/tools-golang/json/marshal" ) type Supplier struct { @@ -43,9 +44,9 @@ func (s *Supplier) UnmarshalJSON(data []byte) error { // This function is also used when marshalling to YAML func (s Supplier) MarshalJSON() ([]byte, error) { if s.Supplier == "NOASSERTION" { - return json.Marshal(s.Supplier) + return marshal.JSON(s.Supplier) } else if s.SupplierType != "" && s.Supplier != "" { - return json.Marshal(fmt.Sprintf("%s: %s", s.SupplierType, s.Supplier)) + return marshal.JSON(fmt.Sprintf("%s: %s", s.SupplierType, s.Supplier)) } return []byte{}, fmt.Errorf("failed to marshal invalid Supplier: %+v", s) @@ -84,12 +85,12 @@ func (o *Originator) UnmarshalJSON(data []byte) error { // This function is also used when marshalling to YAML func (o Originator) MarshalJSON() ([]byte, error) { if o.Originator == "NOASSERTION" { - return json.Marshal(o.Originator) - } else if o.Originator != "" { - return json.Marshal(fmt.Sprintf("%s: %s", o.OriginatorType, o.Originator)) + return marshal.JSON(o.Originator) + } else if o.OriginatorType != "" && o.Originator != "" { + return marshal.JSON(fmt.Sprintf("%s: %s", o.OriginatorType, o.Originator)) } - return []byte{}, nil + return []byte{}, fmt.Errorf("failed to marshal invalid Originator: %+v", o) } type PackageVerificationCode struct { diff --git a/vendor/github.com/spdx/tools-golang/spdx/v2/v2_1/document.go b/vendor/github.com/spdx/tools-golang/spdx/v2/v2_1/document.go index 60a27c44d8..bd6b41d4a0 100644 --- a/vendor/github.com/spdx/tools-golang/spdx/v2/v2_1/document.go +++ b/vendor/github.com/spdx/tools-golang/spdx/v2/v2_1/document.go @@ -4,7 +4,7 @@ package v2_1 import ( - "github.com/anchore/go-struct-converter" + converter "github.com/anchore/go-struct-converter" "github.com/spdx/tools-golang/spdx/v2/common" ) diff --git a/vendor/github.com/spdx/tools-golang/spdx/v2/v2_2/document.go b/vendor/github.com/spdx/tools-golang/spdx/v2/v2_2/document.go index c7dae4423f..5fcd33aa41 100644 --- a/vendor/github.com/spdx/tools-golang/spdx/v2/v2_2/document.go +++ b/vendor/github.com/spdx/tools-golang/spdx/v2/v2_2/document.go @@ -120,6 +120,14 @@ func (d *Document) UnmarshalJSON(b []byte) error { return fmt.Sprintf("%v-%v->%v", common.RenderDocElementID(refA), rel, common.RenderDocElementID(refB)) } + // remove null relationships + for i := 0; i < len(d.Relationships); i++ { + if d.Relationships[i] == nil { + d.Relationships = append(d.Relationships[0:i], d.Relationships[i+1:]...) + i-- + } + } + // index current list of relationships to ensure no duplication for _, r := range d.Relationships { relationshipExists[serializeRel(r)] = true diff --git a/vendor/github.com/spdx/tools-golang/spdx/v2/v2_2/package.go b/vendor/github.com/spdx/tools-golang/spdx/v2/v2_2/package.go index 54de537c3f..a41471eda9 100644 --- a/vendor/github.com/spdx/tools-golang/spdx/v2/v2_2/package.go +++ b/vendor/github.com/spdx/tools-golang/spdx/v2/v2_2/package.go @@ -6,6 +6,7 @@ import ( "encoding/json" "strings" + "github.com/spdx/tools-golang/json/marshal" "github.com/spdx/tools-golang/spdx/v2/common" ) @@ -74,7 +75,7 @@ type Package struct { // 7.14: All Licenses Info from Files: SPDX License Expression, "NONE" or "NOASSERTION" // Cardinality: mandatory, one or many if filesAnalyzed is true / omitted; // zero (must be omitted) if filesAnalyzed is false - PackageLicenseInfoFromFiles []string `json:"licenseInfoFromFiles"` + PackageLicenseInfoFromFiles []string `json:"licenseInfoFromFiles,omitempty"` // 7.15: Declared License: SPDX License Expression, "NONE" or "NOASSERTION" // Cardinality: mandatory, one @@ -122,6 +123,32 @@ type Package struct { hasFiles []common.DocElementID } +func (p Package) MarshalJSON() ([]byte, error) { + type pkg Package + p2 := pkg(p) + + data, err := marshal.JSON(p2) + if err != nil { + return nil, err + } + + // remove empty packageVerificationCode entries -- required by SPDX 2.2 but + // omitempty has no effect since it is a non-comparable struct and not a pointer, so we + // manually check to determine if there is a valid value to output and omit the field if not + // see: https://spdx.github.io/spdx-spec/v2.2.2/package-information/#79-package-verification-code-field + if p.PackageVerificationCode.Value == "" && p.PackageVerificationCode.ExcludedFiles == nil { + var values map[string]interface{} + err = json.Unmarshal(data, &values) + if err != nil { + return nil, err + } + delete(values, "packageVerificationCode") + return marshal.JSON(values) + } + + return data, nil +} + func (p *Package) UnmarshalJSON(b []byte) error { type pkg Package type extras struct { @@ -153,6 +180,7 @@ func (p *Package) UnmarshalJSON(b []byte) error { } var _ json.Unmarshaler = (*Package)(nil) +var _ json.Marshaler = (*Package)(nil) // PackageExternalReference is an External Reference to additional info // about a Package, as defined in section 7.21 in version 2.2 of the spec. @@ -199,5 +227,5 @@ func (r *PackageExternalReference) MarshalJSON() ([]byte, error) { rr = ref(*r) rr.Category = strings.ReplaceAll(rr.Category, "-", "_") - return json.Marshal(&rr) + return marshal.JSON(&rr) } diff --git a/vendor/github.com/spdx/tools-golang/spdx/v2/v2_3/document.go b/vendor/github.com/spdx/tools-golang/spdx/v2/v2_3/document.go index 7350192ae9..62b7619b2f 100644 --- a/vendor/github.com/spdx/tools-golang/spdx/v2/v2_3/document.go +++ b/vendor/github.com/spdx/tools-golang/spdx/v2/v2_3/document.go @@ -119,6 +119,14 @@ func (d *Document) UnmarshalJSON(b []byte) error { return fmt.Sprintf("%v-%v->%v", common.RenderDocElementID(refA), rel, common.RenderDocElementID(refB)) } + // remove null relationships + for i := 0; i < len(d.Relationships); i++ { + if d.Relationships[i] == nil { + d.Relationships = append(d.Relationships[0:i], d.Relationships[i+1:]...) + i-- + } + } + // index current list of relationships to ensure no duplication for _, r := range d.Relationships { relationshipExists[serializeRel(r)] = true diff --git a/vendor/github.com/spdx/tools-golang/spdx/v2/v2_3/package.go b/vendor/github.com/spdx/tools-golang/spdx/v2/v2_3/package.go index 0acadc27be..6488a7e8cc 100644 --- a/vendor/github.com/spdx/tools-golang/spdx/v2/v2_3/package.go +++ b/vendor/github.com/spdx/tools-golang/spdx/v2/v2_3/package.go @@ -6,6 +6,7 @@ import ( "encoding/json" "strings" + "github.com/spdx/tools-golang/json/marshal" "github.com/spdx/tools-golang/spdx/v2/common" ) @@ -217,5 +218,5 @@ func (r *PackageExternalReference) MarshalJSON() ([]byte, error) { rr.Category = strings.ReplaceAll(rr.Category, "_", "-") - return json.Marshal(&rr) + return marshal.JSON(&rr) } diff --git a/vendor/github.com/tonistiigi/fsutil/send.go b/vendor/github.com/tonistiigi/fsutil/send.go index e4a315638b..31d6100815 100644 --- a/vendor/github.com/tonistiigi/fsutil/send.go +++ b/vendor/github.com/tonistiigi/fsutil/send.go @@ -148,7 +148,8 @@ func (s *sender) sendFile(h *sendHandle) error { func (s *sender) walk(ctx context.Context) error { var i uint32 = 0 - err := s.fs.Walk(ctx, "/", func(path string, entry os.DirEntry, err error) error { + target := string(filepath.Separator) + err := s.fs.Walk(ctx, target, func(path string, entry os.DirEntry, err error) error { if err != nil { return err } diff --git a/vendor/github.com/tonistiigi/go-actions-cache/Dockerfile b/vendor/github.com/tonistiigi/go-actions-cache/Dockerfile index 2b7680e542..d581245763 100644 --- a/vendor/github.com/tonistiigi/go-actions-cache/Dockerfile +++ b/vendor/github.com/tonistiigi/go-actions-cache/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 -ARG GO_VERSION=1.23 +ARG GO_VERSION=1.24 ARG XX_VERSION=1.6.1 FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx diff --git a/vendor/github.com/tonistiigi/go-actions-cache/cache.go b/vendor/github.com/tonistiigi/go-actions-cache/cache.go index a47fc9cc42..6cdb96619c 100644 --- a/vendor/github.com/tonistiigi/go-actions-cache/cache.go +++ b/vendor/github.com/tonistiigi/go-actions-cache/cache.go @@ -545,7 +545,7 @@ func (c *Cache) doWithRetries(ctx context.Context, r *request) (*http.Response, } func (c *Cache) url(p string) string { - return c.URL + "_apis/artifactcache/" + p + return strings.TrimRight(c.URL, "/") + "/_apis/artifactcache/" + p } func (c *Cache) AllKeys(ctx context.Context, api *RestAPI, prefix string) (map[string]struct{}, error) { diff --git a/vendor/github.com/tonistiigi/go-actions-cache/cache_v2.go b/vendor/github.com/tonistiigi/go-actions-cache/cache_v2.go index 6bf7ec3c08..a2f5b6af27 100644 --- a/vendor/github.com/tonistiigi/go-actions-cache/cache_v2.go +++ b/vendor/github.com/tonistiigi/go-actions-cache/cache_v2.go @@ -5,6 +5,7 @@ import ( "context" "encoding/json" "io" + "strings" "time" "github.com/Azure/azure-sdk-for-go/sdk/azcore" @@ -204,5 +205,5 @@ func (c *Cache) newRequestV2(url string, body func() io.Reader) *request { } func (c *Cache) urlV2(p string) string { - return c.URL + "twirp/github.actions.results.api.v1.CacheService/" + p + return strings.TrimRight(c.URL, "/") + "/twirp/github.actions.results.api.v1.CacheService/" + p } diff --git a/vendor/github.com/tonistiigi/go-csvvalue/Dockerfile b/vendor/github.com/tonistiigi/go-csvvalue/Dockerfile index fd144d9236..19c76ae116 100644 --- a/vendor/github.com/tonistiigi/go-csvvalue/Dockerfile +++ b/vendor/github.com/tonistiigi/go-csvvalue/Dockerfile @@ -1,7 +1,7 @@ #syntax=docker/dockerfile:1.8 #check=error=true -ARG GO_VERSION=1.22 +ARG GO_VERSION=1.23 ARG XX_VERSION=1.4.0 ARG COVER_FILENAME="cover.out" diff --git a/vendor/modules.txt b/vendor/modules.txt index 9b7c590cb6..a1d04bab90 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -25,9 +25,6 @@ dario.cat/mergo # github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 ## explicit; go 1.20 github.com/AdaLogics/go-fuzz-headers -# github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20231105174938-2b5cbb29f3e2 -## explicit; go 1.18 -github.com/AdamKorcz/go-118-fuzz-build/testing # github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0 ## explicit; go 1.18 github.com/Azure/azure-sdk-for-go/sdk/azcore @@ -86,8 +83,8 @@ github.com/Microsoft/go-winio/pkg/etwlogrus github.com/Microsoft/go-winio/pkg/fs github.com/Microsoft/go-winio/pkg/guid github.com/Microsoft/go-winio/vhd -# github.com/Microsoft/hcsshim v0.12.9 -## explicit; go 1.22 +# github.com/Microsoft/hcsshim v0.13.0 +## explicit; go 1.23.0 github.com/Microsoft/hcsshim github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options github.com/Microsoft/hcsshim/computestorage @@ -114,16 +111,11 @@ github.com/Microsoft/hcsshim/internal/runhcs github.com/Microsoft/hcsshim/internal/safefile github.com/Microsoft/hcsshim/internal/security github.com/Microsoft/hcsshim/internal/timeout -github.com/Microsoft/hcsshim/internal/vhdx github.com/Microsoft/hcsshim/internal/vmcompute github.com/Microsoft/hcsshim/internal/wclayer -github.com/Microsoft/hcsshim/internal/wclayer/cim github.com/Microsoft/hcsshim/internal/winapi github.com/Microsoft/hcsshim/osversion -github.com/Microsoft/hcsshim/pkg/cimfs -github.com/Microsoft/hcsshim/pkg/cimfs/format github.com/Microsoft/hcsshim/pkg/ociwclayer -github.com/Microsoft/hcsshim/pkg/ociwclayer/cim # github.com/RackSec/srslog v0.0.0-20180709174129-a4725f04ec91 ## explicit github.com/RackSec/srslog @@ -331,7 +323,7 @@ github.com/containerd/containerd/api/types/runc/options github.com/containerd/containerd/api/types/runtimeoptions/v1 github.com/containerd/containerd/api/types/task github.com/containerd/containerd/api/types/transfer -# github.com/containerd/containerd/v2 v2.0.5 +# github.com/containerd/containerd/v2 v2.1.1 ## explicit; go 1.23.0 github.com/containerd/containerd/v2/client github.com/containerd/containerd/v2/cmd/containerd/server/config @@ -358,7 +350,6 @@ github.com/containerd/containerd/v2/core/remotes github.com/containerd/containerd/v2/core/remotes/docker github.com/containerd/containerd/v2/core/remotes/docker/auth github.com/containerd/containerd/v2/core/remotes/docker/config -github.com/containerd/containerd/v2/core/remotes/docker/schema1 github.com/containerd/containerd/v2/core/remotes/errors github.com/containerd/containerd/v2/core/sandbox github.com/containerd/containerd/v2/core/sandbox/proxy @@ -374,6 +365,7 @@ github.com/containerd/containerd/v2/defaults github.com/containerd/containerd/v2/internal/cleanup github.com/containerd/containerd/v2/internal/fsverity github.com/containerd/containerd/v2/internal/kmutex +github.com/containerd/containerd/v2/internal/lazyregexp github.com/containerd/containerd/v2/internal/randutil github.com/containerd/containerd/v2/internal/userns github.com/containerd/containerd/v2/pkg/apparmor @@ -382,7 +374,6 @@ github.com/containerd/containerd/v2/pkg/archive/compression github.com/containerd/containerd/v2/pkg/archive/tarheader github.com/containerd/containerd/v2/pkg/cap github.com/containerd/containerd/v2/pkg/cio -github.com/containerd/containerd/v2/pkg/deprecation github.com/containerd/containerd/v2/pkg/dialer github.com/containerd/containerd/v2/pkg/epoch github.com/containerd/containerd/v2/pkg/filters @@ -457,7 +448,7 @@ github.com/containerd/ttrpc # github.com/containerd/typeurl/v2 v2.2.3 ## explicit; go 1.21 github.com/containerd/typeurl/v2 -# github.com/containernetworking/cni v1.2.3 +# github.com/containernetworking/cni v1.3.0 ## explicit; go 1.21 github.com/containernetworking/cni/libcni github.com/containernetworking/cni/pkg/invoke @@ -469,8 +460,8 @@ github.com/containernetworking/cni/pkg/types/create github.com/containernetworking/cni/pkg/types/internal github.com/containernetworking/cni/pkg/utils github.com/containernetworking/cni/pkg/version -# github.com/containernetworking/plugins v1.6.2 -## explicit; go 1.23 +# github.com/containernetworking/plugins v1.7.1 +## explicit; go 1.23.0 github.com/containernetworking/plugins/pkg/ns # github.com/coreos/go-systemd/v22 v22.5.0 ## explicit; go 1.12 @@ -725,12 +716,13 @@ github.com/hashicorp/memberlist ## explicit github.com/hashicorp/serf/coordinate github.com/hashicorp/serf/serf -# github.com/in-toto/in-toto-golang v0.5.0 -## explicit; go 1.17 +# github.com/in-toto/in-toto-golang v0.9.0 +## explicit; go 1.20 github.com/in-toto/in-toto-golang/in_toto github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/common github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/v0.1 github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/v0.2 +github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/v1 # github.com/inconshreveable/mousetrap v1.1.0 ## explicit; go 1.18 github.com/inconshreveable/mousetrap @@ -765,7 +757,7 @@ github.com/mitchellh/hashstructure/v2 # github.com/mitchellh/reflectwalk v1.0.2 ## explicit github.com/mitchellh/reflectwalk -# github.com/moby/buildkit v0.22.0 +# github.com/moby/buildkit v0.23.0-rc1 ## explicit; go 1.23.0 github.com/moby/buildkit/api/services/control github.com/moby/buildkit/api/types @@ -1150,20 +1142,22 @@ github.com/sasha-s/go-deadlock # github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 ## explicit github.com/sean-/seed -# github.com/secure-systems-lab/go-securesystemslib v0.4.0 -## explicit; go 1.17 +# github.com/secure-systems-lab/go-securesystemslib v0.6.0 +## explicit; go 1.20 github.com/secure-systems-lab/go-securesystemslib/cjson github.com/secure-systems-lab/go-securesystemslib/dsse +github.com/secure-systems-lab/go-securesystemslib/signerverifier # github.com/shibumi/go-pathspec v1.3.0 ## explicit; go 1.17 github.com/shibumi/go-pathspec # github.com/sirupsen/logrus v1.9.3 ## explicit; go 1.13 github.com/sirupsen/logrus -# github.com/spdx/tools-golang v0.5.3 +# github.com/spdx/tools-golang v0.5.5 ## explicit; go 1.13 github.com/spdx/tools-golang/convert github.com/spdx/tools-golang/json +github.com/spdx/tools-golang/json/marshal github.com/spdx/tools-golang/spdx github.com/spdx/tools-golang/spdx/common github.com/spdx/tools-golang/spdx/v2/common @@ -1191,18 +1185,18 @@ github.com/tinylib/msgp/msgp # github.com/tonistiigi/dchapes-mode v0.0.0-20250318174251-73d941a28323 ## explicit; go 1.21 github.com/tonistiigi/dchapes-mode -# github.com/tonistiigi/fsutil v0.0.0-20250417144416-3f76f8130144 +# github.com/tonistiigi/fsutil v0.0.0-20250605211040-586307ad452f ## explicit; go 1.21 github.com/tonistiigi/fsutil github.com/tonistiigi/fsutil/copy github.com/tonistiigi/fsutil/types -# github.com/tonistiigi/go-actions-cache v0.0.0-20250228231703-3e9a6642607f -## explicit; go 1.22 +# github.com/tonistiigi/go-actions-cache v0.0.0-20250611155157-388a2ec8cdf8 +## explicit; go 1.23.0 github.com/tonistiigi/go-actions-cache # github.com/tonistiigi/go-archvariant v1.0.0 ## explicit; go 1.17 github.com/tonistiigi/go-archvariant -# github.com/tonistiigi/go-csvvalue v0.0.0-20240710180619-ddb21b71c0b4 +# github.com/tonistiigi/go-csvvalue v0.0.0-20240814133006-030d3b2625d0 ## explicit; go 1.16 github.com/tonistiigi/go-csvvalue # github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea @@ -1535,7 +1529,7 @@ google.golang.org/api/support/bundler google.golang.org/api/transport/grpc google.golang.org/api/transport/http google.golang.org/api/transport/http/internal/propagation -# google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 +# google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de ## explicit; go 1.19 google.golang.org/genproto/googleapis/logging/type # google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a