From 44f2431deae44e81d37a4e6a15b638d9c9c97135 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 12:34:49 +0000 Subject: [PATCH] Bump github.com/tektoncd/pipeline from 0.48.0 to 0.51.0 Bumps [github.com/tektoncd/pipeline](https://github.com/tektoncd/pipeline) from 0.48.0 to 0.51.0. - [Release notes](https://github.com/tektoncd/pipeline/releases) - [Changelog](https://github.com/tektoncd/pipeline/blob/main/releases.md) - [Commits](https://github.com/tektoncd/pipeline/compare/v0.48.0...v0.51.0) --- updated-dependencies: - dependency-name: github.com/tektoncd/pipeline dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 8 +- go.sum | 26 +- .../go-crypto/openpgp/armor/armor.go | 11 +- .../ProtonMail/go-crypto/openpgp/keys.go | 4 +- .../go-crypto/openpgp/packet/public_key.go | 4 + .../go-crypto/openpgp/packet/signature.go | 2 +- .../openpgp/packet/symmetric_key_encrypted.go | 31 +- .../ProtonMail/go-crypto/openpgp/write.go | 2 +- .../github.com/hashicorp/golang-lru/README.md | 26 +- .../pipeline/pkg/apis/config/feature_flags.go | 6 +- .../pipeline/internal/checksum/checksum.go | 57 + .../pkg/apis/pipeline/v1/pipeline_types.go | 22 + .../pipeline/v1/pipelinerun_validation.go | 4 + .../pkg/apis/pipeline/v1/task_types.go | 22 + .../apis/pipeline/v1beta1/pipeline_types.go | 22 + .../pkg/apis/pipeline/v1beta1/task_types.go | 22 + .../client/clientset/versioned/clientset.go | 3 +- .../informers/externalversions/factory.go | 79 +- .../pkg/client/injection/client/client.go | 1657 ----------------- .../pipeline/v1/pipeline/pipeline.go | 64 - .../pipeline/v1/pipelinerun/pipelinerun.go | 64 - .../informers/pipeline/v1/task/task.go | 64 - .../informers/pipeline/v1/taskrun/taskrun.go | 64 - .../verificationpolicy/verificationpolicy.go | 64 - .../v1beta1/clustertask/clustertask.go | 58 - .../pipeline/v1beta1/customrun/customrun.go | 64 - .../pipeline/v1beta1/pipeline/pipeline.go | 64 - .../v1beta1/pipelinerun/pipelinerun.go | 64 - .../informers/pipeline/v1beta1/task/task.go | 64 - .../pipeline/v1beta1/taskrun/taskrun.go | 64 - .../clientset/versioned/clientset.go | 3 +- .../informers/externalversions/factory.go | 79 +- .../resolution/injection/client/client.go | 334 ---- .../resolutionrequest/resolutionrequest.go | 64 - .../events/cloudevent/cloudeventclient.go | 1 - vendor/modules.txt | 9 +- 36 files changed, 349 insertions(+), 2847 deletions(-) create mode 100644 vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/internal/checksum/checksum.go diff --git a/go.mod b/go.mod index 9ac361bd5..a57c69ad4 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( github.com/spf13/pflag v1.0.5 github.com/tektoncd/chains v0.17.0 github.com/tektoncd/hub v1.13.0 - github.com/tektoncd/pipeline v0.50.1 + github.com/tektoncd/pipeline v0.51.0 github.com/tektoncd/plumbing v0.0.0-20221102182345-5dbcfda657d7 github.com/tektoncd/triggers v0.25.0 github.com/theupdateframework/go-tuf v0.6.1 @@ -39,7 +39,7 @@ require ( k8s.io/apimachinery v0.27.3 k8s.io/cli-runtime v0.25.13 k8s.io/client-go v0.27.3 - knative.dev/pkg v0.0.0-20230612155445-74c4be5e935e + knative.dev/pkg v0.0.0-20230718152110-aef227e72ead sigs.k8s.io/yaml v1.3.0 ) @@ -72,7 +72,7 @@ require ( github.com/Azure/go-autorest/tracing v0.6.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect - github.com/ProtonMail/go-crypto v0.0.0-20230518184743-7afd39499903 // indirect + github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95 // indirect github.com/Shopify/sarama v1.38.1 // indirect github.com/ThalesIgnite/crypto11 v1.2.5 // indirect github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4 // indirect @@ -189,7 +189,7 @@ require ( github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect github.com/hashicorp/go-sockaddr v1.0.2 // indirect github.com/hashicorp/go-uuid v1.0.3 // indirect - github.com/hashicorp/golang-lru v0.6.0 // indirect + github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/vault/api v1.9.2 // indirect github.com/imdario/mergo v0.3.15 // indirect diff --git a/go.sum b/go.sum index c1afd92d0..42aeb8181 100644 --- a/go.sum +++ b/go.sum @@ -650,6 +650,7 @@ contrib.go.opencensus.io/exporter/stackdriver v0.13.4/go.mod h1:aXENhDJ1Y4lIg4EU contrib.go.opencensus.io/exporter/stackdriver v0.13.14/go.mod h1:5pSSGY0Bhuk7waTHuDf4aQ8D2DrhgETRo9fy6k3Xlzc= contrib.go.opencensus.io/exporter/zipkin v0.1.2/go.mod h1:mP5xM3rrgOjpn79MM8fZbj3gsxcuytSqtH0dxSWW1RE= contrib.go.opencensus.io/integrations/ocsql v0.1.7/go.mod h1:8DsSdjz3F+APR+0z0WkU1aRorQCFfRxvqjUUPMbF3fE= +dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -799,8 +800,8 @@ github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 h1:+vx7roKuyA63n github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2/go.mod h1:HBCaDeC1lPdgDeDbhX8XFpy1jqjK0IBG8W5K+xYqA0w= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/OpenPeeDeeP/depguard v1.0.1/go.mod h1:xsIw86fROiiwelg+jB2uM9PiKihMMmUx/1V+TNhjQvM= -github.com/ProtonMail/go-crypto v0.0.0-20230518184743-7afd39499903 h1:ZK3C5DtzV2nVAQTx5S5jQvMeDqWtD1By5mOoyY/xJek= -github.com/ProtonMail/go-crypto v0.0.0-20230518184743-7afd39499903/go.mod h1:8TI4H3IbrackdNgv+92dI+rhpCaLqM0IfpgCgenFvRE= +github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95 h1:KLq8BE0KwCL+mmXnjLWEAOYO+2l2AE4YMmqG1ZpZHBs= +github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= @@ -1055,7 +1056,7 @@ github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8n github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50= github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= github.com/butuzov/ireturn v0.1.1/go.mod h1:Wh6Zl3IMtTpaIKbmwzqi6olnM9ptYQxxVacMsOEFPoc= -github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/c2h5oh/datasize v0.0.0-20171227191756-4eba002a5eae/go.mod h1:S/7n9copUssQ56c7aAgHqftWO4LTf4xY6CGWt8Bc+3M= github.com/c2h5oh/datasize v0.0.0-20200112174442-28bbd4740fee/go.mod h1:S/7n9copUssQ56c7aAgHqftWO4LTf4xY6CGWt8Bc+3M= github.com/casbin/casbin/v2 v2.37.0/go.mod h1:vByNa/Fchek0KZUgG5wEsl7iFsiviAYKRtgrQfcJqHg= @@ -1108,7 +1109,6 @@ github.com/cloudevents/sdk-go/v2 v2.4.1/go.mod h1:MZiMwmAh5tGj+fPFvtHv9hKurKqXtd github.com/cloudevents/sdk-go/v2 v2.8.0/go.mod h1:GpCBmUj7DIRiDhVvsK5d6WCbgTWs8DxAWTRtAwQmIXs= github.com/cloudevents/sdk-go/v2 v2.14.0 h1:Nrob4FwVgi5L4tV9lhjzZcjYqFVyJzsA56CwPaPfv6s= github.com/cloudevents/sdk-go/v2 v2.14.0/go.mod h1:xDmKfzNjM8gBvjaF8ijFjM1VYOVUEeUfapHMUX1T5To= -github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= @@ -1175,7 +1175,7 @@ github.com/containerd/containerd v1.5.7/go.mod h1:gyvv6+ugqY25TiXxcZC3L5yOeYgEw0 github.com/containerd/containerd v1.5.8/go.mod h1:YdFSv5bTFLpG2HIYmfqDpSYYTDX+mc5qtSuYx1YUb/s= github.com/containerd/containerd v1.5.9/go.mod h1:fvQqCfadDGga5HZyn3j4+dx56qj2I9YwBrlSdalvJYQ= github.com/containerd/containerd v1.6.1/go.mod h1:1nJz5xCZPusx6jJU8Frfct988y0NpumIq9ODB0kLtoE= -github.com/containerd/containerd v1.6.19 h1:F0qgQPrG0P2JPgwpxWxYavrVeXAG0ezUIB9Z/4FTUAU= +github.com/containerd/containerd v1.7.3 h1:cKwYKkP1eTj54bP3wCdXXBymmKRQMrWjkLSWZZJDa8o= github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/containerd/continuity v0.0.0-20191127005431-f65d91d395eb/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= @@ -1466,9 +1466,9 @@ github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3 github.com/go-fonts/liberation v0.1.1/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= github.com/go-fonts/liberation v0.2.0/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= github.com/go-fonts/stix v0.1.0/go.mod h1:w/c1f0ldAUlJmLBvlbkvVXLAD+tAMqobIIQpmnUIzUY= -github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= +github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/go-billy/v5 v5.4.1 h1:Uwp5tDRkPr+l/TnbHOQzp+tmJfLceOlbVucgpTz8ix4= -github.com/go-git/go-git/v5 v5.6.1 h1:q4ZRqQl4pR/ZJHc1L5CFjGA1a10u76aV1iC+nh+bHsk= +github.com/go-git/go-git/v5 v5.8.1 h1:Zo79E4p7TRk0xoRgMq0RShiTHGKcKI4+DI6BfJc/Q+A= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -2002,8 +2002,9 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/golang-lru v0.6.0 h1:uL2shRDx7RTrOrTCUZEGP/wJUFiUI8QT6E7z5o8jga4= github.com/hashicorp/golang-lru v0.6.0/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= @@ -2774,7 +2775,7 @@ github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVs github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/sivchari/tenv v1.4.7/go.mod h1:5nF+bITvkebQVanjU6IuMbvIot/7ReNsUV7I5NbprB0= -github.com/skeema/knownhosts v1.1.0 h1:Wvr9V0MxhjRbl3f9nMnKnFfiWTJmtECJ9Njkea3ysW0= +github.com/skeema/knownhosts v1.2.0 h1:h9r9cf0+u7wSE+M183ZtMGgOJKiL96brpaz5ekfJCpM= github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 h1:JIAuq3EEf9cgbU6AtGPK4CTG3Zf6CKMNqf0MHTggAUA= github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog= github.com/smallstep/assert v0.0.0-20200723003110-82e2b9b3b262 h1:unQFBIznI+VYD1/1fApl1A+9VcBk+9dcqGfnePY87LY= @@ -2836,7 +2837,7 @@ github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= github.com/spiffe/go-spiffe/v2 v2.1.6 h1:4SdizuQieFyL9eNU+SPiCArH4kynzaKOOj0VvM8R7Xo= github.com/spiffe/go-spiffe/v2 v2.1.6/go.mod h1:eVDqm9xFvyqao6C+eQensb9ZPkyNEeaUbqbBpOhBnNk= -github.com/spiffe/spire-api-sdk v1.7.0 h1:ThqXfS5dt29Noq8Sjr65CPtIk7Pe7LLoLr7S8g671Ic= +github.com/spiffe/spire-api-sdk v1.7.1 h1:i/X23zWJtk8G6gy1QYXkWBldruAzRdzxH6icgjMJjUs= github.com/sqs/goreturns v0.0.0-20181028201513-538ac6014518/go.mod h1:CKI4AZ4XmGV240rTHfO0hfE83S6/a3/Q1siZJ/vXf7A= github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jWoI= github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= @@ -2888,8 +2889,8 @@ github.com/tektoncd/chains v0.17.0 h1:iUcZA6ZMtuKmigcbJ/GqoKWR1YTCHZjGlREMAo5kg8 github.com/tektoncd/chains v0.17.0/go.mod h1:xnn91ocomJeb4QNMFr4Rw5nrQ8MuJqWrvivINFhjJJI= github.com/tektoncd/hub v1.13.0 h1:WJF9JMQzdBxfiQILtDT2lgAXxBc+y9v5U4qwavUO5pE= github.com/tektoncd/hub v1.13.0/go.mod h1:9n47cu03gbNVB5n922jKjc602sRpe/ihgQ3SvHNijQ4= -github.com/tektoncd/pipeline v0.50.1 h1:Asdfn1MxUSTlfzmr0PV4BPIEH7K4QLGym33nLgQlPCQ= -github.com/tektoncd/pipeline v0.50.1/go.mod h1:OjhCfhPQbVvK6GUmIseL2ipjaQ8ILcUerMk4P4sCcHA= +github.com/tektoncd/pipeline v0.51.0 h1:n2i/AJPXkTwcv9uc9xRJCtMeAHF1c1NkF7cNQ5zEf+0= +github.com/tektoncd/pipeline v0.51.0/go.mod h1:P9xePA0fqYIhaw4fllmX2LtMneyWqj60EjsZp5qqq9U= github.com/tektoncd/plumbing v0.0.0-20221102182345-5dbcfda657d7 h1:YsjQ83UBIIq4k/s2PzQ6pqe4tpPtm1hia3oyNBDDrDU= github.com/tektoncd/plumbing v0.0.0-20221102182345-5dbcfda657d7/go.mod h1:uJBaI0AL/kjPThiMYZcWRujEz7D401v643d6s/21GAg= github.com/tektoncd/triggers v0.25.0 h1:HaHZ0w8RpeIvB/7DoIZz+KhIOAVzPiFIPZOrDtvEPbM= @@ -3227,6 +3228,7 @@ golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20221012134737-56aed061732a/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= +golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/armor/armor.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/armor/armor.go index 0d6c5f3f9..d7af9141e 100644 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/armor/armor.go +++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/armor/armor.go @@ -10,8 +10,9 @@ import ( "bufio" "bytes" "encoding/base64" - "github.com/ProtonMail/go-crypto/openpgp/errors" "io" + + "github.com/ProtonMail/go-crypto/openpgp/errors" ) // A Block represents an OpenPGP armored structure. @@ -208,12 +209,16 @@ TryNextBlock: break } - i := bytes.Index(line, []byte(": ")) + i := bytes.Index(line, []byte(":")) if i == -1 { goto TryNextBlock } lastKey = string(line[:i]) - p.Header[lastKey] = string(line[i+2:]) + var value string + if len(line) > i+2 { + value = string(line[i+2:]) + } + p.Header[lastKey] = value } p.lReader.in = r diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/keys.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/keys.go index 7283ca91c..2d7b0cf37 100644 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/keys.go +++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/keys.go @@ -504,7 +504,7 @@ EachPacket: // Else, ignoring the signature as it does not follow anything // we would know to attach it to. case *packet.PrivateKey: - if pkt.IsSubkey == false { + if !pkt.IsSubkey { packets.Unread(p) break EachPacket } @@ -513,7 +513,7 @@ EachPacket: return nil, err } case *packet.PublicKey: - if pkt.IsSubkey == false { + if !pkt.IsSubkey { packets.Unread(p) break EachPacket } diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/public_key.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/public_key.go index ec903ee95..3402b8c14 100644 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/public_key.go +++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/public_key.go @@ -415,6 +415,10 @@ func (pk *PublicKey) parseEdDSA(r io.Reader) (err error) { return } + if len(pk.p.Bytes()) == 0 { + return errors.StructuralError("empty EdDSA public key") + } + pub := eddsa.NewPublicKey(c) switch flag := pk.p.Bytes()[0]; flag { diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/signature.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/signature.go index 6c58c86fa..80d0bb98e 100644 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/signature.go +++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/signature.go @@ -904,7 +904,7 @@ func (sig *Signature) buildSubpackets(issuer PublicKey) (subpackets []outputSubp if sig.IssuerKeyId != nil && sig.Version == 4 { keyId := make([]byte, 8) binary.BigEndian.PutUint64(keyId, *sig.IssuerKeyId) - subpackets = append(subpackets, outputSubpacket{true, issuerSubpacket, true, keyId}) + subpackets = append(subpackets, outputSubpacket{true, issuerSubpacket, false, keyId}) } if sig.IssuerFingerprint != nil { contents := append([]uint8{uint8(issuer.Version)}, sig.IssuerFingerprint...) diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/symmetric_key_encrypted.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/symmetric_key_encrypted.go index a8abf2ff7..bac2b132e 100644 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/symmetric_key_encrypted.go +++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/symmetric_key_encrypted.go @@ -7,13 +7,11 @@ package packet import ( "bytes" "crypto/cipher" - "crypto/sha256" "io" "strconv" "github.com/ProtonMail/go-crypto/openpgp/errors" "github.com/ProtonMail/go-crypto/openpgp/s2k" - "golang.org/x/crypto/hkdf" ) // This is the largest session key that we'll support. Since at most 256-bit cipher @@ -45,13 +43,6 @@ func (ske *SymmetricKeyEncrypted) parse(r io.Reader) error { return errors.UnsupportedError("unknown SymmetricKeyEncrypted version") } - if ske.Version == 5 { - // Scalar octet count - if _, err := readFull(r, buf[:]); err != nil { - return err - } - } - // Cipher function if _, err := readFull(r, buf[:]); err != nil { return err @@ -67,11 +58,6 @@ func (ske *SymmetricKeyEncrypted) parse(r io.Reader) error { return errors.StructuralError("cannot read AEAD octet from packet") } ske.Mode = AEADMode(buf[0]) - - // Scalar octet count - if _, err := readFull(r, buf[:]); err != nil { - return err - } } var err error @@ -220,7 +206,7 @@ func SerializeSymmetricKeyEncryptedReuseKey(w io.Writer, sessionKey []byte, pass case 5: ivLen := config.AEAD().Mode().IvLength() tagLen := config.AEAD().Mode().TagLength() - packetLength = 5 + len(s2kBytes) + ivLen + keySize + tagLen + packetLength = 3 + len(s2kBytes) + ivLen + keySize + tagLen } err = serializeHeader(w, packetTypeSymmetricKeyEncrypted, packetLength) if err != nil { @@ -230,20 +216,12 @@ func SerializeSymmetricKeyEncryptedReuseKey(w io.Writer, sessionKey []byte, pass // Symmetric Key Encrypted Version buf := []byte{byte(version)} - if version == 5 { - // Scalar octet count - buf = append(buf, byte(3+len(s2kBytes)+config.AEAD().Mode().IvLength())) - } - // Cipher function buf = append(buf, byte(cipherFunc)) if version == 5 { // AEAD mode buf = append(buf, byte(config.AEAD().Mode())) - - // Scalar octet count - buf = append(buf, byte(len(s2kBytes))) } _, err = w.Write(buf) if err != nil { @@ -293,11 +271,6 @@ func SerializeSymmetricKeyEncryptedReuseKey(w io.Writer, sessionKey []byte, pass } func getEncryptedKeyAeadInstance(c CipherFunction, mode AEADMode, inputKey, associatedData []byte) (aead cipher.AEAD) { - hkdfReader := hkdf.New(sha256.New, inputKey, []byte{}, associatedData) - - encryptionKey := make([]byte, c.KeySize()) - _, _ = readFull(hkdfReader, encryptionKey) - - blockCipher := c.new(encryptionKey) + blockCipher := c.new(inputKey) return mode.new(blockCipher) } diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/write.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/write.go index 864d8ca6b..7fdd13a3d 100644 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/write.go +++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/write.go @@ -381,7 +381,7 @@ func encrypt(keyWriter io.Writer, dataWriter io.Writer, to []*Entity, signed *En } sig := to[i].PrimaryIdentity().SelfSignature - if sig.SEIPDv2 == false { + if !sig.SEIPDv2 { aeadSupported = false } diff --git a/vendor/github.com/hashicorp/golang-lru/README.md b/vendor/github.com/hashicorp/golang-lru/README.md index 063bb1605..03bcfb5b7 100644 --- a/vendor/github.com/hashicorp/golang-lru/README.md +++ b/vendor/github.com/hashicorp/golang-lru/README.md @@ -1,25 +1,7 @@ golang-lru ========== -This provides the `lru` package which implements a fixed-size -thread safe LRU cache. It is based on the cache in Groupcache. - -Documentation -============= - -Full docs are available on [Godoc](https://pkg.go.dev/github.com/hashicorp/golang-lru) - -Example -======= - -Using the LRU is very simple: - -```go -l, _ := New(128) -for i := 0; i < 256; i++ { - l.Add(i, nil) -} -if l.Len() != 128 { - panic(fmt.Sprintf("bad len: %v", l.Len())) -} -``` +Please upgrade to github.com/hashicorp/golang-lru/v2 for all new code as v1 will +not be updated anymore. The v2 version supports generics and is faster; old code +can specify a specific tag, e.g. github.com/hashicorp/golang-lru/v1.0.2 for +backwards compatibility. diff --git a/vendor/github.com/tektoncd/pipeline/pkg/apis/config/feature_flags.go b/vendor/github.com/tektoncd/pipeline/pkg/apis/config/feature_flags.go index 8e0054daf..e3f43cc2d 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/apis/config/feature_flags.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/apis/config/feature_flags.go @@ -73,7 +73,7 @@ const ( // EnforceNonfalsifiabilityWithSpire is the value used for "enable-nonfalsifiability" when SPIRE is used to enable non-falsifiability. EnforceNonfalsifiabilityWithSpire = "spire" // EnforceNonfalsifiabilityNone is the value used for "enable-nonfalsifiability" when non-falsifiability is not enabled. - EnforceNonfalsifiabilityNone = "" + EnforceNonfalsifiabilityNone = "none" // DefaultEnforceNonfalsifiability is the default value for "enforce-nonfalsifiability". DefaultEnforceNonfalsifiability = EnforceNonfalsifiabilityNone // DefaultNoMatchPolicyConfig is the default value for "trusted-resources-verification-no-match-policy". @@ -195,7 +195,7 @@ func NewFeatureFlagsFromMap(cfgMap map[string]string) (*FeatureFlags, error) { if err := setMaxResultSize(cfgMap, DefaultMaxResultSize, &tc.MaxResultSize); err != nil { return nil, err } - if err := setEnforceNonFalsifiability(cfgMap, tc.EnableAPIFields, &tc.EnforceNonfalsifiability); err != nil { + if err := setEnforceNonFalsifiability(cfgMap, &tc.EnforceNonfalsifiability); err != nil { return nil, err } if err := setFeature(setSecurityContextKey, DefaultSetSecurityContext, &tc.SetSecurityContext); err != nil { @@ -262,7 +262,7 @@ func setCoschedule(cfgMap map[string]string, defaultValue string, disabledAffini // setEnforceNonFalsifiability sets the "enforce-nonfalsifiability" flag based on the content of a given map. // If the feature gate is invalid, then an error is returned. -func setEnforceNonFalsifiability(cfgMap map[string]string, enableAPIFields string, feature *string) error { +func setEnforceNonFalsifiability(cfgMap map[string]string, feature *string) error { var value = DefaultEnforceNonfalsifiability if cfg, ok := cfgMap[enforceNonfalsifiability]; ok { value = strings.ToLower(cfg) diff --git a/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/internal/checksum/checksum.go b/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/internal/checksum/checksum.go new file mode 100644 index 000000000..29cca04f7 --- /dev/null +++ b/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/internal/checksum/checksum.go @@ -0,0 +1,57 @@ +package checksum + +import ( + "crypto/sha256" + "encoding/json" + "fmt" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +const ( + // SignatureAnnotation is the key of signature in annotation map + SignatureAnnotation = "tekton.dev/signature" +) + +// PrepareObjectMeta will remove annotations not configured from user side -- "kubectl-client-side-apply" and "kubectl.kubernetes.io/last-applied-configuration" +// (added when an object is created with `kubectl apply`) to avoid verification failure and extract the signature. +// Returns a copy of the input object metadata with the annotations removed and the object's signature, +// if it is present in the metadata. +func PrepareObjectMeta(in metav1.Object) metav1.ObjectMeta { + outMeta := metav1.ObjectMeta{} + + // exclude the fields populated by system. + outMeta.Name = in.GetName() + outMeta.GenerateName = in.GetGenerateName() + outMeta.Namespace = in.GetNamespace() + + if in.GetLabels() != nil { + outMeta.Labels = make(map[string]string) + for k, v := range in.GetLabels() { + outMeta.Labels[k] = v + } + } + + outMeta.Annotations = make(map[string]string) + for k, v := range in.GetAnnotations() { + outMeta.Annotations[k] = v + } + + // exclude the annotations added by other components + delete(outMeta.Annotations, "kubectl-client-side-apply") + delete(outMeta.Annotations, "kubectl.kubernetes.io/last-applied-configuration") + delete(outMeta.Annotations, SignatureAnnotation) + + return outMeta +} + +// ComputeSha256Checksum computes the sha256 checksum of the tekton object. +func ComputeSha256Checksum(obj interface{}) ([]byte, error) { + ts, err := json.Marshal(obj) + if err != nil { + return nil, fmt.Errorf("failed to marshal the object: %w", err) + } + h := sha256.New() + h.Write(ts) + return h.Sum(nil), nil +} diff --git a/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/pipeline_types.go b/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/pipeline_types.go index e0ce5ec67..19f97cbf2 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/pipeline_types.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/pipeline_types.go @@ -18,6 +18,7 @@ package v1 import ( "github.com/tektoncd/pipeline/pkg/apis/pipeline" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/internal/checksum" "github.com/tektoncd/pipeline/pkg/reconciler/pipeline/dag" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -70,6 +71,27 @@ func (*Pipeline) GetGroupVersionKind() schema.GroupVersionKind { return SchemeGroupVersion.WithKind(pipeline.PipelineControllerName) } +// Checksum computes the sha256 checksum of the pipeline object. +// Prior to computing the checksum, it performs some preprocessing on the +// metadata of the object where it removes system provided annotations. +// Only the name, namespace, generateName, user-provided labels and annotations +// and the pipelineSpec are included for the checksum computation. +func (p *Pipeline) Checksum() ([]byte, error) { + objectMeta := checksum.PrepareObjectMeta(p) + preprocessedPipeline := Pipeline{ + TypeMeta: metav1.TypeMeta{ + APIVersion: "tekton.dev/v1", + Kind: "Pipeline"}, + ObjectMeta: objectMeta, + Spec: p.Spec, + } + sha256Checksum, err := checksum.ComputeSha256Checksum(preprocessedPipeline) + if err != nil { + return nil, err + } + return sha256Checksum, nil +} + // PipelineSpec defines the desired state of Pipeline. type PipelineSpec struct { // DisplayName is a user-facing name of the pipeline that may be diff --git a/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/pipelinerun_validation.go b/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/pipelinerun_validation.go index e6c7299c8..1f56c2050 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/pipelinerun_validation.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/pipelinerun_validation.go @@ -109,6 +109,10 @@ func (ps *PipelineRunSpec) Validate(ctx context.Context) (errs *apis.FieldError) errs = errs.Also(validateTaskRunSpec(ctx, trs).ViaIndex(idx).ViaField("taskRunSpecs")) } + if ps.TaskRunTemplate.PodTemplate != nil { + errs = errs.Also(validatePodTemplateEnv(ctx, *ps.TaskRunTemplate.PodTemplate).ViaField("taskRunTemplate")) + } + return errs } diff --git a/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/task_types.go b/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/task_types.go index 9a46de41b..894590508 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/task_types.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/task_types.go @@ -18,6 +18,7 @@ package v1 import ( "github.com/tektoncd/pipeline/pkg/apis/pipeline" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/internal/checksum" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" @@ -52,6 +53,27 @@ func (*Task) GetGroupVersionKind() schema.GroupVersionKind { return SchemeGroupVersion.WithKind(pipeline.TaskControllerName) } +// Checksum computes the sha256 checksum of the task object. +// Prior to computing the checksum, it performs some preprocessing on the +// metadata of the object where it removes system provided annotations. +// Only the name, namespace, generateName, user-provided labels and annotations +// and the taskSpec are included for the checksum computation. +func (t *Task) Checksum() ([]byte, error) { + objectMeta := checksum.PrepareObjectMeta(t) + preprocessedTask := Task{ + TypeMeta: metav1.TypeMeta{ + APIVersion: "tekton.dev/v1", + Kind: "Task"}, + ObjectMeta: objectMeta, + Spec: t.Spec, + } + sha256Checksum, err := checksum.ComputeSha256Checksum(preprocessedTask) + if err != nil { + return nil, err + } + return sha256Checksum, nil +} + // TaskSpec defines the desired state of Task. type TaskSpec struct { // Params is a list of input parameters required to run the task. Params diff --git a/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1/pipeline_types.go b/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1/pipeline_types.go index 4426d5ddb..eba6cba27 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1/pipeline_types.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1/pipeline_types.go @@ -18,6 +18,7 @@ package v1beta1 import ( "github.com/tektoncd/pipeline/pkg/apis/pipeline" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/internal/checksum" "github.com/tektoncd/pipeline/pkg/reconciler/pipeline/dag" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -77,6 +78,27 @@ func (*Pipeline) GetGroupVersionKind() schema.GroupVersionKind { return SchemeGroupVersion.WithKind(pipeline.PipelineControllerName) } +// Checksum computes the sha256 checksum of the task object. +// Prior to computing the checksum, it performs some preprocessing on the +// metadata of the object where it removes system provided annotations. +// Only the name, namespace, generateName, user-provided labels and annotations +// and the pipelineSpec are included for the checksum computation. +func (p *Pipeline) Checksum() ([]byte, error) { + objectMeta := checksum.PrepareObjectMeta(p) + preprocessedPipeline := Pipeline{ + TypeMeta: metav1.TypeMeta{ + APIVersion: "tekton.dev/v1beta1", + Kind: "Pipeline"}, + ObjectMeta: objectMeta, + Spec: p.Spec, + } + sha256Checksum, err := checksum.ComputeSha256Checksum(preprocessedPipeline) + if err != nil { + return nil, err + } + return sha256Checksum, nil +} + // PipelineSpec defines the desired state of Pipeline. type PipelineSpec struct { // DisplayName is a user-facing name of the pipeline that may be diff --git a/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1/task_types.go b/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1/task_types.go index 855309256..2961ade3b 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1/task_types.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1/task_types.go @@ -18,6 +18,7 @@ package v1beta1 import ( "github.com/tektoncd/pipeline/pkg/apis/pipeline" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/internal/checksum" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" @@ -68,6 +69,27 @@ func (*Task) GetGroupVersionKind() schema.GroupVersionKind { return SchemeGroupVersion.WithKind(pipeline.TaskControllerName) } +// Checksum computes the sha256 checksum of the task object. +// Prior to computing the checksum, it performs some preprocessing on the +// metadata of the object where it removes system provided annotations. +// Only the name, namespace, generateName, user-provided labels and annotations +// and the taskSpec are included for the checksum computation. +func (t *Task) Checksum() ([]byte, error) { + objectMeta := checksum.PrepareObjectMeta(t) + preprocessedTask := Task{ + TypeMeta: metav1.TypeMeta{ + APIVersion: "tekton.dev/v1beta1", + Kind: "Task"}, + ObjectMeta: objectMeta, + Spec: t.Spec, + } + sha256Checksum, err := checksum.ComputeSha256Checksum(preprocessedTask) + if err != nil { + return nil, err + } + return sha256Checksum, nil +} + // TaskSpec defines the desired state of Task. type TaskSpec struct { // Resources is a list input and output resource to run the task diff --git a/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/clientset.go b/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/clientset.go index 081e93512..56848e8d5 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/clientset.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/clientset.go @@ -37,8 +37,7 @@ type Interface interface { TektonV1() tektonv1.TektonV1Interface } -// Clientset contains the clients for groups. Each group has exactly one -// version included in a Clientset. +// Clientset contains the clients for groups. type Clientset struct { *discovery.DiscoveryClient tektonV1alpha1 *tektonv1alpha1.TektonV1alpha1Client diff --git a/vendor/github.com/tektoncd/pipeline/pkg/client/informers/externalversions/factory.go b/vendor/github.com/tektoncd/pipeline/pkg/client/informers/externalversions/factory.go index 691cee85d..b0cd64175 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/client/informers/externalversions/factory.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/client/informers/externalversions/factory.go @@ -47,6 +47,11 @@ type sharedInformerFactory struct { // startedInformers is used for tracking which informers have been started. // This allows Start() to be called multiple times safely. startedInformers map[reflect.Type]bool + // wg tracks how many goroutines were started. + wg sync.WaitGroup + // shuttingDown is true when Shutdown has been called. It may still be running + // because it needs to wait for goroutines. + shuttingDown bool } // WithCustomResyncConfig sets a custom resync period for the specified informer types. @@ -107,20 +112,39 @@ func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResy return factory } -// Start initializes all requested informers. func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { f.lock.Lock() defer f.lock.Unlock() + if f.shuttingDown { + return + } + for informerType, informer := range f.informers { if !f.startedInformers[informerType] { - go informer.Run(stopCh) + f.wg.Add(1) + // We need a new variable in each loop iteration, + // otherwise the goroutine would use the loop variable + // and that keeps changing. + informer := informer + go func() { + defer f.wg.Done() + informer.Run(stopCh) + }() f.startedInformers[informerType] = true } } } -// WaitForCacheSync waits for all started informers' cache were synced. +func (f *sharedInformerFactory) Shutdown() { + f.lock.Lock() + f.shuttingDown = true + f.lock.Unlock() + + // Will return immediately if there is nothing to wait for. + f.wg.Wait() +} + func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { informers := func() map[reflect.Type]cache.SharedIndexInformer { f.lock.Lock() @@ -167,11 +191,58 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal // SharedInformerFactory provides shared informers for resources in all known // API group versions. +// +// It is typically used like this: +// +// ctx, cancel := context.Background() +// defer cancel() +// factory := NewSharedInformerFactory(client, resyncPeriod) +// defer factory.WaitForStop() // Returns immediately if nothing was started. +// genericInformer := factory.ForResource(resource) +// typedInformer := factory.SomeAPIGroup().V1().SomeType() +// factory.Start(ctx.Done()) // Start processing these informers. +// synced := factory.WaitForCacheSync(ctx.Done()) +// for v, ok := range synced { +// if !ok { +// fmt.Fprintf(os.Stderr, "caches failed to sync: %v", v) +// return +// } +// } +// +// // Creating informers can also be created after Start, but then +// // Start must be called again: +// anotherGenericInformer := factory.ForResource(resource) +// factory.Start(ctx.Done()) type SharedInformerFactory interface { internalinterfaces.SharedInformerFactory - ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + + // Start initializes all requested informers. They are handled in goroutines + // which run until the stop channel gets closed. + Start(stopCh <-chan struct{}) + + // Shutdown marks a factory as shutting down. At that point no new + // informers can be started anymore and Start will return without + // doing anything. + // + // In addition, Shutdown blocks until all goroutines have terminated. For that + // to happen, the close channel(s) that they were started with must be closed, + // either before Shutdown gets called or while it is waiting. + // + // Shutdown may be called multiple times, even concurrently. All such calls will + // block until all goroutines have terminated. + Shutdown() + + // WaitForCacheSync blocks until all started informers' caches were synced + // or the stop channel gets closed. WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool + // ForResource gives generic access to a shared informer of the matching type. + ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + + // InternalInformerFor returns the SharedIndexInformer for obj using an internal + // client. + InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer + Tekton() pipeline.Interface } diff --git a/vendor/github.com/tektoncd/pipeline/pkg/client/injection/client/client.go b/vendor/github.com/tektoncd/pipeline/pkg/client/injection/client/client.go index 67cd130ad..af3642aaa 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/client/injection/client/client.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/client/injection/client/client.go @@ -20,28 +20,10 @@ package client import ( context "context" - json "encoding/json" - errors "errors" - fmt "fmt" - pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - v1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" versioned "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" - typedtektonv1 "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1" - typedtektonv1alpha1 "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha1" - typedtektonv1beta1 "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - discovery "k8s.io/client-go/discovery" - dynamic "k8s.io/client-go/dynamic" rest "k8s.io/client-go/rest" injection "knative.dev/pkg/injection" - dynamicclient "knative.dev/pkg/injection/clients/dynamicclient" logging "knative.dev/pkg/logging" ) @@ -50,7 +32,6 @@ func init() { injection.Default.RegisterClientFetcher(func(ctx context.Context) interface{} { return Get(ctx) }) - injection.Dynamic.RegisterDynamicClient(withClientFromDynamic) } // Key is used as the key for associating information with a context.Context. @@ -60,10 +41,6 @@ func withClientFromConfig(ctx context.Context, cfg *rest.Config) context.Context return context.WithValue(ctx, Key{}, versioned.NewForConfigOrDie(cfg)) } -func withClientFromDynamic(ctx context.Context) context.Context { - return context.WithValue(ctx, Key{}, &wrapClient{dyn: dynamicclient.Get(ctx)}) -} - // Get extracts the versioned.Interface client from the context. func Get(ctx context.Context) versioned.Interface { untyped := ctx.Value(Key{}) @@ -78,1637 +55,3 @@ func Get(ctx context.Context) versioned.Interface { } return untyped.(versioned.Interface) } - -type wrapClient struct { - dyn dynamic.Interface -} - -var _ versioned.Interface = (*wrapClient)(nil) - -func (w *wrapClient) Discovery() discovery.DiscoveryInterface { - panic("Discovery called on dynamic client!") -} - -func convert(from interface{}, to runtime.Object) error { - bs, err := json.Marshal(from) - if err != nil { - return fmt.Errorf("Marshal() = %w", err) - } - if err := json.Unmarshal(bs, to); err != nil { - return fmt.Errorf("Unmarshal() = %w", err) - } - return nil -} - -// TektonV1alpha1 retrieves the TektonV1alpha1Client -func (w *wrapClient) TektonV1alpha1() typedtektonv1alpha1.TektonV1alpha1Interface { - return &wrapTektonV1alpha1{ - dyn: w.dyn, - } -} - -type wrapTektonV1alpha1 struct { - dyn dynamic.Interface -} - -func (w *wrapTektonV1alpha1) RESTClient() rest.Interface { - panic("RESTClient called on dynamic client!") -} - -func (w *wrapTektonV1alpha1) Runs(namespace string) typedtektonv1alpha1.RunInterface { - return &wrapTektonV1alpha1RunImpl{ - dyn: w.dyn.Resource(schema.GroupVersionResource{ - Group: "tekton.dev", - Version: "v1alpha1", - Resource: "runs", - }), - - namespace: namespace, - } -} - -type wrapTektonV1alpha1RunImpl struct { - dyn dynamic.NamespaceableResourceInterface - - namespace string -} - -var _ typedtektonv1alpha1.RunInterface = (*wrapTektonV1alpha1RunImpl)(nil) - -func (w *wrapTektonV1alpha1RunImpl) Create(ctx context.Context, in *v1alpha1.Run, opts v1.CreateOptions) (*v1alpha1.Run, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1alpha1", - Kind: "Run", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &v1alpha1.Run{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1alpha1RunImpl) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) -} - -func (w *wrapTektonV1alpha1RunImpl) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) -} - -func (w *wrapTektonV1alpha1RunImpl) Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Run, error) { - uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) - if err != nil { - return nil, err - } - out := &v1alpha1.Run{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1alpha1RunImpl) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.RunList, error) { - uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) - if err != nil { - return nil, err - } - out := &v1alpha1.RunList{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1alpha1RunImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Run, err error) { - uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) - if err != nil { - return nil, err - } - out := &v1alpha1.Run{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1alpha1RunImpl) Update(ctx context.Context, in *v1alpha1.Run, opts v1.UpdateOptions) (*v1alpha1.Run, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1alpha1", - Kind: "Run", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &v1alpha1.Run{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1alpha1RunImpl) UpdateStatus(ctx context.Context, in *v1alpha1.Run, opts v1.UpdateOptions) (*v1alpha1.Run, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1alpha1", - Kind: "Run", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &v1alpha1.Run{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1alpha1RunImpl) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return nil, errors.New("NYI: Watch") -} - -func (w *wrapTektonV1alpha1) VerificationPolicies(namespace string) typedtektonv1alpha1.VerificationPolicyInterface { - return &wrapTektonV1alpha1VerificationPolicyImpl{ - dyn: w.dyn.Resource(schema.GroupVersionResource{ - Group: "tekton.dev", - Version: "v1alpha1", - Resource: "verificationpolicies", - }), - - namespace: namespace, - } -} - -type wrapTektonV1alpha1VerificationPolicyImpl struct { - dyn dynamic.NamespaceableResourceInterface - - namespace string -} - -var _ typedtektonv1alpha1.VerificationPolicyInterface = (*wrapTektonV1alpha1VerificationPolicyImpl)(nil) - -func (w *wrapTektonV1alpha1VerificationPolicyImpl) Create(ctx context.Context, in *v1alpha1.VerificationPolicy, opts v1.CreateOptions) (*v1alpha1.VerificationPolicy, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1alpha1", - Kind: "VerificationPolicy", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &v1alpha1.VerificationPolicy{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1alpha1VerificationPolicyImpl) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) -} - -func (w *wrapTektonV1alpha1VerificationPolicyImpl) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) -} - -func (w *wrapTektonV1alpha1VerificationPolicyImpl) Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.VerificationPolicy, error) { - uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) - if err != nil { - return nil, err - } - out := &v1alpha1.VerificationPolicy{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1alpha1VerificationPolicyImpl) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.VerificationPolicyList, error) { - uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) - if err != nil { - return nil, err - } - out := &v1alpha1.VerificationPolicyList{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1alpha1VerificationPolicyImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VerificationPolicy, err error) { - uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) - if err != nil { - return nil, err - } - out := &v1alpha1.VerificationPolicy{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1alpha1VerificationPolicyImpl) Update(ctx context.Context, in *v1alpha1.VerificationPolicy, opts v1.UpdateOptions) (*v1alpha1.VerificationPolicy, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1alpha1", - Kind: "VerificationPolicy", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &v1alpha1.VerificationPolicy{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1alpha1VerificationPolicyImpl) UpdateStatus(ctx context.Context, in *v1alpha1.VerificationPolicy, opts v1.UpdateOptions) (*v1alpha1.VerificationPolicy, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1alpha1", - Kind: "VerificationPolicy", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &v1alpha1.VerificationPolicy{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1alpha1VerificationPolicyImpl) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return nil, errors.New("NYI: Watch") -} - -// TektonV1beta1 retrieves the TektonV1beta1Client -func (w *wrapClient) TektonV1beta1() typedtektonv1beta1.TektonV1beta1Interface { - return &wrapTektonV1beta1{ - dyn: w.dyn, - } -} - -type wrapTektonV1beta1 struct { - dyn dynamic.Interface -} - -func (w *wrapTektonV1beta1) RESTClient() rest.Interface { - panic("RESTClient called on dynamic client!") -} - -func (w *wrapTektonV1beta1) ClusterTasks() typedtektonv1beta1.ClusterTaskInterface { - return &wrapTektonV1beta1ClusterTaskImpl{ - dyn: w.dyn.Resource(schema.GroupVersionResource{ - Group: "tekton.dev", - Version: "v1beta1", - Resource: "clustertasks", - }), - } -} - -type wrapTektonV1beta1ClusterTaskImpl struct { - dyn dynamic.NamespaceableResourceInterface -} - -var _ typedtektonv1beta1.ClusterTaskInterface = (*wrapTektonV1beta1ClusterTaskImpl)(nil) - -func (w *wrapTektonV1beta1ClusterTaskImpl) Create(ctx context.Context, in *v1beta1.ClusterTask, opts v1.CreateOptions) (*v1beta1.ClusterTask, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1beta1", - Kind: "ClusterTask", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Create(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &v1beta1.ClusterTask{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1ClusterTaskImpl) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return w.dyn.Delete(ctx, name, opts) -} - -func (w *wrapTektonV1beta1ClusterTaskImpl) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - return w.dyn.DeleteCollection(ctx, opts, listOpts) -} - -func (w *wrapTektonV1beta1ClusterTaskImpl) Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ClusterTask, error) { - uo, err := w.dyn.Get(ctx, name, opts) - if err != nil { - return nil, err - } - out := &v1beta1.ClusterTask{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1ClusterTaskImpl) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ClusterTaskList, error) { - uo, err := w.dyn.List(ctx, opts) - if err != nil { - return nil, err - } - out := &v1beta1.ClusterTaskList{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1ClusterTaskImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterTask, err error) { - uo, err := w.dyn.Patch(ctx, name, pt, data, opts) - if err != nil { - return nil, err - } - out := &v1beta1.ClusterTask{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1ClusterTaskImpl) Update(ctx context.Context, in *v1beta1.ClusterTask, opts v1.UpdateOptions) (*v1beta1.ClusterTask, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1beta1", - Kind: "ClusterTask", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Update(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &v1beta1.ClusterTask{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1ClusterTaskImpl) UpdateStatus(ctx context.Context, in *v1beta1.ClusterTask, opts v1.UpdateOptions) (*v1beta1.ClusterTask, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1beta1", - Kind: "ClusterTask", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.UpdateStatus(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &v1beta1.ClusterTask{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1ClusterTaskImpl) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return nil, errors.New("NYI: Watch") -} - -func (w *wrapTektonV1beta1) CustomRuns(namespace string) typedtektonv1beta1.CustomRunInterface { - return &wrapTektonV1beta1CustomRunImpl{ - dyn: w.dyn.Resource(schema.GroupVersionResource{ - Group: "tekton.dev", - Version: "v1beta1", - Resource: "customruns", - }), - - namespace: namespace, - } -} - -type wrapTektonV1beta1CustomRunImpl struct { - dyn dynamic.NamespaceableResourceInterface - - namespace string -} - -var _ typedtektonv1beta1.CustomRunInterface = (*wrapTektonV1beta1CustomRunImpl)(nil) - -func (w *wrapTektonV1beta1CustomRunImpl) Create(ctx context.Context, in *v1beta1.CustomRun, opts v1.CreateOptions) (*v1beta1.CustomRun, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1beta1", - Kind: "CustomRun", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &v1beta1.CustomRun{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1CustomRunImpl) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) -} - -func (w *wrapTektonV1beta1CustomRunImpl) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) -} - -func (w *wrapTektonV1beta1CustomRunImpl) Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.CustomRun, error) { - uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) - if err != nil { - return nil, err - } - out := &v1beta1.CustomRun{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1CustomRunImpl) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CustomRunList, error) { - uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) - if err != nil { - return nil, err - } - out := &v1beta1.CustomRunList{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1CustomRunImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CustomRun, err error) { - uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) - if err != nil { - return nil, err - } - out := &v1beta1.CustomRun{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1CustomRunImpl) Update(ctx context.Context, in *v1beta1.CustomRun, opts v1.UpdateOptions) (*v1beta1.CustomRun, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1beta1", - Kind: "CustomRun", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &v1beta1.CustomRun{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1CustomRunImpl) UpdateStatus(ctx context.Context, in *v1beta1.CustomRun, opts v1.UpdateOptions) (*v1beta1.CustomRun, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1beta1", - Kind: "CustomRun", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &v1beta1.CustomRun{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1CustomRunImpl) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return nil, errors.New("NYI: Watch") -} - -func (w *wrapTektonV1beta1) Pipelines(namespace string) typedtektonv1beta1.PipelineInterface { - return &wrapTektonV1beta1PipelineImpl{ - dyn: w.dyn.Resource(schema.GroupVersionResource{ - Group: "tekton.dev", - Version: "v1beta1", - Resource: "pipelines", - }), - - namespace: namespace, - } -} - -type wrapTektonV1beta1PipelineImpl struct { - dyn dynamic.NamespaceableResourceInterface - - namespace string -} - -var _ typedtektonv1beta1.PipelineInterface = (*wrapTektonV1beta1PipelineImpl)(nil) - -func (w *wrapTektonV1beta1PipelineImpl) Create(ctx context.Context, in *v1beta1.Pipeline, opts v1.CreateOptions) (*v1beta1.Pipeline, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1beta1", - Kind: "Pipeline", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &v1beta1.Pipeline{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1PipelineImpl) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) -} - -func (w *wrapTektonV1beta1PipelineImpl) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) -} - -func (w *wrapTektonV1beta1PipelineImpl) Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Pipeline, error) { - uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) - if err != nil { - return nil, err - } - out := &v1beta1.Pipeline{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1PipelineImpl) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PipelineList, error) { - uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) - if err != nil { - return nil, err - } - out := &v1beta1.PipelineList{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1PipelineImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Pipeline, err error) { - uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) - if err != nil { - return nil, err - } - out := &v1beta1.Pipeline{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1PipelineImpl) Update(ctx context.Context, in *v1beta1.Pipeline, opts v1.UpdateOptions) (*v1beta1.Pipeline, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1beta1", - Kind: "Pipeline", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &v1beta1.Pipeline{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1PipelineImpl) UpdateStatus(ctx context.Context, in *v1beta1.Pipeline, opts v1.UpdateOptions) (*v1beta1.Pipeline, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1beta1", - Kind: "Pipeline", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &v1beta1.Pipeline{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1PipelineImpl) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return nil, errors.New("NYI: Watch") -} - -func (w *wrapTektonV1beta1) PipelineRuns(namespace string) typedtektonv1beta1.PipelineRunInterface { - return &wrapTektonV1beta1PipelineRunImpl{ - dyn: w.dyn.Resource(schema.GroupVersionResource{ - Group: "tekton.dev", - Version: "v1beta1", - Resource: "pipelineruns", - }), - - namespace: namespace, - } -} - -type wrapTektonV1beta1PipelineRunImpl struct { - dyn dynamic.NamespaceableResourceInterface - - namespace string -} - -var _ typedtektonv1beta1.PipelineRunInterface = (*wrapTektonV1beta1PipelineRunImpl)(nil) - -func (w *wrapTektonV1beta1PipelineRunImpl) Create(ctx context.Context, in *v1beta1.PipelineRun, opts v1.CreateOptions) (*v1beta1.PipelineRun, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1beta1", - Kind: "PipelineRun", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &v1beta1.PipelineRun{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1PipelineRunImpl) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) -} - -func (w *wrapTektonV1beta1PipelineRunImpl) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) -} - -func (w *wrapTektonV1beta1PipelineRunImpl) Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.PipelineRun, error) { - uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) - if err != nil { - return nil, err - } - out := &v1beta1.PipelineRun{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1PipelineRunImpl) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PipelineRunList, error) { - uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) - if err != nil { - return nil, err - } - out := &v1beta1.PipelineRunList{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1PipelineRunImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PipelineRun, err error) { - uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) - if err != nil { - return nil, err - } - out := &v1beta1.PipelineRun{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1PipelineRunImpl) Update(ctx context.Context, in *v1beta1.PipelineRun, opts v1.UpdateOptions) (*v1beta1.PipelineRun, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1beta1", - Kind: "PipelineRun", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &v1beta1.PipelineRun{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1PipelineRunImpl) UpdateStatus(ctx context.Context, in *v1beta1.PipelineRun, opts v1.UpdateOptions) (*v1beta1.PipelineRun, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1beta1", - Kind: "PipelineRun", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &v1beta1.PipelineRun{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1PipelineRunImpl) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return nil, errors.New("NYI: Watch") -} - -func (w *wrapTektonV1beta1) Tasks(namespace string) typedtektonv1beta1.TaskInterface { - return &wrapTektonV1beta1TaskImpl{ - dyn: w.dyn.Resource(schema.GroupVersionResource{ - Group: "tekton.dev", - Version: "v1beta1", - Resource: "tasks", - }), - - namespace: namespace, - } -} - -type wrapTektonV1beta1TaskImpl struct { - dyn dynamic.NamespaceableResourceInterface - - namespace string -} - -var _ typedtektonv1beta1.TaskInterface = (*wrapTektonV1beta1TaskImpl)(nil) - -func (w *wrapTektonV1beta1TaskImpl) Create(ctx context.Context, in *v1beta1.Task, opts v1.CreateOptions) (*v1beta1.Task, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1beta1", - Kind: "Task", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &v1beta1.Task{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1TaskImpl) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) -} - -func (w *wrapTektonV1beta1TaskImpl) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) -} - -func (w *wrapTektonV1beta1TaskImpl) Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Task, error) { - uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) - if err != nil { - return nil, err - } - out := &v1beta1.Task{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1TaskImpl) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.TaskList, error) { - uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) - if err != nil { - return nil, err - } - out := &v1beta1.TaskList{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1TaskImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Task, err error) { - uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) - if err != nil { - return nil, err - } - out := &v1beta1.Task{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1TaskImpl) Update(ctx context.Context, in *v1beta1.Task, opts v1.UpdateOptions) (*v1beta1.Task, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1beta1", - Kind: "Task", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &v1beta1.Task{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1TaskImpl) UpdateStatus(ctx context.Context, in *v1beta1.Task, opts v1.UpdateOptions) (*v1beta1.Task, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1beta1", - Kind: "Task", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &v1beta1.Task{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1TaskImpl) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return nil, errors.New("NYI: Watch") -} - -func (w *wrapTektonV1beta1) TaskRuns(namespace string) typedtektonv1beta1.TaskRunInterface { - return &wrapTektonV1beta1TaskRunImpl{ - dyn: w.dyn.Resource(schema.GroupVersionResource{ - Group: "tekton.dev", - Version: "v1beta1", - Resource: "taskruns", - }), - - namespace: namespace, - } -} - -type wrapTektonV1beta1TaskRunImpl struct { - dyn dynamic.NamespaceableResourceInterface - - namespace string -} - -var _ typedtektonv1beta1.TaskRunInterface = (*wrapTektonV1beta1TaskRunImpl)(nil) - -func (w *wrapTektonV1beta1TaskRunImpl) Create(ctx context.Context, in *v1beta1.TaskRun, opts v1.CreateOptions) (*v1beta1.TaskRun, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1beta1", - Kind: "TaskRun", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &v1beta1.TaskRun{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1TaskRunImpl) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) -} - -func (w *wrapTektonV1beta1TaskRunImpl) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) -} - -func (w *wrapTektonV1beta1TaskRunImpl) Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.TaskRun, error) { - uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) - if err != nil { - return nil, err - } - out := &v1beta1.TaskRun{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1TaskRunImpl) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.TaskRunList, error) { - uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) - if err != nil { - return nil, err - } - out := &v1beta1.TaskRunList{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1TaskRunImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.TaskRun, err error) { - uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) - if err != nil { - return nil, err - } - out := &v1beta1.TaskRun{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1TaskRunImpl) Update(ctx context.Context, in *v1beta1.TaskRun, opts v1.UpdateOptions) (*v1beta1.TaskRun, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1beta1", - Kind: "TaskRun", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &v1beta1.TaskRun{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1TaskRunImpl) UpdateStatus(ctx context.Context, in *v1beta1.TaskRun, opts v1.UpdateOptions) (*v1beta1.TaskRun, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1beta1", - Kind: "TaskRun", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &v1beta1.TaskRun{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1beta1TaskRunImpl) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return nil, errors.New("NYI: Watch") -} - -// TektonV1 retrieves the TektonV1Client -func (w *wrapClient) TektonV1() typedtektonv1.TektonV1Interface { - return &wrapTektonV1{ - dyn: w.dyn, - } -} - -type wrapTektonV1 struct { - dyn dynamic.Interface -} - -func (w *wrapTektonV1) RESTClient() rest.Interface { - panic("RESTClient called on dynamic client!") -} - -func (w *wrapTektonV1) Pipelines(namespace string) typedtektonv1.PipelineInterface { - return &wrapTektonV1PipelineImpl{ - dyn: w.dyn.Resource(schema.GroupVersionResource{ - Group: "tekton.dev", - Version: "v1", - Resource: "pipelines", - }), - - namespace: namespace, - } -} - -type wrapTektonV1PipelineImpl struct { - dyn dynamic.NamespaceableResourceInterface - - namespace string -} - -var _ typedtektonv1.PipelineInterface = (*wrapTektonV1PipelineImpl)(nil) - -func (w *wrapTektonV1PipelineImpl) Create(ctx context.Context, in *pipelinev1.Pipeline, opts v1.CreateOptions) (*pipelinev1.Pipeline, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1", - Kind: "Pipeline", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &pipelinev1.Pipeline{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1PipelineImpl) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) -} - -func (w *wrapTektonV1PipelineImpl) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) -} - -func (w *wrapTektonV1PipelineImpl) Get(ctx context.Context, name string, opts v1.GetOptions) (*pipelinev1.Pipeline, error) { - uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) - if err != nil { - return nil, err - } - out := &pipelinev1.Pipeline{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1PipelineImpl) List(ctx context.Context, opts v1.ListOptions) (*pipelinev1.PipelineList, error) { - uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) - if err != nil { - return nil, err - } - out := &pipelinev1.PipelineList{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1PipelineImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *pipelinev1.Pipeline, err error) { - uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) - if err != nil { - return nil, err - } - out := &pipelinev1.Pipeline{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1PipelineImpl) Update(ctx context.Context, in *pipelinev1.Pipeline, opts v1.UpdateOptions) (*pipelinev1.Pipeline, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1", - Kind: "Pipeline", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &pipelinev1.Pipeline{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1PipelineImpl) UpdateStatus(ctx context.Context, in *pipelinev1.Pipeline, opts v1.UpdateOptions) (*pipelinev1.Pipeline, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1", - Kind: "Pipeline", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &pipelinev1.Pipeline{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1PipelineImpl) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return nil, errors.New("NYI: Watch") -} - -func (w *wrapTektonV1) PipelineRuns(namespace string) typedtektonv1.PipelineRunInterface { - return &wrapTektonV1PipelineRunImpl{ - dyn: w.dyn.Resource(schema.GroupVersionResource{ - Group: "tekton.dev", - Version: "v1", - Resource: "pipelineruns", - }), - - namespace: namespace, - } -} - -type wrapTektonV1PipelineRunImpl struct { - dyn dynamic.NamespaceableResourceInterface - - namespace string -} - -var _ typedtektonv1.PipelineRunInterface = (*wrapTektonV1PipelineRunImpl)(nil) - -func (w *wrapTektonV1PipelineRunImpl) Create(ctx context.Context, in *pipelinev1.PipelineRun, opts v1.CreateOptions) (*pipelinev1.PipelineRun, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1", - Kind: "PipelineRun", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &pipelinev1.PipelineRun{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1PipelineRunImpl) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) -} - -func (w *wrapTektonV1PipelineRunImpl) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) -} - -func (w *wrapTektonV1PipelineRunImpl) Get(ctx context.Context, name string, opts v1.GetOptions) (*pipelinev1.PipelineRun, error) { - uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) - if err != nil { - return nil, err - } - out := &pipelinev1.PipelineRun{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1PipelineRunImpl) List(ctx context.Context, opts v1.ListOptions) (*pipelinev1.PipelineRunList, error) { - uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) - if err != nil { - return nil, err - } - out := &pipelinev1.PipelineRunList{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1PipelineRunImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *pipelinev1.PipelineRun, err error) { - uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) - if err != nil { - return nil, err - } - out := &pipelinev1.PipelineRun{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1PipelineRunImpl) Update(ctx context.Context, in *pipelinev1.PipelineRun, opts v1.UpdateOptions) (*pipelinev1.PipelineRun, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1", - Kind: "PipelineRun", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &pipelinev1.PipelineRun{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1PipelineRunImpl) UpdateStatus(ctx context.Context, in *pipelinev1.PipelineRun, opts v1.UpdateOptions) (*pipelinev1.PipelineRun, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1", - Kind: "PipelineRun", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &pipelinev1.PipelineRun{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1PipelineRunImpl) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return nil, errors.New("NYI: Watch") -} - -func (w *wrapTektonV1) Tasks(namespace string) typedtektonv1.TaskInterface { - return &wrapTektonV1TaskImpl{ - dyn: w.dyn.Resource(schema.GroupVersionResource{ - Group: "tekton.dev", - Version: "v1", - Resource: "tasks", - }), - - namespace: namespace, - } -} - -type wrapTektonV1TaskImpl struct { - dyn dynamic.NamespaceableResourceInterface - - namespace string -} - -var _ typedtektonv1.TaskInterface = (*wrapTektonV1TaskImpl)(nil) - -func (w *wrapTektonV1TaskImpl) Create(ctx context.Context, in *pipelinev1.Task, opts v1.CreateOptions) (*pipelinev1.Task, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1", - Kind: "Task", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &pipelinev1.Task{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1TaskImpl) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) -} - -func (w *wrapTektonV1TaskImpl) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) -} - -func (w *wrapTektonV1TaskImpl) Get(ctx context.Context, name string, opts v1.GetOptions) (*pipelinev1.Task, error) { - uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) - if err != nil { - return nil, err - } - out := &pipelinev1.Task{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1TaskImpl) List(ctx context.Context, opts v1.ListOptions) (*pipelinev1.TaskList, error) { - uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) - if err != nil { - return nil, err - } - out := &pipelinev1.TaskList{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1TaskImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *pipelinev1.Task, err error) { - uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) - if err != nil { - return nil, err - } - out := &pipelinev1.Task{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1TaskImpl) Update(ctx context.Context, in *pipelinev1.Task, opts v1.UpdateOptions) (*pipelinev1.Task, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1", - Kind: "Task", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &pipelinev1.Task{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1TaskImpl) UpdateStatus(ctx context.Context, in *pipelinev1.Task, opts v1.UpdateOptions) (*pipelinev1.Task, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1", - Kind: "Task", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &pipelinev1.Task{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1TaskImpl) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return nil, errors.New("NYI: Watch") -} - -func (w *wrapTektonV1) TaskRuns(namespace string) typedtektonv1.TaskRunInterface { - return &wrapTektonV1TaskRunImpl{ - dyn: w.dyn.Resource(schema.GroupVersionResource{ - Group: "tekton.dev", - Version: "v1", - Resource: "taskruns", - }), - - namespace: namespace, - } -} - -type wrapTektonV1TaskRunImpl struct { - dyn dynamic.NamespaceableResourceInterface - - namespace string -} - -var _ typedtektonv1.TaskRunInterface = (*wrapTektonV1TaskRunImpl)(nil) - -func (w *wrapTektonV1TaskRunImpl) Create(ctx context.Context, in *pipelinev1.TaskRun, opts v1.CreateOptions) (*pipelinev1.TaskRun, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1", - Kind: "TaskRun", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &pipelinev1.TaskRun{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1TaskRunImpl) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) -} - -func (w *wrapTektonV1TaskRunImpl) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) -} - -func (w *wrapTektonV1TaskRunImpl) Get(ctx context.Context, name string, opts v1.GetOptions) (*pipelinev1.TaskRun, error) { - uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) - if err != nil { - return nil, err - } - out := &pipelinev1.TaskRun{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1TaskRunImpl) List(ctx context.Context, opts v1.ListOptions) (*pipelinev1.TaskRunList, error) { - uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) - if err != nil { - return nil, err - } - out := &pipelinev1.TaskRunList{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1TaskRunImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *pipelinev1.TaskRun, err error) { - uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) - if err != nil { - return nil, err - } - out := &pipelinev1.TaskRun{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1TaskRunImpl) Update(ctx context.Context, in *pipelinev1.TaskRun, opts v1.UpdateOptions) (*pipelinev1.TaskRun, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1", - Kind: "TaskRun", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &pipelinev1.TaskRun{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1TaskRunImpl) UpdateStatus(ctx context.Context, in *pipelinev1.TaskRun, opts v1.UpdateOptions) (*pipelinev1.TaskRun, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "tekton.dev", - Version: "v1", - Kind: "TaskRun", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &pipelinev1.TaskRun{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapTektonV1TaskRunImpl) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return nil, errors.New("NYI: Watch") -} diff --git a/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1/pipeline/pipeline.go b/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1/pipeline/pipeline.go index a58d4037b..7a79f9115 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1/pipeline/pipeline.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1/pipeline/pipeline.go @@ -21,15 +21,8 @@ package pipeline import ( context "context" - apispipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - versioned "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" v1 "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1" - client "github.com/tektoncd/pipeline/pkg/client/injection/client" factory "github.com/tektoncd/pipeline/pkg/client/injection/informers/factory" - pipelinev1 "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - cache "k8s.io/client-go/tools/cache" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" logging "knative.dev/pkg/logging" @@ -37,7 +30,6 @@ import ( func init() { injection.Default.RegisterInformer(withInformer) - injection.Dynamic.RegisterDynamicInformer(withDynamicInformer) } // Key is used for associating the Informer inside the context.Context. @@ -49,11 +41,6 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) { return context.WithValue(ctx, Key{}, inf), inf.Informer() } -func withDynamicInformer(ctx context.Context) context.Context { - inf := &wrapper{client: client.Get(ctx), resourceVersion: injection.GetResourceVersion(ctx)} - return context.WithValue(ctx, Key{}, inf) -} - // Get extracts the typed informer from the context. func Get(ctx context.Context) v1.PipelineInformer { untyped := ctx.Value(Key{}) @@ -63,54 +50,3 @@ func Get(ctx context.Context) v1.PipelineInformer { } return untyped.(v1.PipelineInformer) } - -type wrapper struct { - client versioned.Interface - - namespace string - - resourceVersion string -} - -var _ v1.PipelineInformer = (*wrapper)(nil) -var _ pipelinev1.PipelineLister = (*wrapper)(nil) - -func (w *wrapper) Informer() cache.SharedIndexInformer { - return cache.NewSharedIndexInformer(nil, &apispipelinev1.Pipeline{}, 0, nil) -} - -func (w *wrapper) Lister() pipelinev1.PipelineLister { - return w -} - -func (w *wrapper) Pipelines(namespace string) pipelinev1.PipelineNamespaceLister { - return &wrapper{client: w.client, namespace: namespace, resourceVersion: w.resourceVersion} -} - -// SetResourceVersion allows consumers to adjust the minimum resourceVersion -// used by the underlying client. It is not accessible via the standard -// lister interface, but can be accessed through a user-defined interface and -// an implementation check e.g. rvs, ok := foo.(ResourceVersionSetter) -func (w *wrapper) SetResourceVersion(resourceVersion string) { - w.resourceVersion = resourceVersion -} - -func (w *wrapper) List(selector labels.Selector) (ret []*apispipelinev1.Pipeline, err error) { - lo, err := w.client.TektonV1().Pipelines(w.namespace).List(context.TODO(), metav1.ListOptions{ - LabelSelector: selector.String(), - ResourceVersion: w.resourceVersion, - }) - if err != nil { - return nil, err - } - for idx := range lo.Items { - ret = append(ret, &lo.Items[idx]) - } - return ret, nil -} - -func (w *wrapper) Get(name string) (*apispipelinev1.Pipeline, error) { - return w.client.TektonV1().Pipelines(w.namespace).Get(context.TODO(), name, metav1.GetOptions{ - ResourceVersion: w.resourceVersion, - }) -} diff --git a/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1/pipelinerun/pipelinerun.go b/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1/pipelinerun/pipelinerun.go index 44b15d523..0e0850531 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1/pipelinerun/pipelinerun.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1/pipelinerun/pipelinerun.go @@ -21,15 +21,8 @@ package pipelinerun import ( context "context" - apispipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - versioned "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" v1 "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1" - client "github.com/tektoncd/pipeline/pkg/client/injection/client" factory "github.com/tektoncd/pipeline/pkg/client/injection/informers/factory" - pipelinev1 "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - cache "k8s.io/client-go/tools/cache" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" logging "knative.dev/pkg/logging" @@ -37,7 +30,6 @@ import ( func init() { injection.Default.RegisterInformer(withInformer) - injection.Dynamic.RegisterDynamicInformer(withDynamicInformer) } // Key is used for associating the Informer inside the context.Context. @@ -49,11 +41,6 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) { return context.WithValue(ctx, Key{}, inf), inf.Informer() } -func withDynamicInformer(ctx context.Context) context.Context { - inf := &wrapper{client: client.Get(ctx), resourceVersion: injection.GetResourceVersion(ctx)} - return context.WithValue(ctx, Key{}, inf) -} - // Get extracts the typed informer from the context. func Get(ctx context.Context) v1.PipelineRunInformer { untyped := ctx.Value(Key{}) @@ -63,54 +50,3 @@ func Get(ctx context.Context) v1.PipelineRunInformer { } return untyped.(v1.PipelineRunInformer) } - -type wrapper struct { - client versioned.Interface - - namespace string - - resourceVersion string -} - -var _ v1.PipelineRunInformer = (*wrapper)(nil) -var _ pipelinev1.PipelineRunLister = (*wrapper)(nil) - -func (w *wrapper) Informer() cache.SharedIndexInformer { - return cache.NewSharedIndexInformer(nil, &apispipelinev1.PipelineRun{}, 0, nil) -} - -func (w *wrapper) Lister() pipelinev1.PipelineRunLister { - return w -} - -func (w *wrapper) PipelineRuns(namespace string) pipelinev1.PipelineRunNamespaceLister { - return &wrapper{client: w.client, namespace: namespace, resourceVersion: w.resourceVersion} -} - -// SetResourceVersion allows consumers to adjust the minimum resourceVersion -// used by the underlying client. It is not accessible via the standard -// lister interface, but can be accessed through a user-defined interface and -// an implementation check e.g. rvs, ok := foo.(ResourceVersionSetter) -func (w *wrapper) SetResourceVersion(resourceVersion string) { - w.resourceVersion = resourceVersion -} - -func (w *wrapper) List(selector labels.Selector) (ret []*apispipelinev1.PipelineRun, err error) { - lo, err := w.client.TektonV1().PipelineRuns(w.namespace).List(context.TODO(), metav1.ListOptions{ - LabelSelector: selector.String(), - ResourceVersion: w.resourceVersion, - }) - if err != nil { - return nil, err - } - for idx := range lo.Items { - ret = append(ret, &lo.Items[idx]) - } - return ret, nil -} - -func (w *wrapper) Get(name string) (*apispipelinev1.PipelineRun, error) { - return w.client.TektonV1().PipelineRuns(w.namespace).Get(context.TODO(), name, metav1.GetOptions{ - ResourceVersion: w.resourceVersion, - }) -} diff --git a/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1/task/task.go b/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1/task/task.go index fb9021cb3..93e7c166d 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1/task/task.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1/task/task.go @@ -21,15 +21,8 @@ package task import ( context "context" - apispipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - versioned "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" v1 "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1" - client "github.com/tektoncd/pipeline/pkg/client/injection/client" factory "github.com/tektoncd/pipeline/pkg/client/injection/informers/factory" - pipelinev1 "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - cache "k8s.io/client-go/tools/cache" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" logging "knative.dev/pkg/logging" @@ -37,7 +30,6 @@ import ( func init() { injection.Default.RegisterInformer(withInformer) - injection.Dynamic.RegisterDynamicInformer(withDynamicInformer) } // Key is used for associating the Informer inside the context.Context. @@ -49,11 +41,6 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) { return context.WithValue(ctx, Key{}, inf), inf.Informer() } -func withDynamicInformer(ctx context.Context) context.Context { - inf := &wrapper{client: client.Get(ctx), resourceVersion: injection.GetResourceVersion(ctx)} - return context.WithValue(ctx, Key{}, inf) -} - // Get extracts the typed informer from the context. func Get(ctx context.Context) v1.TaskInformer { untyped := ctx.Value(Key{}) @@ -63,54 +50,3 @@ func Get(ctx context.Context) v1.TaskInformer { } return untyped.(v1.TaskInformer) } - -type wrapper struct { - client versioned.Interface - - namespace string - - resourceVersion string -} - -var _ v1.TaskInformer = (*wrapper)(nil) -var _ pipelinev1.TaskLister = (*wrapper)(nil) - -func (w *wrapper) Informer() cache.SharedIndexInformer { - return cache.NewSharedIndexInformer(nil, &apispipelinev1.Task{}, 0, nil) -} - -func (w *wrapper) Lister() pipelinev1.TaskLister { - return w -} - -func (w *wrapper) Tasks(namespace string) pipelinev1.TaskNamespaceLister { - return &wrapper{client: w.client, namespace: namespace, resourceVersion: w.resourceVersion} -} - -// SetResourceVersion allows consumers to adjust the minimum resourceVersion -// used by the underlying client. It is not accessible via the standard -// lister interface, but can be accessed through a user-defined interface and -// an implementation check e.g. rvs, ok := foo.(ResourceVersionSetter) -func (w *wrapper) SetResourceVersion(resourceVersion string) { - w.resourceVersion = resourceVersion -} - -func (w *wrapper) List(selector labels.Selector) (ret []*apispipelinev1.Task, err error) { - lo, err := w.client.TektonV1().Tasks(w.namespace).List(context.TODO(), metav1.ListOptions{ - LabelSelector: selector.String(), - ResourceVersion: w.resourceVersion, - }) - if err != nil { - return nil, err - } - for idx := range lo.Items { - ret = append(ret, &lo.Items[idx]) - } - return ret, nil -} - -func (w *wrapper) Get(name string) (*apispipelinev1.Task, error) { - return w.client.TektonV1().Tasks(w.namespace).Get(context.TODO(), name, metav1.GetOptions{ - ResourceVersion: w.resourceVersion, - }) -} diff --git a/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1/taskrun/taskrun.go b/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1/taskrun/taskrun.go index 0b7cb1be3..bd575e14c 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1/taskrun/taskrun.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1/taskrun/taskrun.go @@ -21,15 +21,8 @@ package taskrun import ( context "context" - apispipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" - versioned "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" v1 "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1" - client "github.com/tektoncd/pipeline/pkg/client/injection/client" factory "github.com/tektoncd/pipeline/pkg/client/injection/informers/factory" - pipelinev1 "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - cache "k8s.io/client-go/tools/cache" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" logging "knative.dev/pkg/logging" @@ -37,7 +30,6 @@ import ( func init() { injection.Default.RegisterInformer(withInformer) - injection.Dynamic.RegisterDynamicInformer(withDynamicInformer) } // Key is used for associating the Informer inside the context.Context. @@ -49,11 +41,6 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) { return context.WithValue(ctx, Key{}, inf), inf.Informer() } -func withDynamicInformer(ctx context.Context) context.Context { - inf := &wrapper{client: client.Get(ctx), resourceVersion: injection.GetResourceVersion(ctx)} - return context.WithValue(ctx, Key{}, inf) -} - // Get extracts the typed informer from the context. func Get(ctx context.Context) v1.TaskRunInformer { untyped := ctx.Value(Key{}) @@ -63,54 +50,3 @@ func Get(ctx context.Context) v1.TaskRunInformer { } return untyped.(v1.TaskRunInformer) } - -type wrapper struct { - client versioned.Interface - - namespace string - - resourceVersion string -} - -var _ v1.TaskRunInformer = (*wrapper)(nil) -var _ pipelinev1.TaskRunLister = (*wrapper)(nil) - -func (w *wrapper) Informer() cache.SharedIndexInformer { - return cache.NewSharedIndexInformer(nil, &apispipelinev1.TaskRun{}, 0, nil) -} - -func (w *wrapper) Lister() pipelinev1.TaskRunLister { - return w -} - -func (w *wrapper) TaskRuns(namespace string) pipelinev1.TaskRunNamespaceLister { - return &wrapper{client: w.client, namespace: namespace, resourceVersion: w.resourceVersion} -} - -// SetResourceVersion allows consumers to adjust the minimum resourceVersion -// used by the underlying client. It is not accessible via the standard -// lister interface, but can be accessed through a user-defined interface and -// an implementation check e.g. rvs, ok := foo.(ResourceVersionSetter) -func (w *wrapper) SetResourceVersion(resourceVersion string) { - w.resourceVersion = resourceVersion -} - -func (w *wrapper) List(selector labels.Selector) (ret []*apispipelinev1.TaskRun, err error) { - lo, err := w.client.TektonV1().TaskRuns(w.namespace).List(context.TODO(), metav1.ListOptions{ - LabelSelector: selector.String(), - ResourceVersion: w.resourceVersion, - }) - if err != nil { - return nil, err - } - for idx := range lo.Items { - ret = append(ret, &lo.Items[idx]) - } - return ret, nil -} - -func (w *wrapper) Get(name string) (*apispipelinev1.TaskRun, error) { - return w.client.TektonV1().TaskRuns(w.namespace).Get(context.TODO(), name, metav1.GetOptions{ - ResourceVersion: w.resourceVersion, - }) -} diff --git a/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1alpha1/verificationpolicy/verificationpolicy.go b/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1alpha1/verificationpolicy/verificationpolicy.go index 04480ee8e..9962547fc 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1alpha1/verificationpolicy/verificationpolicy.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1alpha1/verificationpolicy/verificationpolicy.go @@ -21,15 +21,8 @@ package verificationpolicy import ( context "context" - apispipelinev1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - versioned "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" v1alpha1 "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1alpha1" - client "github.com/tektoncd/pipeline/pkg/client/injection/client" factory "github.com/tektoncd/pipeline/pkg/client/injection/informers/factory" - pipelinev1alpha1 "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - cache "k8s.io/client-go/tools/cache" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" logging "knative.dev/pkg/logging" @@ -37,7 +30,6 @@ import ( func init() { injection.Default.RegisterInformer(withInformer) - injection.Dynamic.RegisterDynamicInformer(withDynamicInformer) } // Key is used for associating the Informer inside the context.Context. @@ -49,11 +41,6 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) { return context.WithValue(ctx, Key{}, inf), inf.Informer() } -func withDynamicInformer(ctx context.Context) context.Context { - inf := &wrapper{client: client.Get(ctx), resourceVersion: injection.GetResourceVersion(ctx)} - return context.WithValue(ctx, Key{}, inf) -} - // Get extracts the typed informer from the context. func Get(ctx context.Context) v1alpha1.VerificationPolicyInformer { untyped := ctx.Value(Key{}) @@ -63,54 +50,3 @@ func Get(ctx context.Context) v1alpha1.VerificationPolicyInformer { } return untyped.(v1alpha1.VerificationPolicyInformer) } - -type wrapper struct { - client versioned.Interface - - namespace string - - resourceVersion string -} - -var _ v1alpha1.VerificationPolicyInformer = (*wrapper)(nil) -var _ pipelinev1alpha1.VerificationPolicyLister = (*wrapper)(nil) - -func (w *wrapper) Informer() cache.SharedIndexInformer { - return cache.NewSharedIndexInformer(nil, &apispipelinev1alpha1.VerificationPolicy{}, 0, nil) -} - -func (w *wrapper) Lister() pipelinev1alpha1.VerificationPolicyLister { - return w -} - -func (w *wrapper) VerificationPolicies(namespace string) pipelinev1alpha1.VerificationPolicyNamespaceLister { - return &wrapper{client: w.client, namespace: namespace, resourceVersion: w.resourceVersion} -} - -// SetResourceVersion allows consumers to adjust the minimum resourceVersion -// used by the underlying client. It is not accessible via the standard -// lister interface, but can be accessed through a user-defined interface and -// an implementation check e.g. rvs, ok := foo.(ResourceVersionSetter) -func (w *wrapper) SetResourceVersion(resourceVersion string) { - w.resourceVersion = resourceVersion -} - -func (w *wrapper) List(selector labels.Selector) (ret []*apispipelinev1alpha1.VerificationPolicy, err error) { - lo, err := w.client.TektonV1alpha1().VerificationPolicies(w.namespace).List(context.TODO(), v1.ListOptions{ - LabelSelector: selector.String(), - ResourceVersion: w.resourceVersion, - }) - if err != nil { - return nil, err - } - for idx := range lo.Items { - ret = append(ret, &lo.Items[idx]) - } - return ret, nil -} - -func (w *wrapper) Get(name string) (*apispipelinev1alpha1.VerificationPolicy, error) { - return w.client.TektonV1alpha1().VerificationPolicies(w.namespace).Get(context.TODO(), name, v1.GetOptions{ - ResourceVersion: w.resourceVersion, - }) -} diff --git a/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/clustertask/clustertask.go b/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/clustertask/clustertask.go index 5aafda689..7626993d1 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/clustertask/clustertask.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/clustertask/clustertask.go @@ -21,15 +21,8 @@ package clustertask import ( context "context" - apispipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" - versioned "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" v1beta1 "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1beta1" - client "github.com/tektoncd/pipeline/pkg/client/injection/client" factory "github.com/tektoncd/pipeline/pkg/client/injection/informers/factory" - pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - cache "k8s.io/client-go/tools/cache" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" logging "knative.dev/pkg/logging" @@ -37,7 +30,6 @@ import ( func init() { injection.Default.RegisterInformer(withInformer) - injection.Dynamic.RegisterDynamicInformer(withDynamicInformer) } // Key is used for associating the Informer inside the context.Context. @@ -49,11 +41,6 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) { return context.WithValue(ctx, Key{}, inf), inf.Informer() } -func withDynamicInformer(ctx context.Context) context.Context { - inf := &wrapper{client: client.Get(ctx), resourceVersion: injection.GetResourceVersion(ctx)} - return context.WithValue(ctx, Key{}, inf) -} - // Get extracts the typed informer from the context. func Get(ctx context.Context) v1beta1.ClusterTaskInformer { untyped := ctx.Value(Key{}) @@ -63,48 +50,3 @@ func Get(ctx context.Context) v1beta1.ClusterTaskInformer { } return untyped.(v1beta1.ClusterTaskInformer) } - -type wrapper struct { - client versioned.Interface - - resourceVersion string -} - -var _ v1beta1.ClusterTaskInformer = (*wrapper)(nil) -var _ pipelinev1beta1.ClusterTaskLister = (*wrapper)(nil) - -func (w *wrapper) Informer() cache.SharedIndexInformer { - return cache.NewSharedIndexInformer(nil, &apispipelinev1beta1.ClusterTask{}, 0, nil) -} - -func (w *wrapper) Lister() pipelinev1beta1.ClusterTaskLister { - return w -} - -// SetResourceVersion allows consumers to adjust the minimum resourceVersion -// used by the underlying client. It is not accessible via the standard -// lister interface, but can be accessed through a user-defined interface and -// an implementation check e.g. rvs, ok := foo.(ResourceVersionSetter) -func (w *wrapper) SetResourceVersion(resourceVersion string) { - w.resourceVersion = resourceVersion -} - -func (w *wrapper) List(selector labels.Selector) (ret []*apispipelinev1beta1.ClusterTask, err error) { - lo, err := w.client.TektonV1beta1().ClusterTasks().List(context.TODO(), v1.ListOptions{ - LabelSelector: selector.String(), - ResourceVersion: w.resourceVersion, - }) - if err != nil { - return nil, err - } - for idx := range lo.Items { - ret = append(ret, &lo.Items[idx]) - } - return ret, nil -} - -func (w *wrapper) Get(name string) (*apispipelinev1beta1.ClusterTask, error) { - return w.client.TektonV1beta1().ClusterTasks().Get(context.TODO(), name, v1.GetOptions{ - ResourceVersion: w.resourceVersion, - }) -} diff --git a/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/customrun/customrun.go b/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/customrun/customrun.go index 5f97b83c0..a35b017b3 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/customrun/customrun.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/customrun/customrun.go @@ -21,15 +21,8 @@ package customrun import ( context "context" - apispipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" - versioned "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" v1beta1 "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1beta1" - client "github.com/tektoncd/pipeline/pkg/client/injection/client" factory "github.com/tektoncd/pipeline/pkg/client/injection/informers/factory" - pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - cache "k8s.io/client-go/tools/cache" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" logging "knative.dev/pkg/logging" @@ -37,7 +30,6 @@ import ( func init() { injection.Default.RegisterInformer(withInformer) - injection.Dynamic.RegisterDynamicInformer(withDynamicInformer) } // Key is used for associating the Informer inside the context.Context. @@ -49,11 +41,6 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) { return context.WithValue(ctx, Key{}, inf), inf.Informer() } -func withDynamicInformer(ctx context.Context) context.Context { - inf := &wrapper{client: client.Get(ctx), resourceVersion: injection.GetResourceVersion(ctx)} - return context.WithValue(ctx, Key{}, inf) -} - // Get extracts the typed informer from the context. func Get(ctx context.Context) v1beta1.CustomRunInformer { untyped := ctx.Value(Key{}) @@ -63,54 +50,3 @@ func Get(ctx context.Context) v1beta1.CustomRunInformer { } return untyped.(v1beta1.CustomRunInformer) } - -type wrapper struct { - client versioned.Interface - - namespace string - - resourceVersion string -} - -var _ v1beta1.CustomRunInformer = (*wrapper)(nil) -var _ pipelinev1beta1.CustomRunLister = (*wrapper)(nil) - -func (w *wrapper) Informer() cache.SharedIndexInformer { - return cache.NewSharedIndexInformer(nil, &apispipelinev1beta1.CustomRun{}, 0, nil) -} - -func (w *wrapper) Lister() pipelinev1beta1.CustomRunLister { - return w -} - -func (w *wrapper) CustomRuns(namespace string) pipelinev1beta1.CustomRunNamespaceLister { - return &wrapper{client: w.client, namespace: namespace, resourceVersion: w.resourceVersion} -} - -// SetResourceVersion allows consumers to adjust the minimum resourceVersion -// used by the underlying client. It is not accessible via the standard -// lister interface, but can be accessed through a user-defined interface and -// an implementation check e.g. rvs, ok := foo.(ResourceVersionSetter) -func (w *wrapper) SetResourceVersion(resourceVersion string) { - w.resourceVersion = resourceVersion -} - -func (w *wrapper) List(selector labels.Selector) (ret []*apispipelinev1beta1.CustomRun, err error) { - lo, err := w.client.TektonV1beta1().CustomRuns(w.namespace).List(context.TODO(), v1.ListOptions{ - LabelSelector: selector.String(), - ResourceVersion: w.resourceVersion, - }) - if err != nil { - return nil, err - } - for idx := range lo.Items { - ret = append(ret, &lo.Items[idx]) - } - return ret, nil -} - -func (w *wrapper) Get(name string) (*apispipelinev1beta1.CustomRun, error) { - return w.client.TektonV1beta1().CustomRuns(w.namespace).Get(context.TODO(), name, v1.GetOptions{ - ResourceVersion: w.resourceVersion, - }) -} diff --git a/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/pipeline/pipeline.go b/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/pipeline/pipeline.go index b94336138..3fae7de53 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/pipeline/pipeline.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/pipeline/pipeline.go @@ -21,15 +21,8 @@ package pipeline import ( context "context" - apispipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" - versioned "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" v1beta1 "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1beta1" - client "github.com/tektoncd/pipeline/pkg/client/injection/client" factory "github.com/tektoncd/pipeline/pkg/client/injection/informers/factory" - pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - cache "k8s.io/client-go/tools/cache" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" logging "knative.dev/pkg/logging" @@ -37,7 +30,6 @@ import ( func init() { injection.Default.RegisterInformer(withInformer) - injection.Dynamic.RegisterDynamicInformer(withDynamicInformer) } // Key is used for associating the Informer inside the context.Context. @@ -49,11 +41,6 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) { return context.WithValue(ctx, Key{}, inf), inf.Informer() } -func withDynamicInformer(ctx context.Context) context.Context { - inf := &wrapper{client: client.Get(ctx), resourceVersion: injection.GetResourceVersion(ctx)} - return context.WithValue(ctx, Key{}, inf) -} - // Get extracts the typed informer from the context. func Get(ctx context.Context) v1beta1.PipelineInformer { untyped := ctx.Value(Key{}) @@ -63,54 +50,3 @@ func Get(ctx context.Context) v1beta1.PipelineInformer { } return untyped.(v1beta1.PipelineInformer) } - -type wrapper struct { - client versioned.Interface - - namespace string - - resourceVersion string -} - -var _ v1beta1.PipelineInformer = (*wrapper)(nil) -var _ pipelinev1beta1.PipelineLister = (*wrapper)(nil) - -func (w *wrapper) Informer() cache.SharedIndexInformer { - return cache.NewSharedIndexInformer(nil, &apispipelinev1beta1.Pipeline{}, 0, nil) -} - -func (w *wrapper) Lister() pipelinev1beta1.PipelineLister { - return w -} - -func (w *wrapper) Pipelines(namespace string) pipelinev1beta1.PipelineNamespaceLister { - return &wrapper{client: w.client, namespace: namespace, resourceVersion: w.resourceVersion} -} - -// SetResourceVersion allows consumers to adjust the minimum resourceVersion -// used by the underlying client. It is not accessible via the standard -// lister interface, but can be accessed through a user-defined interface and -// an implementation check e.g. rvs, ok := foo.(ResourceVersionSetter) -func (w *wrapper) SetResourceVersion(resourceVersion string) { - w.resourceVersion = resourceVersion -} - -func (w *wrapper) List(selector labels.Selector) (ret []*apispipelinev1beta1.Pipeline, err error) { - lo, err := w.client.TektonV1beta1().Pipelines(w.namespace).List(context.TODO(), v1.ListOptions{ - LabelSelector: selector.String(), - ResourceVersion: w.resourceVersion, - }) - if err != nil { - return nil, err - } - for idx := range lo.Items { - ret = append(ret, &lo.Items[idx]) - } - return ret, nil -} - -func (w *wrapper) Get(name string) (*apispipelinev1beta1.Pipeline, error) { - return w.client.TektonV1beta1().Pipelines(w.namespace).Get(context.TODO(), name, v1.GetOptions{ - ResourceVersion: w.resourceVersion, - }) -} diff --git a/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/pipelinerun/pipelinerun.go b/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/pipelinerun/pipelinerun.go index 8ffb08c78..29efdfecd 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/pipelinerun/pipelinerun.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/pipelinerun/pipelinerun.go @@ -21,15 +21,8 @@ package pipelinerun import ( context "context" - apispipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" - versioned "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" v1beta1 "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1beta1" - client "github.com/tektoncd/pipeline/pkg/client/injection/client" factory "github.com/tektoncd/pipeline/pkg/client/injection/informers/factory" - pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - cache "k8s.io/client-go/tools/cache" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" logging "knative.dev/pkg/logging" @@ -37,7 +30,6 @@ import ( func init() { injection.Default.RegisterInformer(withInformer) - injection.Dynamic.RegisterDynamicInformer(withDynamicInformer) } // Key is used for associating the Informer inside the context.Context. @@ -49,11 +41,6 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) { return context.WithValue(ctx, Key{}, inf), inf.Informer() } -func withDynamicInformer(ctx context.Context) context.Context { - inf := &wrapper{client: client.Get(ctx), resourceVersion: injection.GetResourceVersion(ctx)} - return context.WithValue(ctx, Key{}, inf) -} - // Get extracts the typed informer from the context. func Get(ctx context.Context) v1beta1.PipelineRunInformer { untyped := ctx.Value(Key{}) @@ -63,54 +50,3 @@ func Get(ctx context.Context) v1beta1.PipelineRunInformer { } return untyped.(v1beta1.PipelineRunInformer) } - -type wrapper struct { - client versioned.Interface - - namespace string - - resourceVersion string -} - -var _ v1beta1.PipelineRunInformer = (*wrapper)(nil) -var _ pipelinev1beta1.PipelineRunLister = (*wrapper)(nil) - -func (w *wrapper) Informer() cache.SharedIndexInformer { - return cache.NewSharedIndexInformer(nil, &apispipelinev1beta1.PipelineRun{}, 0, nil) -} - -func (w *wrapper) Lister() pipelinev1beta1.PipelineRunLister { - return w -} - -func (w *wrapper) PipelineRuns(namespace string) pipelinev1beta1.PipelineRunNamespaceLister { - return &wrapper{client: w.client, namespace: namespace, resourceVersion: w.resourceVersion} -} - -// SetResourceVersion allows consumers to adjust the minimum resourceVersion -// used by the underlying client. It is not accessible via the standard -// lister interface, but can be accessed through a user-defined interface and -// an implementation check e.g. rvs, ok := foo.(ResourceVersionSetter) -func (w *wrapper) SetResourceVersion(resourceVersion string) { - w.resourceVersion = resourceVersion -} - -func (w *wrapper) List(selector labels.Selector) (ret []*apispipelinev1beta1.PipelineRun, err error) { - lo, err := w.client.TektonV1beta1().PipelineRuns(w.namespace).List(context.TODO(), v1.ListOptions{ - LabelSelector: selector.String(), - ResourceVersion: w.resourceVersion, - }) - if err != nil { - return nil, err - } - for idx := range lo.Items { - ret = append(ret, &lo.Items[idx]) - } - return ret, nil -} - -func (w *wrapper) Get(name string) (*apispipelinev1beta1.PipelineRun, error) { - return w.client.TektonV1beta1().PipelineRuns(w.namespace).Get(context.TODO(), name, v1.GetOptions{ - ResourceVersion: w.resourceVersion, - }) -} diff --git a/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/task/task.go b/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/task/task.go index c53c62384..ed40a826e 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/task/task.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/task/task.go @@ -21,15 +21,8 @@ package task import ( context "context" - apispipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" - versioned "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" v1beta1 "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1beta1" - client "github.com/tektoncd/pipeline/pkg/client/injection/client" factory "github.com/tektoncd/pipeline/pkg/client/injection/informers/factory" - pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - cache "k8s.io/client-go/tools/cache" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" logging "knative.dev/pkg/logging" @@ -37,7 +30,6 @@ import ( func init() { injection.Default.RegisterInformer(withInformer) - injection.Dynamic.RegisterDynamicInformer(withDynamicInformer) } // Key is used for associating the Informer inside the context.Context. @@ -49,11 +41,6 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) { return context.WithValue(ctx, Key{}, inf), inf.Informer() } -func withDynamicInformer(ctx context.Context) context.Context { - inf := &wrapper{client: client.Get(ctx), resourceVersion: injection.GetResourceVersion(ctx)} - return context.WithValue(ctx, Key{}, inf) -} - // Get extracts the typed informer from the context. func Get(ctx context.Context) v1beta1.TaskInformer { untyped := ctx.Value(Key{}) @@ -63,54 +50,3 @@ func Get(ctx context.Context) v1beta1.TaskInformer { } return untyped.(v1beta1.TaskInformer) } - -type wrapper struct { - client versioned.Interface - - namespace string - - resourceVersion string -} - -var _ v1beta1.TaskInformer = (*wrapper)(nil) -var _ pipelinev1beta1.TaskLister = (*wrapper)(nil) - -func (w *wrapper) Informer() cache.SharedIndexInformer { - return cache.NewSharedIndexInformer(nil, &apispipelinev1beta1.Task{}, 0, nil) -} - -func (w *wrapper) Lister() pipelinev1beta1.TaskLister { - return w -} - -func (w *wrapper) Tasks(namespace string) pipelinev1beta1.TaskNamespaceLister { - return &wrapper{client: w.client, namespace: namespace, resourceVersion: w.resourceVersion} -} - -// SetResourceVersion allows consumers to adjust the minimum resourceVersion -// used by the underlying client. It is not accessible via the standard -// lister interface, but can be accessed through a user-defined interface and -// an implementation check e.g. rvs, ok := foo.(ResourceVersionSetter) -func (w *wrapper) SetResourceVersion(resourceVersion string) { - w.resourceVersion = resourceVersion -} - -func (w *wrapper) List(selector labels.Selector) (ret []*apispipelinev1beta1.Task, err error) { - lo, err := w.client.TektonV1beta1().Tasks(w.namespace).List(context.TODO(), v1.ListOptions{ - LabelSelector: selector.String(), - ResourceVersion: w.resourceVersion, - }) - if err != nil { - return nil, err - } - for idx := range lo.Items { - ret = append(ret, &lo.Items[idx]) - } - return ret, nil -} - -func (w *wrapper) Get(name string) (*apispipelinev1beta1.Task, error) { - return w.client.TektonV1beta1().Tasks(w.namespace).Get(context.TODO(), name, v1.GetOptions{ - ResourceVersion: w.resourceVersion, - }) -} diff --git a/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/taskrun/taskrun.go b/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/taskrun/taskrun.go index 70f4da7a1..7cab8456f 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/taskrun/taskrun.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/taskrun/taskrun.go @@ -21,15 +21,8 @@ package taskrun import ( context "context" - apispipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" - versioned "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" v1beta1 "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1beta1" - client "github.com/tektoncd/pipeline/pkg/client/injection/client" factory "github.com/tektoncd/pipeline/pkg/client/injection/informers/factory" - pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - cache "k8s.io/client-go/tools/cache" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" logging "knative.dev/pkg/logging" @@ -37,7 +30,6 @@ import ( func init() { injection.Default.RegisterInformer(withInformer) - injection.Dynamic.RegisterDynamicInformer(withDynamicInformer) } // Key is used for associating the Informer inside the context.Context. @@ -49,11 +41,6 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) { return context.WithValue(ctx, Key{}, inf), inf.Informer() } -func withDynamicInformer(ctx context.Context) context.Context { - inf := &wrapper{client: client.Get(ctx), resourceVersion: injection.GetResourceVersion(ctx)} - return context.WithValue(ctx, Key{}, inf) -} - // Get extracts the typed informer from the context. func Get(ctx context.Context) v1beta1.TaskRunInformer { untyped := ctx.Value(Key{}) @@ -63,54 +50,3 @@ func Get(ctx context.Context) v1beta1.TaskRunInformer { } return untyped.(v1beta1.TaskRunInformer) } - -type wrapper struct { - client versioned.Interface - - namespace string - - resourceVersion string -} - -var _ v1beta1.TaskRunInformer = (*wrapper)(nil) -var _ pipelinev1beta1.TaskRunLister = (*wrapper)(nil) - -func (w *wrapper) Informer() cache.SharedIndexInformer { - return cache.NewSharedIndexInformer(nil, &apispipelinev1beta1.TaskRun{}, 0, nil) -} - -func (w *wrapper) Lister() pipelinev1beta1.TaskRunLister { - return w -} - -func (w *wrapper) TaskRuns(namespace string) pipelinev1beta1.TaskRunNamespaceLister { - return &wrapper{client: w.client, namespace: namespace, resourceVersion: w.resourceVersion} -} - -// SetResourceVersion allows consumers to adjust the minimum resourceVersion -// used by the underlying client. It is not accessible via the standard -// lister interface, but can be accessed through a user-defined interface and -// an implementation check e.g. rvs, ok := foo.(ResourceVersionSetter) -func (w *wrapper) SetResourceVersion(resourceVersion string) { - w.resourceVersion = resourceVersion -} - -func (w *wrapper) List(selector labels.Selector) (ret []*apispipelinev1beta1.TaskRun, err error) { - lo, err := w.client.TektonV1beta1().TaskRuns(w.namespace).List(context.TODO(), v1.ListOptions{ - LabelSelector: selector.String(), - ResourceVersion: w.resourceVersion, - }) - if err != nil { - return nil, err - } - for idx := range lo.Items { - ret = append(ret, &lo.Items[idx]) - } - return ret, nil -} - -func (w *wrapper) Get(name string) (*apispipelinev1beta1.TaskRun, error) { - return w.client.TektonV1beta1().TaskRuns(w.namespace).Get(context.TODO(), name, v1.GetOptions{ - ResourceVersion: w.resourceVersion, - }) -} diff --git a/vendor/github.com/tektoncd/pipeline/pkg/client/resolution/clientset/versioned/clientset.go b/vendor/github.com/tektoncd/pipeline/pkg/client/resolution/clientset/versioned/clientset.go index df12dfc02..48ab00477 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/client/resolution/clientset/versioned/clientset.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/client/resolution/clientset/versioned/clientset.go @@ -35,8 +35,7 @@ type Interface interface { ResolutionV1beta1() resolutionv1beta1.ResolutionV1beta1Interface } -// Clientset contains the clients for groups. Each group has exactly one -// version included in a Clientset. +// Clientset contains the clients for groups. type Clientset struct { *discovery.DiscoveryClient resolutionV1alpha1 *resolutionv1alpha1.ResolutionV1alpha1Client diff --git a/vendor/github.com/tektoncd/pipeline/pkg/client/resolution/informers/externalversions/factory.go b/vendor/github.com/tektoncd/pipeline/pkg/client/resolution/informers/externalversions/factory.go index 39c9230ec..49918ae94 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/client/resolution/informers/externalversions/factory.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/client/resolution/informers/externalversions/factory.go @@ -47,6 +47,11 @@ type sharedInformerFactory struct { // startedInformers is used for tracking which informers have been started. // This allows Start() to be called multiple times safely. startedInformers map[reflect.Type]bool + // wg tracks how many goroutines were started. + wg sync.WaitGroup + // shuttingDown is true when Shutdown has been called. It may still be running + // because it needs to wait for goroutines. + shuttingDown bool } // WithCustomResyncConfig sets a custom resync period for the specified informer types. @@ -107,20 +112,39 @@ func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResy return factory } -// Start initializes all requested informers. func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { f.lock.Lock() defer f.lock.Unlock() + if f.shuttingDown { + return + } + for informerType, informer := range f.informers { if !f.startedInformers[informerType] { - go informer.Run(stopCh) + f.wg.Add(1) + // We need a new variable in each loop iteration, + // otherwise the goroutine would use the loop variable + // and that keeps changing. + informer := informer + go func() { + defer f.wg.Done() + informer.Run(stopCh) + }() f.startedInformers[informerType] = true } } } -// WaitForCacheSync waits for all started informers' cache were synced. +func (f *sharedInformerFactory) Shutdown() { + f.lock.Lock() + f.shuttingDown = true + f.lock.Unlock() + + // Will return immediately if there is nothing to wait for. + f.wg.Wait() +} + func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { informers := func() map[reflect.Type]cache.SharedIndexInformer { f.lock.Lock() @@ -167,11 +191,58 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal // SharedInformerFactory provides shared informers for resources in all known // API group versions. +// +// It is typically used like this: +// +// ctx, cancel := context.Background() +// defer cancel() +// factory := NewSharedInformerFactory(client, resyncPeriod) +// defer factory.WaitForStop() // Returns immediately if nothing was started. +// genericInformer := factory.ForResource(resource) +// typedInformer := factory.SomeAPIGroup().V1().SomeType() +// factory.Start(ctx.Done()) // Start processing these informers. +// synced := factory.WaitForCacheSync(ctx.Done()) +// for v, ok := range synced { +// if !ok { +// fmt.Fprintf(os.Stderr, "caches failed to sync: %v", v) +// return +// } +// } +// +// // Creating informers can also be created after Start, but then +// // Start must be called again: +// anotherGenericInformer := factory.ForResource(resource) +// factory.Start(ctx.Done()) type SharedInformerFactory interface { internalinterfaces.SharedInformerFactory - ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + + // Start initializes all requested informers. They are handled in goroutines + // which run until the stop channel gets closed. + Start(stopCh <-chan struct{}) + + // Shutdown marks a factory as shutting down. At that point no new + // informers can be started anymore and Start will return without + // doing anything. + // + // In addition, Shutdown blocks until all goroutines have terminated. For that + // to happen, the close channel(s) that they were started with must be closed, + // either before Shutdown gets called or while it is waiting. + // + // Shutdown may be called multiple times, even concurrently. All such calls will + // block until all goroutines have terminated. + Shutdown() + + // WaitForCacheSync blocks until all started informers' caches were synced + // or the stop channel gets closed. WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool + // ForResource gives generic access to a shared informer of the matching type. + ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + + // InternalInformerFor returns the SharedIndexInformer for obj using an internal + // client. + InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer + Resolution() resolution.Interface } diff --git a/vendor/github.com/tektoncd/pipeline/pkg/client/resolution/injection/client/client.go b/vendor/github.com/tektoncd/pipeline/pkg/client/resolution/injection/client/client.go index 2b357f825..498e20322 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/client/resolution/injection/client/client.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/client/resolution/injection/client/client.go @@ -20,26 +20,10 @@ package client import ( context "context" - json "encoding/json" - errors "errors" - fmt "fmt" - v1alpha1 "github.com/tektoncd/pipeline/pkg/apis/resolution/v1alpha1" - v1beta1 "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" versioned "github.com/tektoncd/pipeline/pkg/client/resolution/clientset/versioned" - typedresolutionv1alpha1 "github.com/tektoncd/pipeline/pkg/client/resolution/clientset/versioned/typed/resolution/v1alpha1" - typedresolutionv1beta1 "github.com/tektoncd/pipeline/pkg/client/resolution/clientset/versioned/typed/resolution/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - discovery "k8s.io/client-go/discovery" - dynamic "k8s.io/client-go/dynamic" rest "k8s.io/client-go/rest" injection "knative.dev/pkg/injection" - dynamicclient "knative.dev/pkg/injection/clients/dynamicclient" logging "knative.dev/pkg/logging" ) @@ -48,7 +32,6 @@ func init() { injection.Default.RegisterClientFetcher(func(ctx context.Context) interface{} { return Get(ctx) }) - injection.Dynamic.RegisterDynamicClient(withClientFromDynamic) } // Key is used as the key for associating information with a context.Context. @@ -58,10 +41,6 @@ func withClientFromConfig(ctx context.Context, cfg *rest.Config) context.Context return context.WithValue(ctx, Key{}, versioned.NewForConfigOrDie(cfg)) } -func withClientFromDynamic(ctx context.Context) context.Context { - return context.WithValue(ctx, Key{}, &wrapClient{dyn: dynamicclient.Get(ctx)}) -} - // Get extracts the versioned.Interface client from the context. func Get(ctx context.Context) versioned.Interface { untyped := ctx.Value(Key{}) @@ -76,316 +55,3 @@ func Get(ctx context.Context) versioned.Interface { } return untyped.(versioned.Interface) } - -type wrapClient struct { - dyn dynamic.Interface -} - -var _ versioned.Interface = (*wrapClient)(nil) - -func (w *wrapClient) Discovery() discovery.DiscoveryInterface { - panic("Discovery called on dynamic client!") -} - -func convert(from interface{}, to runtime.Object) error { - bs, err := json.Marshal(from) - if err != nil { - return fmt.Errorf("Marshal() = %w", err) - } - if err := json.Unmarshal(bs, to); err != nil { - return fmt.Errorf("Unmarshal() = %w", err) - } - return nil -} - -// ResolutionV1alpha1 retrieves the ResolutionV1alpha1Client -func (w *wrapClient) ResolutionV1alpha1() typedresolutionv1alpha1.ResolutionV1alpha1Interface { - return &wrapResolutionV1alpha1{ - dyn: w.dyn, - } -} - -type wrapResolutionV1alpha1 struct { - dyn dynamic.Interface -} - -func (w *wrapResolutionV1alpha1) RESTClient() rest.Interface { - panic("RESTClient called on dynamic client!") -} - -func (w *wrapResolutionV1alpha1) ResolutionRequests(namespace string) typedresolutionv1alpha1.ResolutionRequestInterface { - return &wrapResolutionV1alpha1ResolutionRequestImpl{ - dyn: w.dyn.Resource(schema.GroupVersionResource{ - Group: "resolution.tekton.dev", - Version: "v1alpha1", - Resource: "resolutionrequests", - }), - - namespace: namespace, - } -} - -type wrapResolutionV1alpha1ResolutionRequestImpl struct { - dyn dynamic.NamespaceableResourceInterface - - namespace string -} - -var _ typedresolutionv1alpha1.ResolutionRequestInterface = (*wrapResolutionV1alpha1ResolutionRequestImpl)(nil) - -func (w *wrapResolutionV1alpha1ResolutionRequestImpl) Create(ctx context.Context, in *v1alpha1.ResolutionRequest, opts v1.CreateOptions) (*v1alpha1.ResolutionRequest, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "resolution.tekton.dev", - Version: "v1alpha1", - Kind: "ResolutionRequest", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &v1alpha1.ResolutionRequest{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapResolutionV1alpha1ResolutionRequestImpl) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) -} - -func (w *wrapResolutionV1alpha1ResolutionRequestImpl) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) -} - -func (w *wrapResolutionV1alpha1ResolutionRequestImpl) Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ResolutionRequest, error) { - uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) - if err != nil { - return nil, err - } - out := &v1alpha1.ResolutionRequest{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapResolutionV1alpha1ResolutionRequestImpl) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ResolutionRequestList, error) { - uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) - if err != nil { - return nil, err - } - out := &v1alpha1.ResolutionRequestList{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapResolutionV1alpha1ResolutionRequestImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ResolutionRequest, err error) { - uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) - if err != nil { - return nil, err - } - out := &v1alpha1.ResolutionRequest{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapResolutionV1alpha1ResolutionRequestImpl) Update(ctx context.Context, in *v1alpha1.ResolutionRequest, opts v1.UpdateOptions) (*v1alpha1.ResolutionRequest, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "resolution.tekton.dev", - Version: "v1alpha1", - Kind: "ResolutionRequest", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &v1alpha1.ResolutionRequest{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapResolutionV1alpha1ResolutionRequestImpl) UpdateStatus(ctx context.Context, in *v1alpha1.ResolutionRequest, opts v1.UpdateOptions) (*v1alpha1.ResolutionRequest, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "resolution.tekton.dev", - Version: "v1alpha1", - Kind: "ResolutionRequest", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &v1alpha1.ResolutionRequest{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapResolutionV1alpha1ResolutionRequestImpl) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return nil, errors.New("NYI: Watch") -} - -// ResolutionV1beta1 retrieves the ResolutionV1beta1Client -func (w *wrapClient) ResolutionV1beta1() typedresolutionv1beta1.ResolutionV1beta1Interface { - return &wrapResolutionV1beta1{ - dyn: w.dyn, - } -} - -type wrapResolutionV1beta1 struct { - dyn dynamic.Interface -} - -func (w *wrapResolutionV1beta1) RESTClient() rest.Interface { - panic("RESTClient called on dynamic client!") -} - -func (w *wrapResolutionV1beta1) ResolutionRequests(namespace string) typedresolutionv1beta1.ResolutionRequestInterface { - return &wrapResolutionV1beta1ResolutionRequestImpl{ - dyn: w.dyn.Resource(schema.GroupVersionResource{ - Group: "resolution.tekton.dev", - Version: "v1beta1", - Resource: "resolutionrequests", - }), - - namespace: namespace, - } -} - -type wrapResolutionV1beta1ResolutionRequestImpl struct { - dyn dynamic.NamespaceableResourceInterface - - namespace string -} - -var _ typedresolutionv1beta1.ResolutionRequestInterface = (*wrapResolutionV1beta1ResolutionRequestImpl)(nil) - -func (w *wrapResolutionV1beta1ResolutionRequestImpl) Create(ctx context.Context, in *v1beta1.ResolutionRequest, opts v1.CreateOptions) (*v1beta1.ResolutionRequest, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "resolution.tekton.dev", - Version: "v1beta1", - Kind: "ResolutionRequest", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &v1beta1.ResolutionRequest{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapResolutionV1beta1ResolutionRequestImpl) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts) -} - -func (w *wrapResolutionV1beta1ResolutionRequestImpl) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts) -} - -func (w *wrapResolutionV1beta1ResolutionRequestImpl) Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ResolutionRequest, error) { - uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts) - if err != nil { - return nil, err - } - out := &v1beta1.ResolutionRequest{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapResolutionV1beta1ResolutionRequestImpl) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ResolutionRequestList, error) { - uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts) - if err != nil { - return nil, err - } - out := &v1beta1.ResolutionRequestList{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapResolutionV1beta1ResolutionRequestImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ResolutionRequest, err error) { - uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts) - if err != nil { - return nil, err - } - out := &v1beta1.ResolutionRequest{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapResolutionV1beta1ResolutionRequestImpl) Update(ctx context.Context, in *v1beta1.ResolutionRequest, opts v1.UpdateOptions) (*v1beta1.ResolutionRequest, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "resolution.tekton.dev", - Version: "v1beta1", - Kind: "ResolutionRequest", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &v1beta1.ResolutionRequest{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapResolutionV1beta1ResolutionRequestImpl) UpdateStatus(ctx context.Context, in *v1beta1.ResolutionRequest, opts v1.UpdateOptions) (*v1beta1.ResolutionRequest, error) { - in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "resolution.tekton.dev", - Version: "v1beta1", - Kind: "ResolutionRequest", - }) - uo := &unstructured.Unstructured{} - if err := convert(in, uo); err != nil { - return nil, err - } - uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts) - if err != nil { - return nil, err - } - out := &v1beta1.ResolutionRequest{} - if err := convert(uo, out); err != nil { - return nil, err - } - return out, nil -} - -func (w *wrapResolutionV1beta1ResolutionRequestImpl) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return nil, errors.New("NYI: Watch") -} diff --git a/vendor/github.com/tektoncd/pipeline/pkg/client/resolution/injection/informers/resolution/v1beta1/resolutionrequest/resolutionrequest.go b/vendor/github.com/tektoncd/pipeline/pkg/client/resolution/injection/informers/resolution/v1beta1/resolutionrequest/resolutionrequest.go index 0ae786c67..973e1f7ef 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/client/resolution/injection/informers/resolution/v1beta1/resolutionrequest/resolutionrequest.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/client/resolution/injection/informers/resolution/v1beta1/resolutionrequest/resolutionrequest.go @@ -21,15 +21,8 @@ package resolutionrequest import ( context "context" - apisresolutionv1beta1 "github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1" - versioned "github.com/tektoncd/pipeline/pkg/client/resolution/clientset/versioned" v1beta1 "github.com/tektoncd/pipeline/pkg/client/resolution/informers/externalversions/resolution/v1beta1" - client "github.com/tektoncd/pipeline/pkg/client/resolution/injection/client" factory "github.com/tektoncd/pipeline/pkg/client/resolution/injection/informers/factory" - resolutionv1beta1 "github.com/tektoncd/pipeline/pkg/client/resolution/listers/resolution/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - cache "k8s.io/client-go/tools/cache" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" logging "knative.dev/pkg/logging" @@ -37,7 +30,6 @@ import ( func init() { injection.Default.RegisterInformer(withInformer) - injection.Dynamic.RegisterDynamicInformer(withDynamicInformer) } // Key is used for associating the Informer inside the context.Context. @@ -49,11 +41,6 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) { return context.WithValue(ctx, Key{}, inf), inf.Informer() } -func withDynamicInformer(ctx context.Context) context.Context { - inf := &wrapper{client: client.Get(ctx), resourceVersion: injection.GetResourceVersion(ctx)} - return context.WithValue(ctx, Key{}, inf) -} - // Get extracts the typed informer from the context. func Get(ctx context.Context) v1beta1.ResolutionRequestInformer { untyped := ctx.Value(Key{}) @@ -63,54 +50,3 @@ func Get(ctx context.Context) v1beta1.ResolutionRequestInformer { } return untyped.(v1beta1.ResolutionRequestInformer) } - -type wrapper struct { - client versioned.Interface - - namespace string - - resourceVersion string -} - -var _ v1beta1.ResolutionRequestInformer = (*wrapper)(nil) -var _ resolutionv1beta1.ResolutionRequestLister = (*wrapper)(nil) - -func (w *wrapper) Informer() cache.SharedIndexInformer { - return cache.NewSharedIndexInformer(nil, &apisresolutionv1beta1.ResolutionRequest{}, 0, nil) -} - -func (w *wrapper) Lister() resolutionv1beta1.ResolutionRequestLister { - return w -} - -func (w *wrapper) ResolutionRequests(namespace string) resolutionv1beta1.ResolutionRequestNamespaceLister { - return &wrapper{client: w.client, namespace: namespace, resourceVersion: w.resourceVersion} -} - -// SetResourceVersion allows consumers to adjust the minimum resourceVersion -// used by the underlying client. It is not accessible via the standard -// lister interface, but can be accessed through a user-defined interface and -// an implementation check e.g. rvs, ok := foo.(ResourceVersionSetter) -func (w *wrapper) SetResourceVersion(resourceVersion string) { - w.resourceVersion = resourceVersion -} - -func (w *wrapper) List(selector labels.Selector) (ret []*apisresolutionv1beta1.ResolutionRequest, err error) { - lo, err := w.client.ResolutionV1beta1().ResolutionRequests(w.namespace).List(context.TODO(), v1.ListOptions{ - LabelSelector: selector.String(), - ResourceVersion: w.resourceVersion, - }) - if err != nil { - return nil, err - } - for idx := range lo.Items { - ret = append(ret, &lo.Items[idx]) - } - return ret, nil -} - -func (w *wrapper) Get(name string) (*apisresolutionv1beta1.ResolutionRequest, error) { - return w.client.ResolutionV1beta1().ResolutionRequests(w.namespace).Get(context.TODO(), name, v1.GetOptions{ - ResourceVersion: w.resourceVersion, - }) -} diff --git a/vendor/github.com/tektoncd/pipeline/pkg/reconciler/events/cloudevent/cloudeventclient.go b/vendor/github.com/tektoncd/pipeline/pkg/reconciler/events/cloudevent/cloudeventclient.go index 0e398a60e..90a6d8999 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/reconciler/events/cloudevent/cloudeventclient.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/reconciler/events/cloudevent/cloudeventclient.go @@ -33,7 +33,6 @@ func init() { injection.Default.RegisterClient(func(ctx context.Context, _ *rest.Config) context.Context { return withCloudEventClient(ctx) }) - injection.Dynamic.RegisterDynamicClient(withCloudEventClient) } // ceKey is used to associate the CloudEventClient inside the context.Context diff --git a/vendor/modules.txt b/vendor/modules.txt index 974c175e4..944e04dda 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -149,7 +149,7 @@ github.com/Microsoft/go-winio/pkg/guid # github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 ## explicit; go 1.13 github.com/Netflix/go-expect -# github.com/ProtonMail/go-crypto v0.0.0-20230518184743-7afd39499903 +# github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95 ## explicit; go 1.13 github.com/ProtonMail/go-crypto/bitcurves github.com/ProtonMail/go-crypto/brainpool @@ -856,7 +856,7 @@ github.com/hashicorp/go-sockaddr # github.com/hashicorp/go-uuid v1.0.3 ## explicit github.com/hashicorp/go-uuid -# github.com/hashicorp/golang-lru v0.6.0 +# github.com/hashicorp/golang-lru v1.0.2 ## explicit; go 1.12 github.com/hashicorp/golang-lru github.com/hashicorp/golang-lru/simplelru @@ -1363,11 +1363,12 @@ github.com/tektoncd/hub/api/v1/gen/http/catalog/client github.com/tektoncd/hub/api/v1/gen/http/resource/client github.com/tektoncd/hub/api/v1/gen/resource github.com/tektoncd/hub/api/v1/gen/resource/views -# github.com/tektoncd/pipeline v0.50.1 +# github.com/tektoncd/pipeline v0.51.0 ## explicit; go 1.19 github.com/tektoncd/pipeline/pkg/apis/config github.com/tektoncd/pipeline/pkg/apis/config/resolver github.com/tektoncd/pipeline/pkg/apis/pipeline +github.com/tektoncd/pipeline/pkg/apis/pipeline/internal/checksum github.com/tektoncd/pipeline/pkg/apis/pipeline/pod github.com/tektoncd/pipeline/pkg/apis/pipeline/v1 github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1 @@ -2484,7 +2485,7 @@ knative.dev/eventing/pkg/reconciler/source ## explicit; go 1.16 knative.dev/networking/pkg/apis/networking knative.dev/networking/pkg/apis/networking/v1alpha1 -# knative.dev/pkg v0.0.0-20230612155445-74c4be5e935e => knative.dev/pkg v0.0.0-20230518105712-dfb4bf04635d +# knative.dev/pkg v0.0.0-20230718152110-aef227e72ead => knative.dev/pkg v0.0.0-20230518105712-dfb4bf04635d ## explicit; go 1.18 knative.dev/pkg/apis knative.dev/pkg/apis/duck