diff --git a/go.mod b/go.mod index a6953e0d75..e870bcb86e 100644 --- a/go.mod +++ b/go.mod @@ -7,36 +7,36 @@ require ( github.com/coreos/go-semver v0.3.1 github.com/distribution/distribution v2.7.1+incompatible github.com/evanphx/json-patch v5.6.0+incompatible - github.com/fsnotify/fsnotify v1.6.0 + github.com/fsnotify/fsnotify v1.7.0 github.com/ghodss/yaml v1.0.0 github.com/go-air/gini v1.0.4 github.com/go-bindata/go-bindata/v3 v3.1.3 - github.com/go-logr/logr v1.3.0 + github.com/go-logr/logr v1.4.1 github.com/golang/mock v1.6.0 github.com/google/go-cmp v0.6.0 github.com/googleapis/gnostic v0.5.5 github.com/itchyny/gojq v0.11.0 - github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2 + github.com/maxbrunsfeld/counterfeiter/v6 v6.8.1 github.com/mikefarah/yq/v3 v3.0.0-20201202084205-8846255d1c37 github.com/mitchellh/hashstructure v1.0.0 github.com/mitchellh/mapstructure v1.5.0 - github.com/onsi/ginkgo/v2 v2.13.2 - github.com/onsi/gomega v1.29.0 + github.com/onsi/ginkgo/v2 v2.17.1 + github.com/onsi/gomega v1.31.1 github.com/openshift/api v3.9.0+incompatible github.com/openshift/client-go v0.0.0-20220525160904-9e1acff93e4a github.com/operator-framework/api v0.22.0 - github.com/operator-framework/operator-registry v1.35.0 + github.com/operator-framework/operator-registry v1.38.0 github.com/otiai10/copy v1.14.0 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.16.0 - github.com/prometheus/client_model v0.4.0 + github.com/prometheus/client_golang v1.17.0 + github.com/prometheus/client_model v0.5.0 github.com/prometheus/common v0.44.0 github.com/sirupsen/logrus v1.9.3 - github.com/spf13/cobra v1.7.0 + github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.4 golang.org/x/net v0.20.0 - golang.org/x/sync v0.5.0 + golang.org/x/sync v0.6.0 golang.org/x/time v0.3.0 google.golang.org/grpc v1.60.1 gopkg.in/yaml.v2 v2.4.0 @@ -68,7 +68,7 @@ require ( github.com/Masterminds/squirrel v1.5.4 // indirect github.com/Masterminds/vcs v1.13.3 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect - github.com/Microsoft/hcsshim v0.12.0-rc.0 // indirect + github.com/Microsoft/hcsshim v0.12.0-rc.1 // indirect github.com/NYTimes/gziphandler v1.1.1 // indirect github.com/alessio/shellescape v1.4.1 // indirect github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df // indirect @@ -83,20 +83,21 @@ require ( github.com/containerd/log v0.1.0 // indirect github.com/containerd/ttrpc v1.2.2 // indirect github.com/containerd/typeurl/v2 v2.1.1 // indirect - github.com/containers/common v0.56.0 // indirect - github.com/containers/image/v5 v5.28.0 // indirect + github.com/containers/common v0.57.1 // indirect + github.com/containers/image/v5 v5.29.0 // indirect github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 // indirect - github.com/containers/ocicrypt v1.1.8 // indirect - github.com/containers/storage v1.50.2 // indirect + github.com/containers/ocicrypt v1.1.9 // indirect + github.com/containers/storage v1.51.0 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect github.com/cyphar/filepath-securejoin v0.2.4 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/docker/cli v24.0.6+incompatible // indirect - github.com/docker/distribution v2.8.2+incompatible // indirect - github.com/docker/docker v24.0.7+incompatible // indirect + github.com/distribution/reference v0.5.0 // indirect + github.com/docker/cli v25.0.5+incompatible // indirect + github.com/docker/distribution v2.8.3+incompatible // indirect + github.com/docker/docker v25.0.5+incompatible // indirect github.com/docker/docker-credential-helpers v0.8.0 // indirect - github.com/docker/go-connections v0.4.0 // indirect + github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-metrics v0.0.1 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect @@ -146,7 +147,7 @@ require ( github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/kisielk/errcheck v1.5.0 // indirect - github.com/klauspost/compress v1.16.7 // indirect + github.com/klauspost/compress v1.17.3 // indirect github.com/klauspost/pgzip v1.2.6 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect @@ -165,23 +166,22 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/moby/locker v1.0.1 // indirect github.com/moby/spdystream v0.2.0 // indirect - github.com/moby/sys/mountinfo v0.6.2 // indirect + github.com/moby/sys/mountinfo v0.7.1 // indirect github.com/moby/sys/sequential v0.5.0 // indirect github.com/moby/term v0.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect - github.com/morikuni/aec v1.0.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.1.0-rc5 // indirect + github.com/opencontainers/image-spec v1.1.0-rc6 // indirect github.com/opencontainers/runc v1.1.12 // indirect github.com/opencontainers/runtime-spec v1.1.0 // indirect github.com/pbnjay/strptime v0.0.0-20140226051138-5c05b0d668c9 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/procfs v0.10.1 // indirect + github.com/prometheus/procfs v0.11.1 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/rubenv/sql-migrate v1.3.1 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect @@ -213,14 +213,14 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.25.0 // indirect golang.org/x/crypto v0.18.0 // indirect - golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 // indirect + golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/oauth2 v0.14.0 // indirect golang.org/x/sys v0.16.0 // indirect golang.org/x/term v0.16.0 // indirect golang.org/x/text v0.14.0 // indirect - golang.org/x/tools v0.16.1 // indirect + golang.org/x/tools v0.17.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect google.golang.org/appengine v1.6.8 // indirect @@ -237,7 +237,7 @@ require ( k8s.io/klog/v2 v2.100.1 // indirect k8s.io/kms v0.28.5 // indirect k8s.io/kubectl v0.28.5 // indirect - oras.land/oras-go v1.2.4 // indirect + oras.land/oras-go v1.2.5 // indirect rsc.io/letsencrypt v0.0.3 // indirect sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.1.2 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect diff --git a/go.sum b/go.sum index 5c2e3e044f..3f0895b79f 100644 --- a/go.sum +++ b/go.sum @@ -70,8 +70,8 @@ github.com/Masterminds/vcs v1.13.3 h1:IIA2aBdXvfbIM+yl/eTnL4hb1XwdpvuQLglAix1gwe github.com/Masterminds/vcs v1.13.3/go.mod h1:TiE7xuEjl1N4j016moRd6vezp6e6Lz23gypeXfzXeW8= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/Microsoft/hcsshim v0.12.0-rc.0 h1:wX/F5huJxH9APBkhKSEAqaiZsuBvbbDnyBROZAqsSaY= -github.com/Microsoft/hcsshim v0.12.0-rc.0/go.mod h1:rvOnw3YlfoNnEp45wReUngvsXbwRW+AFQ10GVjG1kMU= +github.com/Microsoft/hcsshim v0.12.0-rc.1 h1:Hy+xzYujv7urO5wrgcG58SPMOXNLrj4WCJbySs2XX/A= +github.com/Microsoft/hcsshim v0.12.0-rc.1/go.mod h1:Y1a1S0QlYp1mBpyvGiuEdOfZqnao+0uX5AWHXQ5NhZU= github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -140,16 +140,16 @@ github.com/containerd/ttrpc v1.2.2 h1:9vqZr0pxwOF5koz6N0N3kJ0zDHokrcPxIR/ZR2YFtO github.com/containerd/ttrpc v1.2.2/go.mod h1:sIT6l32Ph/H9cvnJsfXM5drIVzTr5A2flTf1G5tYZak= github.com/containerd/typeurl/v2 v2.1.1 h1:3Q4Pt7i8nYwy2KmQWIw2+1hTvwTE/6w9FqcttATPO/4= github.com/containerd/typeurl/v2 v2.1.1/go.mod h1:IDp2JFvbwZ31H8dQbEIY7sDl2L3o3HZj1hsSQlywkQ0= -github.com/containers/common v0.56.0 h1:hysHUsEai1EkMXanU26UV55wMXns/a6AYmaFqJ4fEMY= -github.com/containers/common v0.56.0/go.mod h1:IjaDdfUtcs2CfCcJMZxuut4XlvkTkY9Nlqkso9xCOq4= -github.com/containers/image/v5 v5.28.0 h1:H4cWbdI88UA/mDb6SxMo3IxpmS1BSs/Kifvhwt9g048= -github.com/containers/image/v5 v5.28.0/go.mod h1:9aPnNkwHNHgGl9VlQxXEshvmOJRbdRAc1rNDD6sP2eU= +github.com/containers/common v0.57.1 h1:KWAs4PMPgBFmBV4QNbXhUB8TqvlgR95BJN2sbbXkWHY= +github.com/containers/common v0.57.1/go.mod h1:t/Z+/sFrapvFMEJe3YnecN49/Tae2wYEQShbEN6SRaU= +github.com/containers/image/v5 v5.29.0 h1:9+nhS/ZM7c4Kuzu5tJ0NMpxrgoryOJ2HAYTgG8Ny7j4= +github.com/containers/image/v5 v5.29.0/go.mod h1:kQ7qcDsps424ZAz24thD+x7+dJw1vgur3A9tTDsj97E= github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 h1:Qzk5C6cYglewc+UyGf6lc8Mj2UaPTHy/iF2De0/77CA= github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01/go.mod h1:9rfv8iPl1ZP7aqh9YA68wnZv2NUDbXdcdPHVz0pFbPY= -github.com/containers/ocicrypt v1.1.8 h1:saSBF0/8DyPUjzcxMVzL2OBUWCkvRvqIm75pu0ADSZk= -github.com/containers/ocicrypt v1.1.8/go.mod h1:jM362hyBtbwLMWzXQZTlkjKGAQf/BN/LFMtH0FIRt34= -github.com/containers/storage v1.50.2 h1:Fys4BjFUVNRBEXlO70hFI48VW4EXsgnGisTpk9tTMsE= -github.com/containers/storage v1.50.2/go.mod h1:dpspZsUrcKD8SpTofvKWhwPDHD0MkO4Q7VE+oYdWkiA= +github.com/containers/ocicrypt v1.1.9 h1:2Csfba4jse85Raxk5HIyEk8OwZNjRvfkhEGijOjIdEM= +github.com/containers/ocicrypt v1.1.9/go.mod h1:dTKx1918d8TDkxXvarscpNVY+lyPakPNFN4jwA9GBys= +github.com/containers/storage v1.51.0 h1:AowbcpiWXzAjHosKz7MKvPEqpyX+ryZA/ZurytRrFNA= +github.com/containers/storage v1.51.0/go.mod h1:ybl8a3j1PPtpyaEi/5A6TOFs+5TrEyObeKJzVtkUlfc= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -163,8 +163,8 @@ github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= @@ -180,16 +180,18 @@ github.com/distribution/distribution v2.7.1+incompatible h1:aGFx4EvJWKEh//lHPLwF github.com/distribution/distribution v2.7.1+incompatible/go.mod h1:EgLm2NgWtdKgzF9NpMzUKgzmR7AMmb0VQi2B+ZzDRjc= github.com/distribution/distribution/v3 v3.0.0-20221208165359-362910506bc2 h1:aBfCb7iqHmDEIp6fBvC/hQUddQfg+3qdYjwzaiP9Hnc= github.com/distribution/distribution/v3 v3.0.0-20221208165359-362910506bc2/go.mod h1:WHNsWjnIn2V1LYOrME7e8KxSeKunYHsxEm4am0BUtcI= -github.com/docker/cli v24.0.6+incompatible h1:fF+XCQCgJjjQNIMjzaSmiKJSCcfcXb3TWTcc7GAneOY= -github.com/docker/cli v24.0.6+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= -github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v24.0.7+incompatible h1:Wo6l37AuwP3JaMnZa226lzVXGA3F9Ig1seQen0cKYlM= -github.com/docker/docker v24.0.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= +github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= +github.com/docker/cli v25.0.5+incompatible h1:3Llw3kcE1gOScEojA247iDD+p1l9hHeC7H3vf3Zd5fk= +github.com/docker/cli v25.0.5+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= +github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/docker v25.0.5+incompatible h1:UmQydMduGkrD5nQde1mecF/YnSbTOaPeFIeP5C4W+DE= +github.com/docker/docker v25.0.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.8.0 h1:YQFtbBQb4VrpoPxhFuzEBPQ9E16qz5SpHLS+uswaCp8= github.com/docker/docker-credential-helpers v0.8.0/go.mod h1:UGFXcuoQ5TxPiB54nHOZ32AWRqQdECoh/Mg0AlEYb40= -github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= -github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= +github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c h1:+pKlWGMw7gf6bQ+oDZB4KHQFypsfjYlq/C4rfL7D3g8= github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8= @@ -233,8 +235,8 @@ github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3 github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/fvbommel/sortorder v1.1.0 h1:fUmoe+HLsBTctBDoaBwpQo5N+nrCp8g/BjKb/6ZQmYw= github.com/fvbommel/sortorder v1.1.0/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= github.com/garyburd/redigo v1.6.0 h1:0VruCpn7yAIIu7pWVClQC8wxCJEcG3nyzpMSHKi1PQc= @@ -267,8 +269,8 @@ github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTg github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= -github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-logr/zapr v1.2.4 h1:QHVo+6stLbfJmYGkQ7uGHUCu5hnAFAj6mDe6Ea0SeOo= @@ -464,7 +466,6 @@ github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0m github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hokaccha/go-prettyjson v0.0.0-20190818114111-108c894c2c0e/go.mod h1:pFlLw2CfqZiIBOx6BuCeRLCrfxBJipTY0nIOF/VbGcI= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= @@ -490,8 +491,6 @@ github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869/go.mod h1:cJ6Cj github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jmoiron/sqlx v1.3.5 h1:vFFPA71p1o5gAeqtEAwLU4dnX2napprKtHr7PYIcN3g= github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Ccp0mQ= -github.com/joefitzgerald/rainbow-reporter v0.1.0 h1:AuMG652zjdzI0YCCnXAqATtRBpGXMcAnrajcaTrSeuo= -github.com/joefitzgerald/rainbow-reporter v0.1.0/go.mod h1:481CNgqmVHQZzdIbN52CupLJyoVwB10FQ/IQlF1pdL8= github.com/joelanford/ignore v0.0.0-20210607151042-0d25dc18b62d h1:A2/B900ip/Z20TzkLeGRNy1s6J2HmH9AmGt+dHyqb4I= github.com/joelanford/ignore v0.0.0-20210607151042-0d25dc18b62d/go.mod h1:7HQupe4vyNxMKXmM5DFuwXHsqwMyglcYmZBtlDPIcZ8= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -517,8 +516,8 @@ github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQL github.com/kisielk/errcheck v1.5.0 h1:e8esj/e4R+SAOwFwN+n3zr0nYeCyeweozKfO23MvHzY= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= -github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= +github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU= github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -591,8 +590,8 @@ github.com/mattn/go-sqlite3 v1.14.19/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2 h1:g+4J5sZg6osfvEfkRZxJ1em0VT95/UOZgi/l7zi1/oE= -github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY= +github.com/maxbrunsfeld/counterfeiter/v6 v6.8.1 h1:NicmruxkeqHjDv03SfSxqmaLuisddudfP3h5wdXFbhM= +github.com/maxbrunsfeld/counterfeiter/v6 v6.8.1/go.mod h1:eyp4DdUJAKkr9tvxR3jWhw2mDK7CWABMG5r9uyaKC7I= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.25 h1:dFwPR6SfLtrSwgDcIq2bcU/gVutB4sNApq2HBdqcakg= github.com/miekg/dns v1.1.25/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= @@ -624,8 +623,8 @@ github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= -github.com/moby/sys/mountinfo v0.6.2 h1:BzJjoreD5BMFNmD9Rus6gdd1pLuecOFPt8wC+Vygl78= -github.com/moby/sys/mountinfo v0.6.2/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI= +github.com/moby/sys/mountinfo v0.7.1 h1:/tTvQaSJRr2FshkhXiIpux6fQ2Zvc4j7tAhMTStAG2g= +github.com/moby/sys/mountinfo v0.7.1/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI= github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc= github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo= github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= @@ -639,8 +638,6 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/2gBQ3RWajuToeY6ZtZTIKv2v7ThUy5KKusIT0yc0= github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4= -github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= -github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -651,19 +648,16 @@ github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.13.2 h1:Bi2gGVkfn6gQcjNjZJVO8Gf0FHzMPf2phUei9tejVMs= -github.com/onsi/ginkgo/v2 v2.13.2/go.mod h1:XStQ8QcGwLyF4HdfcZB8SFOS/MWCgDuXMSBe6zrvLgM= -github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= -github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= +github.com/onsi/ginkgo/v2 v2.17.1 h1:V++EzdbhI4ZV4ev0UTIj0PzhzOcReJFyJaLjtSF55M8= +github.com/onsi/ginkgo/v2 v2.17.1/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs= +github.com/onsi/gomega v1.31.1 h1:KYppCUK+bUgAZwHOu7EXVBKyQA6ILvOESHkn/tgoqvo= +github.com/onsi/gomega v1.31.1/go.mod h1:y40C95dwAD1Nz36SsEnxvfFe8FFfNxzI5eJ0EYGyAy0= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI= -github.com/opencontainers/image-spec v1.1.0-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= +github.com/opencontainers/image-spec v1.1.0-rc6 h1:XDqvyKsJEbRtATzkgItUqBA7QHk58yxX1Ov9HERHNqU= +github.com/opencontainers/image-spec v1.1.0-rc6/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM= github.com/opencontainers/runc v1.1.12 h1:BOIssBaW1La0/qbNZHXOOa71dZfZEQOzW7dqQf3phss= github.com/opencontainers/runc v1.1.12/go.mod h1:S+lQwSfncpBha7XTy/5lBwWgm5+y5Ma/O44Ekby9FK8= github.com/opencontainers/runtime-spec v1.1.0 h1:HHUyrt9mwHUjtasSbXSMvs4cyFxh+Bll4AjJ9odEGpg= @@ -674,8 +668,8 @@ github.com/openshift/client-go v0.0.0-20221019143426-16aed247da5c h1:CV76yFOTXmq github.com/openshift/client-go v0.0.0-20221019143426-16aed247da5c/go.mod h1:lFMO8mLHXWFzSdYvGNo8ivF9SfF6zInA8ZGw4phRnUE= github.com/operator-framework/api v0.22.0 h1:UZSn+iaQih4rCReezOnWTTJkMyawwV5iLnIItaOzytY= github.com/operator-framework/api v0.22.0/go.mod h1:p/7YDbr+n4fmESfZ47yLAV1SvkfE6NU2aX8KhcfI0GA= -github.com/operator-framework/operator-registry v1.35.0 h1:BvytqLwhgb0QiAkEODEKXq3vc2vWiHQq0IlofvFA+OI= -github.com/operator-framework/operator-registry v1.35.0/go.mod h1:foC+NO1V9JuDIOk3pjjlrPE0KVkq09m8oDVRz/a/nFA= +github.com/operator-framework/operator-registry v1.38.0 h1:IYFziHSR4LPGGHmEUQyL6iIJj/4WuvaIprR/6/1zaiw= +github.com/operator-framework/operator-registry v1.38.0/go.mod h1:6JllKmggrMqIwKpwLdk2BTpepD3gLh59Rh7LxtNz5lM= github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU= github.com/otiai10/copy v1.14.0/go.mod h1:ECfuL02W+/FkTWZWgQqXPWZgW9oeKCSQ5qVfSc4qc4w= github.com/otiai10/mint v1.5.1 h1:XaPLeE+9vGbuyEHem1JNk3bYc7KKqyI/na0/mLd/Kks= @@ -709,13 +703,13 @@ github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXP github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= -github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= -github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= +github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= +github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= -github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= +github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -727,8 +721,8 @@ github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7z github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= -github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= +github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= @@ -739,16 +733,16 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/rubenv/sql-migrate v1.3.1 h1:Vx+n4Du8X8VTYuXbhNxdEUoh6wiJERA0GlWocR5FrbA= github.com/rubenv/sql-migrate v1.3.1/go.mod h1:YzG/Vh82CwyhTFXy+Mf5ahAiiEOpAlHurg+23VEzcsk= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sclevine/spec v1.2.0 h1:1Jwdf9jSfDl9NVmt8ndHqbTZ7XCCPbh1jI3hkDBHVYA= -github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U= +github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8= +github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= @@ -776,8 +770,8 @@ github.com/spf13/cobra v0.0.6/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHN github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -933,8 +927,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 h1:m64FZMko/V45gv0bNmrNYoDEq8U5YUhetc9cBWKS1TQ= -golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63/go.mod h1:0v4NqG35kSWCMzLaMeX+IQrlSnVE/bqGSyC2cz/9Le8= +golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= +golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -966,7 +960,6 @@ golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1037,12 +1030,11 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1054,7 +1046,6 @@ golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1102,7 +1093,6 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1150,7 +1140,6 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190706070813-72ffa07ba3db/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1195,8 +1184,8 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA= -golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= +golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= +golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1330,7 +1319,6 @@ gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= gopkg.in/go-playground/validator.v9 v9.30.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= @@ -1405,8 +1393,8 @@ k8s.io/kubectl v0.28.5 h1:jq8xtiCCZPR8Cl/Qe1D7bLU0h8KtcunwfROqIekCUeU= k8s.io/kubectl v0.28.5/go.mod h1:9WiwzqeKs3vLiDtEQPbjhqqysX+BIVMLt7C7gN+T5w8= k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 h1:qY1Ad8PODbnymg2pRbkyMT/ylpTrCM8P2RJ0yroCyIk= k8s.io/utils v0.0.0-20230406110748-d93618cff8a2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -oras.land/oras-go v1.2.4 h1:djpBY2/2Cs1PV87GSJlxv4voajVOMZxqqtq9AB8YNvY= -oras.land/oras-go v1.2.4/go.mod h1:DYcGfb3YF1nKjcezfX2SNlDAeQFKSXmf+qrFmrh4324= +oras.land/oras-go v1.2.5 h1:XpYuAwAb0DfQsunIyMfeET92emK8km3W4yEzZvUbsTo= +oras.land/oras-go v1.2.5/go.mod h1:PuAwRShRZCsZb7g8Ar3jKKQR/2A/qN+pkYxIOd/FAoo= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/letsencrypt v0.0.3 h1:H7xDfhkaFFSYEJlKeq38RwX2jYcnTeHuDQyT+mMNMwM= rsc.io/letsencrypt v0.0.3/go.mod h1:buyQKZ6IXrRnB7TdkHP0RyEybLx18HHyOSoTyoOLqNY= diff --git a/pkg/api/wrappers/wrappersfakes/fake_install_strategy_deployment_interface.go b/pkg/api/wrappers/wrappersfakes/fake_install_strategy_deployment_interface.go index 1ef65511fb..022d580264 100644 --- a/pkg/api/wrappers/wrappersfakes/fake_install_strategy_deployment_interface.go +++ b/pkg/api/wrappers/wrappersfakes/fake_install_strategy_deployment_interface.go @@ -161,15 +161,16 @@ func (fake *FakeInstallStrategyDeploymentInterface) CreateDeployment(arg1 *v1.De fake.createDeploymentArgsForCall = append(fake.createDeploymentArgsForCall, struct { arg1 *v1.Deployment }{arg1}) + stub := fake.CreateDeploymentStub + fakeReturns := fake.createDeploymentReturns fake.recordInvocation("CreateDeployment", []interface{}{arg1}) fake.createDeploymentMutex.Unlock() - if fake.CreateDeploymentStub != nil { - return fake.CreateDeploymentStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.createDeploymentReturns return fakeReturns.result1, fakeReturns.result2 } @@ -224,15 +225,16 @@ func (fake *FakeInstallStrategyDeploymentInterface) CreateOrUpdateDeployment(arg fake.createOrUpdateDeploymentArgsForCall = append(fake.createOrUpdateDeploymentArgsForCall, struct { arg1 *v1.Deployment }{arg1}) + stub := fake.CreateOrUpdateDeploymentStub + fakeReturns := fake.createOrUpdateDeploymentReturns fake.recordInvocation("CreateOrUpdateDeployment", []interface{}{arg1}) fake.createOrUpdateDeploymentMutex.Unlock() - if fake.CreateOrUpdateDeploymentStub != nil { - return fake.CreateOrUpdateDeploymentStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.createOrUpdateDeploymentReturns return fakeReturns.result1, fakeReturns.result2 } @@ -287,15 +289,16 @@ func (fake *FakeInstallStrategyDeploymentInterface) CreateRole(arg1 *v1a.Role) ( fake.createRoleArgsForCall = append(fake.createRoleArgsForCall, struct { arg1 *v1a.Role }{arg1}) + stub := fake.CreateRoleStub + fakeReturns := fake.createRoleReturns fake.recordInvocation("CreateRole", []interface{}{arg1}) fake.createRoleMutex.Unlock() - if fake.CreateRoleStub != nil { - return fake.CreateRoleStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.createRoleReturns return fakeReturns.result1, fakeReturns.result2 } @@ -350,15 +353,16 @@ func (fake *FakeInstallStrategyDeploymentInterface) CreateRoleBinding(arg1 *v1a. fake.createRoleBindingArgsForCall = append(fake.createRoleBindingArgsForCall, struct { arg1 *v1a.RoleBinding }{arg1}) + stub := fake.CreateRoleBindingStub + fakeReturns := fake.createRoleBindingReturns fake.recordInvocation("CreateRoleBinding", []interface{}{arg1}) fake.createRoleBindingMutex.Unlock() - if fake.CreateRoleBindingStub != nil { - return fake.CreateRoleBindingStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.createRoleBindingReturns return fakeReturns.result1, fakeReturns.result2 } @@ -413,15 +417,16 @@ func (fake *FakeInstallStrategyDeploymentInterface) DeleteDeployment(arg1 string fake.deleteDeploymentArgsForCall = append(fake.deleteDeploymentArgsForCall, struct { arg1 string }{arg1}) + stub := fake.DeleteDeploymentStub + fakeReturns := fake.deleteDeploymentReturns fake.recordInvocation("DeleteDeployment", []interface{}{arg1}) fake.deleteDeploymentMutex.Unlock() - if fake.DeleteDeploymentStub != nil { - return fake.DeleteDeploymentStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1 } - fakeReturns := fake.deleteDeploymentReturns return fakeReturns.result1 } @@ -474,15 +479,16 @@ func (fake *FakeInstallStrategyDeploymentInterface) EnsureServiceAccount(arg1 *v arg1 *v1b.ServiceAccount arg2 ownerutil.Owner }{arg1, arg2}) + stub := fake.EnsureServiceAccountStub + fakeReturns := fake.ensureServiceAccountReturns fake.recordInvocation("EnsureServiceAccount", []interface{}{arg1, arg2}) fake.ensureServiceAccountMutex.Unlock() - if fake.EnsureServiceAccountStub != nil { - return fake.EnsureServiceAccountStub(arg1, arg2) + if stub != nil { + return stub(arg1, arg2) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.ensureServiceAccountReturns return fakeReturns.result1, fakeReturns.result2 } @@ -537,15 +543,16 @@ func (fake *FakeInstallStrategyDeploymentInterface) FindAnyDeploymentsMatchingLa fake.findAnyDeploymentsMatchingLabelsArgsForCall = append(fake.findAnyDeploymentsMatchingLabelsArgsForCall, struct { arg1 labels.Selector }{arg1}) + stub := fake.FindAnyDeploymentsMatchingLabelsStub + fakeReturns := fake.findAnyDeploymentsMatchingLabelsReturns fake.recordInvocation("FindAnyDeploymentsMatchingLabels", []interface{}{arg1}) fake.findAnyDeploymentsMatchingLabelsMutex.Unlock() - if fake.FindAnyDeploymentsMatchingLabelsStub != nil { - return fake.FindAnyDeploymentsMatchingLabelsStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.findAnyDeploymentsMatchingLabelsReturns return fakeReturns.result1, fakeReturns.result2 } @@ -605,15 +612,16 @@ func (fake *FakeInstallStrategyDeploymentInterface) FindAnyDeploymentsMatchingNa fake.findAnyDeploymentsMatchingNamesArgsForCall = append(fake.findAnyDeploymentsMatchingNamesArgsForCall, struct { arg1 []string }{arg1Copy}) + stub := fake.FindAnyDeploymentsMatchingNamesStub + fakeReturns := fake.findAnyDeploymentsMatchingNamesReturns fake.recordInvocation("FindAnyDeploymentsMatchingNames", []interface{}{arg1Copy}) fake.findAnyDeploymentsMatchingNamesMutex.Unlock() - if fake.FindAnyDeploymentsMatchingNamesStub != nil { - return fake.FindAnyDeploymentsMatchingNamesStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.findAnyDeploymentsMatchingNamesReturns return fakeReturns.result1, fakeReturns.result2 } @@ -667,15 +675,16 @@ func (fake *FakeInstallStrategyDeploymentInterface) GetOpClient() operatorclient ret, specificReturn := fake.getOpClientReturnsOnCall[len(fake.getOpClientArgsForCall)] fake.getOpClientArgsForCall = append(fake.getOpClientArgsForCall, struct { }{}) + stub := fake.GetOpClientStub + fakeReturns := fake.getOpClientReturns fake.recordInvocation("GetOpClient", []interface{}{}) fake.getOpClientMutex.Unlock() - if fake.GetOpClientStub != nil { - return fake.GetOpClientStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.getOpClientReturns return fakeReturns.result1 } @@ -719,15 +728,16 @@ func (fake *FakeInstallStrategyDeploymentInterface) GetOpLister() operatorlister ret, specificReturn := fake.getOpListerReturnsOnCall[len(fake.getOpListerArgsForCall)] fake.getOpListerArgsForCall = append(fake.getOpListerArgsForCall, struct { }{}) + stub := fake.GetOpListerStub + fakeReturns := fake.getOpListerReturns fake.recordInvocation("GetOpLister", []interface{}{}) fake.getOpListerMutex.Unlock() - if fake.GetOpListerStub != nil { - return fake.GetOpListerStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.getOpListerReturns return fakeReturns.result1 } @@ -772,15 +782,16 @@ func (fake *FakeInstallStrategyDeploymentInterface) GetServiceAccountByName(arg1 fake.getServiceAccountByNameArgsForCall = append(fake.getServiceAccountByNameArgsForCall, struct { arg1 string }{arg1}) + stub := fake.GetServiceAccountByNameStub + fakeReturns := fake.getServiceAccountByNameReturns fake.recordInvocation("GetServiceAccountByName", []interface{}{arg1}) fake.getServiceAccountByNameMutex.Unlock() - if fake.GetServiceAccountByNameStub != nil { - return fake.GetServiceAccountByNameStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getServiceAccountByNameReturns return fakeReturns.result1, fakeReturns.result2 } diff --git a/pkg/controller/bundle/bundlefakes/fake_unpacker.go b/pkg/controller/bundle/bundlefakes/fake_unpacker.go index 791df3ea61..f710412ac9 100644 --- a/pkg/controller/bundle/bundlefakes/fake_unpacker.go +++ b/pkg/controller/bundle/bundlefakes/fake_unpacker.go @@ -37,15 +37,16 @@ func (fake *FakeUnpacker) UnpackBundle(arg1 *v1alpha1.BundleLookup, arg2 time.Du arg2 time.Duration arg3 time.Duration }{arg1, arg2, arg3}) + stub := fake.UnpackBundleStub + fakeReturns := fake.unpackBundleReturns fake.recordInvocation("UnpackBundle", []interface{}{arg1, arg2, arg3}) fake.unpackBundleMutex.Unlock() - if fake.UnpackBundleStub != nil { - return fake.UnpackBundleStub(arg1, arg2, arg3) + if stub != nil { + return stub(arg1, arg2, arg3) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.unpackBundleReturns return fakeReturns.result1, fakeReturns.result2 } diff --git a/pkg/controller/registry/resolver/solver/zz_search_test.go b/pkg/controller/registry/resolver/solver/zz_search_test.go index 6fbdbccc46..f3f8be8fd5 100644 --- a/pkg/controller/registry/resolver/solver/zz_search_test.go +++ b/pkg/controller/registry/resolver/solver/zz_search_test.go @@ -147,9 +147,10 @@ func (fake *FakeS) Add(arg1 z.Lit) { fake.addArgsForCall = append(fake.addArgsForCall, struct { arg1 z.Lit }{arg1}) + stub := fake.AddStub fake.recordInvocation("Add", []interface{}{arg1}) fake.addMutex.Unlock() - if fake.AddStub != nil { + if stub != nil { fake.AddStub(arg1) } } @@ -178,9 +179,10 @@ func (fake *FakeS) Assume(arg1 ...z.Lit) { fake.assumeArgsForCall = append(fake.assumeArgsForCall, struct { arg1 []z.Lit }{arg1}) + stub := fake.AssumeStub fake.recordInvocation("Assume", []interface{}{arg1}) fake.assumeMutex.Unlock() - if fake.AssumeStub != nil { + if stub != nil { fake.AssumeStub(arg1...) } } @@ -209,15 +211,16 @@ func (fake *FakeS) GoSolve() inter.Solve { ret, specificReturn := fake.goSolveReturnsOnCall[len(fake.goSolveArgsForCall)] fake.goSolveArgsForCall = append(fake.goSolveArgsForCall, struct { }{}) + stub := fake.GoSolveStub + fakeReturns := fake.goSolveReturns fake.recordInvocation("GoSolve", []interface{}{}) fake.goSolveMutex.Unlock() - if fake.GoSolveStub != nil { - return fake.GoSolveStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.goSolveReturns return fakeReturns.result1 } @@ -261,15 +264,16 @@ func (fake *FakeS) Lit() z.Lit { ret, specificReturn := fake.litReturnsOnCall[len(fake.litArgsForCall)] fake.litArgsForCall = append(fake.litArgsForCall, struct { }{}) + stub := fake.LitStub + fakeReturns := fake.litReturns fake.recordInvocation("Lit", []interface{}{}) fake.litMutex.Unlock() - if fake.LitStub != nil { - return fake.LitStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.litReturns return fakeReturns.result1 } @@ -313,15 +317,16 @@ func (fake *FakeS) MaxVar() z.Var { ret, specificReturn := fake.maxVarReturnsOnCall[len(fake.maxVarArgsForCall)] fake.maxVarArgsForCall = append(fake.maxVarArgsForCall, struct { }{}) + stub := fake.MaxVarStub + fakeReturns := fake.maxVarReturns fake.recordInvocation("MaxVar", []interface{}{}) fake.maxVarMutex.Unlock() - if fake.MaxVarStub != nil { - return fake.MaxVarStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.maxVarReturns return fakeReturns.result1 } @@ -372,15 +377,16 @@ func (fake *FakeS) Reasons(arg1 []z.Lit, arg2 z.Lit) []z.Lit { arg1 []z.Lit arg2 z.Lit }{arg1Copy, arg2}) + stub := fake.ReasonsStub + fakeReturns := fake.reasonsReturns fake.recordInvocation("Reasons", []interface{}{arg1Copy, arg2}) fake.reasonsMutex.Unlock() - if fake.ReasonsStub != nil { - return fake.ReasonsStub(arg1, arg2) + if stub != nil { + return stub(arg1, arg2) } if specificReturn { return ret.result1 } - fakeReturns := fake.reasonsReturns return fakeReturns.result1 } @@ -431,15 +437,16 @@ func (fake *FakeS) SCopy() inter.S { ret, specificReturn := fake.sCopyReturnsOnCall[len(fake.sCopyArgsForCall)] fake.sCopyArgsForCall = append(fake.sCopyArgsForCall, struct { }{}) + stub := fake.SCopyStub + fakeReturns := fake.sCopyReturns fake.recordInvocation("SCopy", []interface{}{}) fake.sCopyMutex.Unlock() - if fake.SCopyStub != nil { - return fake.SCopyStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.sCopyReturns return fakeReturns.result1 } @@ -483,15 +490,16 @@ func (fake *FakeS) Solve() int { ret, specificReturn := fake.solveReturnsOnCall[len(fake.solveArgsForCall)] fake.solveArgsForCall = append(fake.solveArgsForCall, struct { }{}) + stub := fake.SolveStub + fakeReturns := fake.solveReturns fake.recordInvocation("Solve", []interface{}{}) fake.solveMutex.Unlock() - if fake.SolveStub != nil { - return fake.SolveStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.solveReturns return fakeReturns.result1 } @@ -541,15 +549,16 @@ func (fake *FakeS) Test(arg1 []z.Lit) (int, []z.Lit) { fake.testArgsForCall = append(fake.testArgsForCall, struct { arg1 []z.Lit }{arg1Copy}) + stub := fake.TestStub + fakeReturns := fake.testReturns fake.recordInvocation("Test", []interface{}{arg1Copy}) fake.testMutex.Unlock() - if fake.TestStub != nil { - return fake.TestStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.testReturns return fakeReturns.result1, fakeReturns.result2 } @@ -604,15 +613,16 @@ func (fake *FakeS) Try(arg1 time.Duration) int { fake.tryArgsForCall = append(fake.tryArgsForCall, struct { arg1 time.Duration }{arg1}) + stub := fake.TryStub + fakeReturns := fake.tryReturns fake.recordInvocation("Try", []interface{}{arg1}) fake.tryMutex.Unlock() - if fake.TryStub != nil { - return fake.TryStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1 } - fakeReturns := fake.tryReturns return fakeReturns.result1 } @@ -663,15 +673,16 @@ func (fake *FakeS) Untest() int { ret, specificReturn := fake.untestReturnsOnCall[len(fake.untestArgsForCall)] fake.untestArgsForCall = append(fake.untestArgsForCall, struct { }{}) + stub := fake.UntestStub + fakeReturns := fake.untestReturns fake.recordInvocation("Untest", []interface{}{}) fake.untestMutex.Unlock() - if fake.UntestStub != nil { - return fake.UntestStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.untestReturns return fakeReturns.result1 } @@ -716,15 +727,16 @@ func (fake *FakeS) Value(arg1 z.Lit) bool { fake.valueArgsForCall = append(fake.valueArgsForCall, struct { arg1 z.Lit }{arg1}) + stub := fake.ValueStub + fakeReturns := fake.valueReturns fake.recordInvocation("Value", []interface{}{arg1}) fake.valueMutex.Unlock() - if fake.ValueStub != nil { - return fake.ValueStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1 } - fakeReturns := fake.valueReturns return fakeReturns.result1 } @@ -781,15 +793,16 @@ func (fake *FakeS) Why(arg1 []z.Lit) []z.Lit { fake.whyArgsForCall = append(fake.whyArgsForCall, struct { arg1 []z.Lit }{arg1Copy}) + stub := fake.WhyStub + fakeReturns := fake.whyReturns fake.recordInvocation("Why", []interface{}{arg1Copy}) fake.whyMutex.Unlock() - if fake.WhyStub != nil { - return fake.WhyStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1 } - fakeReturns := fake.whyReturns return fakeReturns.result1 } diff --git a/pkg/fakes/client-go/listers/fake_rbac_v1_clusterrolebinding_lister.go b/pkg/fakes/client-go/listers/fake_rbac_v1_clusterrolebinding_lister.go index ce04860beb..c8d5145b60 100644 --- a/pkg/fakes/client-go/listers/fake_rbac_v1_clusterrolebinding_lister.go +++ b/pkg/fakes/client-go/listers/fake_rbac_v1_clusterrolebinding_lister.go @@ -46,15 +46,16 @@ func (fake *FakeClusterRoleBindingLister) Get(arg1 string) (*v1a.ClusterRoleBind fake.getArgsForCall = append(fake.getArgsForCall, struct { arg1 string }{arg1}) + stub := fake.GetStub + fakeReturns := fake.getReturns fake.recordInvocation("Get", []interface{}{arg1}) fake.getMutex.Unlock() - if fake.GetStub != nil { - return fake.GetStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getReturns return fakeReturns.result1, fakeReturns.result2 } @@ -109,15 +110,16 @@ func (fake *FakeClusterRoleBindingLister) List(arg1 labels.Selector) ([]*v1a.Clu fake.listArgsForCall = append(fake.listArgsForCall, struct { arg1 labels.Selector }{arg1}) + stub := fake.ListStub + fakeReturns := fake.listReturns fake.recordInvocation("List", []interface{}{arg1}) fake.listMutex.Unlock() - if fake.ListStub != nil { - return fake.ListStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.listReturns return fakeReturns.result1, fakeReturns.result2 } diff --git a/pkg/fakes/client-go/listers/fake_rbac_v1_role_lister.go b/pkg/fakes/client-go/listers/fake_rbac_v1_role_lister.go index 2ed191e7c5..572d652e6d 100644 --- a/pkg/fakes/client-go/listers/fake_rbac_v1_role_lister.go +++ b/pkg/fakes/client-go/listers/fake_rbac_v1_role_lister.go @@ -44,15 +44,16 @@ func (fake *FakeRoleLister) List(arg1 labels.Selector) ([]*v1a.Role, error) { fake.listArgsForCall = append(fake.listArgsForCall, struct { arg1 labels.Selector }{arg1}) + stub := fake.ListStub + fakeReturns := fake.listReturns fake.recordInvocation("List", []interface{}{arg1}) fake.listMutex.Unlock() - if fake.ListStub != nil { - return fake.ListStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.listReturns return fakeReturns.result1, fakeReturns.result2 } @@ -107,15 +108,16 @@ func (fake *FakeRoleLister) Roles(arg1 string) v1.RoleNamespaceLister { fake.rolesArgsForCall = append(fake.rolesArgsForCall, struct { arg1 string }{arg1}) + stub := fake.RolesStub + fakeReturns := fake.rolesReturns fake.recordInvocation("Roles", []interface{}{arg1}) fake.rolesMutex.Unlock() - if fake.RolesStub != nil { - return fake.RolesStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1 } - fakeReturns := fake.rolesReturns return fakeReturns.result1 } diff --git a/pkg/fakes/client-go/listers/fake_rbac_v1_role_namespace_lister.go b/pkg/fakes/client-go/listers/fake_rbac_v1_role_namespace_lister.go index 705002c787..52aa39bed6 100644 --- a/pkg/fakes/client-go/listers/fake_rbac_v1_role_namespace_lister.go +++ b/pkg/fakes/client-go/listers/fake_rbac_v1_role_namespace_lister.go @@ -46,15 +46,16 @@ func (fake *FakeRoleNamespaceLister) Get(arg1 string) (*v1a.Role, error) { fake.getArgsForCall = append(fake.getArgsForCall, struct { arg1 string }{arg1}) + stub := fake.GetStub + fakeReturns := fake.getReturns fake.recordInvocation("Get", []interface{}{arg1}) fake.getMutex.Unlock() - if fake.GetStub != nil { - return fake.GetStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getReturns return fakeReturns.result1, fakeReturns.result2 } @@ -109,15 +110,16 @@ func (fake *FakeRoleNamespaceLister) List(arg1 labels.Selector) ([]*v1a.Role, er fake.listArgsForCall = append(fake.listArgsForCall, struct { arg1 labels.Selector }{arg1}) + stub := fake.ListStub + fakeReturns := fake.listReturns fake.recordInvocation("List", []interface{}{arg1}) fake.listMutex.Unlock() - if fake.ListStub != nil { - return fake.ListStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.listReturns return fakeReturns.result1, fakeReturns.result2 } diff --git a/pkg/fakes/client-go/listers/fake_rbac_v1_rolebinding_lister.go b/pkg/fakes/client-go/listers/fake_rbac_v1_rolebinding_lister.go index 539ad6370a..1ba69b7956 100644 --- a/pkg/fakes/client-go/listers/fake_rbac_v1_rolebinding_lister.go +++ b/pkg/fakes/client-go/listers/fake_rbac_v1_rolebinding_lister.go @@ -44,15 +44,16 @@ func (fake *FakeRoleBindingLister) List(arg1 labels.Selector) ([]*v1a.RoleBindin fake.listArgsForCall = append(fake.listArgsForCall, struct { arg1 labels.Selector }{arg1}) + stub := fake.ListStub + fakeReturns := fake.listReturns fake.recordInvocation("List", []interface{}{arg1}) fake.listMutex.Unlock() - if fake.ListStub != nil { - return fake.ListStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.listReturns return fakeReturns.result1, fakeReturns.result2 } @@ -107,15 +108,16 @@ func (fake *FakeRoleBindingLister) RoleBindings(arg1 string) v1.RoleBindingNames fake.roleBindingsArgsForCall = append(fake.roleBindingsArgsForCall, struct { arg1 string }{arg1}) + stub := fake.RoleBindingsStub + fakeReturns := fake.roleBindingsReturns fake.recordInvocation("RoleBindings", []interface{}{arg1}) fake.roleBindingsMutex.Unlock() - if fake.RoleBindingsStub != nil { - return fake.RoleBindingsStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1 } - fakeReturns := fake.roleBindingsReturns return fakeReturns.result1 } diff --git a/pkg/fakes/client-go/listers/fake_rbac_v1_rolebinding_namespace_lister.go b/pkg/fakes/client-go/listers/fake_rbac_v1_rolebinding_namespace_lister.go index 528e7d3b79..858563e503 100644 --- a/pkg/fakes/client-go/listers/fake_rbac_v1_rolebinding_namespace_lister.go +++ b/pkg/fakes/client-go/listers/fake_rbac_v1_rolebinding_namespace_lister.go @@ -46,15 +46,16 @@ func (fake *FakeRoleBindingNamespaceLister) Get(arg1 string) (*v1a.RoleBinding, fake.getArgsForCall = append(fake.getArgsForCall, struct { arg1 string }{arg1}) + stub := fake.GetStub + fakeReturns := fake.getReturns fake.recordInvocation("Get", []interface{}{arg1}) fake.getMutex.Unlock() - if fake.GetStub != nil { - return fake.GetStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getReturns return fakeReturns.result1, fakeReturns.result2 } @@ -109,15 +110,16 @@ func (fake *FakeRoleBindingNamespaceLister) List(arg1 labels.Selector) ([]*v1a.R fake.listArgsForCall = append(fake.listArgsForCall, struct { arg1 labels.Selector }{arg1}) + stub := fake.ListStub + fakeReturns := fake.listReturns fake.recordInvocation("List", []interface{}{arg1}) fake.listMutex.Unlock() - if fake.ListStub != nil { - return fake.ListStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.listReturns return fakeReturns.result1, fakeReturns.result2 } diff --git a/pkg/fakes/client-go/listers/fake_v1_secret_lister.go b/pkg/fakes/client-go/listers/fake_v1_secret_lister.go index 9bd42e308e..1f0be9775c 100644 --- a/pkg/fakes/client-go/listers/fake_v1_secret_lister.go +++ b/pkg/fakes/client-go/listers/fake_v1_secret_lister.go @@ -44,15 +44,16 @@ func (fake *FakeSecretLister) List(arg1 labels.Selector) ([]*v1a.Secret, error) fake.listArgsForCall = append(fake.listArgsForCall, struct { arg1 labels.Selector }{arg1}) + stub := fake.ListStub + fakeReturns := fake.listReturns fake.recordInvocation("List", []interface{}{arg1}) fake.listMutex.Unlock() - if fake.ListStub != nil { - return fake.ListStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.listReturns return fakeReturns.result1, fakeReturns.result2 } @@ -107,15 +108,16 @@ func (fake *FakeSecretLister) Secrets(arg1 string) v1.SecretNamespaceLister { fake.secretsArgsForCall = append(fake.secretsArgsForCall, struct { arg1 string }{arg1}) + stub := fake.SecretsStub + fakeReturns := fake.secretsReturns fake.recordInvocation("Secrets", []interface{}{arg1}) fake.secretsMutex.Unlock() - if fake.SecretsStub != nil { - return fake.SecretsStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1 } - fakeReturns := fake.secretsReturns return fakeReturns.result1 } diff --git a/pkg/fakes/client-go/listers/fake_v1_secret_namespace_lister.go b/pkg/fakes/client-go/listers/fake_v1_secret_namespace_lister.go index 96ecc11a5c..745bf8cfe0 100644 --- a/pkg/fakes/client-go/listers/fake_v1_secret_namespace_lister.go +++ b/pkg/fakes/client-go/listers/fake_v1_secret_namespace_lister.go @@ -46,15 +46,16 @@ func (fake *FakeSecretNamespaceLister) Get(arg1 string) (*v1a.Secret, error) { fake.getArgsForCall = append(fake.getArgsForCall, struct { arg1 string }{arg1}) + stub := fake.GetStub + fakeReturns := fake.getReturns fake.recordInvocation("Get", []interface{}{arg1}) fake.getMutex.Unlock() - if fake.GetStub != nil { - return fake.GetStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getReturns return fakeReturns.result1, fakeReturns.result2 } @@ -109,15 +110,16 @@ func (fake *FakeSecretNamespaceLister) List(arg1 labels.Selector) ([]*v1a.Secret fake.listArgsForCall = append(fake.listArgsForCall, struct { arg1 labels.Selector }{arg1}) + stub := fake.ListStub + fakeReturns := fake.listReturns fake.recordInvocation("List", []interface{}{arg1}) fake.listMutex.Unlock() - if fake.ListStub != nil { - return fake.ListStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.listReturns return fakeReturns.result1, fakeReturns.result2 } diff --git a/pkg/fakes/client-go/listers/fake_v1_service_account_lister.go b/pkg/fakes/client-go/listers/fake_v1_service_account_lister.go index a715a6a096..ef7b3619af 100644 --- a/pkg/fakes/client-go/listers/fake_v1_service_account_lister.go +++ b/pkg/fakes/client-go/listers/fake_v1_service_account_lister.go @@ -44,15 +44,16 @@ func (fake *FakeServiceAccountLister) List(arg1 labels.Selector) ([]*v1a.Service fake.listArgsForCall = append(fake.listArgsForCall, struct { arg1 labels.Selector }{arg1}) + stub := fake.ListStub + fakeReturns := fake.listReturns fake.recordInvocation("List", []interface{}{arg1}) fake.listMutex.Unlock() - if fake.ListStub != nil { - return fake.ListStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.listReturns return fakeReturns.result1, fakeReturns.result2 } @@ -107,15 +108,16 @@ func (fake *FakeServiceAccountLister) ServiceAccounts(arg1 string) v1.ServiceAcc fake.serviceAccountsArgsForCall = append(fake.serviceAccountsArgsForCall, struct { arg1 string }{arg1}) + stub := fake.ServiceAccountsStub + fakeReturns := fake.serviceAccountsReturns fake.recordInvocation("ServiceAccounts", []interface{}{arg1}) fake.serviceAccountsMutex.Unlock() - if fake.ServiceAccountsStub != nil { - return fake.ServiceAccountsStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1 } - fakeReturns := fake.serviceAccountsReturns return fakeReturns.result1 } diff --git a/pkg/fakes/client-go/listers/fake_v1_service_account_namespace_lister.go b/pkg/fakes/client-go/listers/fake_v1_service_account_namespace_lister.go index 7f924a1be5..fc70380fea 100644 --- a/pkg/fakes/client-go/listers/fake_v1_service_account_namespace_lister.go +++ b/pkg/fakes/client-go/listers/fake_v1_service_account_namespace_lister.go @@ -46,15 +46,16 @@ func (fake *FakeServiceAccountNamespaceLister) Get(arg1 string) (*v1a.ServiceAcc fake.getArgsForCall = append(fake.getArgsForCall, struct { arg1 string }{arg1}) + stub := fake.GetStub + fakeReturns := fake.getReturns fake.recordInvocation("Get", []interface{}{arg1}) fake.getMutex.Unlock() - if fake.GetStub != nil { - return fake.GetStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getReturns return fakeReturns.result1, fakeReturns.result2 } @@ -109,15 +110,16 @@ func (fake *FakeServiceAccountNamespaceLister) List(arg1 labels.Selector) ([]*v1 fake.listArgsForCall = append(fake.listArgsForCall, struct { arg1 labels.Selector }{arg1}) + stub := fake.ListStub + fakeReturns := fake.listReturns fake.recordInvocation("List", []interface{}{arg1}) fake.listMutex.Unlock() - if fake.ListStub != nil { - return fake.ListStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.listReturns return fakeReturns.result1, fakeReturns.result2 } diff --git a/pkg/fakes/client-go/listers/fake_v1_service_lister.go b/pkg/fakes/client-go/listers/fake_v1_service_lister.go index 18e6c82785..d92397c35c 100644 --- a/pkg/fakes/client-go/listers/fake_v1_service_lister.go +++ b/pkg/fakes/client-go/listers/fake_v1_service_lister.go @@ -44,15 +44,16 @@ func (fake *FakeServiceLister) List(arg1 labels.Selector) ([]*v1a.Service, error fake.listArgsForCall = append(fake.listArgsForCall, struct { arg1 labels.Selector }{arg1}) + stub := fake.ListStub + fakeReturns := fake.listReturns fake.recordInvocation("List", []interface{}{arg1}) fake.listMutex.Unlock() - if fake.ListStub != nil { - return fake.ListStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.listReturns return fakeReturns.result1, fakeReturns.result2 } @@ -107,15 +108,16 @@ func (fake *FakeServiceLister) Services(arg1 string) v1.ServiceNamespaceLister { fake.servicesArgsForCall = append(fake.servicesArgsForCall, struct { arg1 string }{arg1}) + stub := fake.ServicesStub + fakeReturns := fake.servicesReturns fake.recordInvocation("Services", []interface{}{arg1}) fake.servicesMutex.Unlock() - if fake.ServicesStub != nil { - return fake.ServicesStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1 } - fakeReturns := fake.servicesReturns return fakeReturns.result1 } diff --git a/pkg/fakes/client-go/listers/fake_v1_service_namespace_lister.go b/pkg/fakes/client-go/listers/fake_v1_service_namespace_lister.go index 850686e202..ed3f7ec881 100644 --- a/pkg/fakes/client-go/listers/fake_v1_service_namespace_lister.go +++ b/pkg/fakes/client-go/listers/fake_v1_service_namespace_lister.go @@ -46,15 +46,16 @@ func (fake *FakeServiceNamespaceLister) Get(arg1 string) (*v1a.Service, error) { fake.getArgsForCall = append(fake.getArgsForCall, struct { arg1 string }{arg1}) + stub := fake.GetStub + fakeReturns := fake.getReturns fake.recordInvocation("Get", []interface{}{arg1}) fake.getMutex.Unlock() - if fake.GetStub != nil { - return fake.GetStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getReturns return fakeReturns.result1, fakeReturns.result2 } @@ -109,15 +110,16 @@ func (fake *FakeServiceNamespaceLister) List(arg1 labels.Selector) ([]*v1a.Servi fake.listArgsForCall = append(fake.listArgsForCall, struct { arg1 labels.Selector }{arg1}) + stub := fake.ListStub + fakeReturns := fake.listReturns fake.recordInvocation("List", []interface{}{arg1}) fake.listMutex.Unlock() - if fake.ListStub != nil { - return fake.ListStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.listReturns return fakeReturns.result1, fakeReturns.result2 } diff --git a/pkg/fakes/fake_reconciler.go b/pkg/fakes/fake_reconciler.go index 80a89f1222..2f15bf8a3b 100644 --- a/pkg/fakes/fake_reconciler.go +++ b/pkg/fakes/fake_reconciler.go @@ -47,15 +47,16 @@ func (fake *FakeRegistryReconciler) CheckRegistryServer(arg1 *logrus.Entry, arg2 arg1 *logrus.Entry arg2 *v1alpha1.CatalogSource }{arg1, arg2}) + stub := fake.CheckRegistryServerStub + fakeReturns := fake.checkRegistryServerReturns fake.recordInvocation("CheckRegistryServer", []interface{}{arg1, arg2}) fake.checkRegistryServerMutex.Unlock() - if fake.CheckRegistryServerStub != nil { - return fake.CheckRegistryServerStub(arg1, arg2) + if stub != nil { + return stub(arg1, arg2) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.checkRegistryServerReturns return fakeReturns.result1, fakeReturns.result2 } @@ -111,15 +112,16 @@ func (fake *FakeRegistryReconciler) EnsureRegistryServer(arg1 *logrus.Entry, arg arg1 *logrus.Entry arg2 *v1alpha1.CatalogSource }{arg1, arg2}) + stub := fake.EnsureRegistryServerStub + fakeReturns := fake.ensureRegistryServerReturns fake.recordInvocation("EnsureRegistryServer", []interface{}{arg1, arg2}) fake.ensureRegistryServerMutex.Unlock() - if fake.EnsureRegistryServerStub != nil { - return fake.EnsureRegistryServerStub(arg1, arg2) + if stub != nil { + return stub(arg1, arg2) } if specificReturn { return ret.result1 } - fakeReturns := fake.ensureRegistryServerReturns return fakeReturns.result1 } diff --git a/pkg/fakes/fake_reconciler_factory.go b/pkg/fakes/fake_reconciler_factory.go index da14129642..2797300230 100644 --- a/pkg/fakes/fake_reconciler_factory.go +++ b/pkg/fakes/fake_reconciler_factory.go @@ -30,15 +30,16 @@ func (fake *FakeRegistryReconcilerFactory) ReconcilerForSource(arg1 *v1alpha1.Ca fake.reconcilerForSourceArgsForCall = append(fake.reconcilerForSourceArgsForCall, struct { arg1 *v1alpha1.CatalogSource }{arg1}) + stub := fake.ReconcilerForSourceStub + fakeReturns := fake.reconcilerForSourceReturns fake.recordInvocation("ReconcilerForSource", []interface{}{arg1}) fake.reconcilerForSourceMutex.Unlock() - if fake.ReconcilerForSourceStub != nil { - return fake.ReconcilerForSourceStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1 } - fakeReturns := fake.reconcilerForSourceReturns return fakeReturns.result1 } diff --git a/pkg/fakes/fake_registry_store.go b/pkg/fakes/fake_registry_store.go index 74f840ea7e..8cc33bf3ee 100644 --- a/pkg/fakes/fake_registry_store.go +++ b/pkg/fakes/fake_registry_store.go @@ -394,15 +394,16 @@ func (fake *FakeQuery) GetApisForEntry(arg1 context.Context, arg2 int64) ([]*api arg1 context.Context arg2 int64 }{arg1, arg2}) + stub := fake.GetApisForEntryStub + fakeReturns := fake.getApisForEntryReturns fake.recordInvocation("GetApisForEntry", []interface{}{arg1, arg2}) fake.getApisForEntryMutex.Unlock() - if fake.GetApisForEntryStub != nil { - return fake.GetApisForEntryStub(arg1, arg2) + if stub != nil { + return stub(arg1, arg2) } if specificReturn { return ret.result1, ret.result2, ret.result3 } - fakeReturns := fake.getApisForEntryReturns return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3 } @@ -463,15 +464,16 @@ func (fake *FakeQuery) GetBundle(arg1 context.Context, arg2 string, arg3 string, arg3 string arg4 string }{arg1, arg2, arg3, arg4}) + stub := fake.GetBundleStub + fakeReturns := fake.getBundleReturns fake.recordInvocation("GetBundle", []interface{}{arg1, arg2, arg3, arg4}) fake.getBundleMutex.Unlock() - if fake.GetBundleStub != nil { - return fake.GetBundleStub(arg1, arg2, arg3, arg4) + if stub != nil { + return stub(arg1, arg2, arg3, arg4) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getBundleReturns return fakeReturns.result1, fakeReturns.result2 } @@ -528,15 +530,16 @@ func (fake *FakeQuery) GetBundleForChannel(arg1 context.Context, arg2 string, ar arg2 string arg3 string }{arg1, arg2, arg3}) + stub := fake.GetBundleForChannelStub + fakeReturns := fake.getBundleForChannelReturns fake.recordInvocation("GetBundleForChannel", []interface{}{arg1, arg2, arg3}) fake.getBundleForChannelMutex.Unlock() - if fake.GetBundleForChannelStub != nil { - return fake.GetBundleForChannelStub(arg1, arg2, arg3) + if stub != nil { + return stub(arg1, arg2, arg3) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getBundleForChannelReturns return fakeReturns.result1, fakeReturns.result2 } @@ -592,15 +595,16 @@ func (fake *FakeQuery) GetBundlePathIfExists(arg1 context.Context, arg2 string) arg1 context.Context arg2 string }{arg1, arg2}) + stub := fake.GetBundlePathIfExistsStub + fakeReturns := fake.getBundlePathIfExistsReturns fake.recordInvocation("GetBundlePathIfExists", []interface{}{arg1, arg2}) fake.getBundlePathIfExistsMutex.Unlock() - if fake.GetBundlePathIfExistsStub != nil { - return fake.GetBundlePathIfExistsStub(arg1, arg2) + if stub != nil { + return stub(arg1, arg2) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getBundlePathIfExistsReturns return fakeReturns.result1, fakeReturns.result2 } @@ -656,15 +660,16 @@ func (fake *FakeQuery) GetBundlePathsForPackage(arg1 context.Context, arg2 strin arg1 context.Context arg2 string }{arg1, arg2}) + stub := fake.GetBundlePathsForPackageStub + fakeReturns := fake.getBundlePathsForPackageReturns fake.recordInvocation("GetBundlePathsForPackage", []interface{}{arg1, arg2}) fake.getBundlePathsForPackageMutex.Unlock() - if fake.GetBundlePathsForPackageStub != nil { - return fake.GetBundlePathsForPackageStub(arg1, arg2) + if stub != nil { + return stub(arg1, arg2) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getBundlePathsForPackageReturns return fakeReturns.result1, fakeReturns.result2 } @@ -722,15 +727,16 @@ func (fake *FakeQuery) GetBundleThatProvides(arg1 context.Context, arg2 string, arg3 string arg4 string }{arg1, arg2, arg3, arg4}) + stub := fake.GetBundleThatProvidesStub + fakeReturns := fake.getBundleThatProvidesReturns fake.recordInvocation("GetBundleThatProvides", []interface{}{arg1, arg2, arg3, arg4}) fake.getBundleThatProvidesMutex.Unlock() - if fake.GetBundleThatProvidesStub != nil { - return fake.GetBundleThatProvidesStub(arg1, arg2, arg3, arg4) + if stub != nil { + return stub(arg1, arg2, arg3, arg4) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getBundleThatProvidesReturns return fakeReturns.result1, fakeReturns.result2 } @@ -788,15 +794,16 @@ func (fake *FakeQuery) GetBundleThatReplaces(arg1 context.Context, arg2 string, arg3 string arg4 string }{arg1, arg2, arg3, arg4}) + stub := fake.GetBundleThatReplacesStub + fakeReturns := fake.getBundleThatReplacesReturns fake.recordInvocation("GetBundleThatReplaces", []interface{}{arg1, arg2, arg3, arg4}) fake.getBundleThatReplacesMutex.Unlock() - if fake.GetBundleThatReplacesStub != nil { - return fake.GetBundleThatReplacesStub(arg1, arg2, arg3, arg4) + if stub != nil { + return stub(arg1, arg2, arg3, arg4) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getBundleThatReplacesReturns return fakeReturns.result1, fakeReturns.result2 } @@ -852,15 +859,16 @@ func (fake *FakeQuery) GetBundleVersion(arg1 context.Context, arg2 string) (stri arg1 context.Context arg2 string }{arg1, arg2}) + stub := fake.GetBundleVersionStub + fakeReturns := fake.getBundleVersionReturns fake.recordInvocation("GetBundleVersion", []interface{}{arg1, arg2}) fake.getBundleVersionMutex.Unlock() - if fake.GetBundleVersionStub != nil { - return fake.GetBundleVersionStub(arg1, arg2) + if stub != nil { + return stub(arg1, arg2) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getBundleVersionReturns return fakeReturns.result1, fakeReturns.result2 } @@ -916,15 +924,16 @@ func (fake *FakeQuery) GetBundlesForPackage(arg1 context.Context, arg2 string) ( arg1 context.Context arg2 string }{arg1, arg2}) + stub := fake.GetBundlesForPackageStub + fakeReturns := fake.getBundlesForPackageReturns fake.recordInvocation("GetBundlesForPackage", []interface{}{arg1, arg2}) fake.getBundlesForPackageMutex.Unlock() - if fake.GetBundlesForPackageStub != nil { - return fake.GetBundlesForPackageStub(arg1, arg2) + if stub != nil { + return stub(arg1, arg2) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getBundlesForPackageReturns return fakeReturns.result1, fakeReturns.result2 } @@ -980,15 +989,16 @@ func (fake *FakeQuery) GetChannelEntriesFromPackage(arg1 context.Context, arg2 s arg1 context.Context arg2 string }{arg1, arg2}) + stub := fake.GetChannelEntriesFromPackageStub + fakeReturns := fake.getChannelEntriesFromPackageReturns fake.recordInvocation("GetChannelEntriesFromPackage", []interface{}{arg1, arg2}) fake.getChannelEntriesFromPackageMutex.Unlock() - if fake.GetChannelEntriesFromPackageStub != nil { - return fake.GetChannelEntriesFromPackageStub(arg1, arg2) + if stub != nil { + return stub(arg1, arg2) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getChannelEntriesFromPackageReturns return fakeReturns.result1, fakeReturns.result2 } @@ -1046,15 +1056,16 @@ func (fake *FakeQuery) GetChannelEntriesThatProvide(arg1 context.Context, arg2 s arg3 string arg4 string }{arg1, arg2, arg3, arg4}) + stub := fake.GetChannelEntriesThatProvideStub + fakeReturns := fake.getChannelEntriesThatProvideReturns fake.recordInvocation("GetChannelEntriesThatProvide", []interface{}{arg1, arg2, arg3, arg4}) fake.getChannelEntriesThatProvideMutex.Unlock() - if fake.GetChannelEntriesThatProvideStub != nil { - return fake.GetChannelEntriesThatProvideStub(arg1, arg2, arg3, arg4) + if stub != nil { + return stub(arg1, arg2, arg3, arg4) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getChannelEntriesThatProvideReturns return fakeReturns.result1, fakeReturns.result2 } @@ -1110,15 +1121,16 @@ func (fake *FakeQuery) GetChannelEntriesThatReplace(arg1 context.Context, arg2 s arg1 context.Context arg2 string }{arg1, arg2}) + stub := fake.GetChannelEntriesThatReplaceStub + fakeReturns := fake.getChannelEntriesThatReplaceReturns fake.recordInvocation("GetChannelEntriesThatReplace", []interface{}{arg1, arg2}) fake.getChannelEntriesThatReplaceMutex.Unlock() - if fake.GetChannelEntriesThatReplaceStub != nil { - return fake.GetChannelEntriesThatReplaceStub(arg1, arg2) + if stub != nil { + return stub(arg1, arg2) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getChannelEntriesThatReplaceReturns return fakeReturns.result1, fakeReturns.result2 } @@ -1175,15 +1187,16 @@ func (fake *FakeQuery) GetCurrentCSVNameForChannel(arg1 context.Context, arg2 st arg2 string arg3 string }{arg1, arg2, arg3}) + stub := fake.GetCurrentCSVNameForChannelStub + fakeReturns := fake.getCurrentCSVNameForChannelReturns fake.recordInvocation("GetCurrentCSVNameForChannel", []interface{}{arg1, arg2, arg3}) fake.getCurrentCSVNameForChannelMutex.Unlock() - if fake.GetCurrentCSVNameForChannelStub != nil { - return fake.GetCurrentCSVNameForChannelStub(arg1, arg2, arg3) + if stub != nil { + return stub(arg1, arg2, arg3) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getCurrentCSVNameForChannelReturns return fakeReturns.result1, fakeReturns.result2 } @@ -1239,15 +1252,16 @@ func (fake *FakeQuery) GetDefaultChannelForPackage(arg1 context.Context, arg2 st arg1 context.Context arg2 string }{arg1, arg2}) + stub := fake.GetDefaultChannelForPackageStub + fakeReturns := fake.getDefaultChannelForPackageReturns fake.recordInvocation("GetDefaultChannelForPackage", []interface{}{arg1, arg2}) fake.getDefaultChannelForPackageMutex.Unlock() - if fake.GetDefaultChannelForPackageStub != nil { - return fake.GetDefaultChannelForPackageStub(arg1, arg2) + if stub != nil { + return stub(arg1, arg2) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getDefaultChannelForPackageReturns return fakeReturns.result1, fakeReturns.result2 } @@ -1303,15 +1317,16 @@ func (fake *FakeQuery) GetDefaultPackage(arg1 context.Context, arg2 string) (str arg1 context.Context arg2 string }{arg1, arg2}) + stub := fake.GetDefaultPackageStub + fakeReturns := fake.getDefaultPackageReturns fake.recordInvocation("GetDefaultPackage", []interface{}{arg1, arg2}) fake.getDefaultPackageMutex.Unlock() - if fake.GetDefaultPackageStub != nil { - return fake.GetDefaultPackageStub(arg1, arg2) + if stub != nil { + return stub(arg1, arg2) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getDefaultPackageReturns return fakeReturns.result1, fakeReturns.result2 } @@ -1369,15 +1384,16 @@ func (fake *FakeQuery) GetDependenciesForBundle(arg1 context.Context, arg2 strin arg3 string arg4 string }{arg1, arg2, arg3, arg4}) + stub := fake.GetDependenciesForBundleStub + fakeReturns := fake.getDependenciesForBundleReturns fake.recordInvocation("GetDependenciesForBundle", []interface{}{arg1, arg2, arg3, arg4}) fake.getDependenciesForBundleMutex.Unlock() - if fake.GetDependenciesForBundleStub != nil { - return fake.GetDependenciesForBundleStub(arg1, arg2, arg3, arg4) + if stub != nil { + return stub(arg1, arg2, arg3, arg4) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getDependenciesForBundleReturns return fakeReturns.result1, fakeReturns.result2 } @@ -1433,15 +1449,16 @@ func (fake *FakeQuery) GetImagesForBundle(arg1 context.Context, arg2 string) ([] arg1 context.Context arg2 string }{arg1, arg2}) + stub := fake.GetImagesForBundleStub + fakeReturns := fake.getImagesForBundleReturns fake.recordInvocation("GetImagesForBundle", []interface{}{arg1, arg2}) fake.getImagesForBundleMutex.Unlock() - if fake.GetImagesForBundleStub != nil { - return fake.GetImagesForBundleStub(arg1, arg2) + if stub != nil { + return stub(arg1, arg2) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getImagesForBundleReturns return fakeReturns.result1, fakeReturns.result2 } @@ -1499,15 +1516,16 @@ func (fake *FakeQuery) GetLatestChannelEntriesThatProvide(arg1 context.Context, arg3 string arg4 string }{arg1, arg2, arg3, arg4}) + stub := fake.GetLatestChannelEntriesThatProvideStub + fakeReturns := fake.getLatestChannelEntriesThatProvideReturns fake.recordInvocation("GetLatestChannelEntriesThatProvide", []interface{}{arg1, arg2, arg3, arg4}) fake.getLatestChannelEntriesThatProvideMutex.Unlock() - if fake.GetLatestChannelEntriesThatProvideStub != nil { - return fake.GetLatestChannelEntriesThatProvideStub(arg1, arg2, arg3, arg4) + if stub != nil { + return stub(arg1, arg2, arg3, arg4) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getLatestChannelEntriesThatProvideReturns return fakeReturns.result1, fakeReturns.result2 } @@ -1563,15 +1581,16 @@ func (fake *FakeQuery) GetPackage(arg1 context.Context, arg2 string) (*registry. arg1 context.Context arg2 string }{arg1, arg2}) + stub := fake.GetPackageStub + fakeReturns := fake.getPackageReturns fake.recordInvocation("GetPackage", []interface{}{arg1, arg2}) fake.getPackageMutex.Unlock() - if fake.GetPackageStub != nil { - return fake.GetPackageStub(arg1, arg2) + if stub != nil { + return stub(arg1, arg2) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getPackageReturns return fakeReturns.result1, fakeReturns.result2 } @@ -1626,15 +1645,16 @@ func (fake *FakeQuery) ListBundles(arg1 context.Context) ([]*api.Bundle, error) fake.listBundlesArgsForCall = append(fake.listBundlesArgsForCall, struct { arg1 context.Context }{arg1}) + stub := fake.ListBundlesStub + fakeReturns := fake.listBundlesReturns fake.recordInvocation("ListBundles", []interface{}{arg1}) fake.listBundlesMutex.Unlock() - if fake.ListBundlesStub != nil { - return fake.ListBundlesStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.listBundlesReturns return fakeReturns.result1, fakeReturns.result2 } @@ -1690,15 +1710,16 @@ func (fake *FakeQuery) ListChannels(arg1 context.Context, arg2 string) ([]string arg1 context.Context arg2 string }{arg1, arg2}) + stub := fake.ListChannelsStub + fakeReturns := fake.listChannelsReturns fake.recordInvocation("ListChannels", []interface{}{arg1, arg2}) fake.listChannelsMutex.Unlock() - if fake.ListChannelsStub != nil { - return fake.ListChannelsStub(arg1, arg2) + if stub != nil { + return stub(arg1, arg2) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.listChannelsReturns return fakeReturns.result1, fakeReturns.result2 } @@ -1753,15 +1774,16 @@ func (fake *FakeQuery) ListImages(arg1 context.Context) ([]string, error) { fake.listImagesArgsForCall = append(fake.listImagesArgsForCall, struct { arg1 context.Context }{arg1}) + stub := fake.ListImagesStub + fakeReturns := fake.listImagesReturns fake.recordInvocation("ListImages", []interface{}{arg1}) fake.listImagesMutex.Unlock() - if fake.ListImagesStub != nil { - return fake.ListImagesStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.listImagesReturns return fakeReturns.result1, fakeReturns.result2 } @@ -1816,15 +1838,16 @@ func (fake *FakeQuery) ListPackages(arg1 context.Context) ([]string, error) { fake.listPackagesArgsForCall = append(fake.listPackagesArgsForCall, struct { arg1 context.Context }{arg1}) + stub := fake.ListPackagesStub + fakeReturns := fake.listPackagesReturns fake.recordInvocation("ListPackages", []interface{}{arg1}) fake.listPackagesMutex.Unlock() - if fake.ListPackagesStub != nil { - return fake.ListPackagesStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.listPackagesReturns return fakeReturns.result1, fakeReturns.result2 } @@ -1879,15 +1902,16 @@ func (fake *FakeQuery) ListRegistryBundles(arg1 context.Context) ([]*registry.Bu fake.listRegistryBundlesArgsForCall = append(fake.listRegistryBundlesArgsForCall, struct { arg1 context.Context }{arg1}) + stub := fake.ListRegistryBundlesStub + fakeReturns := fake.listRegistryBundlesReturns fake.recordInvocation("ListRegistryBundles", []interface{}{arg1}) fake.listRegistryBundlesMutex.Unlock() - if fake.ListRegistryBundlesStub != nil { - return fake.ListRegistryBundlesStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.listRegistryBundlesReturns return fakeReturns.result1, fakeReturns.result2 } @@ -1942,15 +1966,16 @@ func (fake *FakeQuery) ListTables(arg1 context.Context) ([]string, error) { fake.listTablesArgsForCall = append(fake.listTablesArgsForCall, struct { arg1 context.Context }{arg1}) + stub := fake.ListTablesStub + fakeReturns := fake.listTablesReturns fake.recordInvocation("ListTables", []interface{}{arg1}) fake.listTablesMutex.Unlock() - if fake.ListTablesStub != nil { - return fake.ListTablesStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.listTablesReturns return fakeReturns.result1, fakeReturns.result2 } @@ -2006,15 +2031,16 @@ func (fake *FakeQuery) SendBundles(arg1 context.Context, arg2 registry.BundleSen arg1 context.Context arg2 registry.BundleSender }{arg1, arg2}) + stub := fake.SendBundlesStub + fakeReturns := fake.sendBundlesReturns fake.recordInvocation("SendBundles", []interface{}{arg1, arg2}) fake.sendBundlesMutex.Unlock() - if fake.SendBundlesStub != nil { - return fake.SendBundlesStub(arg1, arg2) + if stub != nil { + return stub(arg1, arg2) } if specificReturn { return ret.result1 } - fakeReturns := fake.sendBundlesReturns return fakeReturns.result1 } diff --git a/pkg/fakes/fake_resolver.go b/pkg/fakes/fake_resolver.go index 3b85a209a1..6f766ece18 100644 --- a/pkg/fakes/fake_resolver.go +++ b/pkg/fakes/fake_resolver.go @@ -36,15 +36,16 @@ func (fake *FakeStepResolver) ResolveSteps(arg1 string) ([]*v1alpha1.Step, []v1a fake.resolveStepsArgsForCall = append(fake.resolveStepsArgsForCall, struct { arg1 string }{arg1}) + stub := fake.ResolveStepsStub + fakeReturns := fake.resolveStepsReturns fake.recordInvocation("ResolveSteps", []interface{}{arg1}) fake.resolveStepsMutex.Unlock() - if fake.ResolveStepsStub != nil { - return fake.ResolveStepsStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2, ret.result3, ret.result4 } - fakeReturns := fake.resolveStepsReturns return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3, fakeReturns.result4 } diff --git a/pkg/fakes/fake_strategy.go b/pkg/fakes/fake_strategy.go index e7653a5d0f..6930c046e4 100644 --- a/pkg/fakes/fake_strategy.go +++ b/pkg/fakes/fake_strategy.go @@ -27,15 +27,16 @@ func (fake *FakeStrategy) GetStrategyName() string { ret, specificReturn := fake.getStrategyNameReturnsOnCall[len(fake.getStrategyNameArgsForCall)] fake.getStrategyNameArgsForCall = append(fake.getStrategyNameArgsForCall, struct { }{}) + stub := fake.GetStrategyNameStub + fakeReturns := fake.getStrategyNameReturns fake.recordInvocation("GetStrategyName", []interface{}{}) fake.getStrategyNameMutex.Unlock() - if fake.GetStrategyNameStub != nil { - return fake.GetStrategyNameStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.getStrategyNameReturns return fakeReturns.result1 } diff --git a/pkg/fakes/fake_strategy_installer.go b/pkg/fakes/fake_strategy_installer.go index 7d6dcf2cec..a61b0c9c6e 100644 --- a/pkg/fakes/fake_strategy_installer.go +++ b/pkg/fakes/fake_strategy_installer.go @@ -62,15 +62,16 @@ func (fake *FakeStrategyInstaller) CertsRotateAt() time.Time { ret, specificReturn := fake.certsRotateAtReturnsOnCall[len(fake.certsRotateAtArgsForCall)] fake.certsRotateAtArgsForCall = append(fake.certsRotateAtArgsForCall, struct { }{}) + stub := fake.CertsRotateAtStub + fakeReturns := fake.certsRotateAtReturns fake.recordInvocation("CertsRotateAt", []interface{}{}) fake.certsRotateAtMutex.Unlock() - if fake.CertsRotateAtStub != nil { - return fake.CertsRotateAtStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.certsRotateAtReturns return fakeReturns.result1 } @@ -114,15 +115,16 @@ func (fake *FakeStrategyInstaller) CertsRotated() bool { ret, specificReturn := fake.certsRotatedReturnsOnCall[len(fake.certsRotatedArgsForCall)] fake.certsRotatedArgsForCall = append(fake.certsRotatedArgsForCall, struct { }{}) + stub := fake.CertsRotatedStub + fakeReturns := fake.certsRotatedReturns fake.recordInvocation("CertsRotated", []interface{}{}) fake.certsRotatedMutex.Unlock() - if fake.CertsRotatedStub != nil { - return fake.CertsRotatedStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.certsRotatedReturns return fakeReturns.result1 } @@ -167,15 +169,16 @@ func (fake *FakeStrategyInstaller) CheckInstalled(arg1 install.Strategy) (bool, fake.checkInstalledArgsForCall = append(fake.checkInstalledArgsForCall, struct { arg1 install.Strategy }{arg1}) + stub := fake.CheckInstalledStub + fakeReturns := fake.checkInstalledReturns fake.recordInvocation("CheckInstalled", []interface{}{arg1}) fake.checkInstalledMutex.Unlock() - if fake.CheckInstalledStub != nil { - return fake.CheckInstalledStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.checkInstalledReturns return fakeReturns.result1, fakeReturns.result2 } @@ -230,15 +233,16 @@ func (fake *FakeStrategyInstaller) Install(arg1 install.Strategy) error { fake.installArgsForCall = append(fake.installArgsForCall, struct { arg1 install.Strategy }{arg1}) + stub := fake.InstallStub + fakeReturns := fake.installReturns fake.recordInvocation("Install", []interface{}{arg1}) fake.installMutex.Unlock() - if fake.InstallStub != nil { - return fake.InstallStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1 } - fakeReturns := fake.installReturns return fakeReturns.result1 } diff --git a/pkg/fakes/fake_strategy_resolver.go b/pkg/fakes/fake_strategy_resolver.go index a60ba6a863..11254decc4 100644 --- a/pkg/fakes/fake_strategy_resolver.go +++ b/pkg/fakes/fake_strategy_resolver.go @@ -70,15 +70,16 @@ func (fake *FakeStrategyResolverInterface) InstallerForStrategy(arg1 string, arg arg7 []v1alpha1.WebhookDescription arg8 install.Strategy }{arg1, arg2, arg3, arg4, arg5, arg6Copy, arg7Copy, arg8}) + stub := fake.InstallerForStrategyStub + fakeReturns := fake.installerForStrategyReturns fake.recordInvocation("InstallerForStrategy", []interface{}{arg1, arg2, arg3, arg4, arg5, arg6Copy, arg7Copy, arg8}) fake.installerForStrategyMutex.Unlock() - if fake.InstallerForStrategyStub != nil { - return fake.InstallerForStrategyStub(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) + if stub != nil { + return stub(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) } if specificReturn { return ret.result1 } - fakeReturns := fake.installerForStrategyReturns return fakeReturns.result1 } @@ -130,15 +131,16 @@ func (fake *FakeStrategyResolverInterface) UnmarshalStrategy(arg1 v1alpha1.Named fake.unmarshalStrategyArgsForCall = append(fake.unmarshalStrategyArgsForCall, struct { arg1 v1alpha1.NamedInstallStrategy }{arg1}) + stub := fake.UnmarshalStrategyStub + fakeReturns := fake.unmarshalStrategyReturns fake.recordInvocation("UnmarshalStrategy", []interface{}{arg1}) fake.unmarshalStrategyMutex.Unlock() - if fake.UnmarshalStrategyStub != nil { - return fake.UnmarshalStrategyStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.unmarshalStrategyReturns return fakeReturns.result1, fakeReturns.result2 } diff --git a/pkg/lib/operatorlister/operatorlisterfakes/fake_apiextensions_v1lister.go b/pkg/lib/operatorlister/operatorlisterfakes/fake_apiextensions_v1lister.go index 31bdfcab3c..06f856a397 100644 --- a/pkg/lib/operatorlister/operatorlisterfakes/fake_apiextensions_v1lister.go +++ b/pkg/lib/operatorlister/operatorlisterfakes/fake_apiextensions_v1lister.go @@ -33,15 +33,16 @@ func (fake *FakeAPIExtensionsV1Lister) CustomResourceDefinitionLister() metadata ret, specificReturn := fake.customResourceDefinitionListerReturnsOnCall[len(fake.customResourceDefinitionListerArgsForCall)] fake.customResourceDefinitionListerArgsForCall = append(fake.customResourceDefinitionListerArgsForCall, struct { }{}) + stub := fake.CustomResourceDefinitionListerStub + fakeReturns := fake.customResourceDefinitionListerReturns fake.recordInvocation("CustomResourceDefinitionLister", []interface{}{}) fake.customResourceDefinitionListerMutex.Unlock() - if fake.CustomResourceDefinitionListerStub != nil { - return fake.CustomResourceDefinitionListerStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.customResourceDefinitionListerReturns return fakeReturns.result1 } @@ -85,9 +86,10 @@ func (fake *FakeAPIExtensionsV1Lister) RegisterCustomResourceDefinitionLister(ar fake.registerCustomResourceDefinitionListerArgsForCall = append(fake.registerCustomResourceDefinitionListerArgsForCall, struct { arg1 metadatalister.Lister }{arg1}) + stub := fake.RegisterCustomResourceDefinitionListerStub fake.recordInvocation("RegisterCustomResourceDefinitionLister", []interface{}{arg1}) fake.registerCustomResourceDefinitionListerMutex.Unlock() - if fake.RegisterCustomResourceDefinitionListerStub != nil { + if stub != nil { fake.RegisterCustomResourceDefinitionListerStub(arg1) } } diff --git a/pkg/lib/operatorlister/operatorlisterfakes/fake_apiregistration_v1lister.go b/pkg/lib/operatorlister/operatorlisterfakes/fake_apiregistration_v1lister.go index edd9834b6c..7300a4afaf 100644 --- a/pkg/lib/operatorlister/operatorlisterfakes/fake_apiregistration_v1lister.go +++ b/pkg/lib/operatorlister/operatorlisterfakes/fake_apiregistration_v1lister.go @@ -33,15 +33,16 @@ func (fake *FakeAPIRegistrationV1Lister) APIServiceLister() v1.APIServiceLister ret, specificReturn := fake.aPIServiceListerReturnsOnCall[len(fake.aPIServiceListerArgsForCall)] fake.aPIServiceListerArgsForCall = append(fake.aPIServiceListerArgsForCall, struct { }{}) + stub := fake.APIServiceListerStub + fakeReturns := fake.aPIServiceListerReturns fake.recordInvocation("APIServiceLister", []interface{}{}) fake.aPIServiceListerMutex.Unlock() - if fake.APIServiceListerStub != nil { - return fake.APIServiceListerStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.aPIServiceListerReturns return fakeReturns.result1 } @@ -85,9 +86,10 @@ func (fake *FakeAPIRegistrationV1Lister) RegisterAPIServiceLister(arg1 v1.APISer fake.registerAPIServiceListerArgsForCall = append(fake.registerAPIServiceListerArgsForCall, struct { arg1 v1.APIServiceLister }{arg1}) + stub := fake.RegisterAPIServiceListerStub fake.recordInvocation("RegisterAPIServiceLister", []interface{}{arg1}) fake.registerAPIServiceListerMutex.Unlock() - if fake.RegisterAPIServiceListerStub != nil { + if stub != nil { fake.RegisterAPIServiceListerStub(arg1) } } diff --git a/pkg/lib/operatorlister/operatorlisterfakes/fake_apps_v1lister.go b/pkg/lib/operatorlister/operatorlisterfakes/fake_apps_v1lister.go index b40fa7c147..be84f79f02 100644 --- a/pkg/lib/operatorlister/operatorlisterfakes/fake_apps_v1lister.go +++ b/pkg/lib/operatorlister/operatorlisterfakes/fake_apps_v1lister.go @@ -34,15 +34,16 @@ func (fake *FakeAppsV1Lister) DeploymentLister() v1.DeploymentLister { ret, specificReturn := fake.deploymentListerReturnsOnCall[len(fake.deploymentListerArgsForCall)] fake.deploymentListerArgsForCall = append(fake.deploymentListerArgsForCall, struct { }{}) + stub := fake.DeploymentListerStub + fakeReturns := fake.deploymentListerReturns fake.recordInvocation("DeploymentLister", []interface{}{}) fake.deploymentListerMutex.Unlock() - if fake.DeploymentListerStub != nil { - return fake.DeploymentListerStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.deploymentListerReturns return fakeReturns.result1 } @@ -87,9 +88,10 @@ func (fake *FakeAppsV1Lister) RegisterDeploymentLister(arg1 string, arg2 v1.Depl arg1 string arg2 v1.DeploymentLister }{arg1, arg2}) + stub := fake.RegisterDeploymentListerStub fake.recordInvocation("RegisterDeploymentLister", []interface{}{arg1, arg2}) fake.registerDeploymentListerMutex.Unlock() - if fake.RegisterDeploymentListerStub != nil { + if stub != nil { fake.RegisterDeploymentListerStub(arg1, arg2) } } diff --git a/pkg/lib/operatorlister/operatorlisterfakes/fake_clusterserviceversion_v1alpha1_lister.go b/pkg/lib/operatorlister/operatorlisterfakes/fake_clusterserviceversion_v1alpha1_lister.go index b53f8bf24f..e2c5235fc8 100644 --- a/pkg/lib/operatorlister/operatorlisterfakes/fake_clusterserviceversion_v1alpha1_lister.go +++ b/pkg/lib/operatorlister/operatorlisterfakes/fake_clusterserviceversion_v1alpha1_lister.go @@ -44,15 +44,16 @@ func (fake *FakeClusterServiceVersionLister) ClusterServiceVersions(arg1 string) fake.clusterServiceVersionsArgsForCall = append(fake.clusterServiceVersionsArgsForCall, struct { arg1 string }{arg1}) + stub := fake.ClusterServiceVersionsStub + fakeReturns := fake.clusterServiceVersionsReturns fake.recordInvocation("ClusterServiceVersions", []interface{}{arg1}) fake.clusterServiceVersionsMutex.Unlock() - if fake.ClusterServiceVersionsStub != nil { - return fake.ClusterServiceVersionsStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1 } - fakeReturns := fake.clusterServiceVersionsReturns return fakeReturns.result1 } @@ -104,15 +105,16 @@ func (fake *FakeClusterServiceVersionLister) List(arg1 labels.Selector) ([]*v1al fake.listArgsForCall = append(fake.listArgsForCall, struct { arg1 labels.Selector }{arg1}) + stub := fake.ListStub + fakeReturns := fake.listReturns fake.recordInvocation("List", []interface{}{arg1}) fake.listMutex.Unlock() - if fake.ListStub != nil { - return fake.ListStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.listReturns return fakeReturns.result1, fakeReturns.result2 } diff --git a/pkg/lib/operatorlister/operatorlisterfakes/fake_clusterserviceversion_v1alpha1_namespace_lister.go b/pkg/lib/operatorlister/operatorlisterfakes/fake_clusterserviceversion_v1alpha1_namespace_lister.go index 21ab65cc35..483f1b0dd0 100644 --- a/pkg/lib/operatorlister/operatorlisterfakes/fake_clusterserviceversion_v1alpha1_namespace_lister.go +++ b/pkg/lib/operatorlister/operatorlisterfakes/fake_clusterserviceversion_v1alpha1_namespace_lister.go @@ -46,15 +46,16 @@ func (fake *FakeClusterServiceVersionNamespaceLister) Get(arg1 string) (*v1alpha fake.getArgsForCall = append(fake.getArgsForCall, struct { arg1 string }{arg1}) + stub := fake.GetStub + fakeReturns := fake.getReturns fake.recordInvocation("Get", []interface{}{arg1}) fake.getMutex.Unlock() - if fake.GetStub != nil { - return fake.GetStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getReturns return fakeReturns.result1, fakeReturns.result2 } @@ -109,15 +110,16 @@ func (fake *FakeClusterServiceVersionNamespaceLister) List(arg1 labels.Selector) fake.listArgsForCall = append(fake.listArgsForCall, struct { arg1 labels.Selector }{arg1}) + stub := fake.ListStub + fakeReturns := fake.listReturns fake.recordInvocation("List", []interface{}{arg1}) fake.listMutex.Unlock() - if fake.ListStub != nil { - return fake.ListStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.listReturns return fakeReturns.result1, fakeReturns.result2 } diff --git a/pkg/lib/operatorlister/operatorlisterfakes/fake_core_v1lister.go b/pkg/lib/operatorlister/operatorlisterfakes/fake_core_v1lister.go index f4ecad035c..48ee59f232 100644 --- a/pkg/lib/operatorlister/operatorlisterfakes/fake_core_v1lister.go +++ b/pkg/lib/operatorlister/operatorlisterfakes/fake_core_v1lister.go @@ -113,15 +113,16 @@ func (fake *FakeCoreV1Lister) ConfigMapLister() v1.ConfigMapLister { ret, specificReturn := fake.configMapListerReturnsOnCall[len(fake.configMapListerArgsForCall)] fake.configMapListerArgsForCall = append(fake.configMapListerArgsForCall, struct { }{}) + stub := fake.ConfigMapListerStub + fakeReturns := fake.configMapListerReturns fake.recordInvocation("ConfigMapLister", []interface{}{}) fake.configMapListerMutex.Unlock() - if fake.ConfigMapListerStub != nil { - return fake.ConfigMapListerStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.configMapListerReturns return fakeReturns.result1 } @@ -165,15 +166,16 @@ func (fake *FakeCoreV1Lister) NamespaceLister() v1.NamespaceLister { ret, specificReturn := fake.namespaceListerReturnsOnCall[len(fake.namespaceListerArgsForCall)] fake.namespaceListerArgsForCall = append(fake.namespaceListerArgsForCall, struct { }{}) + stub := fake.NamespaceListerStub + fakeReturns := fake.namespaceListerReturns fake.recordInvocation("NamespaceLister", []interface{}{}) fake.namespaceListerMutex.Unlock() - if fake.NamespaceListerStub != nil { - return fake.NamespaceListerStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.namespaceListerReturns return fakeReturns.result1 } @@ -217,15 +219,16 @@ func (fake *FakeCoreV1Lister) PodLister() v1.PodLister { ret, specificReturn := fake.podListerReturnsOnCall[len(fake.podListerArgsForCall)] fake.podListerArgsForCall = append(fake.podListerArgsForCall, struct { }{}) + stub := fake.PodListerStub + fakeReturns := fake.podListerReturns fake.recordInvocation("PodLister", []interface{}{}) fake.podListerMutex.Unlock() - if fake.PodListerStub != nil { - return fake.PodListerStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.podListerReturns return fakeReturns.result1 } @@ -270,9 +273,10 @@ func (fake *FakeCoreV1Lister) RegisterConfigMapLister(arg1 string, arg2 v1.Confi arg1 string arg2 v1.ConfigMapLister }{arg1, arg2}) + stub := fake.RegisterConfigMapListerStub fake.recordInvocation("RegisterConfigMapLister", []interface{}{arg1, arg2}) fake.registerConfigMapListerMutex.Unlock() - if fake.RegisterConfigMapListerStub != nil { + if stub != nil { fake.RegisterConfigMapListerStub(arg1, arg2) } } @@ -301,9 +305,10 @@ func (fake *FakeCoreV1Lister) RegisterNamespaceLister(arg1 v1.NamespaceLister) { fake.registerNamespaceListerArgsForCall = append(fake.registerNamespaceListerArgsForCall, struct { arg1 v1.NamespaceLister }{arg1}) + stub := fake.RegisterNamespaceListerStub fake.recordInvocation("RegisterNamespaceLister", []interface{}{arg1}) fake.registerNamespaceListerMutex.Unlock() - if fake.RegisterNamespaceListerStub != nil { + if stub != nil { fake.RegisterNamespaceListerStub(arg1) } } @@ -333,9 +338,10 @@ func (fake *FakeCoreV1Lister) RegisterPodLister(arg1 string, arg2 v1.PodLister) arg1 string arg2 v1.PodLister }{arg1, arg2}) + stub := fake.RegisterPodListerStub fake.recordInvocation("RegisterPodLister", []interface{}{arg1, arg2}) fake.registerPodListerMutex.Unlock() - if fake.RegisterPodListerStub != nil { + if stub != nil { fake.RegisterPodListerStub(arg1, arg2) } } @@ -365,9 +371,10 @@ func (fake *FakeCoreV1Lister) RegisterSecretLister(arg1 string, arg2 v1.SecretLi arg1 string arg2 v1.SecretLister }{arg1, arg2}) + stub := fake.RegisterSecretListerStub fake.recordInvocation("RegisterSecretLister", []interface{}{arg1, arg2}) fake.registerSecretListerMutex.Unlock() - if fake.RegisterSecretListerStub != nil { + if stub != nil { fake.RegisterSecretListerStub(arg1, arg2) } } @@ -397,9 +404,10 @@ func (fake *FakeCoreV1Lister) RegisterServiceAccountLister(arg1 string, arg2 v1. arg1 string arg2 v1.ServiceAccountLister }{arg1, arg2}) + stub := fake.RegisterServiceAccountListerStub fake.recordInvocation("RegisterServiceAccountLister", []interface{}{arg1, arg2}) fake.registerServiceAccountListerMutex.Unlock() - if fake.RegisterServiceAccountListerStub != nil { + if stub != nil { fake.RegisterServiceAccountListerStub(arg1, arg2) } } @@ -429,9 +437,10 @@ func (fake *FakeCoreV1Lister) RegisterServiceLister(arg1 string, arg2 v1.Service arg1 string arg2 v1.ServiceLister }{arg1, arg2}) + stub := fake.RegisterServiceListerStub fake.recordInvocation("RegisterServiceLister", []interface{}{arg1, arg2}) fake.registerServiceListerMutex.Unlock() - if fake.RegisterServiceListerStub != nil { + if stub != nil { fake.RegisterServiceListerStub(arg1, arg2) } } @@ -460,15 +469,16 @@ func (fake *FakeCoreV1Lister) SecretLister() v1.SecretLister { ret, specificReturn := fake.secretListerReturnsOnCall[len(fake.secretListerArgsForCall)] fake.secretListerArgsForCall = append(fake.secretListerArgsForCall, struct { }{}) + stub := fake.SecretListerStub + fakeReturns := fake.secretListerReturns fake.recordInvocation("SecretLister", []interface{}{}) fake.secretListerMutex.Unlock() - if fake.SecretListerStub != nil { - return fake.SecretListerStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.secretListerReturns return fakeReturns.result1 } @@ -512,15 +522,16 @@ func (fake *FakeCoreV1Lister) ServiceAccountLister() v1.ServiceAccountLister { ret, specificReturn := fake.serviceAccountListerReturnsOnCall[len(fake.serviceAccountListerArgsForCall)] fake.serviceAccountListerArgsForCall = append(fake.serviceAccountListerArgsForCall, struct { }{}) + stub := fake.ServiceAccountListerStub + fakeReturns := fake.serviceAccountListerReturns fake.recordInvocation("ServiceAccountLister", []interface{}{}) fake.serviceAccountListerMutex.Unlock() - if fake.ServiceAccountListerStub != nil { - return fake.ServiceAccountListerStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.serviceAccountListerReturns return fakeReturns.result1 } @@ -564,15 +575,16 @@ func (fake *FakeCoreV1Lister) ServiceLister() v1.ServiceLister { ret, specificReturn := fake.serviceListerReturnsOnCall[len(fake.serviceListerArgsForCall)] fake.serviceListerArgsForCall = append(fake.serviceListerArgsForCall, struct { }{}) + stub := fake.ServiceListerStub + fakeReturns := fake.serviceListerReturns fake.recordInvocation("ServiceLister", []interface{}{}) fake.serviceListerMutex.Unlock() - if fake.ServiceListerStub != nil { - return fake.ServiceListerStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.serviceListerReturns return fakeReturns.result1 } diff --git a/pkg/lib/operatorlister/operatorlisterfakes/fake_operator_lister.go b/pkg/lib/operatorlister/operatorlisterfakes/fake_operator_lister.go index 0b1273fa4d..e786088167 100644 --- a/pkg/lib/operatorlister/operatorlisterfakes/fake_operator_lister.go +++ b/pkg/lib/operatorlister/operatorlisterfakes/fake_operator_lister.go @@ -97,15 +97,16 @@ func (fake *FakeOperatorLister) APIExtensionsV1() operatorlister.APIExtensionsV1 ret, specificReturn := fake.aPIExtensionsV1ReturnsOnCall[len(fake.aPIExtensionsV1ArgsForCall)] fake.aPIExtensionsV1ArgsForCall = append(fake.aPIExtensionsV1ArgsForCall, struct { }{}) + stub := fake.APIExtensionsV1Stub + fakeReturns := fake.aPIExtensionsV1Returns fake.recordInvocation("APIExtensionsV1", []interface{}{}) fake.aPIExtensionsV1Mutex.Unlock() - if fake.APIExtensionsV1Stub != nil { - return fake.APIExtensionsV1Stub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.aPIExtensionsV1Returns return fakeReturns.result1 } @@ -149,15 +150,16 @@ func (fake *FakeOperatorLister) APIRegistrationV1() operatorlister.APIRegistrati ret, specificReturn := fake.aPIRegistrationV1ReturnsOnCall[len(fake.aPIRegistrationV1ArgsForCall)] fake.aPIRegistrationV1ArgsForCall = append(fake.aPIRegistrationV1ArgsForCall, struct { }{}) + stub := fake.APIRegistrationV1Stub + fakeReturns := fake.aPIRegistrationV1Returns fake.recordInvocation("APIRegistrationV1", []interface{}{}) fake.aPIRegistrationV1Mutex.Unlock() - if fake.APIRegistrationV1Stub != nil { - return fake.APIRegistrationV1Stub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.aPIRegistrationV1Returns return fakeReturns.result1 } @@ -201,15 +203,16 @@ func (fake *FakeOperatorLister) AppsV1() operatorlister.AppsV1Lister { ret, specificReturn := fake.appsV1ReturnsOnCall[len(fake.appsV1ArgsForCall)] fake.appsV1ArgsForCall = append(fake.appsV1ArgsForCall, struct { }{}) + stub := fake.AppsV1Stub + fakeReturns := fake.appsV1Returns fake.recordInvocation("AppsV1", []interface{}{}) fake.appsV1Mutex.Unlock() - if fake.AppsV1Stub != nil { - return fake.AppsV1Stub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.appsV1Returns return fakeReturns.result1 } @@ -253,15 +256,16 @@ func (fake *FakeOperatorLister) CoreV1() operatorlister.CoreV1Lister { ret, specificReturn := fake.coreV1ReturnsOnCall[len(fake.coreV1ArgsForCall)] fake.coreV1ArgsForCall = append(fake.coreV1ArgsForCall, struct { }{}) + stub := fake.CoreV1Stub + fakeReturns := fake.coreV1Returns fake.recordInvocation("CoreV1", []interface{}{}) fake.coreV1Mutex.Unlock() - if fake.CoreV1Stub != nil { - return fake.CoreV1Stub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.coreV1Returns return fakeReturns.result1 } @@ -305,15 +309,16 @@ func (fake *FakeOperatorLister) OperatorsV1() operatorlister.OperatorsV1Lister { ret, specificReturn := fake.operatorsV1ReturnsOnCall[len(fake.operatorsV1ArgsForCall)] fake.operatorsV1ArgsForCall = append(fake.operatorsV1ArgsForCall, struct { }{}) + stub := fake.OperatorsV1Stub + fakeReturns := fake.operatorsV1Returns fake.recordInvocation("OperatorsV1", []interface{}{}) fake.operatorsV1Mutex.Unlock() - if fake.OperatorsV1Stub != nil { - return fake.OperatorsV1Stub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.operatorsV1Returns return fakeReturns.result1 } @@ -357,15 +362,16 @@ func (fake *FakeOperatorLister) OperatorsV1alpha1() operatorlister.OperatorsV1al ret, specificReturn := fake.operatorsV1alpha1ReturnsOnCall[len(fake.operatorsV1alpha1ArgsForCall)] fake.operatorsV1alpha1ArgsForCall = append(fake.operatorsV1alpha1ArgsForCall, struct { }{}) + stub := fake.OperatorsV1alpha1Stub + fakeReturns := fake.operatorsV1alpha1Returns fake.recordInvocation("OperatorsV1alpha1", []interface{}{}) fake.operatorsV1alpha1Mutex.Unlock() - if fake.OperatorsV1alpha1Stub != nil { - return fake.OperatorsV1alpha1Stub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.operatorsV1alpha1Returns return fakeReturns.result1 } @@ -409,15 +415,16 @@ func (fake *FakeOperatorLister) OperatorsV2() operatorlister.OperatorsV2Lister { ret, specificReturn := fake.operatorsV2ReturnsOnCall[len(fake.operatorsV2ArgsForCall)] fake.operatorsV2ArgsForCall = append(fake.operatorsV2ArgsForCall, struct { }{}) + stub := fake.OperatorsV2Stub + fakeReturns := fake.operatorsV2Returns fake.recordInvocation("OperatorsV2", []interface{}{}) fake.operatorsV2Mutex.Unlock() - if fake.OperatorsV2Stub != nil { - return fake.OperatorsV2Stub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.operatorsV2Returns return fakeReturns.result1 } @@ -461,15 +468,16 @@ func (fake *FakeOperatorLister) RbacV1() operatorlister.RbacV1Lister { ret, specificReturn := fake.rbacV1ReturnsOnCall[len(fake.rbacV1ArgsForCall)] fake.rbacV1ArgsForCall = append(fake.rbacV1ArgsForCall, struct { }{}) + stub := fake.RbacV1Stub + fakeReturns := fake.rbacV1Returns fake.recordInvocation("RbacV1", []interface{}{}) fake.rbacV1Mutex.Unlock() - if fake.RbacV1Stub != nil { - return fake.RbacV1Stub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.rbacV1Returns return fakeReturns.result1 } diff --git a/pkg/lib/operatorlister/operatorlisterfakes/fake_operators_v1alpha1lister.go b/pkg/lib/operatorlister/operatorlisterfakes/fake_operators_v1alpha1lister.go index 4885d924b2..a3a4256c37 100644 --- a/pkg/lib/operatorlister/operatorlisterfakes/fake_operators_v1alpha1lister.go +++ b/pkg/lib/operatorlister/operatorlisterfakes/fake_operators_v1alpha1lister.go @@ -82,15 +82,16 @@ func (fake *FakeOperatorsV1alpha1Lister) CatalogSourceLister() v1alpha1.CatalogS ret, specificReturn := fake.catalogSourceListerReturnsOnCall[len(fake.catalogSourceListerArgsForCall)] fake.catalogSourceListerArgsForCall = append(fake.catalogSourceListerArgsForCall, struct { }{}) + stub := fake.CatalogSourceListerStub + fakeReturns := fake.catalogSourceListerReturns fake.recordInvocation("CatalogSourceLister", []interface{}{}) fake.catalogSourceListerMutex.Unlock() - if fake.CatalogSourceListerStub != nil { - return fake.CatalogSourceListerStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.catalogSourceListerReturns return fakeReturns.result1 } @@ -134,15 +135,16 @@ func (fake *FakeOperatorsV1alpha1Lister) ClusterServiceVersionLister() v1alpha1. ret, specificReturn := fake.clusterServiceVersionListerReturnsOnCall[len(fake.clusterServiceVersionListerArgsForCall)] fake.clusterServiceVersionListerArgsForCall = append(fake.clusterServiceVersionListerArgsForCall, struct { }{}) + stub := fake.ClusterServiceVersionListerStub + fakeReturns := fake.clusterServiceVersionListerReturns fake.recordInvocation("ClusterServiceVersionLister", []interface{}{}) fake.clusterServiceVersionListerMutex.Unlock() - if fake.ClusterServiceVersionListerStub != nil { - return fake.ClusterServiceVersionListerStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.clusterServiceVersionListerReturns return fakeReturns.result1 } @@ -186,15 +188,16 @@ func (fake *FakeOperatorsV1alpha1Lister) InstallPlanLister() v1alpha1.InstallPla ret, specificReturn := fake.installPlanListerReturnsOnCall[len(fake.installPlanListerArgsForCall)] fake.installPlanListerArgsForCall = append(fake.installPlanListerArgsForCall, struct { }{}) + stub := fake.InstallPlanListerStub + fakeReturns := fake.installPlanListerReturns fake.recordInvocation("InstallPlanLister", []interface{}{}) fake.installPlanListerMutex.Unlock() - if fake.InstallPlanListerStub != nil { - return fake.InstallPlanListerStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.installPlanListerReturns return fakeReturns.result1 } @@ -239,9 +242,10 @@ func (fake *FakeOperatorsV1alpha1Lister) RegisterCatalogSourceLister(arg1 string arg1 string arg2 v1alpha1.CatalogSourceLister }{arg1, arg2}) + stub := fake.RegisterCatalogSourceListerStub fake.recordInvocation("RegisterCatalogSourceLister", []interface{}{arg1, arg2}) fake.registerCatalogSourceListerMutex.Unlock() - if fake.RegisterCatalogSourceListerStub != nil { + if stub != nil { fake.RegisterCatalogSourceListerStub(arg1, arg2) } } @@ -271,9 +275,10 @@ func (fake *FakeOperatorsV1alpha1Lister) RegisterClusterServiceVersionLister(arg arg1 string arg2 v1alpha1.ClusterServiceVersionLister }{arg1, arg2}) + stub := fake.RegisterClusterServiceVersionListerStub fake.recordInvocation("RegisterClusterServiceVersionLister", []interface{}{arg1, arg2}) fake.registerClusterServiceVersionListerMutex.Unlock() - if fake.RegisterClusterServiceVersionListerStub != nil { + if stub != nil { fake.RegisterClusterServiceVersionListerStub(arg1, arg2) } } @@ -303,9 +308,10 @@ func (fake *FakeOperatorsV1alpha1Lister) RegisterInstallPlanLister(arg1 string, arg1 string arg2 v1alpha1.InstallPlanLister }{arg1, arg2}) + stub := fake.RegisterInstallPlanListerStub fake.recordInvocation("RegisterInstallPlanLister", []interface{}{arg1, arg2}) fake.registerInstallPlanListerMutex.Unlock() - if fake.RegisterInstallPlanListerStub != nil { + if stub != nil { fake.RegisterInstallPlanListerStub(arg1, arg2) } } @@ -335,9 +341,10 @@ func (fake *FakeOperatorsV1alpha1Lister) RegisterSubscriptionLister(arg1 string, arg1 string arg2 v1alpha1.SubscriptionLister }{arg1, arg2}) + stub := fake.RegisterSubscriptionListerStub fake.recordInvocation("RegisterSubscriptionLister", []interface{}{arg1, arg2}) fake.registerSubscriptionListerMutex.Unlock() - if fake.RegisterSubscriptionListerStub != nil { + if stub != nil { fake.RegisterSubscriptionListerStub(arg1, arg2) } } @@ -366,15 +373,16 @@ func (fake *FakeOperatorsV1alpha1Lister) SubscriptionLister() v1alpha1.Subscript ret, specificReturn := fake.subscriptionListerReturnsOnCall[len(fake.subscriptionListerArgsForCall)] fake.subscriptionListerArgsForCall = append(fake.subscriptionListerArgsForCall, struct { }{}) + stub := fake.SubscriptionListerStub + fakeReturns := fake.subscriptionListerReturns fake.recordInvocation("SubscriptionLister", []interface{}{}) fake.subscriptionListerMutex.Unlock() - if fake.SubscriptionListerStub != nil { - return fake.SubscriptionListerStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.subscriptionListerReturns return fakeReturns.result1 } diff --git a/pkg/lib/operatorlister/operatorlisterfakes/fake_operators_v1lister.go b/pkg/lib/operatorlister/operatorlisterfakes/fake_operators_v1lister.go index e6e6c91e96..5ca20c7d14 100644 --- a/pkg/lib/operatorlister/operatorlisterfakes/fake_operators_v1lister.go +++ b/pkg/lib/operatorlister/operatorlisterfakes/fake_operators_v1lister.go @@ -34,15 +34,16 @@ func (fake *FakeOperatorsV1Lister) OperatorGroupLister() v1.OperatorGroupLister ret, specificReturn := fake.operatorGroupListerReturnsOnCall[len(fake.operatorGroupListerArgsForCall)] fake.operatorGroupListerArgsForCall = append(fake.operatorGroupListerArgsForCall, struct { }{}) + stub := fake.OperatorGroupListerStub + fakeReturns := fake.operatorGroupListerReturns fake.recordInvocation("OperatorGroupLister", []interface{}{}) fake.operatorGroupListerMutex.Unlock() - if fake.OperatorGroupListerStub != nil { - return fake.OperatorGroupListerStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.operatorGroupListerReturns return fakeReturns.result1 } @@ -87,9 +88,10 @@ func (fake *FakeOperatorsV1Lister) RegisterOperatorGroupLister(arg1 string, arg2 arg1 string arg2 v1.OperatorGroupLister }{arg1, arg2}) + stub := fake.RegisterOperatorGroupListerStub fake.recordInvocation("RegisterOperatorGroupLister", []interface{}{arg1, arg2}) fake.registerOperatorGroupListerMutex.Unlock() - if fake.RegisterOperatorGroupListerStub != nil { + if stub != nil { fake.RegisterOperatorGroupListerStub(arg1, arg2) } } diff --git a/pkg/lib/operatorlister/operatorlisterfakes/fake_operators_v2lister.go b/pkg/lib/operatorlister/operatorlisterfakes/fake_operators_v2lister.go index b2032df369..2239e3dff1 100644 --- a/pkg/lib/operatorlister/operatorlisterfakes/fake_operators_v2lister.go +++ b/pkg/lib/operatorlister/operatorlisterfakes/fake_operators_v2lister.go @@ -34,15 +34,16 @@ func (fake *FakeOperatorsV2Lister) OperatorConditionLister() v2.OperatorConditio ret, specificReturn := fake.operatorConditionListerReturnsOnCall[len(fake.operatorConditionListerArgsForCall)] fake.operatorConditionListerArgsForCall = append(fake.operatorConditionListerArgsForCall, struct { }{}) + stub := fake.OperatorConditionListerStub + fakeReturns := fake.operatorConditionListerReturns fake.recordInvocation("OperatorConditionLister", []interface{}{}) fake.operatorConditionListerMutex.Unlock() - if fake.OperatorConditionListerStub != nil { - return fake.OperatorConditionListerStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.operatorConditionListerReturns return fakeReturns.result1 } @@ -87,9 +88,10 @@ func (fake *FakeOperatorsV2Lister) RegisterOperatorConditionLister(arg1 string, arg1 string arg2 v2.OperatorConditionLister }{arg1, arg2}) + stub := fake.RegisterOperatorConditionListerStub fake.recordInvocation("RegisterOperatorConditionLister", []interface{}{arg1, arg2}) fake.registerOperatorConditionListerMutex.Unlock() - if fake.RegisterOperatorConditionListerStub != nil { + if stub != nil { fake.RegisterOperatorConditionListerStub(arg1, arg2) } } diff --git a/pkg/lib/operatorlister/operatorlisterfakes/fake_rbac_v1lister.go b/pkg/lib/operatorlister/operatorlisterfakes/fake_rbac_v1lister.go index 051aa64737..e8f1b1abff 100644 --- a/pkg/lib/operatorlister/operatorlisterfakes/fake_rbac_v1lister.go +++ b/pkg/lib/operatorlister/operatorlisterfakes/fake_rbac_v1lister.go @@ -80,15 +80,16 @@ func (fake *FakeRbacV1Lister) ClusterRoleBindingLister() v1.ClusterRoleBindingLi ret, specificReturn := fake.clusterRoleBindingListerReturnsOnCall[len(fake.clusterRoleBindingListerArgsForCall)] fake.clusterRoleBindingListerArgsForCall = append(fake.clusterRoleBindingListerArgsForCall, struct { }{}) + stub := fake.ClusterRoleBindingListerStub + fakeReturns := fake.clusterRoleBindingListerReturns fake.recordInvocation("ClusterRoleBindingLister", []interface{}{}) fake.clusterRoleBindingListerMutex.Unlock() - if fake.ClusterRoleBindingListerStub != nil { - return fake.ClusterRoleBindingListerStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.clusterRoleBindingListerReturns return fakeReturns.result1 } @@ -132,15 +133,16 @@ func (fake *FakeRbacV1Lister) ClusterRoleLister() v1.ClusterRoleLister { ret, specificReturn := fake.clusterRoleListerReturnsOnCall[len(fake.clusterRoleListerArgsForCall)] fake.clusterRoleListerArgsForCall = append(fake.clusterRoleListerArgsForCall, struct { }{}) + stub := fake.ClusterRoleListerStub + fakeReturns := fake.clusterRoleListerReturns fake.recordInvocation("ClusterRoleLister", []interface{}{}) fake.clusterRoleListerMutex.Unlock() - if fake.ClusterRoleListerStub != nil { - return fake.ClusterRoleListerStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.clusterRoleListerReturns return fakeReturns.result1 } @@ -184,9 +186,10 @@ func (fake *FakeRbacV1Lister) RegisterClusterRoleBindingLister(arg1 v1.ClusterRo fake.registerClusterRoleBindingListerArgsForCall = append(fake.registerClusterRoleBindingListerArgsForCall, struct { arg1 v1.ClusterRoleBindingLister }{arg1}) + stub := fake.RegisterClusterRoleBindingListerStub fake.recordInvocation("RegisterClusterRoleBindingLister", []interface{}{arg1}) fake.registerClusterRoleBindingListerMutex.Unlock() - if fake.RegisterClusterRoleBindingListerStub != nil { + if stub != nil { fake.RegisterClusterRoleBindingListerStub(arg1) } } @@ -215,9 +218,10 @@ func (fake *FakeRbacV1Lister) RegisterClusterRoleLister(arg1 v1.ClusterRoleListe fake.registerClusterRoleListerArgsForCall = append(fake.registerClusterRoleListerArgsForCall, struct { arg1 v1.ClusterRoleLister }{arg1}) + stub := fake.RegisterClusterRoleListerStub fake.recordInvocation("RegisterClusterRoleLister", []interface{}{arg1}) fake.registerClusterRoleListerMutex.Unlock() - if fake.RegisterClusterRoleListerStub != nil { + if stub != nil { fake.RegisterClusterRoleListerStub(arg1) } } @@ -247,9 +251,10 @@ func (fake *FakeRbacV1Lister) RegisterRoleBindingLister(arg1 string, arg2 v1.Rol arg1 string arg2 v1.RoleBindingLister }{arg1, arg2}) + stub := fake.RegisterRoleBindingListerStub fake.recordInvocation("RegisterRoleBindingLister", []interface{}{arg1, arg2}) fake.registerRoleBindingListerMutex.Unlock() - if fake.RegisterRoleBindingListerStub != nil { + if stub != nil { fake.RegisterRoleBindingListerStub(arg1, arg2) } } @@ -279,9 +284,10 @@ func (fake *FakeRbacV1Lister) RegisterRoleLister(arg1 string, arg2 v1.RoleLister arg1 string arg2 v1.RoleLister }{arg1, arg2}) + stub := fake.RegisterRoleListerStub fake.recordInvocation("RegisterRoleLister", []interface{}{arg1, arg2}) fake.registerRoleListerMutex.Unlock() - if fake.RegisterRoleListerStub != nil { + if stub != nil { fake.RegisterRoleListerStub(arg1, arg2) } } @@ -310,15 +316,16 @@ func (fake *FakeRbacV1Lister) RoleBindingLister() v1.RoleBindingLister { ret, specificReturn := fake.roleBindingListerReturnsOnCall[len(fake.roleBindingListerArgsForCall)] fake.roleBindingListerArgsForCall = append(fake.roleBindingListerArgsForCall, struct { }{}) + stub := fake.RoleBindingListerStub + fakeReturns := fake.roleBindingListerReturns fake.recordInvocation("RoleBindingLister", []interface{}{}) fake.roleBindingListerMutex.Unlock() - if fake.RoleBindingListerStub != nil { - return fake.RoleBindingListerStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.roleBindingListerReturns return fakeReturns.result1 } @@ -362,15 +369,16 @@ func (fake *FakeRbacV1Lister) RoleLister() v1.RoleLister { ret, specificReturn := fake.roleListerReturnsOnCall[len(fake.roleListerArgsForCall)] fake.roleListerArgsForCall = append(fake.roleListerArgsForCall, struct { }{}) + stub := fake.RoleListerStub + fakeReturns := fake.roleListerReturns fake.recordInvocation("RoleLister", []interface{}{}) fake.roleListerMutex.Unlock() - if fake.RoleListerStub != nil { - return fake.RoleListerStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.roleListerReturns return fakeReturns.result1 } diff --git a/pkg/package-server/client/fakes/fake_list_bundles_client.go b/pkg/package-server/client/fakes/fake_list_bundles_client.go index d434884ce0..e98a2c9525 100644 --- a/pkg/package-server/client/fakes/fake_list_bundles_client.go +++ b/pkg/package-server/client/fakes/fake_list_bundles_client.go @@ -95,15 +95,16 @@ func (fake *FakeRegistry_ListBundlesClient) CloseSend() error { ret, specificReturn := fake.closeSendReturnsOnCall[len(fake.closeSendArgsForCall)] fake.closeSendArgsForCall = append(fake.closeSendArgsForCall, struct { }{}) + stub := fake.CloseSendStub + fakeReturns := fake.closeSendReturns fake.recordInvocation("CloseSend", []interface{}{}) fake.closeSendMutex.Unlock() - if fake.CloseSendStub != nil { - return fake.CloseSendStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.closeSendReturns return fakeReturns.result1 } @@ -147,15 +148,16 @@ func (fake *FakeRegistry_ListBundlesClient) Context() context.Context { ret, specificReturn := fake.contextReturnsOnCall[len(fake.contextArgsForCall)] fake.contextArgsForCall = append(fake.contextArgsForCall, struct { }{}) + stub := fake.ContextStub + fakeReturns := fake.contextReturns fake.recordInvocation("Context", []interface{}{}) fake.contextMutex.Unlock() - if fake.ContextStub != nil { - return fake.ContextStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.contextReturns return fakeReturns.result1 } @@ -199,15 +201,16 @@ func (fake *FakeRegistry_ListBundlesClient) Header() (metadata.MD, error) { ret, specificReturn := fake.headerReturnsOnCall[len(fake.headerArgsForCall)] fake.headerArgsForCall = append(fake.headerArgsForCall, struct { }{}) + stub := fake.HeaderStub + fakeReturns := fake.headerReturns fake.recordInvocation("Header", []interface{}{}) fake.headerMutex.Unlock() - if fake.HeaderStub != nil { - return fake.HeaderStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.headerReturns return fakeReturns.result1, fakeReturns.result2 } @@ -254,15 +257,16 @@ func (fake *FakeRegistry_ListBundlesClient) Recv() (*api.Bundle, error) { ret, specificReturn := fake.recvReturnsOnCall[len(fake.recvArgsForCall)] fake.recvArgsForCall = append(fake.recvArgsForCall, struct { }{}) + stub := fake.RecvStub + fakeReturns := fake.recvReturns fake.recordInvocation("Recv", []interface{}{}) fake.recvMutex.Unlock() - if fake.RecvStub != nil { - return fake.RecvStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.recvReturns return fakeReturns.result1, fakeReturns.result2 } @@ -310,15 +314,16 @@ func (fake *FakeRegistry_ListBundlesClient) RecvMsg(arg1 any) error { fake.recvMsgArgsForCall = append(fake.recvMsgArgsForCall, struct { arg1 any }{arg1}) + stub := fake.RecvMsgStub + fakeReturns := fake.recvMsgReturns fake.recordInvocation("RecvMsg", []interface{}{arg1}) fake.recvMsgMutex.Unlock() - if fake.RecvMsgStub != nil { - return fake.RecvMsgStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1 } - fakeReturns := fake.recvMsgReturns return fakeReturns.result1 } @@ -370,15 +375,16 @@ func (fake *FakeRegistry_ListBundlesClient) SendMsg(arg1 any) error { fake.sendMsgArgsForCall = append(fake.sendMsgArgsForCall, struct { arg1 any }{arg1}) + stub := fake.SendMsgStub + fakeReturns := fake.sendMsgReturns fake.recordInvocation("SendMsg", []interface{}{arg1}) fake.sendMsgMutex.Unlock() - if fake.SendMsgStub != nil { - return fake.SendMsgStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1 } - fakeReturns := fake.sendMsgReturns return fakeReturns.result1 } @@ -429,15 +435,16 @@ func (fake *FakeRegistry_ListBundlesClient) Trailer() metadata.MD { ret, specificReturn := fake.trailerReturnsOnCall[len(fake.trailerArgsForCall)] fake.trailerArgsForCall = append(fake.trailerArgsForCall, struct { }{}) + stub := fake.TrailerStub + fakeReturns := fake.trailerReturns fake.recordInvocation("Trailer", []interface{}{}) fake.trailerMutex.Unlock() - if fake.TrailerStub != nil { - return fake.TrailerStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.trailerReturns return fakeReturns.result1 } diff --git a/pkg/package-server/client/fakes/fake_list_packages_client.go b/pkg/package-server/client/fakes/fake_list_packages_client.go index 3ae18fc38d..e24b25a870 100644 --- a/pkg/package-server/client/fakes/fake_list_packages_client.go +++ b/pkg/package-server/client/fakes/fake_list_packages_client.go @@ -95,15 +95,16 @@ func (fake *FakeRegistry_ListPackagesClient) CloseSend() error { ret, specificReturn := fake.closeSendReturnsOnCall[len(fake.closeSendArgsForCall)] fake.closeSendArgsForCall = append(fake.closeSendArgsForCall, struct { }{}) + stub := fake.CloseSendStub + fakeReturns := fake.closeSendReturns fake.recordInvocation("CloseSend", []interface{}{}) fake.closeSendMutex.Unlock() - if fake.CloseSendStub != nil { - return fake.CloseSendStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.closeSendReturns return fakeReturns.result1 } @@ -147,15 +148,16 @@ func (fake *FakeRegistry_ListPackagesClient) Context() context.Context { ret, specificReturn := fake.contextReturnsOnCall[len(fake.contextArgsForCall)] fake.contextArgsForCall = append(fake.contextArgsForCall, struct { }{}) + stub := fake.ContextStub + fakeReturns := fake.contextReturns fake.recordInvocation("Context", []interface{}{}) fake.contextMutex.Unlock() - if fake.ContextStub != nil { - return fake.ContextStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.contextReturns return fakeReturns.result1 } @@ -199,15 +201,16 @@ func (fake *FakeRegistry_ListPackagesClient) Header() (metadata.MD, error) { ret, specificReturn := fake.headerReturnsOnCall[len(fake.headerArgsForCall)] fake.headerArgsForCall = append(fake.headerArgsForCall, struct { }{}) + stub := fake.HeaderStub + fakeReturns := fake.headerReturns fake.recordInvocation("Header", []interface{}{}) fake.headerMutex.Unlock() - if fake.HeaderStub != nil { - return fake.HeaderStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.headerReturns return fakeReturns.result1, fakeReturns.result2 } @@ -254,15 +257,16 @@ func (fake *FakeRegistry_ListPackagesClient) Recv() (*api.PackageName, error) { ret, specificReturn := fake.recvReturnsOnCall[len(fake.recvArgsForCall)] fake.recvArgsForCall = append(fake.recvArgsForCall, struct { }{}) + stub := fake.RecvStub + fakeReturns := fake.recvReturns fake.recordInvocation("Recv", []interface{}{}) fake.recvMutex.Unlock() - if fake.RecvStub != nil { - return fake.RecvStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.recvReturns return fakeReturns.result1, fakeReturns.result2 } @@ -310,15 +314,16 @@ func (fake *FakeRegistry_ListPackagesClient) RecvMsg(arg1 any) error { fake.recvMsgArgsForCall = append(fake.recvMsgArgsForCall, struct { arg1 any }{arg1}) + stub := fake.RecvMsgStub + fakeReturns := fake.recvMsgReturns fake.recordInvocation("RecvMsg", []interface{}{arg1}) fake.recvMsgMutex.Unlock() - if fake.RecvMsgStub != nil { - return fake.RecvMsgStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1 } - fakeReturns := fake.recvMsgReturns return fakeReturns.result1 } @@ -370,15 +375,16 @@ func (fake *FakeRegistry_ListPackagesClient) SendMsg(arg1 any) error { fake.sendMsgArgsForCall = append(fake.sendMsgArgsForCall, struct { arg1 any }{arg1}) + stub := fake.SendMsgStub + fakeReturns := fake.sendMsgReturns fake.recordInvocation("SendMsg", []interface{}{arg1}) fake.sendMsgMutex.Unlock() - if fake.SendMsgStub != nil { - return fake.SendMsgStub(arg1) + if stub != nil { + return stub(arg1) } if specificReturn { return ret.result1 } - fakeReturns := fake.sendMsgReturns return fakeReturns.result1 } @@ -429,15 +435,16 @@ func (fake *FakeRegistry_ListPackagesClient) Trailer() metadata.MD { ret, specificReturn := fake.trailerReturnsOnCall[len(fake.trailerArgsForCall)] fake.trailerArgsForCall = append(fake.trailerArgsForCall, struct { }{}) + stub := fake.TrailerStub + fakeReturns := fake.trailerReturns fake.recordInvocation("Trailer", []interface{}{}) fake.trailerMutex.Unlock() - if fake.TrailerStub != nil { - return fake.TrailerStub() + if stub != nil { + return stub() } if specificReturn { return ret.result1 } - fakeReturns := fake.trailerReturns return fakeReturns.result1 } diff --git a/pkg/package-server/client/fakes/fake_registry_client.go b/pkg/package-server/client/fakes/fake_registry_client.go index ff5b4119a6..8d087c3e3f 100644 --- a/pkg/package-server/client/fakes/fake_registry_client.go +++ b/pkg/package-server/client/fakes/fake_registry_client.go @@ -172,15 +172,16 @@ func (fake *FakeRegistryClient) GetBundle(arg1 context.Context, arg2 *api.GetBun arg2 *api.GetBundleRequest arg3 []grpc.CallOption }{arg1, arg2, arg3}) + stub := fake.GetBundleStub + fakeReturns := fake.getBundleReturns fake.recordInvocation("GetBundle", []interface{}{arg1, arg2, arg3}) fake.getBundleMutex.Unlock() - if fake.GetBundleStub != nil { - return fake.GetBundleStub(arg1, arg2, arg3...) + if stub != nil { + return stub(arg1, arg2, arg3...) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getBundleReturns return fakeReturns.result1, fakeReturns.result2 } @@ -237,15 +238,16 @@ func (fake *FakeRegistryClient) GetBundleForChannel(arg1 context.Context, arg2 * arg2 *api.GetBundleInChannelRequest arg3 []grpc.CallOption }{arg1, arg2, arg3}) + stub := fake.GetBundleForChannelStub + fakeReturns := fake.getBundleForChannelReturns fake.recordInvocation("GetBundleForChannel", []interface{}{arg1, arg2, arg3}) fake.getBundleForChannelMutex.Unlock() - if fake.GetBundleForChannelStub != nil { - return fake.GetBundleForChannelStub(arg1, arg2, arg3...) + if stub != nil { + return stub(arg1, arg2, arg3...) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getBundleForChannelReturns return fakeReturns.result1, fakeReturns.result2 } @@ -302,15 +304,16 @@ func (fake *FakeRegistryClient) GetBundleThatReplaces(arg1 context.Context, arg2 arg2 *api.GetReplacementRequest arg3 []grpc.CallOption }{arg1, arg2, arg3}) + stub := fake.GetBundleThatReplacesStub + fakeReturns := fake.getBundleThatReplacesReturns fake.recordInvocation("GetBundleThatReplaces", []interface{}{arg1, arg2, arg3}) fake.getBundleThatReplacesMutex.Unlock() - if fake.GetBundleThatReplacesStub != nil { - return fake.GetBundleThatReplacesStub(arg1, arg2, arg3...) + if stub != nil { + return stub(arg1, arg2, arg3...) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getBundleThatReplacesReturns return fakeReturns.result1, fakeReturns.result2 } @@ -367,15 +370,16 @@ func (fake *FakeRegistryClient) GetChannelEntriesThatProvide(arg1 context.Contex arg2 *api.GetAllProvidersRequest arg3 []grpc.CallOption }{arg1, arg2, arg3}) + stub := fake.GetChannelEntriesThatProvideStub + fakeReturns := fake.getChannelEntriesThatProvideReturns fake.recordInvocation("GetChannelEntriesThatProvide", []interface{}{arg1, arg2, arg3}) fake.getChannelEntriesThatProvideMutex.Unlock() - if fake.GetChannelEntriesThatProvideStub != nil { - return fake.GetChannelEntriesThatProvideStub(arg1, arg2, arg3...) + if stub != nil { + return stub(arg1, arg2, arg3...) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getChannelEntriesThatProvideReturns return fakeReturns.result1, fakeReturns.result2 } @@ -432,15 +436,16 @@ func (fake *FakeRegistryClient) GetChannelEntriesThatReplace(arg1 context.Contex arg2 *api.GetAllReplacementsRequest arg3 []grpc.CallOption }{arg1, arg2, arg3}) + stub := fake.GetChannelEntriesThatReplaceStub + fakeReturns := fake.getChannelEntriesThatReplaceReturns fake.recordInvocation("GetChannelEntriesThatReplace", []interface{}{arg1, arg2, arg3}) fake.getChannelEntriesThatReplaceMutex.Unlock() - if fake.GetChannelEntriesThatReplaceStub != nil { - return fake.GetChannelEntriesThatReplaceStub(arg1, arg2, arg3...) + if stub != nil { + return stub(arg1, arg2, arg3...) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getChannelEntriesThatReplaceReturns return fakeReturns.result1, fakeReturns.result2 } @@ -497,15 +502,16 @@ func (fake *FakeRegistryClient) GetDefaultBundleThatProvides(arg1 context.Contex arg2 *api.GetDefaultProviderRequest arg3 []grpc.CallOption }{arg1, arg2, arg3}) + stub := fake.GetDefaultBundleThatProvidesStub + fakeReturns := fake.getDefaultBundleThatProvidesReturns fake.recordInvocation("GetDefaultBundleThatProvides", []interface{}{arg1, arg2, arg3}) fake.getDefaultBundleThatProvidesMutex.Unlock() - if fake.GetDefaultBundleThatProvidesStub != nil { - return fake.GetDefaultBundleThatProvidesStub(arg1, arg2, arg3...) + if stub != nil { + return stub(arg1, arg2, arg3...) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getDefaultBundleThatProvidesReturns return fakeReturns.result1, fakeReturns.result2 } @@ -562,15 +568,16 @@ func (fake *FakeRegistryClient) GetLatestChannelEntriesThatProvide(arg1 context. arg2 *api.GetLatestProvidersRequest arg3 []grpc.CallOption }{arg1, arg2, arg3}) + stub := fake.GetLatestChannelEntriesThatProvideStub + fakeReturns := fake.getLatestChannelEntriesThatProvideReturns fake.recordInvocation("GetLatestChannelEntriesThatProvide", []interface{}{arg1, arg2, arg3}) fake.getLatestChannelEntriesThatProvideMutex.Unlock() - if fake.GetLatestChannelEntriesThatProvideStub != nil { - return fake.GetLatestChannelEntriesThatProvideStub(arg1, arg2, arg3...) + if stub != nil { + return stub(arg1, arg2, arg3...) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getLatestChannelEntriesThatProvideReturns return fakeReturns.result1, fakeReturns.result2 } @@ -627,15 +634,16 @@ func (fake *FakeRegistryClient) GetPackage(arg1 context.Context, arg2 *api.GetPa arg2 *api.GetPackageRequest arg3 []grpc.CallOption }{arg1, arg2, arg3}) + stub := fake.GetPackageStub + fakeReturns := fake.getPackageReturns fake.recordInvocation("GetPackage", []interface{}{arg1, arg2, arg3}) fake.getPackageMutex.Unlock() - if fake.GetPackageStub != nil { - return fake.GetPackageStub(arg1, arg2, arg3...) + if stub != nil { + return stub(arg1, arg2, arg3...) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getPackageReturns return fakeReturns.result1, fakeReturns.result2 } @@ -692,15 +700,16 @@ func (fake *FakeRegistryClient) ListBundles(arg1 context.Context, arg2 *api.List arg2 *api.ListBundlesRequest arg3 []grpc.CallOption }{arg1, arg2, arg3}) + stub := fake.ListBundlesStub + fakeReturns := fake.listBundlesReturns fake.recordInvocation("ListBundles", []interface{}{arg1, arg2, arg3}) fake.listBundlesMutex.Unlock() - if fake.ListBundlesStub != nil { - return fake.ListBundlesStub(arg1, arg2, arg3...) + if stub != nil { + return stub(arg1, arg2, arg3...) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.listBundlesReturns return fakeReturns.result1, fakeReturns.result2 } @@ -757,15 +766,16 @@ func (fake *FakeRegistryClient) ListPackages(arg1 context.Context, arg2 *api.Lis arg2 *api.ListPackageRequest arg3 []grpc.CallOption }{arg1, arg2, arg3}) + stub := fake.ListPackagesStub + fakeReturns := fake.listPackagesReturns fake.recordInvocation("ListPackages", []interface{}{arg1, arg2, arg3}) fake.listPackagesMutex.Unlock() - if fake.ListPackagesStub != nil { - return fake.ListPackagesStub(arg1, arg2, arg3...) + if stub != nil { + return stub(arg1, arg2, arg3...) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.listPackagesReturns return fakeReturns.result1, fakeReturns.result2 } diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/process.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/process.go index e437e297c0..37afbf6917 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/hcs/process.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/hcs/process.go @@ -12,14 +12,16 @@ import ( "syscall" "time" + "go.opencensus.io/trace" + "github.com/Microsoft/hcsshim/internal/cow" + hcsschema "github.com/Microsoft/hcsshim/internal/hcs/schema2" "github.com/Microsoft/hcsshim/internal/log" "github.com/Microsoft/hcsshim/internal/oc" + "github.com/Microsoft/hcsshim/internal/protocol/guestrequest" "github.com/Microsoft/hcsshim/internal/vmcompute" - "go.opencensus.io/trace" ) -// ContainerError is an error encountered in HCS type Process struct { handleLock sync.RWMutex handle vmcompute.HcsProcess @@ -50,35 +52,6 @@ func newProcess(process vmcompute.HcsProcess, processID int, computeSystem *Syst } } -type processModifyRequest struct { - Operation string - ConsoleSize *consoleSize `json:",omitempty"` - CloseHandle *closeHandle `json:",omitempty"` -} - -type consoleSize struct { - Height uint16 - Width uint16 -} - -type closeHandle struct { - Handle string -} - -type processStatus struct { - ProcessID uint32 - Exited bool - ExitCode uint32 - LastWaitResult int32 -} - -const stdIn string = "StdIn" - -const ( - modifyConsoleSize string = "ConsoleSize" - modifyCloseHandle string = "CloseHandle" -) - // Pid returns the process ID of the process within the container. func (process *Process) Pid() int { return process.processID @@ -260,14 +233,14 @@ func (process *Process) waitBackground() { process.handleLock.RLock() defer process.handleLock.RUnlock() - // Make sure we didnt race with Close() here + // Make sure we didn't race with Close() here if process.handle != 0 { propertiesJSON, resultJSON, err = vmcompute.HcsGetProcessProperties(ctx, process.handle) events := processHcsResult(ctx, resultJSON) if err != nil { err = makeProcessError(process, operation, err, events) } else { - properties := &processStatus{} + properties := &hcsschema.ProcessStatus{} err = json.Unmarshal([]byte(propertiesJSON), properties) if err != nil { err = makeProcessError(process, operation, err, nil) @@ -318,10 +291,9 @@ func (process *Process) ResizeConsole(ctx context.Context, width, height uint16) if process.handle == 0 { return makeProcessError(process, operation, ErrAlreadyClosed, nil) } - - modifyRequest := processModifyRequest{ - Operation: modifyConsoleSize, - ConsoleSize: &consoleSize{ + modifyRequest := hcsschema.ProcessModifyRequest{ + Operation: guestrequest.ModifyProcessConsoleSize, + ConsoleSize: &hcsschema.ConsoleSize{ Height: height, Width: width, }, @@ -421,18 +393,12 @@ func (process *Process) CloseStdin(ctx context.Context) (err error) { return makeProcessError(process, operation, ErrAlreadyClosed, nil) } - process.stdioLock.Lock() - defer process.stdioLock.Unlock() - if process.stdin == nil { - return nil - } - //HcsModifyProcess request to close stdin will fail if the process has already exited if !process.stopped() { - modifyRequest := processModifyRequest{ - Operation: modifyCloseHandle, - CloseHandle: &closeHandle{ - Handle: stdIn, + modifyRequest := hcsschema.ProcessModifyRequest{ + Operation: guestrequest.CloseProcessHandle, + CloseHandle: &hcsschema.CloseHandle{ + Handle: guestrequest.STDInHandle, }, } @@ -448,8 +414,12 @@ func (process *Process) CloseStdin(ctx context.Context) (err error) { } } - process.stdin.Close() - process.stdin = nil + process.stdioLock.Lock() + defer process.stdioLock.Unlock() + if process.stdin != nil { + process.stdin.Close() + process.stdin = nil + } return nil } diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/close_handle.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/close_handle.go index b4f9c315b0..bb36777b82 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/close_handle.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/close_handle.go @@ -9,6 +9,8 @@ package hcsschema +import "github.com/Microsoft/hcsshim/internal/protocol/guestrequest" + type CloseHandle struct { - Handle string `json:"Handle,omitempty"` + Handle guestrequest.STDIOHandle `json:"Handle,omitempty"` // NOTE: Swagger generated as string. Locally updated. } diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/console_size.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/console_size.go index 68aa04a573..347da50e86 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/console_size.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/console_size.go @@ -9,8 +9,11 @@ package hcsschema +// NOTE: Swagger generated fields as int32. Locally updated to uint16 to match documentation. +// https://learn.microsoft.com/en-us/virtualization/api/hcs/schemareference#ConsoleSize + type ConsoleSize struct { - Height int32 `json:"Height,omitempty"` + Height uint16 `json:"Height,omitempty"` - Width int32 `json:"Width,omitempty"` + Width uint16 `json:"Width,omitempty"` } diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/process_modify_request.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/process_modify_request.go index e4ed095c7b..862b7911e2 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/process_modify_request.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/process_modify_request.go @@ -9,9 +9,11 @@ package hcsschema -// Passed to HcsRpc_ModifyProcess +import "github.com/Microsoft/hcsshim/internal/protocol/guestrequest" + +// Passed to HcsRpc_ModifyProcess type ProcessModifyRequest struct { - Operation string `json:"Operation,omitempty"` + Operation guestrequest.ProcessModifyOperation `json:"Operation,omitempty"` // NOTE: Swagger generated as string. Locally updated. ConsoleSize *ConsoleSize `json:"ConsoleSize,omitempty"` diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/process_status.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/process_status.go index ad9a4fa9ad..3c371d4650 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/process_status.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/process_status.go @@ -9,13 +9,16 @@ package hcsschema -// Status of a process running in a container +// NOTE: Swagger generated fields as int32. Locally updated to uint16 to match documentation. +// https://learn.microsoft.com/en-us/virtualization/api/hcs/schemareference#ConsoleSize + +// Status of a process running in a container type ProcessStatus struct { - ProcessId int32 `json:"ProcessId,omitempty"` + ProcessId uint32 `json:"ProcessId,omitempty"` // NOTE: Swagger generated as int32. Locally updated to match documentation. Exited bool `json:"Exited,omitempty"` - ExitCode int32 `json:"ExitCode,omitempty"` + ExitCode uint32 `json:"ExitCode,omitempty"` // NOTE: Swagger generated as int32. Locally updated to match documentation. LastWaitResult int32 `json:"LastWaitResult,omitempty"` } diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/system.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/system.go index cf20adefc9..cf1db7da9a 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/hcs/system.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/hcs/system.go @@ -304,11 +304,22 @@ func (computeSystem *System) WaitError() error { return computeSystem.waitError } -// Wait synchronously waits for the compute system to shutdown or terminate. If -// the compute system has already exited returns the previous error (if any). +// Wait synchronously waits for the compute system to shutdown or terminate. +// If the compute system has already exited returns the previous error (if any). func (computeSystem *System) Wait() error { - <-computeSystem.WaitChannel() - return computeSystem.WaitError() + return computeSystem.WaitCtx(context.Background()) +} + +// WaitCtx synchronously waits for the compute system to shutdown or terminate, or the context to be cancelled. +// +// See [System.Wait] for more information. +func (computeSystem *System) WaitCtx(ctx context.Context) error { + select { + case <-computeSystem.WaitChannel(): + return computeSystem.WaitError() + case <-ctx.Done(): + return ctx.Err() + } } // stopped returns true if the compute system stopped. @@ -735,9 +746,17 @@ func (computeSystem *System) OpenProcess(ctx context.Context, pid int) (*Process } // Close cleans up any state associated with the compute system but does not terminate or wait for it. -func (computeSystem *System) Close() (err error) { +func (computeSystem *System) Close() error { + return computeSystem.CloseCtx(context.Background()) +} + +// CloseCtx is similar to [System.Close], but accepts a context. +// +// The context is used for all operations, including waits, so timeouts/cancellations may prevent +// proper system cleanup. +func (computeSystem *System) CloseCtx(ctx context.Context) (err error) { operation := "hcs::System::Close" - ctx, span := oc.StartSpan(context.Background(), operation) + ctx, span := oc.StartSpan(ctx, operation) defer span.End() defer func() { oc.SetSpanStatus(span, err) }() span.AddAttributes(trace.StringAttribute("cid", computeSystem.id)) diff --git a/vendor/github.com/Microsoft/hcsshim/internal/log/format.go b/vendor/github.com/Microsoft/hcsshim/internal/log/format.go index d35efa0161..6d69c15b97 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/log/format.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/log/format.go @@ -9,13 +9,16 @@ import ( "reflect" "time" - "github.com/containerd/containerd/log" "github.com/sirupsen/logrus" "google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/proto" ) -const TimeFormat = log.RFC3339NanoFixed +// TimeFormat is [time.RFC3339Nano] with nanoseconds padded using +// zeros to ensure the formatted time is always the same number of +// characters. +// Based on RFC3339NanoFixed from github.com/containerd/log +const TimeFormat = "2006-01-02T15:04:05.000000000Z07:00" func FormatTime(t time.Time) string { return t.Format(TimeFormat) diff --git a/vendor/github.com/Microsoft/hcsshim/internal/log/hook.go b/vendor/github.com/Microsoft/hcsshim/internal/log/hook.go index 94c6d0918f..bb547a329f 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/log/hook.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/log/hook.go @@ -6,7 +6,6 @@ import ( "time" "github.com/Microsoft/hcsshim/internal/logfields" - "github.com/containerd/containerd/log" "github.com/sirupsen/logrus" "go.opencensus.io/trace" ) @@ -30,7 +29,7 @@ type Hook struct { // An empty string disables formatting. // When disabled, the fall back will the JSON encoding, if enabled. // - // Default is [github.com/containerd/containerd/log.RFC3339NanoFixed]. + // Default is [TimeFormat]. TimeFormat string // Duration format converts a [time.Duration] fields to an appropriate encoding. @@ -49,7 +48,7 @@ var _ logrus.Hook = &Hook{} func NewHook() *Hook { return &Hook{ - TimeFormat: log.RFC3339NanoFixed, + TimeFormat: TimeFormat, DurationFormat: DurationFormatString, AddSpanContext: true, } diff --git a/vendor/github.com/Microsoft/hcsshim/internal/log/nopformatter.go b/vendor/github.com/Microsoft/hcsshim/internal/log/nopformatter.go new file mode 100644 index 0000000000..909ba68b28 --- /dev/null +++ b/vendor/github.com/Microsoft/hcsshim/internal/log/nopformatter.go @@ -0,0 +1,12 @@ +package log + +import ( + "github.com/sirupsen/logrus" +) + +type NopFormatter struct{} + +var _ logrus.Formatter = NopFormatter{} + +// Format does nothing and returns a nil slice. +func (NopFormatter) Format(*logrus.Entry) ([]byte, error) { return nil, nil } diff --git a/vendor/github.com/Microsoft/hcsshim/internal/protocol/guestrequest/types.go b/vendor/github.com/Microsoft/hcsshim/internal/protocol/guestrequest/types.go index d8d0c20b10..4f441803b7 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/protocol/guestrequest/types.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/protocol/guestrequest/types.go @@ -5,7 +5,7 @@ package guestrequest type RequestType string type ResourceType string -// RequestType const +// RequestType const. const ( RequestTypeAdd RequestType = "Add" RequestTypeRemove RequestType = "Remove" @@ -54,3 +54,23 @@ var ( "305891a9-b251-5dfe-91a2-c25d9212275b", } ) + +// constants for v2 schema ProcessModifyRequest + +// Operation type for [hcsschema.ProcessModifyRequest]. +type ProcessModifyOperation string + +const ( + ModifyProcessConsoleSize ProcessModifyOperation = "ConsoleSize" + CloseProcessHandle ProcessModifyOperation = "CloseHandle" +) + +// Standard IO handle(s) to close for [hcsschema.CloseHandle] in [hcsschema.ProcessModifyRequest]. +type STDIOHandle string + +const ( + STDInHandle STDIOHandle = "StdIn" + STDOutHandle STDIOHandle = "StdOut" + STDErrHandle STDIOHandle = "StdErr" + AllHandles STDIOHandle = "All" +) diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerutils.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerutils.go index d5d2cb137a..ee17dd3d1a 100644 --- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerutils.go +++ b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerutils.go @@ -7,6 +7,10 @@ package wclayer import ( "context" + "fmt" + "os" + "path/filepath" + "strconv" "syscall" "github.com/Microsoft/go-winio/pkg/guid" @@ -101,3 +105,23 @@ func layerPathsToDescriptors(ctx context.Context, parentLayerPaths []string) ([] return layers, nil } + +// GetLayerUvmBuild looks for a file named `uvmbuildversion` at `layerPath\uvmbuildversion` and returns the +// build number of the UVM from that file. +func GetLayerUvmBuild(layerPath string) (uint16, error) { + data, err := os.ReadFile(filepath.Join(layerPath, UvmBuildFileName)) + if err != nil { + return 0, err + } + ver, err := strconv.ParseUint(string(data), 10, 16) + if err != nil { + return 0, err + } + return uint16(ver), nil +} + +// WriteLayerUvmBuildFile writes a file at path `layerPath\uvmbuildversion` that contains the given `build` +// version for future reference. +func WriteLayerUvmBuildFile(layerPath string, build uint16) error { + return os.WriteFile(filepath.Join(layerPath, UvmBuildFileName), []byte(fmt.Sprintf("%d", build)), 0777) +} diff --git a/vendor/github.com/Microsoft/hcsshim/layer.go b/vendor/github.com/Microsoft/hcsshim/layer.go index afd1ddd0ae..7e9c9fbbe8 100644 --- a/vendor/github.com/Microsoft/hcsshim/layer.go +++ b/vendor/github.com/Microsoft/hcsshim/layer.go @@ -32,6 +32,7 @@ func CreateScratchLayer(info DriverInfo, layerId, parentId string, parentLayerPa func DeactivateLayer(info DriverInfo, id string) error { return wclayer.DeactivateLayer(context.Background(), layerPath(&info, id)) } + func DestroyLayer(info DriverInfo, id string) error { return wclayer.DestroyLayer(context.Background(), layerPath(&info, id)) } diff --git a/vendor/github.com/containers/common/libnetwork/types/const.go b/vendor/github.com/containers/common/libnetwork/types/const.go deleted file mode 100644 index 83103ef6ef..0000000000 --- a/vendor/github.com/containers/common/libnetwork/types/const.go +++ /dev/null @@ -1,59 +0,0 @@ -package types - -const ( - // BridgeNetworkDriver defines the bridge driver - BridgeNetworkDriver = "bridge" - // DefaultNetworkDriver is the default network type used - DefaultNetworkDriver = BridgeNetworkDriver - // MacVLANNetworkDriver defines the macvlan driver - MacVLANNetworkDriver = "macvlan" - // MacVLANNetworkDriver defines the macvlan driver - IPVLANNetworkDriver = "ipvlan" - - // IPAM drivers - Driver = "driver" - // HostLocalIPAMDriver store the ip locally in a db - HostLocalIPAMDriver = "host-local" - // DHCPIPAMDriver get subnet and ip from dhcp server - DHCPIPAMDriver = "dhcp" - // NoneIPAMDriver do not provide ipam management - NoneIPAMDriver = "none" - - // DefaultSubnet is the name that will be used for the default CNI network. - DefaultNetworkName = "podman" - // DefaultSubnet is the subnet that will be used for the default CNI network. - DefaultSubnet = "10.88.0.0/16" - - // valid macvlan driver mode values - MacVLANModeBridge = "bridge" - MacVLANModePrivate = "private" - MacVLANModeVepa = "vepa" - MacVLANModePassthru = "passthru" - - // valid ipvlan driver modes - IPVLANModeL2 = "l2" - IPVLANModeL3 = "l3" - IPVLANModeL3s = "l3s" - - // valid network options - VLANOption = "vlan" - MTUOption = "mtu" - ModeOption = "mode" - IsolateOption = "isolate" - MetricOption = "metric" - NoDefaultRoute = "no_default_route" - BclimOption = "bclim" -) - -type NetworkBackend string - -const ( - CNI NetworkBackend = "cni" - Netavark NetworkBackend = "netavark" -) - -// ValidMacVLANModes is the list of valid mode options for the macvlan driver -var ValidMacVLANModes = []string{MacVLANModeBridge, MacVLANModePrivate, MacVLANModeVepa, MacVLANModePassthru} - -// ValidIPVLANModes is the list of valid mode options for the ipvlan driver -var ValidIPVLANModes = []string{IPVLANModeL2, IPVLANModeL3, IPVLANModeL3s} diff --git a/vendor/github.com/containers/common/libnetwork/types/define.go b/vendor/github.com/containers/common/libnetwork/types/define.go deleted file mode 100644 index 6e91ccda96..0000000000 --- a/vendor/github.com/containers/common/libnetwork/types/define.go +++ /dev/null @@ -1,30 +0,0 @@ -package types - -import ( - "errors" - "fmt" - - "github.com/containers/storage/pkg/regexp" -) - -var ( - // ErrNoSuchNetwork indicates the requested network does not exist - ErrNoSuchNetwork = errors.New("network not found") - - // ErrInvalidArg indicates that an invalid argument was passed - ErrInvalidArg = errors.New("invalid argument") - - // ErrNetworkExists indicates that a network with the given name already - // exists. - ErrNetworkExists = errors.New("network already exists") - - // NameRegex is a regular expression to validate names. - // This must NOT be changed. - NameRegex = regexp.Delayed("^[a-zA-Z0-9][a-zA-Z0-9_.-]*$") - // RegexError is thrown in presence of an invalid name. - RegexError = fmt.Errorf("names must match [a-zA-Z0-9][a-zA-Z0-9_.-]*: %w", ErrInvalidArg) // nolint:revive // This lint is new and we do not want to break the API. - - // NotHexRegex is a regular expression to check if a string is - // a hexadecimal string. - NotHexRegex = regexp.Delayed(`[^0-9a-fA-F]`) -) diff --git a/vendor/github.com/containers/common/libnetwork/types/network.go b/vendor/github.com/containers/common/libnetwork/types/network.go deleted file mode 100644 index 94087fd375..0000000000 --- a/vendor/github.com/containers/common/libnetwork/types/network.go +++ /dev/null @@ -1,339 +0,0 @@ -package types - -import ( - "encoding/json" - "net" - "time" -) - -type ContainerNetwork interface { - // NetworkCreate will take a partial filled Network and fill the - // missing fields. It creates the Network and returns the full Network. - NetworkCreate(Network, *NetworkCreateOptions) (Network, error) - // NetworkUpdate will take network name and ID and updates network DNS Servers. - NetworkUpdate(nameOrID string, options NetworkUpdateOptions) error - // NetworkRemove will remove the Network with the given name or ID. - NetworkRemove(nameOrID string) error - // NetworkList will return all known Networks. Optionally you can - // supply a list of filter functions. Only if a network matches all - // functions it is returned. - NetworkList(...FilterFunc) ([]Network, error) - // NetworkInspect will return the Network with the given name or ID. - NetworkInspect(nameOrID string) (Network, error) - - // Setup will setup the container network namespace. It returns - // a map of StatusBlocks, the key is the network name. - Setup(namespacePath string, options SetupOptions) (map[string]StatusBlock, error) - // Teardown will teardown the container network namespace. - Teardown(namespacePath string, options TeardownOptions) error - - // Drivers will return the list of supported network drivers - // for this interface. - Drivers() []string - - // DefaultNetworkName will return the default network name - // for this interface. - DefaultNetworkName() string - - // NetworkInfo return the network information about backend type, - // binary path, package version and so on. - NetworkInfo() NetworkInfo -} - -// Network describes the Network attributes. -type Network struct { - // Name of the Network. - Name string `json:"name"` - // ID of the Network. - ID string `json:"id"` - // Driver for this Network, e.g. bridge, macvlan... - Driver string `json:"driver"` - // NetworkInterface is the network interface name on the host. - NetworkInterface string `json:"network_interface,omitempty"` - // Created contains the timestamp when this network was created. - Created time.Time `json:"created,omitempty"` - // Subnets to use for this network. - Subnets []Subnet `json:"subnets,omitempty"` - // Routes to use for this network. - Routes []Route `json:"routes,omitempty"` - // IPv6Enabled if set to true an ipv6 subnet should be created for this net. - IPv6Enabled bool `json:"ipv6_enabled"` - // Internal is whether the Network should not have external routes - // to public or other Networks. - Internal bool `json:"internal"` - // DNSEnabled is whether name resolution is active for container on - // this Network. Only supported with the bridge driver. - DNSEnabled bool `json:"dns_enabled"` - // List of custom DNS server for podman's DNS resolver at network level, - // all the containers attached to this network will consider resolvers - // configured at network level. - NetworkDNSServers []string `json:"network_dns_servers,omitempty"` - // Labels is a set of key-value labels that have been applied to the - // Network. - Labels map[string]string `json:"labels,omitempty"` - // Options is a set of key-value options that have been applied to - // the Network. - Options map[string]string `json:"options,omitempty"` - // IPAMOptions contains options used for the ip assignment. - IPAMOptions map[string]string `json:"ipam_options,omitempty"` -} - -// NetworkOptions for a given container. -type NetworkUpdateOptions struct { - // List of custom DNS server for podman's DNS resolver. - // Priority order will be kept as defined by user in the configuration. - AddDNSServers []string `json:"add_dns_servers,omitempty"` - RemoveDNSServers []string `json:"remove_dns_servers,omitempty"` -} - -// NetworkInfo contains the network information. -type NetworkInfo struct { - Backend NetworkBackend `json:"backend"` - Version string `json:"version,omitempty"` - Package string `json:"package,omitempty"` - Path string `json:"path,omitempty"` - DNS DNSNetworkInfo `json:"dns,omitempty"` -} - -// NetworkInfo contains the DNS information. -type DNSNetworkInfo struct { - Version string `json:"version,omitempty"` - Package string `json:"package,omitempty"` - Path string `json:"path,omitempty"` -} - -// IPNet is used as custom net.IPNet type to add Marshal/Unmarshal methods. -type IPNet struct { - net.IPNet -} - -// ParseCIDR parse a string to IPNet -func ParseCIDR(cidr string) (IPNet, error) { - ip, subnet, err := net.ParseCIDR(cidr) - if err != nil { - return IPNet{}, err - } - // convert to 4 bytes if ipv4 - ipv4 := ip.To4() - if ipv4 != nil { - ip = ipv4 - } - subnet.IP = ip - return IPNet{*subnet}, err -} - -func (n *IPNet) MarshalText() ([]byte, error) { - return []byte(n.String()), nil -} - -func (n *IPNet) UnmarshalText(text []byte) error { - subnet, err := ParseCIDR(string(text)) - if err != nil { - return err - } - *n = subnet - return nil -} - -// HardwareAddr is the same as net.HardwareAddr except -// that it adds the json marshal/unmarshal methods. -// This allows us to read the mac from a json string -// and a byte array. -// swagger:model MacAddress -type HardwareAddr net.HardwareAddr - -func (h *HardwareAddr) String() string { - return (*net.HardwareAddr)(h).String() -} - -func (h HardwareAddr) MarshalText() ([]byte, error) { - return []byte(h.String()), nil -} - -func (h *HardwareAddr) UnmarshalJSON(text []byte) error { - if len(text) == 0 { - *h = nil - return nil - } - - // if the json string start with a quote we got a string - // unmarshal the string and parse the mac from this string - if string(text[0]) == `"` { - var macString string - err := json.Unmarshal(text, &macString) - if err == nil { - mac, err := net.ParseMAC(macString) - if err == nil { - *h = HardwareAddr(mac) - return nil - } - } - } - // not a string or got an error fallback to the normal parsing - mac := make(net.HardwareAddr, 0, 6) - // use the standard json unmarshal for backwards compat - err := json.Unmarshal(text, &mac) - if err != nil { - return err - } - *h = HardwareAddr(mac) - return nil -} - -type Subnet struct { - // Subnet for this Network in CIDR form. - // swagger:strfmt string - Subnet IPNet `json:"subnet"` - // Gateway IP for this Network. - // swagger:strfmt string - Gateway net.IP `json:"gateway,omitempty"` - // LeaseRange contains the range where IP are leased. Optional. - LeaseRange *LeaseRange `json:"lease_range,omitempty"` -} - -type Route struct { - // Destination for this route in CIDR form. - // swagger:strfmt string - Destination IPNet `json:"destination"` - // Gateway IP for this route. - // swagger:strfmt string - Gateway net.IP `json:"gateway"` - // Metric for this route. Optional. - Metric *uint32 `json:"metric,omitempty"` -} - -// LeaseRange contains the range where IP are leased. -type LeaseRange struct { - // StartIP first IP in the subnet which should be used to assign ips. - // swagger:strfmt string - StartIP net.IP `json:"start_ip,omitempty"` - // EndIP last IP in the subnet which should be used to assign ips. - // swagger:strfmt string - EndIP net.IP `json:"end_ip,omitempty"` -} - -// StatusBlock contains the network information about a container -// connected to one Network. -type StatusBlock struct { - // Interfaces contains the created network interface in the container. - // The map key is the interface name. - Interfaces map[string]NetInterface `json:"interfaces,omitempty"` - // DNSServerIPs nameserver addresses which should be added to - // the containers resolv.conf file. - DNSServerIPs []net.IP `json:"dns_server_ips,omitempty"` - // DNSSearchDomains search domains which should be added to - // the containers resolv.conf file. - DNSSearchDomains []string `json:"dns_search_domains,omitempty"` -} - -// NetInterface contains the settings for a given network interface. -type NetInterface struct { - // Subnets list of assigned subnets with their gateway. - Subnets []NetAddress `json:"subnets,omitempty"` - // MacAddress for this Interface. - MacAddress HardwareAddr `json:"mac_address"` -} - -// NetAddress contains the ip address, subnet and gateway. -type NetAddress struct { - // IPNet of this NetAddress. Note that this is a subnet but it has to contain the - // actual ip of the network interface and not the network address. - IPNet IPNet `json:"ipnet"` - // Gateway for the network. This can be empty if there is no gateway, e.g. internal network. - Gateway net.IP `json:"gateway,omitempty"` -} - -// PerNetworkOptions are options which should be set on a per network basis. -type PerNetworkOptions struct { - // StaticIPs for this container. Optional. - // swagger:type []string - StaticIPs []net.IP `json:"static_ips,omitempty"` - // Aliases contains a list of names which the dns server should resolve - // to this container. Should only be set when DNSEnabled is true on the Network. - // If aliases are set but there is no dns support for this network the - // network interface implementation should ignore this and NOT error. - // Optional. - Aliases []string `json:"aliases,omitempty"` - // StaticMac for this container. Optional. - // swagger:strfmt string - StaticMAC HardwareAddr `json:"static_mac,omitempty"` - // InterfaceName for this container. Required in the backend. - // Optional in the frontend. Will be filled with ethX (where X is a integer) when empty. - InterfaceName string `json:"interface_name"` -} - -// NetworkOptions for a given container. -type NetworkOptions struct { - // ContainerID is the container id, used for iptables comments and ipam allocation. - ContainerID string `json:"container_id"` - // ContainerName is the container name, used as dns name. - ContainerName string `json:"container_name"` - // PortMappings contains the port mappings for this container - PortMappings []PortMapping `json:"port_mappings,omitempty"` - // Networks contains all networks with the PerNetworkOptions. - // The map should contain at least one element. - Networks map[string]PerNetworkOptions `json:"networks"` - // List of custom DNS server for podman's DNS resolver. - // Priority order will be kept as defined by user in the configuration. - DNSServers []string `json:"dns_servers,omitempty"` -} - -// PortMapping is one or more ports that will be mapped into the container. -type PortMapping struct { - // HostIP is the IP that we will bind to on the host. - // If unset, assumed to be 0.0.0.0 (all interfaces). - HostIP string `json:"host_ip"` - // ContainerPort is the port number that will be exposed from the - // container. - // Mandatory. - ContainerPort uint16 `json:"container_port"` - // HostPort is the port number that will be forwarded from the host into - // the container. - // If omitted, a random port on the host (guaranteed to be over 1024) - // will be assigned. - HostPort uint16 `json:"host_port"` - // Range is the number of ports that will be forwarded, starting at - // HostPort and ContainerPort and counting up. - // This is 1-indexed, so 1 is assumed to be a single port (only the - // Hostport:Containerport mapping will be added), 2 is two ports (both - // Hostport:Containerport and Hostport+1:Containerport+1), etc. - // If unset, assumed to be 1 (a single port). - // Both hostport + range and containerport + range must be less than - // 65536. - Range uint16 `json:"range"` - // Protocol is the protocol forward. - // Must be either "tcp", "udp", and "sctp", or some combination of these - // separated by commas. - // If unset, assumed to be TCP. - Protocol string `json:"protocol"` -} - -// OCICNIPortMapping maps to the standard CNI portmapping Capability. -// Deprecated: Do not use this struct for new fields. This only exists -// for backwards compatibility. -type OCICNIPortMapping struct { - // HostPort is the port number on the host. - HostPort int32 `json:"hostPort"` - // ContainerPort is the port number inside the sandbox. - ContainerPort int32 `json:"containerPort"` - // Protocol is the protocol of the port mapping. - Protocol string `json:"protocol"` - // HostIP is the host ip to use. - HostIP string `json:"hostIP"` -} - -type SetupOptions struct { - NetworkOptions -} - -type TeardownOptions struct { - NetworkOptions -} - -// FilterFunc can be passed to NetworkList to filter the networks. -type FilterFunc func(Network) bool - -type NetworkCreateOptions struct { - // IgnoreIfExists if true, do not fail if the network already exists - IgnoreIfExists bool -} diff --git a/vendor/github.com/containers/common/pkg/auth/auth.go b/vendor/github.com/containers/common/pkg/auth/auth.go index a96ee8ebe1..6536d0f2fd 100644 --- a/vendor/github.com/containers/common/pkg/auth/auth.go +++ b/vendor/github.com/containers/common/pkg/auth/auth.go @@ -10,12 +10,13 @@ import ( "path/filepath" "strings" - "github.com/containers/common/pkg/util" + passwd "github.com/containers/common/pkg/password" "github.com/containers/image/v5/docker" "github.com/containers/image/v5/docker/reference" "github.com/containers/image/v5/pkg/docker/config" "github.com/containers/image/v5/pkg/sysregistriesv2" "github.com/containers/image/v5/types" + "github.com/containers/storage/pkg/homedir" "github.com/sirupsen/logrus" ) @@ -39,33 +40,46 @@ func (e ErrNewCredentialsInvalid) Unwrap() error { // GetDefaultAuthFile returns env value REGISTRY_AUTH_FILE as default // --authfile path used in multiple --authfile flag definitions // Will fail over to DOCKER_CONFIG if REGISTRY_AUTH_FILE environment is not set +// +// WARNINGS: +// - In almost all invocations, expect this function to return ""; so it can not be used +// for directly accessing the file. +// - Use this only for commands that _read_ credentials, not write them. +// The path may refer to github.com/containers auth.json, or to Docker config.json, +// and the distinction is lost; writing auth.json data to config.json may not be consumable by Docker, +// or it may overwrite and discard unrelated Docker configuration set by the user. func GetDefaultAuthFile() string { + // Keep this in sync with the default logic in systemContextWithOptions! + if authfile := os.Getenv("REGISTRY_AUTH_FILE"); authfile != "" { return authfile } + // This pre-existing behavior is not conceptually consistent: + // If users have a ~/.docker/config.json in the default path, and no environment variable + // set, we read auth.json first, falling back to config.json; + // but if DOCKER_CONFIG is set, we read only config.json in that path, and we don’t read auth.json at all. if authEnv := os.Getenv("DOCKER_CONFIG"); authEnv != "" { return filepath.Join(authEnv, "config.json") } return "" } -// CheckAuthFile validates filepath given by --authfile -// used by command has --authfile flag -func CheckAuthFile(authfile string) error { - if authfile == "" { +// CheckAuthFile validates a path option, failing if the option is set but the referenced file is not accessible. +func CheckAuthFile(pathOption string) error { + if pathOption == "" { return nil } - if _, err := os.Stat(authfile); err != nil { - return fmt.Errorf("checking authfile: %w", err) + if _, err := os.Stat(pathOption); err != nil { + return fmt.Errorf("credential file is not accessible: %w", err) } return nil } // systemContextWithOptions returns a version of sys -// updated with authFile and certDir values (if they are not ""). +// updated with authFile, dockerCompatAuthFile and certDir values (if they are not ""). // NOTE: this is a shallow copy that can be used and updated, but may share // data with the original parameter. -func systemContextWithOptions(sys *types.SystemContext, authFile, certDir string) *types.SystemContext { +func systemContextWithOptions(sys *types.SystemContext, authFile, dockerCompatAuthFile, certDir string) (*types.SystemContext, error) { if sys != nil { sysCopy := *sys sys = &sysCopy @@ -73,24 +87,50 @@ func systemContextWithOptions(sys *types.SystemContext, authFile, certDir string sys = &types.SystemContext{} } - if authFile != "" { + defaultDockerConfigPath := filepath.Join(homedir.Get(), ".docker", "config.json") + switch { + case authFile != "" && dockerCompatAuthFile != "": + return nil, errors.New("options for paths to the credential file and to the Docker-compatible credential file can not be set simultaneously") + case authFile != "": + if authFile == defaultDockerConfigPath { + logrus.Warn("saving credentials to ~/.docker/config.json, but not using Docker-compatible file format") + } sys.AuthFilePath = authFile + case dockerCompatAuthFile != "": + sys.DockerCompatAuthFilePath = dockerCompatAuthFile + default: + // Keep this in sync with GetDefaultAuthFile()! + // + // Note that c/image does not natively implement the REGISTRY_AUTH_FILE + // variable, so not all callers look for credentials in this location. + if authFileVar := os.Getenv("REGISTRY_AUTH_FILE"); authFileVar != "" { + if authFileVar == defaultDockerConfigPath { + logrus.Warn("$REGISTRY_AUTH_FILE points to ~/.docker/config.json, but the file format is not fully compatible; use the Docker-compatible file path option instead") + } + sys.AuthFilePath = authFileVar + } else if dockerConfig := os.Getenv("DOCKER_CONFIG"); dockerConfig != "" { + // This preserves pre-existing _inconsistent_ behavior: + // If the Docker configuration exists in the default ~/.docker/config.json location, + // we DO NOT write to it; instead, we update auth.json in the default path. + // Only if the user explicitly sets DOCKER_CONFIG, we write to that config.json. + sys.DockerCompatAuthFilePath = filepath.Join(dockerConfig, "config.json") + } } if certDir != "" { sys.DockerCertPath = certDir } - return sys + return sys, nil } // Login implements a “log in” command with the provided opts and args // reading the password from opts.Stdin or the options in opts. func Login(ctx context.Context, systemContext *types.SystemContext, opts *LoginOptions, args []string) error { - systemContext = systemContextWithOptions(systemContext, opts.AuthFile, opts.CertDir) + systemContext, err := systemContextWithOptions(systemContext, opts.AuthFile, opts.DockerCompatAuthFile, opts.CertDir) + if err != nil { + return err + } - var ( - key, registry string - err error - ) + var key, registry string switch len(args) { case 0: if !opts.AcceptUnspecifiedRegistry { @@ -269,7 +309,7 @@ func getUserAndPass(opts *LoginOptions, password, userFromAuthFile string) (user } if password == "" { fmt.Fprint(opts.Stdout, "Password: ") - pass, err := util.ReadPassword(int(os.Stdin.Fd())) + pass, err := passwd.Read(int(os.Stdin.Fd())) if err != nil { return "", "", fmt.Errorf("reading password: %w", err) } @@ -284,7 +324,13 @@ func Logout(systemContext *types.SystemContext, opts *LogoutOptions, args []stri if err := CheckAuthFile(opts.AuthFile); err != nil { return err } - systemContext = systemContextWithOptions(systemContext, opts.AuthFile, "") + if err := CheckAuthFile(opts.DockerCompatAuthFile); err != nil { + return err + } + systemContext, err := systemContextWithOptions(systemContext, opts.AuthFile, opts.DockerCompatAuthFile, "") + if err != nil { + return err + } if opts.All { if len(args) != 0 { @@ -297,10 +343,7 @@ func Logout(systemContext *types.SystemContext, opts *LogoutOptions, args []stri return nil } - var ( - key, registry string - err error - ) + var key, registry string switch len(args) { case 0: if !opts.AcceptUnspecifiedRegistry { diff --git a/vendor/github.com/containers/common/pkg/auth/cli.go b/vendor/github.com/containers/common/pkg/auth/cli.go index 26727f35cc..60e02e51e6 100644 --- a/vendor/github.com/containers/common/pkg/auth/cli.go +++ b/vendor/github.com/containers/common/pkg/auth/cli.go @@ -14,14 +14,15 @@ type LoginOptions struct { // CLI flags managed by the FlagSet returned by GetLoginFlags // Callers that use GetLoginFlags should not need to touch these values at all; callers that use // other CLI frameworks should set them based on user input. - AuthFile string - CertDir string - Password string - Username string - StdinPassword bool - GetLoginSet bool - Verbose bool // set to true for verbose output - AcceptRepositories bool // set to true to allow namespaces or repositories rather than just registries + AuthFile string + DockerCompatAuthFile string + CertDir string + Password string + Username string + StdinPassword bool + GetLoginSet bool + Verbose bool // set to true for verbose output + AcceptRepositories bool // set to true to allow namespaces or repositories rather than just registries // Options caller can set Stdin io.Reader // set to os.Stdin Stdout io.Writer // set to os.Stdout @@ -34,9 +35,10 @@ type LogoutOptions struct { // CLI flags managed by the FlagSet returned by GetLogoutFlags // Callers that use GetLogoutFlags should not need to touch these values at all; callers that use // other CLI frameworks should set them based on user input. - AuthFile string - All bool - AcceptRepositories bool // set to true to allow namespaces or repositories rather than just registries + AuthFile string + DockerCompatAuthFile string + All bool + AcceptRepositories bool // set to true to allow namespaces or repositories rather than just registries // Options caller can set Stdout io.Writer // set to os.Stdout AcceptUnspecifiedRegistry bool // set to true if allows logout with unspecified registry @@ -45,7 +47,8 @@ type LogoutOptions struct { // GetLoginFlags defines and returns login flags for containers tools func GetLoginFlags(flags *LoginOptions) *pflag.FlagSet { fs := pflag.FlagSet{} - fs.StringVar(&flags.AuthFile, "authfile", GetDefaultAuthFile(), "path of the authentication file. Use REGISTRY_AUTH_FILE environment variable to override") + fs.StringVar(&flags.AuthFile, "authfile", "", "path of the authentication file. Use REGISTRY_AUTH_FILE environment variable to override") + fs.StringVar(&flags.DockerCompatAuthFile, "compat-auth-file", "", "path of a Docker-compatible config file to update instead") fs.StringVar(&flags.CertDir, "cert-dir", "", "use certificates at the specified path to access the registry") fs.StringVarP(&flags.Password, "password", "p", "", "Password for registry") fs.StringVarP(&flags.Username, "username", "u", "", "Username for registry") @@ -59,6 +62,7 @@ func GetLoginFlags(flags *LoginOptions) *pflag.FlagSet { func GetLoginFlagsCompletions() completion.FlagCompletions { flagCompletion := completion.FlagCompletions{} flagCompletion["authfile"] = completion.AutocompleteDefault + flagCompletion["compat-auth-file"] = completion.AutocompleteDefault flagCompletion["cert-dir"] = completion.AutocompleteDefault flagCompletion["password"] = completion.AutocompleteNone flagCompletion["username"] = completion.AutocompleteNone @@ -68,7 +72,8 @@ func GetLoginFlagsCompletions() completion.FlagCompletions { // GetLogoutFlags defines and returns logout flags for containers tools func GetLogoutFlags(flags *LogoutOptions) *pflag.FlagSet { fs := pflag.FlagSet{} - fs.StringVar(&flags.AuthFile, "authfile", GetDefaultAuthFile(), "path of the authentication file. Use REGISTRY_AUTH_FILE environment variable to override") + fs.StringVar(&flags.AuthFile, "authfile", "", "path of the authentication file. Use REGISTRY_AUTH_FILE environment variable to override") + fs.StringVar(&flags.DockerCompatAuthFile, "compat-auth-file", "", "path of a Docker-compatible config file to update instead") fs.BoolVarP(&flags.All, "all", "a", false, "Remove the cached credentials for all registries in the auth file") return &fs } @@ -77,5 +82,6 @@ func GetLogoutFlags(flags *LogoutOptions) *pflag.FlagSet { func GetLogoutFlagsCompletions() completion.FlagCompletions { flagCompletion := completion.FlagCompletions{} flagCompletion["authfile"] = completion.AutocompleteDefault + flagCompletion["compat-auth-file"] = completion.AutocompleteDefault return flagCompletion } diff --git a/vendor/github.com/containers/common/pkg/password/password_supported.go b/vendor/github.com/containers/common/pkg/password/password_supported.go new file mode 100644 index 0000000000..56e95b3d5f --- /dev/null +++ b/vendor/github.com/containers/common/pkg/password/password_supported.go @@ -0,0 +1,57 @@ +//go:build linux || darwin || freebsd +// +build linux darwin freebsd + +package password + +import ( + "errors" + "os" + "os/signal" + "syscall" + + terminal "golang.org/x/term" +) + +var ErrInterrupt = errors.New("interrupted") + +// Read reads a password from the terminal without echo. +func Read(fd int) ([]byte, error) { + // Store and restore the terminal status on interruptions to + // avoid that the terminal remains in the password state + // This is necessary as for https://github.com/golang/go/issues/31180 + + oldState, err := terminal.GetState(fd) + if err != nil { + return make([]byte, 0), err + } + + type Buffer struct { + Buffer []byte + Error error + } + errorChannel := make(chan Buffer, 1) + + // SIGINT and SIGTERM restore the terminal, otherwise the no-echo mode would remain intact + interruptChannel := make(chan os.Signal, 1) + signal.Notify(interruptChannel, syscall.SIGINT, syscall.SIGTERM) + defer func() { + signal.Stop(interruptChannel) + close(interruptChannel) + }() + go func() { + for range interruptChannel { + if oldState != nil { + _ = terminal.Restore(fd, oldState) + } + errorChannel <- Buffer{Buffer: make([]byte, 0), Error: ErrInterrupt} + } + }() + + go func() { + buf, err := terminal.ReadPassword(fd) + errorChannel <- Buffer{Buffer: buf, Error: err} + }() + + buf := <-errorChannel + return buf.Buffer, buf.Error +} diff --git a/vendor/github.com/containers/common/pkg/util/util_windows.go b/vendor/github.com/containers/common/pkg/password/password_windows.go similarity index 50% rename from vendor/github.com/containers/common/pkg/util/util_windows.go rename to vendor/github.com/containers/common/pkg/password/password_windows.go index cc431e8ad8..7a0822d010 100644 --- a/vendor/github.com/containers/common/pkg/util/util_windows.go +++ b/vendor/github.com/containers/common/pkg/password/password_windows.go @@ -1,21 +1,14 @@ //go:build windows // +build windows -package util +package password import ( - "errors" - terminal "golang.org/x/term" ) -// getRuntimeDir returns the runtime directory -func GetRuntimeDir() (string, error) { - return "", errors.New("this function is not implemented for windows") -} - -// ReadPassword reads a password from the terminal. -func ReadPassword(fd int) ([]byte, error) { +// Read reads a password from the terminal. +func Read(fd int) ([]byte, error) { oldState, err := terminal.GetState(fd) if err != nil { return make([]byte, 0), err diff --git a/vendor/github.com/containers/common/pkg/util/copy.go b/vendor/github.com/containers/common/pkg/util/copy.go deleted file mode 100644 index a45b82fc94..0000000000 --- a/vendor/github.com/containers/common/pkg/util/copy.go +++ /dev/null @@ -1,57 +0,0 @@ -package util - -import ( - "errors" - "io" -) - -// ErrDetach indicates that an attach session was manually detached by -// the user. -var ErrDetach = errors.New("detached from container") - -// CopyDetachable is similar to io.Copy but support a detach key sequence to break out. -func CopyDetachable(dst io.Writer, src io.Reader, keys []byte) (written int64, err error) { - buf := make([]byte, 32*1024) - for { - nr, er := src.Read(buf) - if nr > 0 { - preservBuf := []byte{} - for i, key := range keys { - preservBuf = append(preservBuf, buf[0:nr]...) - if nr != 1 || buf[0] != key { - break - } - if i == len(keys)-1 { - return 0, ErrDetach - } - nr, er = src.Read(buf) - } - var nw int - var ew error - if len(preservBuf) > 0 { - nw, ew = dst.Write(preservBuf) - nr = len(preservBuf) - } else { - nw, ew = dst.Write(buf[0:nr]) - } - if nw > 0 { - written += int64(nw) - } - if ew != nil { - err = ew - break - } - if nr != nw { - err = io.ErrShortWrite - break - } - } - if er != nil { - if er != io.EOF { - err = er - } - break - } - } - return written, err -} diff --git a/vendor/github.com/containers/common/pkg/util/util.go b/vendor/github.com/containers/common/pkg/util/util.go deleted file mode 100644 index 221b011930..0000000000 --- a/vendor/github.com/containers/common/pkg/util/util.go +++ /dev/null @@ -1,206 +0,0 @@ -package util - -import ( - "bytes" - "errors" - "fmt" - "os" - "os/exec" - "path/filepath" - "regexp" - "strings" - "time" - - "github.com/containers/common/libnetwork/types" - "github.com/fsnotify/fsnotify" - "github.com/sirupsen/logrus" -) - -const ( - UnknownPackage = "Unknown" -) - -var ErrInterrupt = errors.New("interrupted") - -// Note: This function is copied from containers/podman libpod/util.go -// Please see https://github.com/containers/common/pull/1460 -func queryPackageVersion(cmdArg ...string) string { - output := UnknownPackage - if 1 < len(cmdArg) { - cmd := exec.Command(cmdArg[0], cmdArg[1:]...) - if outp, err := cmd.Output(); err == nil { - output = string(outp) - deb := false - if cmdArg[0] == "/usr/bin/dlocate" { - // can return multiple matches - l := strings.Split(output, "\n") - output = l[0] - deb = true - } else if cmdArg[0] == "/usr/bin/dpkg" { - deb = true - } - if deb { - r := strings.Split(output, ": ") - queryFormat := `${Package}_${Version}_${Architecture}` - cmd = exec.Command("/usr/bin/dpkg-query", "-f", queryFormat, "-W", r[0]) - if outp, err := cmd.Output(); err == nil { - output = string(outp) - } - } - } - if cmdArg[0] == "/sbin/apk" { - prefix := cmdArg[len(cmdArg)-1] + " is owned by " - output = strings.Replace(output, prefix, "", 1) - } - } - return strings.Trim(output, "\n") -} - -// Note: This function is copied from containers/podman libpod/util.go -// Please see https://github.com/containers/common/pull/1460 -func PackageVersion(program string) string { // program is full path - _, err := os.Stat(program) - if err != nil { - return UnknownPackage - } - packagers := [][]string{ - {"/usr/bin/rpm", "-q", "-f"}, - {"/usr/bin/dlocate", "-F"}, // Debian, Ubuntu (quick) - {"/usr/bin/dpkg", "-S"}, // Debian, Ubuntu (slow) - {"/usr/bin/pacman", "-Qo"}, // Arch - {"/usr/bin/qfile", "-qv"}, // Gentoo (quick) - {"/usr/bin/equery", "b"}, // Gentoo (slow) - {"/sbin/apk", "info", "-W"}, // Alpine - {"/usr/local/sbin/pkg", "which", "-q"}, // FreeBSD - } - - for _, cmd := range packagers { - cmd = append(cmd, program) - if out := queryPackageVersion(cmd...); out != UnknownPackage { - return out - } - } - return UnknownPackage -} - -// Note: This function is copied from containers/podman libpod/util.go -// Please see https://github.com/containers/common/pull/1460 -func ProgramVersion(program string) (string, error) { - return programVersion(program, false) -} - -func ProgramVersionDnsname(program string) (string, error) { - return programVersion(program, true) -} - -func programVersion(program string, dnsname bool) (string, error) { - cmd := exec.Command(program, "--version") - var stdout bytes.Buffer - var stderr bytes.Buffer - cmd.Stdout = &stdout - cmd.Stderr = &stderr - - err := cmd.Run() - if err != nil { - return "", fmt.Errorf("`%v --version` failed: %v %v (%v)", program, stderr.String(), stdout.String(), err) - } - - output := strings.TrimSuffix(stdout.String(), "\n") - // dnsname --version returns the information to stderr - if dnsname { - output = strings.TrimSuffix(stderr.String(), "\n") - } - - return output, nil -} - -// StringInSlice determines if a string is in a string slice, returns bool -func StringInSlice(s string, sl []string) bool { - for _, i := range sl { - if i == s { - return true - } - } - return false -} - -// StringMatchRegexSlice determines if a given string matches one of the given regexes, returns bool -func StringMatchRegexSlice(s string, re []string) bool { - for _, r := range re { - m, err := regexp.MatchString(r, s) - if err == nil && m { - return true - } - } - return false -} - -// FilterID is a function used to compare an id against a set of ids, if the -// input is hex we check if the prefix matches. Otherwise we assume it is a -// regex and try to match that. -// see https://github.com/containers/podman/issues/18471 for why we do this -func FilterID(id string, filters []string) bool { - for _, want := range filters { - isRegex := types.NotHexRegex.MatchString(want) - if isRegex { - match, err := regexp.MatchString(want, id) - if err == nil && match { - return true - } - } else if strings.HasPrefix(id, strings.ToLower(want)) { - return true - } - } - return false -} - -// WaitForFile waits until a file has been created or the given timeout has occurred -func WaitForFile(path string, chWait chan error, timeout time.Duration) (bool, error) { - var inotifyEvents chan fsnotify.Event - watcher, err := fsnotify.NewWatcher() - if err == nil { - if err := watcher.Add(filepath.Dir(path)); err == nil { - inotifyEvents = watcher.Events - } - defer func() { - if err := watcher.Close(); err != nil { - logrus.Errorf("Failed to close fsnotify watcher: %v", err) - } - }() - } - - var timeoutChan <-chan time.Time - - if timeout != 0 { - timeoutChan = time.After(timeout) - } - - for { - select { - case e := <-chWait: - return true, e - case <-inotifyEvents: - _, err := os.Stat(path) - if err == nil { - return false, nil - } - if !os.IsNotExist(err) { - return false, err - } - case <-time.After(25 * time.Millisecond): - // Check periodically for the file existence. It is needed - // if the inotify watcher could not have been created. It is - // also useful when using inotify as if for any reasons we missed - // a notification, we won't hang the process. - _, err := os.Stat(path) - if err == nil { - return false, nil - } - if !os.IsNotExist(err) { - return false, err - } - case <-timeoutChan: - return false, fmt.Errorf("timed out waiting for file %s", path) - } - } -} diff --git a/vendor/github.com/containers/common/pkg/util/util_supported.go b/vendor/github.com/containers/common/pkg/util/util_supported.go deleted file mode 100644 index aa659c17e9..0000000000 --- a/vendor/github.com/containers/common/pkg/util/util_supported.go +++ /dev/null @@ -1,135 +0,0 @@ -//go:build linux || darwin || freebsd -// +build linux darwin freebsd - -package util - -import ( - "errors" - "fmt" - "os" - "os/signal" - "path/filepath" - "sync" - "syscall" - - "github.com/containers/storage/pkg/homedir" - "github.com/containers/storage/pkg/unshare" - "github.com/sirupsen/logrus" - terminal "golang.org/x/term" -) - -var ( - rootlessRuntimeDirOnce sync.Once - rootlessRuntimeDir string -) - -// isWriteableOnlyByOwner checks that the specified permission mask allows write -// access only to the owner. -func isWriteableOnlyByOwner(perm os.FileMode) bool { - return (perm & 0o722) == 0o700 -} - -// GetRuntimeDir returns the runtime directory -func GetRuntimeDir() (string, error) { - var rootlessRuntimeDirError error - - rootlessRuntimeDirOnce.Do(func() { - runtimeDir, err := homedir.GetRuntimeDir() - if err != nil { - logrus.Debug(err) - } - if runtimeDir != "" { - st, err := os.Stat(runtimeDir) - if err != nil { - rootlessRuntimeDirError = err - return - } - if int(st.Sys().(*syscall.Stat_t).Uid) != os.Geteuid() { - rootlessRuntimeDirError = fmt.Errorf("XDG_RUNTIME_DIR directory %q is not owned by the current user", runtimeDir) - return - } - } - uid := fmt.Sprintf("%d", unshare.GetRootlessUID()) - if runtimeDir == "" { - tmpDir := filepath.Join("/run", "user", uid) - if err := os.MkdirAll(tmpDir, 0o700); err != nil { - logrus.Debugf("unable to make temp dir: %v", err) - } - st, err := os.Stat(tmpDir) - if err == nil && int(st.Sys().(*syscall.Stat_t).Uid) == os.Geteuid() && isWriteableOnlyByOwner(st.Mode().Perm()) { - runtimeDir = tmpDir - } - } - if runtimeDir == "" { - tmpDir := filepath.Join(os.TempDir(), fmt.Sprintf("podman-run-%s", uid)) - if err := os.MkdirAll(tmpDir, 0o700); err != nil { - logrus.Debugf("unable to make temp dir %v", err) - } - st, err := os.Stat(tmpDir) - if err == nil && int(st.Sys().(*syscall.Stat_t).Uid) == os.Geteuid() && isWriteableOnlyByOwner(st.Mode().Perm()) { - runtimeDir = tmpDir - } - } - if runtimeDir == "" { - home := os.Getenv("HOME") - if home == "" { - rootlessRuntimeDirError = errors.New("neither XDG_RUNTIME_DIR nor HOME was set non-empty") - return - } - resolvedHome, err := filepath.EvalSymlinks(home) - if err != nil { - rootlessRuntimeDirError = fmt.Errorf("cannot resolve home: %w", err) - return - } - runtimeDir = filepath.Join(resolvedHome, "rundir") - } - rootlessRuntimeDir = runtimeDir - }) - - if rootlessRuntimeDirError != nil { - return "", rootlessRuntimeDirError - } - return rootlessRuntimeDir, nil -} - -// ReadPassword reads a password from the terminal without echo. -func ReadPassword(fd int) ([]byte, error) { - // Store and restore the terminal status on interruptions to - // avoid that the terminal remains in the password state - // This is necessary as for https://github.com/golang/go/issues/31180 - - oldState, err := terminal.GetState(fd) - if err != nil { - return make([]byte, 0), err - } - - type Buffer struct { - Buffer []byte - Error error - } - errorChannel := make(chan Buffer, 1) - - // SIGINT and SIGTERM restore the terminal, otherwise the no-echo mode would remain intact - interruptChannel := make(chan os.Signal, 1) - signal.Notify(interruptChannel, syscall.SIGINT, syscall.SIGTERM) - defer func() { - signal.Stop(interruptChannel) - close(interruptChannel) - }() - go func() { - for range interruptChannel { - if oldState != nil { - _ = terminal.Restore(fd, oldState) - } - errorChannel <- Buffer{Buffer: make([]byte, 0), Error: ErrInterrupt} - } - }() - - go func() { - buf, err := terminal.ReadPassword(fd) - errorChannel <- Buffer{Buffer: buf, Error: err} - }() - - buf := <-errorChannel - return buf.Buffer, buf.Error -} diff --git a/vendor/github.com/containers/image/v5/docker/distribution_error.go b/vendor/github.com/containers/image/v5/docker/distribution_error.go index 0fe915249b..11b42c6e00 100644 --- a/vendor/github.com/containers/image/v5/docker/distribution_error.go +++ b/vendor/github.com/containers/image/v5/docker/distribution_error.go @@ -24,6 +24,7 @@ import ( "github.com/docker/distribution/registry/api/errcode" dockerChallenge "github.com/docker/distribution/registry/client/auth/challenge" + "golang.org/x/exp/slices" ) // errNoErrorsInBody is returned when an HTTP response body parses to an empty @@ -105,7 +106,7 @@ func makeErrorList(err error) []error { } func mergeErrors(err1, err2 error) error { - return errcode.Errors(append(makeErrorList(err1), makeErrorList(err2)...)) + return errcode.Errors(append(slices.Clone(makeErrorList(err1)), makeErrorList(err2)...)) } // handleErrorResponse returns error parsed from HTTP response for an diff --git a/vendor/github.com/containers/image/v5/docker/docker_client.go b/vendor/github.com/containers/image/v5/docker/docker_client.go index 288dd1a93f..6ce8f70083 100644 --- a/vendor/github.com/containers/image/v5/docker/docker_client.go +++ b/vendor/github.com/containers/image/v5/docker/docker_client.go @@ -363,6 +363,11 @@ func SearchRegistry(ctx context.Context, sys *types.SystemContext, registry, ima hostname := registry if registry == dockerHostname { hostname = dockerV1Hostname + // A search term of library/foo does not find the library/foo image on the docker.io servers, + // which is surprising - and that Docker is modifying the search term client-side this same way, + // and it seems convenient to do the same thing. + // Read more here: https://github.com/containers/image/pull/2133#issue-1928524334 + image = strings.TrimPrefix(image, "library/") } client, err := newDockerClient(sys, hostname, registry) diff --git a/vendor/github.com/containers/image/v5/docker/docker_image_dest.go b/vendor/github.com/containers/image/v5/docker/docker_image_dest.go index 0e7b154cc6..774068c276 100644 --- a/vendor/github.com/containers/image/v5/docker/docker_image_dest.go +++ b/vendor/github.com/containers/image/v5/docker/docker_image_dest.go @@ -137,7 +137,7 @@ func (d *dockerImageDestination) PutBlobWithOptions(ctx context.Context, stream // If requested, precompute the blob digest to prevent uploading layers that already exist on the registry. // This functionality is particularly useful when BlobInfoCache has not been populated with compressed digests, // the source blob is uncompressed, and the destination blob is being compressed "on the fly". - if inputInfo.Digest == "" && d.c.sys.DockerRegistryPushPrecomputeDigests { + if inputInfo.Digest == "" && d.c.sys != nil && d.c.sys.DockerRegistryPushPrecomputeDigests { logrus.Debugf("Precomputing digest layer for %s", reference.Path(d.ref.ref)) streamCopy, cleanup, err := streamdigest.ComputeBlobInfo(d.c.sys, stream, &inputInfo) if err != nil { @@ -341,39 +341,58 @@ func (d *dockerImageDestination) TryReusingBlobWithOptions(ctx context.Context, // Then try reusing blobs from other locations. candidates := options.Cache.CandidateLocations2(d.ref.Transport(), bicTransportScope(d.ref), info.Digest, options.CanSubstitute) for _, candidate := range candidates { - candidateRepo, err := parseBICLocationReference(candidate.Location) - if err != nil { - logrus.Debugf("Error parsing BlobInfoCache location reference: %s", err) - continue - } + var err error compressionOperation, compressionAlgorithm, err := blobinfocache.OperationAndAlgorithmForCompressor(candidate.CompressorName) if err != nil { logrus.Debugf("OperationAndAlgorithmForCompressor Failed: %v", err) continue } + var candidateRepo reference.Named + if !candidate.UnknownLocation { + candidateRepo, err = parseBICLocationReference(candidate.Location) + if err != nil { + logrus.Debugf("Error parsing BlobInfoCache location reference: %s", err) + continue + } + } if !impl.BlobMatchesRequiredCompression(options, compressionAlgorithm) { requiredCompression := "nil" if compressionAlgorithm != nil { requiredCompression = compressionAlgorithm.Name() } - logrus.Debugf("Ignoring candidate blob %s as reuse candidate due to compression mismatch ( %s vs %s ) in %s", candidate.Digest.String(), options.RequiredCompression.Name(), requiredCompression, candidateRepo.Name()) + if !candidate.UnknownLocation { + logrus.Debugf("Ignoring candidate blob %s as reuse candidate due to compression mismatch ( %s vs %s ) in %s", candidate.Digest.String(), options.RequiredCompression.Name(), requiredCompression, candidateRepo.Name()) + } else { + logrus.Debugf("Ignoring candidate blob %s as reuse candidate due to compression mismatch ( %s vs %s ) with no location match, checking current repo", candidate.Digest.String(), options.RequiredCompression.Name(), requiredCompression) + } continue } - if candidate.CompressorName != blobinfocache.Uncompressed { - logrus.Debugf("Trying to reuse cached location %s compressed with %s in %s", candidate.Digest.String(), candidate.CompressorName, candidateRepo.Name()) + if !candidate.UnknownLocation { + if candidate.CompressorName != blobinfocache.Uncompressed { + logrus.Debugf("Trying to reuse blob with cached digest %s compressed with %s in destination repo %s", candidate.Digest.String(), candidate.CompressorName, candidateRepo.Name()) + } else { + logrus.Debugf("Trying to reuse blob with cached digest %s in destination repo %s", candidate.Digest.String(), candidateRepo.Name()) + } + // Sanity checks: + if reference.Domain(candidateRepo) != reference.Domain(d.ref.ref) { + // OCI distribution spec 1.1 allows mounting blobs without specifying the source repo + // (the "from" parameter); in that case we might try to use these candidates as well. + // + // OTOH that would mean we can’t do the “blobExists” check, and if there is no match + // we could get an upload request that we would have to cancel. + logrus.Debugf("... Internal error: domain %s does not match destination %s", reference.Domain(candidateRepo), reference.Domain(d.ref.ref)) + continue + } } else { - logrus.Debugf("Trying to reuse cached location %s with no compression in %s", candidate.Digest.String(), candidateRepo.Name()) - } - - // Sanity checks: - if reference.Domain(candidateRepo) != reference.Domain(d.ref.ref) { - // OCI distribution spec 1.1 allows mounting blobs without specifying the source repo - // (the "from" parameter); in that case we might try to use these candidates as well. - // - // OTOH that would mean we can’t do the “blobExists” check, and if there is no match - // we could get an upload request that we would have to cancel. - logrus.Debugf("... Internal error: domain %s does not match destination %s", reference.Domain(candidateRepo), reference.Domain(d.ref.ref)) - continue + if candidate.CompressorName != blobinfocache.Uncompressed { + logrus.Debugf("Trying to reuse blob with cached digest %s compressed with %s with no location match, checking current repo", candidate.Digest.String(), candidate.CompressorName) + } else { + logrus.Debugf("Trying to reuse blob with cached digest %s in destination repo with no location match, checking current repo", candidate.Digest.String()) + } + // This digest is a known variant of this blob but we don’t + // have a recorded location in this registry, let’s try looking + // for it in the current repo. + candidateRepo = reference.TrimNamed(d.ref.ref) } if candidateRepo.Name() == d.ref.ref.Name() && candidate.Digest == info.Digest { logrus.Debug("... Already tried the primary destination") @@ -688,6 +707,10 @@ func (d *dockerImageDestination) putSignaturesToSigstoreAttachments(ctx context. } } + // To make sure we can safely append to the slices of ociManifest, without adding a remote dependency on the code that creates it. + ociManifest.Layers = slices.Clone(ociManifest.Layers) + // We don’t need to ^^^ for ociConfig.RootFS.DiffIDs because we have created it empty ourselves, and json.Unmarshal is documented to append() to + // the slice in the original object (or in a newly allocated object). for _, sig := range signatures { mimeType := sig.UntrustedMIMEType() payloadBlob := sig.UntrustedPayload() diff --git a/vendor/github.com/containers/image/v5/docker/errors.go b/vendor/github.com/containers/image/v5/docker/errors.go index e039691890..4392f9d182 100644 --- a/vendor/github.com/containers/image/v5/docker/errors.go +++ b/vendor/github.com/containers/image/v5/docker/errors.go @@ -88,7 +88,7 @@ func registryHTTPResponseToError(res *http.Response) error { response = response[:50] + "..." } // %.0w makes e visible to error.Unwrap() without including any text - err = fmt.Errorf("StatusCode: %d, %s%.0w", e.StatusCode, response, e) + err = fmt.Errorf("StatusCode: %d, %q%.0w", e.StatusCode, response, e) case errcode.Error: // e.Error() is fmt.Sprintf("%s: %s", e.Code.Error(), e.Message, which is usually // rather redundant. So reword it without using e.Code.Error() if e.Message is the default. diff --git a/vendor/github.com/containers/image/v5/internal/blobinfocache/types.go b/vendor/github.com/containers/image/v5/internal/blobinfocache/types.go index fdd245812b..429d682635 100644 --- a/vendor/github.com/containers/image/v5/internal/blobinfocache/types.go +++ b/vendor/github.com/containers/image/v5/internal/blobinfocache/types.go @@ -32,7 +32,7 @@ type BlobInfoCache2 interface { // otherwise the cache could be poisoned and cause us to make incorrect edits to type // information in a manifest. RecordDigestCompressorName(anyDigest digest.Digest, compressorName string) - // CandidateLocations2 returns a prioritized, limited, number of blobs and their locations + // CandidateLocations2 returns a prioritized, limited, number of blobs and their locations (if known) // that could possibly be reused within the specified (transport scope) (if they still // exist, which is not guaranteed). // @@ -46,7 +46,8 @@ type BlobInfoCache2 interface { // BICReplacementCandidate2 is an item returned by BlobInfoCache2.CandidateLocations2. type BICReplacementCandidate2 struct { - Digest digest.Digest - CompressorName string // either the Name() of a known pkg/compression.Algorithm, or Uncompressed or UnknownCompression - Location types.BICLocationReference + Digest digest.Digest + CompressorName string // either the Name() of a known pkg/compression.Algorithm, or Uncompressed or UnknownCompression + UnknownLocation bool // is true when `Location` for this blob is not set + Location types.BICLocationReference // not set if UnknownLocation is set to `true` } diff --git a/vendor/github.com/containers/image/v5/internal/image/oci.go b/vendor/github.com/containers/image/v5/internal/image/oci.go index 6629967be9..df0e8e4171 100644 --- a/vendor/github.com/containers/image/v5/internal/image/oci.go +++ b/vendor/github.com/containers/image/v5/internal/image/oci.go @@ -196,14 +196,12 @@ func (m *manifestOCI1) convertToManifestSchema2Generic(ctx context.Context, opti return m.convertToManifestSchema2(ctx, options) } -// prepareLayerDecryptEditsIfNecessary checks if options requires layer decryptions. +// layerEditsOfOCIOnlyFeatures checks if options requires some layer edits to be done before converting to a Docker format. // If not, it returns (nil, nil). // If decryption is required, it returns a set of edits to provide to OCI1.UpdateLayerInfos, // and edits *options to not try decryption again. -func (m *manifestOCI1) prepareLayerDecryptEditsIfNecessary(options *types.ManifestUpdateOptions) ([]types.BlobInfo, error) { - if options == nil || !slices.ContainsFunc(options.LayerInfos, func(info types.BlobInfo) bool { - return info.CryptoOperation == types.Decrypt - }) { +func (m *manifestOCI1) layerEditsOfOCIOnlyFeatures(options *types.ManifestUpdateOptions) ([]types.BlobInfo, error) { + if options == nil || options.LayerInfos == nil { return nil, nil } @@ -212,19 +210,35 @@ func (m *manifestOCI1) prepareLayerDecryptEditsIfNecessary(options *types.Manife return nil, fmt.Errorf("preparing to decrypt before conversion: %d layers vs. %d layer edits", len(originalInfos), len(options.LayerInfos)) } - res := slices.Clone(originalInfos) // Start with a full copy so that we don't forget to copy anything: use the current data in full unless we intentionaly deviate. - updatedEdits := slices.Clone(options.LayerInfos) - for i, info := range options.LayerInfos { - if info.CryptoOperation == types.Decrypt { - res[i].CryptoOperation = types.Decrypt - updatedEdits[i].CryptoOperation = types.PreserveOriginalCrypto // Don't try to decrypt in a schema[12] manifest later, that would fail. + ociOnlyEdits := slices.Clone(originalInfos) // Start with a full copy so that we don't forget to copy anything: use the current data in full unless we intentionally deviate. + laterEdits := slices.Clone(options.LayerInfos) + needsOCIOnlyEdits := false + for i, edit := range options.LayerInfos { + // Unless determined otherwise, don't do any compression-related MIME type conversions. m.LayerInfos() should not set these edit instructions, but be explicit. + ociOnlyEdits[i].CompressionOperation = types.PreserveOriginal + ociOnlyEdits[i].CompressionAlgorithm = nil + + if edit.CryptoOperation == types.Decrypt { + needsOCIOnlyEdits = true // Encrypted types must be removed before conversion because they can’t be represented in Docker schemas + ociOnlyEdits[i].CryptoOperation = types.Decrypt + laterEdits[i].CryptoOperation = types.PreserveOriginalCrypto // Don't try to decrypt in a schema[12] manifest later, that would fail. + } + + if originalInfos[i].MediaType == imgspecv1.MediaTypeImageLayerZstd || + originalInfos[i].MediaType == imgspecv1.MediaTypeImageLayerNonDistributableZstd { //nolint:staticcheck // NonDistributable layers are deprecated, but we want to continue to support manipulating pre-existing images. + needsOCIOnlyEdits = true // Zstd MIME types must be removed before conversion because they can’t be represented in Docker schemas. + ociOnlyEdits[i].CompressionOperation = edit.CompressionOperation + ociOnlyEdits[i].CompressionAlgorithm = edit.CompressionAlgorithm + laterEdits[i].CompressionOperation = types.PreserveOriginal + laterEdits[i].CompressionAlgorithm = nil } - // Don't do any compression-related MIME type conversions. m.LayerInfos() should not set these edit instructions, but be explicit. - res[i].CompressionOperation = types.PreserveOriginal - res[i].CompressionAlgorithm = nil } - options.LayerInfos = updatedEdits - return res, nil + if !needsOCIOnlyEdits { + return nil, nil + } + + options.LayerInfos = laterEdits + return ociOnlyEdits, nil } // convertToManifestSchema2 returns a genericManifest implementation converted to manifest.DockerV2Schema2MediaType. @@ -238,15 +252,15 @@ func (m *manifestOCI1) convertToManifestSchema2(_ context.Context, options *type // Mostly we first make a format conversion, and _afterwards_ do layer edits. But first we need to do the layer edits // which remove OCI-specific features, because trying to convert those layers would fail. - // So, do the layer updates for decryption. + // So, do the layer updates for decryption, and for conversions from Zstd. ociManifest := m.m - layerDecryptEdits, err := m.prepareLayerDecryptEditsIfNecessary(options) + ociOnlyEdits, err := m.layerEditsOfOCIOnlyFeatures(options) if err != nil { return nil, err } - if layerDecryptEdits != nil { + if ociOnlyEdits != nil { ociManifest = manifest.OCI1Clone(ociManifest) - if err := ociManifest.UpdateLayerInfos(layerDecryptEdits); err != nil { + if err := ociManifest.UpdateLayerInfos(ociOnlyEdits); err != nil { return nil, err } } @@ -275,9 +289,8 @@ func (m *manifestOCI1) convertToManifestSchema2(_ context.Context, options *type layers[idx].MediaType = manifest.DockerV2Schema2LayerMediaType case imgspecv1.MediaTypeImageLayerZstd: return nil, fmt.Errorf("Error during manifest conversion: %q: zstd compression is not supported for docker images", layers[idx].MediaType) - // FIXME: s/Zsdt/Zstd/ after ocicrypt with https://github.com/containers/ocicrypt/pull/91 is released case ociencspec.MediaTypeLayerEnc, ociencspec.MediaTypeLayerGzipEnc, ociencspec.MediaTypeLayerZstdEnc, - ociencspec.MediaTypeLayerNonDistributableEnc, ociencspec.MediaTypeLayerNonDistributableGzipEnc, ociencspec.MediaTypeLayerNonDistributableZsdtEnc: + ociencspec.MediaTypeLayerNonDistributableEnc, ociencspec.MediaTypeLayerNonDistributableGzipEnc, ociencspec.MediaTypeLayerNonDistributableZstdEnc: return nil, fmt.Errorf("during manifest conversion: encrypted layers (%q) are not supported in docker images", layers[idx].MediaType) default: return nil, fmt.Errorf("Unknown media type during manifest conversion: %q", layers[idx].MediaType) diff --git a/vendor/github.com/containers/image/v5/internal/imagedestination/impl/helpers.go b/vendor/github.com/containers/image/v5/internal/imagedestination/impl/helpers.go index d5de81a613..5d28b3e73a 100644 --- a/vendor/github.com/containers/image/v5/internal/imagedestination/impl/helpers.go +++ b/vendor/github.com/containers/image/v5/internal/imagedestination/impl/helpers.go @@ -12,6 +12,11 @@ func BlobMatchesRequiredCompression(options private.TryReusingBlobOptions, candi if options.RequiredCompression == nil { return true // no requirement imposed } + if options.RequiredCompression.Name() == compression.ZstdChunkedAlgorithmName { + // HACK: Never match when the caller asks for zstd:chunked, because we don’t record the annotations required to use the chunked blobs. + // The caller must re-compress to build those annotations. + return false + } return candidateCompression != nil && (options.RequiredCompression.Name() == candidateCompression.Name()) } diff --git a/vendor/github.com/containers/image/v5/internal/manifest/docker_schema2_list.go b/vendor/github.com/containers/image/v5/internal/manifest/docker_schema2_list.go index 357e2f3d3e..7ce5bb0696 100644 --- a/vendor/github.com/containers/image/v5/internal/manifest/docker_schema2_list.go +++ b/vendor/github.com/containers/image/v5/internal/manifest/docker_schema2_list.go @@ -133,7 +133,9 @@ func (index *Schema2ListPublic) editInstances(editInstances []ListEdit) error { } } if len(addedEntries) != 0 { - index.Manifests = append(index.Manifests, addedEntries...) + // slices.Clone() here to ensure a private backing array; + // an external caller could have manually created Schema2ListPublic with a slice with extra capacity. + index.Manifests = append(slices.Clone(index.Manifests), addedEntries...) } return nil } diff --git a/vendor/github.com/containers/image/v5/internal/manifest/oci_index.go b/vendor/github.com/containers/image/v5/internal/manifest/oci_index.go index dcd2646d13..d8d06513b5 100644 --- a/vendor/github.com/containers/image/v5/internal/manifest/oci_index.go +++ b/vendor/github.com/containers/image/v5/internal/manifest/oci_index.go @@ -167,7 +167,9 @@ func (index *OCI1IndexPublic) editInstances(editInstances []ListEdit) error { } } if len(addedEntries) != 0 { - index.Manifests = append(index.Manifests, addedEntries...) + // slices.Clone() here to ensure the slice uses a private backing array; + // an external caller could have manually created OCI1IndexPublic with a slice with extra capacity. + index.Manifests = append(slices.Clone(index.Manifests), addedEntries...) } if len(addedEntries) != 0 || updatedAnnotations { slices.SortStableFunc(index.Manifests, func(a, b imgspecv1.Descriptor) int { @@ -220,7 +222,7 @@ func (ic instanceCandidate) isPreferredOver(other *instanceCandidate, preferGzip case ic.manifestPosition != other.manifestPosition: return ic.manifestPosition < other.manifestPosition } - panic("internal error: invalid comparision between two candidates") // This should not be reachable because in all calls we make, the two candidates differ at least in manifestPosition. + panic("internal error: invalid comparison between two candidates") // This should not be reachable because in all calls we make, the two candidates differ at least in manifestPosition. } // chooseInstance is a private equivalent to ChooseInstanceByCompression, diff --git a/vendor/github.com/containers/image/v5/pkg/docker/config/config.go b/vendor/github.com/containers/image/v5/pkg/docker/config/config.go index b987c58060..c61065cb01 100644 --- a/vendor/github.com/containers/image/v5/pkg/docker/config/config.go +++ b/vendor/github.com/containers/image/v5/pkg/docker/config/config.go @@ -5,6 +5,7 @@ import ( "encoding/json" "errors" "fmt" + "io/fs" "os" "os/exec" "path/filepath" @@ -61,78 +62,6 @@ func newAuthPathDefault(path string) authPath { return authPath{path: path, legacyFormat: false} } -// SetCredentials stores the username and password in a location -// appropriate for sys and the users’ configuration. -// A valid key is a repository, a namespace within a registry, or a registry hostname; -// using forms other than just a registry may fail depending on configuration. -// Returns a human-readable description of the location that was updated. -// NOTE: The return value is only intended to be read by humans; its form is not an API, -// it may change (or new forms can be added) any time. -func SetCredentials(sys *types.SystemContext, key, username, password string) (string, error) { - isNamespaced, err := validateKey(key) - if err != nil { - return "", err - } - - helpers, err := sysregistriesv2.CredentialHelpers(sys) - if err != nil { - return "", err - } - - // Make sure to collect all errors. - var multiErr error - for _, helper := range helpers { - var desc string - var err error - switch helper { - // Special-case the built-in helpers for auth files. - case sysregistriesv2.AuthenticationFileHelper: - desc, err = modifyJSON(sys, func(fileContents *dockerConfigFile) (bool, string, error) { - if ch, exists := fileContents.CredHelpers[key]; exists { - if isNamespaced { - return false, "", unsupportedNamespaceErr(ch) - } - desc, err := setCredsInCredHelper(ch, key, username, password) - if err != nil { - return false, "", err - } - return false, desc, nil - } - creds := base64.StdEncoding.EncodeToString([]byte(username + ":" + password)) - newCreds := dockerAuthConfig{Auth: creds} - fileContents.AuthConfigs[key] = newCreds - return true, "", nil - }) - // External helpers. - default: - if isNamespaced { - err = unsupportedNamespaceErr(helper) - } else { - desc, err = setCredsInCredHelper(helper, key, username, password) - } - } - if err != nil { - multiErr = multierror.Append(multiErr, err) - logrus.Debugf("Error storing credentials for %s in credential helper %s: %v", key, helper, err) - continue - } - logrus.Debugf("Stored credentials for %s in credential helper %s", key, helper) - return desc, nil - } - return "", multiErr -} - -func unsupportedNamespaceErr(helper string) error { - return fmt.Errorf("namespaced key is not supported for credential helper %s", helper) -} - -// SetAuthentication stores the username and password in the credential helper or file -// See the documentation of SetCredentials for format of "key" -func SetAuthentication(sys *types.SystemContext, key, username, password string) error { - _, err := SetCredentials(sys, key, username, password) - return err -} - // GetAllCredentials returns the registry credentials for all registries stored // in any of the configured credential helpers. func GetAllCredentials(sys *types.SystemContext) (map[string]types.DockerAuthConfig, error) { @@ -370,17 +299,79 @@ func getAuthenticationWithHomeDir(sys *types.SystemContext, key, homeDir string) return creds.Username, creds.Password, nil } -// RemoveAuthentication removes credentials for `key` from all possible -// sources such as credential helpers and auth files. +// SetCredentials stores the username and password in a location +// appropriate for sys and the users’ configuration. // A valid key is a repository, a namespace within a registry, or a registry hostname; // using forms other than just a registry may fail depending on configuration. -func RemoveAuthentication(sys *types.SystemContext, key string) error { - isNamespaced, err := validateKey(key) +// Returns a human-readable description of the location that was updated. +// NOTE: The return value is only intended to be read by humans; its form is not an API, +// it may change (or new forms can be added) any time. +func SetCredentials(sys *types.SystemContext, key, username, password string) (string, error) { + helpers, jsonEditor, key, isNamespaced, err := prepareForEdit(sys, key, true) if err != nil { - return err + return "", err } - helpers, err := sysregistriesv2.CredentialHelpers(sys) + // Make sure to collect all errors. + var multiErr error + for _, helper := range helpers { + var desc string + var err error + switch helper { + // Special-case the built-in helpers for auth files. + case sysregistriesv2.AuthenticationFileHelper: + desc, err = jsonEditor(sys, func(fileContents *dockerConfigFile) (bool, string, error) { + if ch, exists := fileContents.CredHelpers[key]; exists { + if isNamespaced { + return false, "", unsupportedNamespaceErr(ch) + } + desc, err := setCredsInCredHelper(ch, key, username, password) + if err != nil { + return false, "", err + } + return false, desc, nil + } + creds := base64.StdEncoding.EncodeToString([]byte(username + ":" + password)) + newCreds := dockerAuthConfig{Auth: creds} + fileContents.AuthConfigs[key] = newCreds + return true, "", nil + }) + // External helpers. + default: + if isNamespaced { + err = unsupportedNamespaceErr(helper) + } else { + desc, err = setCredsInCredHelper(helper, key, username, password) + } + } + if err != nil { + multiErr = multierror.Append(multiErr, err) + logrus.Debugf("Error storing credentials for %s in credential helper %s: %v", key, helper, err) + continue + } + logrus.Debugf("Stored credentials for %s in credential helper %s", key, helper) + return desc, nil + } + return "", multiErr +} + +func unsupportedNamespaceErr(helper string) error { + return fmt.Errorf("namespaced key is not supported for credential helper %s", helper) +} + +// SetAuthentication stores the username and password in the credential helper or file +// See the documentation of SetCredentials for format of "key" +func SetAuthentication(sys *types.SystemContext, key, username, password string) error { + _, err := SetCredentials(sys, key, username, password) + return err +} + +// RemoveAuthentication removes credentials for `key` from all possible +// sources such as credential helpers and auth files. +// A valid key is a repository, a namespace within a registry, or a registry hostname; +// using forms other than just a registry may fail depending on configuration. +func RemoveAuthentication(sys *types.SystemContext, key string) error { + helpers, jsonEditor, key, isNamespaced, err := prepareForEdit(sys, key, true) if err != nil { return err } @@ -411,7 +402,7 @@ func RemoveAuthentication(sys *types.SystemContext, key string) error { switch helper { // Special-case the built-in helper for auth files. case sysregistriesv2.AuthenticationFileHelper: - _, err = modifyJSON(sys, func(fileContents *dockerConfigFile) (bool, string, error) { + _, err = jsonEditor(sys, func(fileContents *dockerConfigFile) (bool, string, error) { if innerHelper, exists := fileContents.CredHelpers[key]; exists { removeFromCredHelper(innerHelper) } @@ -443,7 +434,7 @@ func RemoveAuthentication(sys *types.SystemContext, key string) error { // RemoveAllAuthentication deletes all the credentials stored in credential // helpers and auth files. func RemoveAllAuthentication(sys *types.SystemContext) error { - helpers, err := sysregistriesv2.CredentialHelpers(sys) + helpers, jsonEditor, _, _, err := prepareForEdit(sys, "", false) if err != nil { return err } @@ -454,7 +445,7 @@ func RemoveAllAuthentication(sys *types.SystemContext) error { switch helper { // Special-case the built-in helper for auth files. case sysregistriesv2.AuthenticationFileHelper: - _, err = modifyJSON(sys, func(fileContents *dockerConfigFile) (bool, string, error) { + _, err = jsonEditor(sys, func(fileContents *dockerConfigFile) (bool, string, error) { for registry, helper := range fileContents.CredHelpers { // Helpers in auth files are expected // to exist, so no special treatment @@ -497,6 +488,46 @@ func RemoveAllAuthentication(sys *types.SystemContext) error { return multiErr } +// prepareForEdit processes sys and key (if keyRelevant) to return: +// - a list of credential helpers +// - a function which can be used to edit the JSON file +// - the key value to actually use in credential helpers / JSON +// - a boolean which is true if key is namespaced (and should not be used with credential helpers). +func prepareForEdit(sys *types.SystemContext, key string, keyRelevant bool) ([]string, func(*types.SystemContext, func(*dockerConfigFile) (bool, string, error)) (string, error), string, bool, error) { + var isNamespaced bool + if keyRelevant { + ns, err := validateKey(key) + if err != nil { + return nil, nil, "", false, err + } + isNamespaced = ns + } + + if sys != nil && sys.DockerCompatAuthFilePath != "" { + if sys.AuthFilePath != "" { + return nil, nil, "", false, errors.New("AuthFilePath and DockerCompatAuthFilePath can not be set simultaneously") + } + if keyRelevant { + if isNamespaced { + return nil, nil, "", false, fmt.Errorf("Credentials cannot be recorded in Docker-compatible format with namespaced key %q", key) + } + if key == "docker.io" { + key = "https://index.docker.io/v1/" + } + } + + // Do not use helpers defined in sysregistriesv2 because Docker isn’t aware of them. + return []string{sysregistriesv2.AuthenticationFileHelper}, modifyDockerConfigJSON, key, false, nil + } + + helpers, err := sysregistriesv2.CredentialHelpers(sys) + if err != nil { + return nil, nil, "", false, err + } + + return helpers, modifyJSON, key, isNamespaced, nil +} + func listCredsInCredHelper(credHelper string) (map[string]string, error) { helperName := fmt.Sprintf("docker-credential-%s", credHelper) p := helperclient.NewShellProgramFunc(helperName) @@ -513,9 +544,17 @@ func getPathToAuth(sys *types.SystemContext) (authPath, bool, error) { // it exists only to allow testing it with an artificial runtime.GOOS. func getPathToAuthWithOS(sys *types.SystemContext, goOS string) (authPath, bool, error) { if sys != nil { + if sys.AuthFilePath != "" && sys.DockerCompatAuthFilePath != "" { + return authPath{}, false, errors.New("AuthFilePath and DockerCompatAuthFilePath can not be set simultaneously") + } if sys.AuthFilePath != "" { return newAuthPathDefault(sys.AuthFilePath), true, nil } + // When reading, we can process auth.json and Docker’s config.json with the same code. + // When writing, prepareForEdit chooses an appropriate jsonEditor implementation. + if sys.DockerCompatAuthFilePath != "" { + return newAuthPathDefault(sys.DockerCompatAuthFilePath), true, nil + } if sys.LegacyFormatAuthFilePath != "" { return authPath{path: sys.LegacyFormatAuthFilePath, legacyFormat: true}, true, nil } @@ -626,6 +665,86 @@ func modifyJSON(sys *types.SystemContext, editor func(fileContents *dockerConfig return description, nil } +// modifyDockerConfigJSON finds a docker config.json file, calls editor on the contents, and +// writes it back if editor returns true. +// Returns a human-readable description of the file, to be returned by SetCredentials. +// +// The editor may also return a human-readable description of the updated location; if it is "", +// the file itself is used. +func modifyDockerConfigJSON(sys *types.SystemContext, editor func(fileContents *dockerConfigFile) (bool, string, error)) (string, error) { + if sys == nil || sys.DockerCompatAuthFilePath == "" { + return "", errors.New("internal error: modifyDockerConfigJSON called with DockerCompatAuthFilePath not set") + } + path := sys.DockerCompatAuthFilePath + + dir := filepath.Dir(path) + if err := os.MkdirAll(dir, 0700); err != nil { + return "", err + } + + // Try hard not to clobber fields we don’t understand, even fields which may be added in future Docker versions. + var rawContents map[string]json.RawMessage + originalBytes, err := os.ReadFile(path) + switch { + case err == nil: + if err := json.Unmarshal(originalBytes, &rawContents); err != nil { + return "", fmt.Errorf("unmarshaling JSON at %q: %w", path, err) + } + case errors.Is(err, fs.ErrNotExist): + rawContents = map[string]json.RawMessage{} + default: // err != nil + return "", err + } + + syntheticContents := dockerConfigFile{ + AuthConfigs: map[string]dockerAuthConfig{}, + CredHelpers: map[string]string{}, + } + // json.Unmarshal also falls back to case-insensitive field matching; this code does not do that. Presumably + // config.json is mostly maintained by machines doing `docker login`, so the files should, hopefully, not contain field names with + // unexpected case. + if rawAuths, ok := rawContents["auths"]; ok { + // This conversion will lose fields we don’t know about; when updating an entry, we can’t tell whether an unknown field + // should be preserved or discarded (because it is made obsolete/unwanted with the new credentials). + // It might make sense to track which entries of "auths" we actually modified, and to not touch any others. + if err := json.Unmarshal(rawAuths, &syntheticContents.AuthConfigs); err != nil { + return "", fmt.Errorf(`unmarshaling "auths" in JSON at %q: %w`, path, err) + } + } + if rawCH, ok := rawContents["credHelpers"]; ok { + if err := json.Unmarshal(rawCH, &syntheticContents.CredHelpers); err != nil { + return "", fmt.Errorf(`unmarshaling "credHelpers" in JSON at %q: %w`, path, err) + + } + } + + updated, description, err := editor(&syntheticContents) + if err != nil { + return "", fmt.Errorf("updating %q: %w", path, err) + } + if updated { + rawAuths, err := json.MarshalIndent(syntheticContents.AuthConfigs, "", "\t") + if err != nil { + return "", fmt.Errorf("marshaling JSON %q: %w", path, err) + } + rawContents["auths"] = rawAuths + // We never modify syntheticContents.CredHelpers, so we don’t need to update it. + newData, err := json.MarshalIndent(rawContents, "", "\t") + if err != nil { + return "", fmt.Errorf("marshaling JSON %q: %w", path, err) + } + + if err = ioutils.AtomicWriteFile(path, newData, 0600); err != nil { + return "", fmt.Errorf("writing to file %q: %w", path, err) + } + } + + if description == "" { + description = path + } + return description, nil +} + func getCredsFromCredHelper(credHelper, registry string) (types.DockerAuthConfig, error) { helperName := fmt.Sprintf("docker-credential-%s", credHelper) p := helperclient.NewShellProgramFunc(helperName) diff --git a/vendor/github.com/containers/image/v5/pkg/tlsclientconfig/tlsclientconfig.go b/vendor/github.com/containers/image/v5/pkg/tlsclientconfig/tlsclientconfig.go index 56b0d49390..c6ec84bd5a 100644 --- a/vendor/github.com/containers/image/v5/pkg/tlsclientconfig/tlsclientconfig.go +++ b/vendor/github.com/containers/image/v5/pkg/tlsclientconfig/tlsclientconfig.go @@ -66,7 +66,7 @@ func SetupCertificates(dir string, tlsc *tls.Config) error { if err != nil { return err } - tlsc.Certificates = append(tlsc.Certificates, cert) + tlsc.Certificates = append(slices.Clone(tlsc.Certificates), cert) } if strings.HasSuffix(f.Name(), ".key") { keyName := f.Name() diff --git a/vendor/github.com/containers/image/v5/types/types.go b/vendor/github.com/containers/image/v5/types/types.go index 33adb5f1df..180a98c5ba 100644 --- a/vendor/github.com/containers/image/v5/types/types.go +++ b/vendor/github.com/containers/image/v5/types/types.go @@ -445,7 +445,7 @@ type ImageCloser interface { Close() error } -// ManifestUpdateOptions is a way to pass named optional arguments to Image.UpdatedManifest +// ManifestUpdateOptions is a way to pass named optional arguments to Image.UpdatedImage type ManifestUpdateOptions struct { LayerInfos []BlobInfo // Complete BlobInfos (size+digest+urls+annotations) which should replace the originals, in order (the root layer first, and then successive layered layers). BlobInfos' MediaType fields are ignored. EmbeddedDockerReference reference.Named @@ -457,7 +457,7 @@ type ManifestUpdateOptions struct { // ManifestUpdateInformation is a component of ManifestUpdateOptions, named here // only to make writing struct literals possible. type ManifestUpdateInformation struct { - Destination ImageDestination // and yes, UpdatedManifest may write to Destination (see the schema2 → schema1 conversion logic in image/docker_schema2.go) + Destination ImageDestination // and yes, UpdatedImage may write to Destination (see the schema2 → schema1 conversion logic in image/docker_schema2.go) LayerInfos []BlobInfo // Complete BlobInfos (size+digest) which have been uploaded, in order (the root layer first, and then successive layered layers) LayerDiffIDs []digest.Digest // Digest values for the _uncompressed_ contents of the blobs which have been uploaded, in the same order. } @@ -594,6 +594,10 @@ type SystemContext struct { // this field is ignored if `AuthFilePath` is set (we favor the newer format); // only reading of this data is supported; LegacyFormatAuthFilePath string + // If set, a path to a Docker-compatible "config.json" file containing credentials; and no other files are processed. + // This must not be set if AuthFilePath is set. + // Only credentials and credential helpers in this file apre processed, not any other configuration in this file. + DockerCompatAuthFilePath string // If not "", overrides the use of platform.GOARCH when choosing an image or verifying architecture match. ArchitectureChoice string // If not "", overrides the use of platform.GOOS when choosing an image or verifying OS match. diff --git a/vendor/github.com/containers/image/v5/version/version.go b/vendor/github.com/containers/image/v5/version/version.go index 27d034dc55..990f0a96d2 100644 --- a/vendor/github.com/containers/image/v5/version/version.go +++ b/vendor/github.com/containers/image/v5/version/version.go @@ -6,7 +6,7 @@ const ( // VersionMajor is for an API incompatible changes VersionMajor = 5 // VersionMinor is for functionality in a backwards-compatible manner - VersionMinor = 28 + VersionMinor = 29 // VersionPatch is for backwards-compatible bug fixes VersionPatch = 0 diff --git a/vendor/github.com/containers/ocicrypt/spec/spec.go b/vendor/github.com/containers/ocicrypt/spec/spec.go index 8665f6f21c..c0c171824f 100644 --- a/vendor/github.com/containers/ocicrypt/spec/spec.go +++ b/vendor/github.com/containers/ocicrypt/spec/spec.go @@ -9,8 +9,12 @@ const ( MediaTypeLayerZstdEnc = "application/vnd.oci.image.layer.v1.tar+zstd+encrypted" // MediaTypeLayerNonDistributableEnc is MIME type used for non distributable encrypted layers. MediaTypeLayerNonDistributableEnc = "application/vnd.oci.image.layer.nondistributable.v1.tar+encrypted" - // MediaTypeLayerGzipEnc is MIME type used for non distributable encrypted gzip-compressed layers. + // MediaTypeLayerNonDistributableGzipEnc is MIME type used for non distributable encrypted gzip-compressed layers. MediaTypeLayerNonDistributableGzipEnc = "application/vnd.oci.image.layer.nondistributable.v1.tar+gzip+encrypted" - // MediaTypeLayerZstdEnc is MIME type used for non distributable encrypted zstd-compressed layers. - MediaTypeLayerNonDistributableZsdtEnc = "application/vnd.oci.image.layer.nondistributable.v1.tar+zstd+encrypted" + // MediaTypeLayerNonDistributableZstdEnc is MIME type used for non distributable encrypted zstd-compressed layers. + MediaTypeLayerNonDistributableZstdEnc = "application/vnd.oci.image.layer.nondistributable.v1.tar+zstd+encrypted" + // MediaTypeLayerNonDistributableZsdtEnc is MIME type used for non distributable encrypted zstd-compressed layers. + // + // Deprecated: Use [MediaTypeLayerNonDistributableZstdEnc]. + MediaTypeLayerNonDistributableZsdtEnc = MediaTypeLayerNonDistributableZstdEnc ) diff --git a/vendor/github.com/containers/storage/pkg/system/rm.go b/vendor/github.com/containers/storage/pkg/system/rm.go index 5917fa251d..12243707ac 100644 --- a/vendor/github.com/containers/storage/pkg/system/rm.go +++ b/vendor/github.com/containers/storage/pkg/system/rm.go @@ -28,7 +28,7 @@ func EnsureRemoveAll(dir string) error { // track retries exitOnErr := make(map[string]int) - maxRetry := 100 + maxRetry := 1000 // Attempt a simple remove all first, this avoids the more expensive // RecursiveUnmount call if not needed. @@ -38,7 +38,7 @@ func EnsureRemoveAll(dir string) error { // Attempt to unmount anything beneath this dir first if err := mount.RecursiveUnmount(dir); err != nil { - logrus.Debugf("RecusiveUnmount on %s failed: %v", dir, err) + logrus.Debugf("RecursiveUnmount on %s failed: %v", dir, err) } for { @@ -94,6 +94,6 @@ func EnsureRemoveAll(dir string) error { return err } exitOnErr[pe.Path]++ - time.Sleep(100 * time.Millisecond) + time.Sleep(10 * time.Millisecond) } } diff --git a/vendor/github.com/containers/storage/pkg/unshare/unshare_darwin.go b/vendor/github.com/containers/storage/pkg/unshare/unshare_darwin.go index 86ac12ecab..480e2fcb09 100644 --- a/vendor/github.com/containers/storage/pkg/unshare/unshare_darwin.go +++ b/vendor/github.com/containers/storage/pkg/unshare/unshare_darwin.go @@ -25,6 +25,11 @@ func GetRootlessUID() int { return os.Getuid() } +// GetRootlessGID returns the GID of the user in the parent userNS +func GetRootlessGID() int { + return os.Getgid() +} + // RootlessEnv returns the environment settings for the rootless containers func RootlessEnv() []string { return append(os.Environ(), UsernsEnvName+"=") diff --git a/vendor/github.com/containers/storage/pkg/unshare/unshare_linux.go b/vendor/github.com/containers/storage/pkg/unshare/unshare_linux.go index e169633d05..a8dc1ba038 100644 --- a/vendor/github.com/containers/storage/pkg/unshare/unshare_linux.go +++ b/vendor/github.com/containers/storage/pkg/unshare/unshare_linux.go @@ -441,6 +441,16 @@ func GetRootlessUID() int { return os.Getuid() } +// GetRootlessGID returns the GID of the user in the parent userNS +func GetRootlessGID() int { + gidEnv := getenv("_CONTAINERS_ROOTLESS_GID") + if gidEnv != "" { + u, _ := strconv.Atoi(gidEnv) + return u + } + return os.Getgid() +} + // RootlessEnv returns the environment settings for the rootless containers func RootlessEnv() []string { return append(os.Environ(), UsernsEnvName+"=done") diff --git a/vendor/github.com/containers/storage/pkg/unshare/unshare_unsupported.go b/vendor/github.com/containers/storage/pkg/unshare/unshare_unsupported.go index 66dd545966..83de680c20 100644 --- a/vendor/github.com/containers/storage/pkg/unshare/unshare_unsupported.go +++ b/vendor/github.com/containers/storage/pkg/unshare/unshare_unsupported.go @@ -25,6 +25,11 @@ func GetRootlessUID() int { return os.Getuid() } +// GetRootlessGID returns the GID of the user in the parent userNS +func GetRootlessGID() int { + return os.Getgid() +} + // RootlessEnv returns the environment settings for the rootless containers func RootlessEnv() []string { return append(os.Environ(), UsernsEnvName+"=") diff --git a/vendor/github.com/cpuguy83/go-md2man/v2/md2man/md2man.go b/vendor/github.com/cpuguy83/go-md2man/v2/md2man/md2man.go index b480056734..42bf32aab0 100644 --- a/vendor/github.com/cpuguy83/go-md2man/v2/md2man/md2man.go +++ b/vendor/github.com/cpuguy83/go-md2man/v2/md2man/md2man.go @@ -9,6 +9,8 @@ func Render(doc []byte) []byte { renderer := NewRoffRenderer() return blackfriday.Run(doc, - []blackfriday.Option{blackfriday.WithRenderer(renderer), - blackfriday.WithExtensions(renderer.GetExtensions())}...) + []blackfriday.Option{ + blackfriday.WithRenderer(renderer), + blackfriday.WithExtensions(renderer.GetExtensions()), + }...) } diff --git a/vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go b/vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go index be2b343606..4b19188d90 100644 --- a/vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go +++ b/vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go @@ -1,6 +1,7 @@ package md2man import ( + "bytes" "fmt" "io" "os" @@ -34,10 +35,10 @@ const ( hruleTag = "\n.ti 0\n\\l'\\n(.lu'\n" linkTag = "\n\\[la]" linkCloseTag = "\\[ra]" - codespanTag = "\\fB\\fC" + codespanTag = "\\fB" codespanCloseTag = "\\fR" - codeTag = "\n.PP\n.RS\n\n.nf\n" - codeCloseTag = "\n.fi\n.RE\n" + codeTag = "\n.EX\n" + codeCloseTag = "\n.EE\n" quoteTag = "\n.PP\n.RS\n" quoteCloseTag = "\n.RE\n" listTag = "\n.RS\n" @@ -86,8 +87,7 @@ func (r *roffRenderer) RenderFooter(w io.Writer, ast *blackfriday.Node) { // RenderNode is called for each node in a markdown document; based on the node // type the equivalent roff output is sent to the writer func (r *roffRenderer) RenderNode(w io.Writer, node *blackfriday.Node, entering bool) blackfriday.WalkStatus { - - var walkAction = blackfriday.GoToNext + walkAction := blackfriday.GoToNext switch node.Type { case blackfriday.Text: @@ -109,9 +109,16 @@ func (r *roffRenderer) RenderNode(w io.Writer, node *blackfriday.Node, entering out(w, strongCloseTag) } case blackfriday.Link: - if !entering { - out(w, linkTag+string(node.LinkData.Destination)+linkCloseTag) + // Don't render the link text for automatic links, because this + // will only duplicate the URL in the roff output. + // See https://daringfireball.net/projects/markdown/syntax#autolink + if !bytes.Equal(node.LinkData.Destination, node.FirstChild.Literal) { + out(w, string(node.FirstChild.Literal)) } + // Hyphens in a link must be escaped to avoid word-wrap in the rendered man page. + escapedLink := strings.ReplaceAll(string(node.LinkData.Destination), "-", "\\-") + out(w, linkTag+escapedLink+linkCloseTag) + walkAction = blackfriday.SkipChildren case blackfriday.Image: // ignore images walkAction = blackfriday.SkipChildren @@ -160,6 +167,11 @@ func (r *roffRenderer) RenderNode(w io.Writer, node *blackfriday.Node, entering r.handleTableCell(w, node, entering) case blackfriday.HTMLSpan: // ignore other HTML tags + case blackfriday.HTMLBlock: + if bytes.HasPrefix(node.Literal, []byte("