From 95921cdf0951eaa3e59f00d339aa34e693aed53d Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Tue, 26 Nov 2024 01:06:05 +0000 Subject: [PATCH 01/10] chore: update docker to v27.3.1 --- go.mod | 51 +++++++++++++++------------- go.sum | 105 +++++++++++++++++++++++++++++---------------------------- 2 files changed, 82 insertions(+), 74 deletions(-) diff --git a/go.mod b/go.mod index 1ae705a..f68a705 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/coder/coder/v2 v2.12.0 github.com/coder/retry v1.5.1 github.com/cpuguy83/dockercfg v0.3.1 - github.com/docker/docker v24.0.9+incompatible + github.com/docker/docker v27.3.1+incompatible github.com/google/go-containerregistry v0.14.0 github.com/google/uuid v1.6.0 github.com/opencontainers/image-spec v1.1.0-rc5 @@ -24,9 +24,10 @@ require ( github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.9.0 github.com/vishvananda/netlink v1.2.1-beta.2 + golang.org/x/crypto v0.28.0 golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 golang.org/x/mod v0.18.0 - golang.org/x/sys v0.21.0 + golang.org/x/sys v0.27.0 golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 k8s.io/mount-utils v0.26.2 k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 @@ -34,7 +35,7 @@ require ( ) require ( - cloud.google.com/go/compute/metadata v0.3.0 // indirect + cloud.google.com/go/compute/metadata v0.5.0 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/DataDog/appsec-internal-go v1.5.0 // indirect @@ -70,27 +71,29 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/bytedance/sonic v1.10.2 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/charmbracelet/lipgloss v0.8.0 // indirect github.com/coder/pretty v0.0.0-20230908205945-e89ba86370e0 // indirect github.com/coder/serpent v0.7.0 // indirect github.com/coder/terraform-provider-coder v0.23.0 // indirect github.com/containerd/continuity v0.4.2 // indirect + github.com/containerd/log v0.1.0 // indirect github.com/coreos/go-iptables v0.6.0 // indirect github.com/coreos/go-oidc/v3 v3.10.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect + github.com/distribution/reference v0.6.0 // indirect github.com/docker/cli v23.0.5+incompatible // indirect - github.com/docker/distribution v2.8.2+incompatible // indirect github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/ebitengine/purego v0.6.0-alpha.5 // indirect github.com/fatih/color v1.17.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fxamacker/cbor/v2 v2.4.0 // indirect github.com/go-chi/chi/v5 v5.0.10 // indirect github.com/go-jose/go-jose/v4 v4.0.1 // indirect - github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-sql-driver/mysql v1.8.1 // indirect @@ -103,7 +106,7 @@ require ( github.com/google/nftables v0.2.0 // indirect github.com/google/pprof v0.0.0-20230817174616-7a8ec2ada47b // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect @@ -141,6 +144,7 @@ require ( github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect + github.com/moby/docker-image-spec v1.3.1 // indirect github.com/moby/sys/mountinfo v0.6.2 // indirect github.com/moby/term v0.5.0 // indirect github.com/muesli/reflow v0.3.0 // indirect @@ -184,31 +188,32 @@ require ( github.com/zclconf/go-cty v1.14.4 // indirect github.com/zeebo/errs v1.3.0 // indirect go.nhat.io/otelsql v0.13.0 // indirect - go.opentelemetry.io/otel v1.24.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect + go.opentelemetry.io/otel v1.32.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.32.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0 // indirect - go.opentelemetry.io/otel/metric v1.24.0 // indirect - go.opentelemetry.io/otel/sdk v1.24.0 // indirect - go.opentelemetry.io/otel/trace v1.24.0 // indirect - go.opentelemetry.io/proto/otlp v1.0.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.32.0 // indirect + go.opentelemetry.io/otel/metric v1.32.0 // indirect + go.opentelemetry.io/otel/sdk v1.32.0 // indirect + go.opentelemetry.io/otel/trace v1.32.0 // indirect + go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/atomic v1.11.0 // indirect go4.org/mem v0.0.0-20220726221520-4f986261bf13 // indirect go4.org/netipx v0.0.0-20230728180743-ad4cb58a6516 // indirect - golang.org/x/crypto v0.24.0 // indirect - golang.org/x/net v0.26.0 // indirect - golang.org/x/oauth2 v0.20.0 // indirect - golang.org/x/sync v0.7.0 // indirect - golang.org/x/term v0.21.0 // indirect - golang.org/x/text v0.16.0 // indirect + golang.org/x/net v0.30.0 // indirect + golang.org/x/oauth2 v0.23.0 // indirect + golang.org/x/sync v0.9.0 // indirect + golang.org/x/term v0.25.0 // indirect + golang.org/x/text v0.20.0 // indirect golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.22.0 // indirect golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect golang.zx2c4.com/wireguard/windows v0.5.3 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240513163218-0867130af1f8 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e // indirect - google.golang.org/grpc v1.64.1 // indirect - google.golang.org/protobuf v1.34.1 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect + google.golang.org/grpc v1.67.1 // indirect + google.golang.org/protobuf v1.35.1 // indirect gopkg.in/DataDog/dd-trace-go.v1 v1.64.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 518bfad..9a84490 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,8 @@ cdr.dev/slog v1.6.2-0.20240126064726-20367d4aede6 h1:KHblWIE/KHOwQ6lEbMZt6YpcGve2FEZ1sDtrW1Am5UI= cdr.dev/slog v1.6.2-0.20240126064726-20367d4aede6/go.mod h1:NaoTA7KwopCrnaSb0JXTC0PTp/O/Y83Lndnq0OEV3ZQ= cloud.google.com/go v0.110.10 h1:LXy9GEO+timppncPIAZoOj3l58LIU9k+kn48AN7IO3Y= -cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= -cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +cloud.google.com/go/compute/metadata v0.5.0 h1:Zr0eK8JbFv6+Wi4ilXAR8FJ3wyNdpxHKJNPos6LTZOY= +cloud.google.com/go/compute/metadata v0.5.0/go.mod h1:aHnloV2TPI38yx4s9+wAZhHykWvVCfu7hQbF+9CWoiY= cloud.google.com/go/logging v1.9.0 h1:iEIOXFO9EmSiTjDmfpbRjOxECO7R8C7b8IXUGOj7xZw= cloud.google.com/go/logging v1.9.0/go.mod h1:1Io0vnZv4onoUnsVUQY3HZ3Igb1nBchky0A0y7BBBhE= cloud.google.com/go/longrunning v0.5.6 h1:xAe8+0YaWoCKr9t1+aWe+OeQgN/iJK1fEgZSXmjuEaE= @@ -94,8 +94,8 @@ github.com/bytedance/sonic v1.10.2/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf5 github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/charmbracelet/lipgloss v0.8.0 h1:IS00fk4XAHcf8uZKc3eHeMUTCxUH6NkaTrdyCQk84RU= github.com/charmbracelet/lipgloss v0.8.0/go.mod h1:p4eYUZZJ/0oXTuCQKFF8mqyKCz0ja6y+7DniDDw5KKU= github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= @@ -122,6 +122,8 @@ github.com/coder/terraform-provider-coder v0.23.0 h1:DuNLWxhnGlXyG0g+OCAZRI6xd8+ github.com/coder/terraform-provider-coder v0.23.0/go.mod h1:wMun9UZ9HT2CzF6qPPBup1odzBpVUc0/xSFoXgdI3tk= github.com/containerd/continuity v0.4.2 h1:v3y/4Yz5jwnvqPKJJ+7Wf93fyWoCB3F5EclWG023MDM= github.com/containerd/continuity v0.4.2/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= +github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= +github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/coreos/go-iptables v0.6.0 h1:is9qnZMPYjLd8LYqmm/qlE+wwEgJIkTYdhV3rfZo4jk= github.com/coreos/go-iptables v0.6.0/go.mod h1:Qe8Bv2Xik5FyTXwgIbLAnv2sWSBmvWdFETJConOQ//Q= github.com/coreos/go-oidc/v3 v3.10.0 h1:tDnXHnLyiTVyT/2zLDGj09pFPkhND8Gl8lnTRhoEaJU= @@ -138,12 +140,12 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8Yc github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= +github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/docker/cli v23.0.5+incompatible h1:ufWmAOuD3Vmr7JP2G5K3cyuNC4YZWiAsuDEvFVVDafE= github.com/docker/cli v23.0.5+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.9+incompatible h1:HPGzNmwfLZWdxHqK9/II92pyi1EpYKsAqcl4G0Of9v0= -github.com/docker/docker v24.0.9+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v27.3.1+incompatible h1:KttF0XoteNTicmUtBO0L2tP+J7FGRFTjaEF4k6WdhfI= +github.com/docker/docker v27.3.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= 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-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= @@ -177,8 +179,8 @@ github.com/go-jose/go-jose/v4 v4.0.1 h1:QVEPDE3OluqXBQZDcnNvQrInro2h0e4eqNbnZSWq github.com/go-jose/go-jose/v4 v4.0.1/go.mod h1:WVf9LFMHh/QVrmqrOfqun0C45tMe3RoiKJMPvgWwLfY= 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.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/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-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= @@ -212,8 +214,6 @@ github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= -github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= @@ -250,8 +250,8 @@ github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 h1:RtRsiaGvWxcwd8y3BiRZxsylPT8hLWZ5SPcfI+3IDNk= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0/go.mod h1:TzP6duP4Py2pHLVPPQp42aoYI92+PCrVotyR5e8Vqlk= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0 h1:ad0vkEBuk23VJzZR9nkLVG0YAoN9coASF1GusYX6AlU= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0/go.mod h1:igFoXX2ELCW06bol23DWPB5BEWfZISOzSP5K2sbLea0= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -377,6 +377,8 @@ github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374 github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= +github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= github.com/moby/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/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= @@ -444,8 +446,8 @@ github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= -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.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/secure-systems-lab/go-securesystemslib v0.7.0 h1:OwvJ5jQf9LnIAS83waAjPbcMsODrTQUpJ02eNLUoxBg= github.com/secure-systems-lab/go-securesystemslib v0.7.0/go.mod h1:/2gYnlnHVQ6xeGtfIqFy7Do03K4cdCY0A/GlJLDKLHI= @@ -548,29 +550,30 @@ github.com/zeebo/errs v1.3.0 h1:hmiaKqgYZzcVgRL1Vkc1Mn2914BbzB0IBxs+ebeutGs= github.com/zeebo/errs v1.3.0/go.mod h1:sgbWHsvVuTPHcqJJGQ1WhI5KbWlHYz+2+2C/LSEtCw4= go.nhat.io/otelsql v0.13.0 h1:L6obwZRxgFQqeSvo7jCemP659fu7pqsDHQNuZ3Ev1yI= go.nhat.io/otelsql v0.13.0/go.mod h1:HyYpqd7G9BK+9cPLydV+2JN/4J5D3wlX6+jDLTk52GE= -go.opentelemetry.io/contrib v1.19.0 h1:rnYI7OEPMWFeM4QCqWQ3InMJ0arWMR1i0Cx9A5hcjYM= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= -go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= -go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 h1:Mne5On7VWdx7omSrSSZvM4Kw7cS7NQkOOmLcgscI51U= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0/go.mod h1:IPtUMKL4O3tH5y+iXVyAXqpAwMuzC1IrxVS81rummfE= +go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U= +go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.32.0 h1:IJFEoHiytixx8cMiVAO+GmHR6Frwu+u5Ur8njpFO6Ac= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.32.0/go.mod h1:3rHrKNtLIoS0oZwkY2vxi+oJcwFRWdtUyRII+so45p8= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0 h1:3d+S281UTjM+AbF31XSOYn1qXn3BgIdWl8HNEpx08Jk= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0/go.mod h1:0+KuTDyKL4gjKCF75pHOX4wuzYDUZYfAQdSu43o+Z2I= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.32.0 h1:cMyu9O88joYEaI47CnQkxO1XZdpoTF9fEnW2duIddhw= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.32.0/go.mod h1:6Am3rn7P9TVVeXYG+wtcGE7IE1tsQ+bP3AuWcKt/gOI= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.24.0 h1:JYE2HM7pZbOt5Jhk8ndWZTUWYOVift2cHjXVMkPdmdc= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.24.0/go.mod h1:yMb/8c6hVsnma0RpsBMNo0fEiQKeclawtgaIaOp2MLY= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.24.0 h1:s0PHtIkN+3xrbDOpt2M8OTG92cWqUESvzh2MxiR5xY8= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.24.0/go.mod h1:hZlFbDbRt++MMPCCfSJfmhkGIWnX1h3XjkfxZUjLrIA= -go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= -go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= -go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw= -go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg= +go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M= +go.opentelemetry.io/otel/metric v1.32.0/go.mod h1:jH7CIbbK6SH2V2wE16W05BHCtIDzauciCRLoc/SyMv8= +go.opentelemetry.io/otel/sdk v1.32.0 h1:RNxepc9vK59A8XsgZQouW8ue8Gkb4jpWtJm9ge5lEG4= +go.opentelemetry.io/otel/sdk v1.32.0/go.mod h1:LqgegDBjKMmb2GC6/PrTnteJG39I8/vJCAP9LlJXEjU= go.opentelemetry.io/otel/sdk/metric v1.24.0 h1:yyMQrPzF+k88/DbH7o4FMAs80puqd+9osbiBrJrz/w8= go.opentelemetry.io/otel/sdk/metric v1.24.0/go.mod h1:I6Y5FjH6rvEnTTAYQz3Mmv2kl6Ek5IIrmwTLqMrrOE0= -go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= -go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= -go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= -go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= +go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9mYrXf8TmY/EXuULKc8hR17vE+Hjv2cssQDe03fM= +go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8= +go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= +go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= @@ -589,8 +592,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= +golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -611,10 +614,10 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= -golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= -golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= +golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= +golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= +golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -622,8 +625,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ 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.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= +golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -653,14 +656,14 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.1-0.20230131160137-e7d7f63158de/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= +golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= +golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -668,8 +671,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= +golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= @@ -698,18 +701,18 @@ google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAs google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda h1:wu/KJm9KJwpfHWhkkZGohVC6KRrc1oJNr4jwtQMOQXw= google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda/go.mod h1:g2LLCvCeCSir/JJSWosk19BR4NVxGqHUC6rxIRsd7Aw= -google.golang.org/genproto/googleapis/api v0.0.0-20240513163218-0867130af1f8 h1:W5Xj/70xIA4x60O/IFyXivR5MGqblAb8R3w26pnD6No= -google.golang.org/genproto/googleapis/api v0.0.0-20240513163218-0867130af1f8/go.mod h1:vPrPUTsDCYxXWjP7clS81mZ6/803D8K4iM9Ma27VKas= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e h1:Elxv5MwEkCI9f5SkoL6afed6NTdxaGoAo39eANBwHL8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= -google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA= -google.golang.org/grpc v1.64.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0= +google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 h1:M0KvPgPmDZHPlbRbaNU1APr28TvwvvdUPlSv7PUvy8g= +google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28/go.mod h1:dguCy7UOdZhTvLzDyt15+rOrawrpM4q7DD9dQ1P11P4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 h1:XVhgTWWV3kGQlwJHR3upFWZeTsei6Oks1apkZSeonIE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= +google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= +google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= +google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/DataDog/dd-trace-go.v1 v1.64.0 h1:zXQo6iv+dKRrDBxMXjRXLSKN2lY9uM34XFI4nPyp0eA= gopkg.in/DataDog/dd-trace-go.v1 v1.64.0/go.mod h1:qzwVu8Qr8CqzQNw2oKEXRdD+fMnjYatjYMGE0tdCVG4= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From f33dbbb17f1202a2a0ec0ab3cec81beadb6ea774 Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Tue, 26 Nov 2024 01:15:04 +0000 Subject: [PATCH 02/10] update docker fake --- cli/docker.go | 3 +- dockerutil/client.go | 4 +- dockerutil/dockerfake/client.go | 281 -------------------------------- dockerutil/dockerfake/doc.go | 1 + 4 files changed, 4 insertions(+), 285 deletions(-) delete mode 100644 dockerutil/dockerfake/client.go diff --git a/cli/docker.go b/cli/docker.go index 8ffbb48..9fd436d 100644 --- a/cli/docker.go +++ b/cli/docker.go @@ -13,7 +13,6 @@ import ( "strconv" "strings" - dockertypes "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/google/go-containerregistry/pkg/name" "github.com/spf13/cobra" @@ -664,7 +663,7 @@ func runDockerCVM(ctx context.Context, log slog.Logger, client dockerutil.Docker // TODO fix iptables when istio detected. blog.Info("Starting up workspace...") - err = client.ContainerStart(ctx, containerID, dockertypes.ContainerStartOptions{}) + err = client.ContainerStart(ctx, containerID, container.StartOptions{}) if err != nil { return xerrors.Errorf("start container: %w", err) } diff --git a/dockerutil/client.go b/dockerutil/client.go index d206219..f6ce1c4 100644 --- a/dockerutil/client.go +++ b/dockerutil/client.go @@ -7,7 +7,7 @@ import ( "os" "github.com/cpuguy83/dockercfg" - dockertypes "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/registry" dockerclient "github.com/docker/docker/client" "golang.org/x/xerrors" @@ -38,7 +38,7 @@ func Client(ctx context.Context) (DockerClient, error) { return client.(DockerClient), nil } -type AuthConfig dockertypes.AuthConfig +type AuthConfig registry.AuthConfig func (a AuthConfig) Base64() (string, error) { authStr, err := json.Marshal(a) diff --git a/dockerutil/dockerfake/client.go b/dockerutil/dockerfake/client.go deleted file mode 100644 index f735f1c..0000000 --- a/dockerutil/dockerfake/client.go +++ /dev/null @@ -1,281 +0,0 @@ -package dockerfake - -import ( - "context" - "io" - "strings" - - dockertypes "github.com/docker/docker/api/types" - containertypes "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/image" - networktypes "github.com/docker/docker/api/types/network" - "github.com/docker/docker/api/types/registry" - specs "github.com/opencontainers/image-spec/specs-go/v1" - - "github.com/coder/envbox/dockerutil" -) - -var _ dockerutil.DockerClient = MockClient{} - -// MockClient provides overrides for functions that are called in envbox. -type MockClient struct { - ImagePullFn func(_ context.Context, ref string, options dockertypes.ImagePullOptions) (io.ReadCloser, error) - ContainerCreateFn func(_ context.Context, config *containertypes.Config, hostConfig *containertypes.HostConfig, networkingConfig *networktypes.NetworkingConfig, _ *specs.Platform, containerName string) (containertypes.CreateResponse, error) - ImagePruneFn func(_ context.Context, pruneFilter filters.Args) (dockertypes.ImagesPruneReport, error) - ContainerStartFn func(_ context.Context, container string, options dockertypes.ContainerStartOptions) error - ContainerExecAttachFn func(_ context.Context, execID string, config dockertypes.ExecStartCheck) (dockertypes.HijackedResponse, error) - ContainerExecCreateFn func(_ context.Context, container string, config dockertypes.ExecConfig) (dockertypes.IDResponse, error) - ContainerExecStartFn func(_ context.Context, execID string, config dockertypes.ExecStartCheck) error - ContainerExecInspectFn func(_ context.Context, execID string) (dockertypes.ContainerExecInspect, error) - ContainerInspectFn func(_ context.Context, container string) (dockertypes.ContainerJSON, error) - ContainerRemoveFn func(_ context.Context, container string, options dockertypes.ContainerRemoveOptions) error - PingFn func(_ context.Context) (dockertypes.Ping, error) -} - -func (MockClient) ImageBuild(_ context.Context, _ io.Reader, _ dockertypes.ImageBuildOptions) (dockertypes.ImageBuildResponse, error) { - panic("not implemented") -} - -func (MockClient) BuildCachePrune(_ context.Context, _ dockertypes.BuildCachePruneOptions) (*dockertypes.BuildCachePruneReport, error) { - panic("not implemented") -} - -func (MockClient) BuildCancel(_ context.Context, _ string) error { - panic("not implemented") -} - -func (MockClient) ImageCreate(_ context.Context, _ string, _ dockertypes.ImageCreateOptions) (io.ReadCloser, error) { - panic("not implemented") -} - -func (MockClient) ImageHistory(_ context.Context, _ string) ([]image.HistoryResponseItem, error) { - panic("not implemented") -} - -func (MockClient) ImageImport(_ context.Context, _ dockertypes.ImageImportSource, _ string, _ dockertypes.ImageImportOptions) (io.ReadCloser, error) { - panic("not implemented") -} - -func (MockClient) ImageInspectWithRaw(_ context.Context, _ string) (dockertypes.ImageInspect, []byte, error) { - panic("not implemented") -} - -func (MockClient) ImageList(_ context.Context, _ dockertypes.ImageListOptions) ([]dockertypes.ImageSummary, error) { - panic("not implemented") -} - -func (MockClient) ImageLoad(_ context.Context, _ io.Reader, _ bool) (dockertypes.ImageLoadResponse, error) { - panic("not implemented") -} - -func (m MockClient) ImagePull(ctx context.Context, ref string, options dockertypes.ImagePullOptions) (io.ReadCloser, error) { - if m.ImagePullFn == nil { - return io.NopCloser(strings.NewReader("")), nil - } - return m.ImagePullFn(ctx, ref, options) -} - -func (MockClient) ImagePush(_ context.Context, _ string, _ dockertypes.ImagePushOptions) (io.ReadCloser, error) { - panic("not implemented") -} - -func (MockClient) ImageRemove(_ context.Context, _ string, _ dockertypes.ImageRemoveOptions) ([]dockertypes.ImageDeleteResponseItem, error) { - panic("not implemented") -} - -func (MockClient) ImageSearch(_ context.Context, _ string, _ dockertypes.ImageSearchOptions) ([]registry.SearchResult, error) { - panic("not implemented") -} - -func (MockClient) ImageSave(_ context.Context, _ []string) (io.ReadCloser, error) { - panic("not implemented") -} - -func (MockClient) ImageTag(_ context.Context, _ string, _ string) error { - panic("not implemented") -} - -func (m MockClient) ImagesPrune(ctx context.Context, pruneFilter filters.Args) (dockertypes.ImagesPruneReport, error) { - if m.ImagePruneFn == nil { - return dockertypes.ImagesPruneReport{}, nil - } - return m.ImagePruneFn(ctx, pruneFilter) -} - -func (MockClient) Events(_ context.Context, _ dockertypes.EventsOptions) (<-chan events.Message, <-chan error) { - panic("not implemented") -} - -func (MockClient) Info(_ context.Context) (dockertypes.Info, error) { - panic("not implemented") -} - -func (MockClient) RegistryLogin(_ context.Context, _ dockertypes.AuthConfig) (registry.AuthenticateOKBody, error) { - panic("not implemented") -} - -func (MockClient) DiskUsage(_ context.Context, _ dockertypes.DiskUsageOptions) (dockertypes.DiskUsage, error) { - panic("not implemented") -} - -func (m MockClient) Ping(ctx context.Context) (dockertypes.Ping, error) { - if m.PingFn == nil { - return dockertypes.Ping{}, nil - } - return m.PingFn(ctx) -} - -func (MockClient) ContainerAttach(_ context.Context, _ string, _ dockertypes.ContainerAttachOptions) (dockertypes.HijackedResponse, error) { - panic("not implemented") -} - -func (MockClient) ContainerCommit(_ context.Context, _ string, _ dockertypes.ContainerCommitOptions) (dockertypes.IDResponse, error) { - panic("not implemented") -} - -func (m MockClient) ContainerCreate(ctx context.Context, config *containertypes.Config, hostConfig *containertypes.HostConfig, networkingConfig *networktypes.NetworkingConfig, pspecs *specs.Platform, containerName string) (containertypes.CreateResponse, error) { - if m.ContainerCreateFn == nil { - return containertypes.CreateResponse{}, nil - } - return m.ContainerCreateFn(ctx, config, hostConfig, networkingConfig, pspecs, containerName) -} - -func (MockClient) ContainerDiff(_ context.Context, _ string) ([]containertypes.ContainerChangeResponseItem, error) { - panic("not implemented") -} - -func (m MockClient) ContainerExecAttach(ctx context.Context, execID string, config dockertypes.ExecStartCheck) (dockertypes.HijackedResponse, error) { - if m.ContainerExecAttachFn == nil { - return dockertypes.HijackedResponse{}, nil - } - return m.ContainerExecAttachFn(ctx, execID, config) -} - -func (m MockClient) ContainerExecCreate(ctx context.Context, name string, config dockertypes.ExecConfig) (dockertypes.IDResponse, error) { - if m.ContainerExecCreateFn == nil { - return dockertypes.IDResponse{}, nil - } - return m.ContainerExecCreateFn(ctx, name, config) -} - -func (m MockClient) ContainerExecInspect(ctx context.Context, id string) (dockertypes.ContainerExecInspect, error) { - if m.ContainerExecInspectFn == nil { - return dockertypes.ContainerExecInspect{}, nil - } - - return m.ContainerExecInspectFn(ctx, id) -} - -func (MockClient) ContainerExecResize(_ context.Context, _ string, _ dockertypes.ResizeOptions) error { - panic("not implemented") -} - -func (m MockClient) ContainerExecStart(ctx context.Context, execID string, config dockertypes.ExecStartCheck) error { - if m.ContainerExecStartFn == nil { - return nil - } - return m.ContainerExecStartFn(ctx, execID, config) -} - -func (MockClient) ContainerExport(_ context.Context, _ string) (io.ReadCloser, error) { - panic("not implemented") -} - -func (m MockClient) ContainerInspect(ctx context.Context, name string) (dockertypes.ContainerJSON, error) { - if m.ContainerInspectFn == nil { - return dockertypes.ContainerJSON{}, nil - } - return m.ContainerInspectFn(ctx, name) -} - -func (MockClient) ContainerInspectWithRaw(_ context.Context, _ string, _ bool) (dockertypes.ContainerJSON, []byte, error) { - panic("not implemented") -} - -func (MockClient) ContainerKill(_ context.Context, _ string, _ string) error { - panic("not implemented") -} - -func (MockClient) ContainerList(_ context.Context, _ dockertypes.ContainerListOptions) ([]dockertypes.Container, error) { - panic("not implemented") -} - -func (MockClient) ContainerLogs(_ context.Context, _ string, _ dockertypes.ContainerLogsOptions) (io.ReadCloser, error) { - panic("not implemented") -} - -func (MockClient) ContainerPause(_ context.Context, _ string) error { - panic("not implemented") -} - -func (m MockClient) ContainerRemove(ctx context.Context, name string, options dockertypes.ContainerRemoveOptions) error { - if m.ContainerRemoveFn == nil { - return nil - } - return m.ContainerRemoveFn(ctx, name, options) -} - -func (MockClient) ContainerRename(_ context.Context, _ string, _ string) error { - panic("not implemented") -} - -func (MockClient) ContainerResize(_ context.Context, _ string, _ dockertypes.ResizeOptions) error { - panic("not implemented") -} - -func (MockClient) ContainerRestart(_ context.Context, _ string, _ containertypes.StopOptions) error { - panic("not implemented") -} - -func (MockClient) ContainerStatPath(_ context.Context, _ string, _ string) (dockertypes.ContainerPathStat, error) { - panic("not implemented") -} - -func (MockClient) ContainerStats(_ context.Context, _ string, _ bool) (dockertypes.ContainerStats, error) { - panic("not implemented") -} - -func (m MockClient) ContainerStart(ctx context.Context, name string, options dockertypes.ContainerStartOptions) error { - if m.ContainerStartFn == nil { - return nil - } - return m.ContainerStartFn(ctx, name, options) -} - -func (MockClient) ContainerStop(_ context.Context, _ string, _ containertypes.StopOptions) error { - panic("not implemented") -} - -func (MockClient) ContainerTop(_ context.Context, _ string, _ []string) (containertypes.ContainerTopOKBody, error) { - panic("not implemented") -} - -func (MockClient) ContainerUnpause(_ context.Context, _ string) error { - panic("not implemented") -} - -func (MockClient) ContainerUpdate(_ context.Context, _ string, _ containertypes.UpdateConfig) (containertypes.ContainerUpdateOKBody, error) { - panic("not implemented") -} - -func (MockClient) ContainerWait(_ context.Context, _ string, _ containertypes.WaitCondition) (<-chan containertypes.WaitResponse, <-chan error) { - panic("not implemented") -} - -func (MockClient) CopyFromContainer(_ context.Context, _ string, _ string) (io.ReadCloser, dockertypes.ContainerPathStat, error) { - panic("not implemented") -} - -func (MockClient) CopyToContainer(_ context.Context, _ string, _ string, _ io.Reader, _ dockertypes.CopyToContainerOptions) error { - panic("not implemented") -} - -func (MockClient) ContainersPrune(_ context.Context, _ filters.Args) (dockertypes.ContainersPruneReport, error) { - panic("not implemented") -} - -func (MockClient) ContainerStatsOneShot(_ context.Context, _ string) (dockertypes.ContainerStats, error) { - panic("not implemented") -} diff --git a/dockerutil/dockerfake/doc.go b/dockerutil/dockerfake/doc.go index b00ea2b..3fd0ead 100644 --- a/dockerutil/dockerfake/doc.go +++ b/dockerutil/dockerfake/doc.go @@ -1,3 +1,4 @@ // Package dockerfake contains logic for mocking out Docker-related // functionality. +//go:generate mockgen -destination ./mock.go -package dockerfake github.com/coder/envbox/dockerutil/dockerfake Client package dockerfake From 09febcd3611ef46fb9ec5ddea4c8a5caaa24f5a9 Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Tue, 26 Nov 2024 01:27:14 +0000 Subject: [PATCH 03/10] use mockgen --- dockerutil/dockerfake/doc.go | 3 +- dockerutil/dockerfake/mock.go | 835 ++++++++++++++++++++++++++++++++++ dockerutil/image.go | 12 +- go.mod | 1 + go.sum | 2 + 5 files changed, 846 insertions(+), 7 deletions(-) create mode 100644 dockerutil/dockerfake/mock.go diff --git a/dockerutil/dockerfake/doc.go b/dockerutil/dockerfake/doc.go index 3fd0ead..8c81260 100644 --- a/dockerutil/dockerfake/doc.go +++ b/dockerutil/dockerfake/doc.go @@ -1,4 +1,5 @@ // Package dockerfake contains logic for mocking out Docker-related // functionality. -//go:generate mockgen -destination ./mock.go -package dockerfake github.com/coder/envbox/dockerutil/dockerfake Client +// +//go:generate mockgen -destination ./mock.go -package dockerfake github.com/coder/envbox/dockerutil DockerClient package dockerfake diff --git a/dockerutil/dockerfake/mock.go b/dockerutil/dockerfake/mock.go new file mode 100644 index 0000000..801232f --- /dev/null +++ b/dockerutil/dockerfake/mock.go @@ -0,0 +1,835 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/coder/envbox/dockerutil (interfaces: DockerClient) +// +// Generated by this command: +// +// mockgen -destination ./mock.go -package dockerfake github.com/coder/envbox/dockerutil DockerClient +// + +// Package dockerfake is a generated GoMock package. +package dockerfake + +import ( + context "context" + io "io" + reflect "reflect" + + types "github.com/docker/docker/api/types" + container "github.com/docker/docker/api/types/container" + events "github.com/docker/docker/api/types/events" + filters "github.com/docker/docker/api/types/filters" + image "github.com/docker/docker/api/types/image" + network "github.com/docker/docker/api/types/network" + registry "github.com/docker/docker/api/types/registry" + system "github.com/docker/docker/api/types/system" + v1 "github.com/opencontainers/image-spec/specs-go/v1" + gomock "go.uber.org/mock/gomock" +) + +// MockDockerClient is a mock of DockerClient interface. +type MockDockerClient struct { + ctrl *gomock.Controller + recorder *MockDockerClientMockRecorder + isgomock struct{} +} + +// MockDockerClientMockRecorder is the mock recorder for MockDockerClient. +type MockDockerClientMockRecorder struct { + mock *MockDockerClient +} + +// NewMockDockerClient creates a new mock instance. +func NewMockDockerClient(ctrl *gomock.Controller) *MockDockerClient { + mock := &MockDockerClient{ctrl: ctrl} + mock.recorder = &MockDockerClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockDockerClient) EXPECT() *MockDockerClientMockRecorder { + return m.recorder +} + +// BuildCachePrune mocks base method. +func (m *MockDockerClient) BuildCachePrune(ctx context.Context, opts types.BuildCachePruneOptions) (*types.BuildCachePruneReport, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BuildCachePrune", ctx, opts) + ret0, _ := ret[0].(*types.BuildCachePruneReport) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// BuildCachePrune indicates an expected call of BuildCachePrune. +func (mr *MockDockerClientMockRecorder) BuildCachePrune(ctx, opts any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BuildCachePrune", reflect.TypeOf((*MockDockerClient)(nil).BuildCachePrune), ctx, opts) +} + +// BuildCancel mocks base method. +func (m *MockDockerClient) BuildCancel(ctx context.Context, id string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BuildCancel", ctx, id) + ret0, _ := ret[0].(error) + return ret0 +} + +// BuildCancel indicates an expected call of BuildCancel. +func (mr *MockDockerClientMockRecorder) BuildCancel(ctx, id any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BuildCancel", reflect.TypeOf((*MockDockerClient)(nil).BuildCancel), ctx, id) +} + +// ContainerAttach mocks base method. +func (m *MockDockerClient) ContainerAttach(ctx context.Context, container string, options container.AttachOptions) (types.HijackedResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ContainerAttach", ctx, container, options) + ret0, _ := ret[0].(types.HijackedResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ContainerAttach indicates an expected call of ContainerAttach. +func (mr *MockDockerClientMockRecorder) ContainerAttach(ctx, container, options any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerAttach", reflect.TypeOf((*MockDockerClient)(nil).ContainerAttach), ctx, container, options) +} + +// ContainerCommit mocks base method. +func (m *MockDockerClient) ContainerCommit(ctx context.Context, container string, options container.CommitOptions) (types.IDResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ContainerCommit", ctx, container, options) + ret0, _ := ret[0].(types.IDResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ContainerCommit indicates an expected call of ContainerCommit. +func (mr *MockDockerClientMockRecorder) ContainerCommit(ctx, container, options any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerCommit", reflect.TypeOf((*MockDockerClient)(nil).ContainerCommit), ctx, container, options) +} + +// ContainerCreate mocks base method. +func (m *MockDockerClient) ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *v1.Platform, containerName string) (container.CreateResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ContainerCreate", ctx, config, hostConfig, networkingConfig, platform, containerName) + ret0, _ := ret[0].(container.CreateResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ContainerCreate indicates an expected call of ContainerCreate. +func (mr *MockDockerClientMockRecorder) ContainerCreate(ctx, config, hostConfig, networkingConfig, platform, containerName any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerCreate", reflect.TypeOf((*MockDockerClient)(nil).ContainerCreate), ctx, config, hostConfig, networkingConfig, platform, containerName) +} + +// ContainerDiff mocks base method. +func (m *MockDockerClient) ContainerDiff(ctx context.Context, container string) ([]container.FilesystemChange, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ContainerDiff", ctx, container) + ret0, _ := ret[0].([]container.FilesystemChange) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ContainerDiff indicates an expected call of ContainerDiff. +func (mr *MockDockerClientMockRecorder) ContainerDiff(ctx, container any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerDiff", reflect.TypeOf((*MockDockerClient)(nil).ContainerDiff), ctx, container) +} + +// ContainerExecAttach mocks base method. +func (m *MockDockerClient) ContainerExecAttach(ctx context.Context, execID string, options container.ExecStartOptions) (types.HijackedResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ContainerExecAttach", ctx, execID, options) + ret0, _ := ret[0].(types.HijackedResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ContainerExecAttach indicates an expected call of ContainerExecAttach. +func (mr *MockDockerClientMockRecorder) ContainerExecAttach(ctx, execID, options any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerExecAttach", reflect.TypeOf((*MockDockerClient)(nil).ContainerExecAttach), ctx, execID, options) +} + +// ContainerExecCreate mocks base method. +func (m *MockDockerClient) ContainerExecCreate(ctx context.Context, container string, options container.ExecOptions) (types.IDResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ContainerExecCreate", ctx, container, options) + ret0, _ := ret[0].(types.IDResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ContainerExecCreate indicates an expected call of ContainerExecCreate. +func (mr *MockDockerClientMockRecorder) ContainerExecCreate(ctx, container, options any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerExecCreate", reflect.TypeOf((*MockDockerClient)(nil).ContainerExecCreate), ctx, container, options) +} + +// ContainerExecInspect mocks base method. +func (m *MockDockerClient) ContainerExecInspect(ctx context.Context, execID string) (container.ExecInspect, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ContainerExecInspect", ctx, execID) + ret0, _ := ret[0].(container.ExecInspect) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ContainerExecInspect indicates an expected call of ContainerExecInspect. +func (mr *MockDockerClientMockRecorder) ContainerExecInspect(ctx, execID any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerExecInspect", reflect.TypeOf((*MockDockerClient)(nil).ContainerExecInspect), ctx, execID) +} + +// ContainerExecResize mocks base method. +func (m *MockDockerClient) ContainerExecResize(ctx context.Context, execID string, options container.ResizeOptions) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ContainerExecResize", ctx, execID, options) + ret0, _ := ret[0].(error) + return ret0 +} + +// ContainerExecResize indicates an expected call of ContainerExecResize. +func (mr *MockDockerClientMockRecorder) ContainerExecResize(ctx, execID, options any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerExecResize", reflect.TypeOf((*MockDockerClient)(nil).ContainerExecResize), ctx, execID, options) +} + +// ContainerExecStart mocks base method. +func (m *MockDockerClient) ContainerExecStart(ctx context.Context, execID string, options container.ExecStartOptions) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ContainerExecStart", ctx, execID, options) + ret0, _ := ret[0].(error) + return ret0 +} + +// ContainerExecStart indicates an expected call of ContainerExecStart. +func (mr *MockDockerClientMockRecorder) ContainerExecStart(ctx, execID, options any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerExecStart", reflect.TypeOf((*MockDockerClient)(nil).ContainerExecStart), ctx, execID, options) +} + +// ContainerExport mocks base method. +func (m *MockDockerClient) ContainerExport(ctx context.Context, container string) (io.ReadCloser, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ContainerExport", ctx, container) + ret0, _ := ret[0].(io.ReadCloser) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ContainerExport indicates an expected call of ContainerExport. +func (mr *MockDockerClientMockRecorder) ContainerExport(ctx, container any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerExport", reflect.TypeOf((*MockDockerClient)(nil).ContainerExport), ctx, container) +} + +// ContainerInspect mocks base method. +func (m *MockDockerClient) ContainerInspect(ctx context.Context, container string) (types.ContainerJSON, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ContainerInspect", ctx, container) + ret0, _ := ret[0].(types.ContainerJSON) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ContainerInspect indicates an expected call of ContainerInspect. +func (mr *MockDockerClientMockRecorder) ContainerInspect(ctx, container any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerInspect", reflect.TypeOf((*MockDockerClient)(nil).ContainerInspect), ctx, container) +} + +// ContainerInspectWithRaw mocks base method. +func (m *MockDockerClient) ContainerInspectWithRaw(ctx context.Context, container string, getSize bool) (types.ContainerJSON, []byte, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ContainerInspectWithRaw", ctx, container, getSize) + ret0, _ := ret[0].(types.ContainerJSON) + ret1, _ := ret[1].([]byte) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// ContainerInspectWithRaw indicates an expected call of ContainerInspectWithRaw. +func (mr *MockDockerClientMockRecorder) ContainerInspectWithRaw(ctx, container, getSize any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerInspectWithRaw", reflect.TypeOf((*MockDockerClient)(nil).ContainerInspectWithRaw), ctx, container, getSize) +} + +// ContainerKill mocks base method. +func (m *MockDockerClient) ContainerKill(ctx context.Context, container, signal string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ContainerKill", ctx, container, signal) + ret0, _ := ret[0].(error) + return ret0 +} + +// ContainerKill indicates an expected call of ContainerKill. +func (mr *MockDockerClientMockRecorder) ContainerKill(ctx, container, signal any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerKill", reflect.TypeOf((*MockDockerClient)(nil).ContainerKill), ctx, container, signal) +} + +// ContainerList mocks base method. +func (m *MockDockerClient) ContainerList(ctx context.Context, options container.ListOptions) ([]types.Container, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ContainerList", ctx, options) + ret0, _ := ret[0].([]types.Container) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ContainerList indicates an expected call of ContainerList. +func (mr *MockDockerClientMockRecorder) ContainerList(ctx, options any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerList", reflect.TypeOf((*MockDockerClient)(nil).ContainerList), ctx, options) +} + +// ContainerLogs mocks base method. +func (m *MockDockerClient) ContainerLogs(ctx context.Context, container string, options container.LogsOptions) (io.ReadCloser, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ContainerLogs", ctx, container, options) + ret0, _ := ret[0].(io.ReadCloser) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ContainerLogs indicates an expected call of ContainerLogs. +func (mr *MockDockerClientMockRecorder) ContainerLogs(ctx, container, options any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerLogs", reflect.TypeOf((*MockDockerClient)(nil).ContainerLogs), ctx, container, options) +} + +// ContainerPause mocks base method. +func (m *MockDockerClient) ContainerPause(ctx context.Context, container string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ContainerPause", ctx, container) + ret0, _ := ret[0].(error) + return ret0 +} + +// ContainerPause indicates an expected call of ContainerPause. +func (mr *MockDockerClientMockRecorder) ContainerPause(ctx, container any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerPause", reflect.TypeOf((*MockDockerClient)(nil).ContainerPause), ctx, container) +} + +// ContainerRemove mocks base method. +func (m *MockDockerClient) ContainerRemove(ctx context.Context, container string, options container.RemoveOptions) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ContainerRemove", ctx, container, options) + ret0, _ := ret[0].(error) + return ret0 +} + +// ContainerRemove indicates an expected call of ContainerRemove. +func (mr *MockDockerClientMockRecorder) ContainerRemove(ctx, container, options any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerRemove", reflect.TypeOf((*MockDockerClient)(nil).ContainerRemove), ctx, container, options) +} + +// ContainerRename mocks base method. +func (m *MockDockerClient) ContainerRename(ctx context.Context, container, newContainerName string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ContainerRename", ctx, container, newContainerName) + ret0, _ := ret[0].(error) + return ret0 +} + +// ContainerRename indicates an expected call of ContainerRename. +func (mr *MockDockerClientMockRecorder) ContainerRename(ctx, container, newContainerName any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerRename", reflect.TypeOf((*MockDockerClient)(nil).ContainerRename), ctx, container, newContainerName) +} + +// ContainerResize mocks base method. +func (m *MockDockerClient) ContainerResize(ctx context.Context, container string, options container.ResizeOptions) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ContainerResize", ctx, container, options) + ret0, _ := ret[0].(error) + return ret0 +} + +// ContainerResize indicates an expected call of ContainerResize. +func (mr *MockDockerClientMockRecorder) ContainerResize(ctx, container, options any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerResize", reflect.TypeOf((*MockDockerClient)(nil).ContainerResize), ctx, container, options) +} + +// ContainerRestart mocks base method. +func (m *MockDockerClient) ContainerRestart(ctx context.Context, container string, options container.StopOptions) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ContainerRestart", ctx, container, options) + ret0, _ := ret[0].(error) + return ret0 +} + +// ContainerRestart indicates an expected call of ContainerRestart. +func (mr *MockDockerClientMockRecorder) ContainerRestart(ctx, container, options any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerRestart", reflect.TypeOf((*MockDockerClient)(nil).ContainerRestart), ctx, container, options) +} + +// ContainerStart mocks base method. +func (m *MockDockerClient) ContainerStart(ctx context.Context, container string, options container.StartOptions) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ContainerStart", ctx, container, options) + ret0, _ := ret[0].(error) + return ret0 +} + +// ContainerStart indicates an expected call of ContainerStart. +func (mr *MockDockerClientMockRecorder) ContainerStart(ctx, container, options any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerStart", reflect.TypeOf((*MockDockerClient)(nil).ContainerStart), ctx, container, options) +} + +// ContainerStatPath mocks base method. +func (m *MockDockerClient) ContainerStatPath(ctx context.Context, container, path string) (container.PathStat, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ContainerStatPath", ctx, container, path) + ret0, _ := ret[0].(container.PathStat) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ContainerStatPath indicates an expected call of ContainerStatPath. +func (mr *MockDockerClientMockRecorder) ContainerStatPath(ctx, container, path any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerStatPath", reflect.TypeOf((*MockDockerClient)(nil).ContainerStatPath), ctx, container, path) +} + +// ContainerStats mocks base method. +func (m *MockDockerClient) ContainerStats(ctx context.Context, container string, stream bool) (container.StatsResponseReader, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ContainerStats", ctx, container, stream) + ret0, _ := ret[0].(container.StatsResponseReader) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ContainerStats indicates an expected call of ContainerStats. +func (mr *MockDockerClientMockRecorder) ContainerStats(ctx, container, stream any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerStats", reflect.TypeOf((*MockDockerClient)(nil).ContainerStats), ctx, container, stream) +} + +// ContainerStatsOneShot mocks base method. +func (m *MockDockerClient) ContainerStatsOneShot(ctx context.Context, container string) (container.StatsResponseReader, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ContainerStatsOneShot", ctx, container) + ret0, _ := ret[0].(container.StatsResponseReader) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ContainerStatsOneShot indicates an expected call of ContainerStatsOneShot. +func (mr *MockDockerClientMockRecorder) ContainerStatsOneShot(ctx, container any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerStatsOneShot", reflect.TypeOf((*MockDockerClient)(nil).ContainerStatsOneShot), ctx, container) +} + +// ContainerStop mocks base method. +func (m *MockDockerClient) ContainerStop(ctx context.Context, container string, options container.StopOptions) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ContainerStop", ctx, container, options) + ret0, _ := ret[0].(error) + return ret0 +} + +// ContainerStop indicates an expected call of ContainerStop. +func (mr *MockDockerClientMockRecorder) ContainerStop(ctx, container, options any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerStop", reflect.TypeOf((*MockDockerClient)(nil).ContainerStop), ctx, container, options) +} + +// ContainerTop mocks base method. +func (m *MockDockerClient) ContainerTop(ctx context.Context, container string, arguments []string) (container.ContainerTopOKBody, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ContainerTop", ctx, container, arguments) + ret0, _ := ret[0].(container.ContainerTopOKBody) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ContainerTop indicates an expected call of ContainerTop. +func (mr *MockDockerClientMockRecorder) ContainerTop(ctx, container, arguments any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerTop", reflect.TypeOf((*MockDockerClient)(nil).ContainerTop), ctx, container, arguments) +} + +// ContainerUnpause mocks base method. +func (m *MockDockerClient) ContainerUnpause(ctx context.Context, container string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ContainerUnpause", ctx, container) + ret0, _ := ret[0].(error) + return ret0 +} + +// ContainerUnpause indicates an expected call of ContainerUnpause. +func (mr *MockDockerClientMockRecorder) ContainerUnpause(ctx, container any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerUnpause", reflect.TypeOf((*MockDockerClient)(nil).ContainerUnpause), ctx, container) +} + +// ContainerUpdate mocks base method. +func (m *MockDockerClient) ContainerUpdate(ctx context.Context, container string, updateConfig container.UpdateConfig) (container.ContainerUpdateOKBody, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ContainerUpdate", ctx, container, updateConfig) + ret0, _ := ret[0].(container.ContainerUpdateOKBody) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ContainerUpdate indicates an expected call of ContainerUpdate. +func (mr *MockDockerClientMockRecorder) ContainerUpdate(ctx, container, updateConfig any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerUpdate", reflect.TypeOf((*MockDockerClient)(nil).ContainerUpdate), ctx, container, updateConfig) +} + +// ContainerWait mocks base method. +func (m *MockDockerClient) ContainerWait(ctx context.Context, container string, condition container.WaitCondition) (<-chan container.WaitResponse, <-chan error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ContainerWait", ctx, container, condition) + ret0, _ := ret[0].(<-chan container.WaitResponse) + ret1, _ := ret[1].(<-chan error) + return ret0, ret1 +} + +// ContainerWait indicates an expected call of ContainerWait. +func (mr *MockDockerClientMockRecorder) ContainerWait(ctx, container, condition any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerWait", reflect.TypeOf((*MockDockerClient)(nil).ContainerWait), ctx, container, condition) +} + +// ContainersPrune mocks base method. +func (m *MockDockerClient) ContainersPrune(ctx context.Context, pruneFilters filters.Args) (container.PruneReport, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ContainersPrune", ctx, pruneFilters) + ret0, _ := ret[0].(container.PruneReport) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ContainersPrune indicates an expected call of ContainersPrune. +func (mr *MockDockerClientMockRecorder) ContainersPrune(ctx, pruneFilters any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainersPrune", reflect.TypeOf((*MockDockerClient)(nil).ContainersPrune), ctx, pruneFilters) +} + +// CopyFromContainer mocks base method. +func (m *MockDockerClient) CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, container.PathStat, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CopyFromContainer", ctx, container, srcPath) + ret0, _ := ret[0].(io.ReadCloser) + ret1, _ := ret[1].(container.PathStat) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// CopyFromContainer indicates an expected call of CopyFromContainer. +func (mr *MockDockerClientMockRecorder) CopyFromContainer(ctx, container, srcPath any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CopyFromContainer", reflect.TypeOf((*MockDockerClient)(nil).CopyFromContainer), ctx, container, srcPath) +} + +// CopyToContainer mocks base method. +func (m *MockDockerClient) CopyToContainer(ctx context.Context, container, path string, content io.Reader, options container.CopyToContainerOptions) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CopyToContainer", ctx, container, path, content, options) + ret0, _ := ret[0].(error) + return ret0 +} + +// CopyToContainer indicates an expected call of CopyToContainer. +func (mr *MockDockerClientMockRecorder) CopyToContainer(ctx, container, path, content, options any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CopyToContainer", reflect.TypeOf((*MockDockerClient)(nil).CopyToContainer), ctx, container, path, content, options) +} + +// DiskUsage mocks base method. +func (m *MockDockerClient) DiskUsage(ctx context.Context, options types.DiskUsageOptions) (types.DiskUsage, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DiskUsage", ctx, options) + ret0, _ := ret[0].(types.DiskUsage) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DiskUsage indicates an expected call of DiskUsage. +func (mr *MockDockerClientMockRecorder) DiskUsage(ctx, options any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DiskUsage", reflect.TypeOf((*MockDockerClient)(nil).DiskUsage), ctx, options) +} + +// Events mocks base method. +func (m *MockDockerClient) Events(ctx context.Context, options events.ListOptions) (<-chan events.Message, <-chan error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Events", ctx, options) + ret0, _ := ret[0].(<-chan events.Message) + ret1, _ := ret[1].(<-chan error) + return ret0, ret1 +} + +// Events indicates an expected call of Events. +func (mr *MockDockerClientMockRecorder) Events(ctx, options any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Events", reflect.TypeOf((*MockDockerClient)(nil).Events), ctx, options) +} + +// ImageBuild mocks base method. +func (m *MockDockerClient) ImageBuild(ctx context.Context, context io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ImageBuild", ctx, context, options) + ret0, _ := ret[0].(types.ImageBuildResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ImageBuild indicates an expected call of ImageBuild. +func (mr *MockDockerClientMockRecorder) ImageBuild(ctx, context, options any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImageBuild", reflect.TypeOf((*MockDockerClient)(nil).ImageBuild), ctx, context, options) +} + +// ImageCreate mocks base method. +func (m *MockDockerClient) ImageCreate(ctx context.Context, parentReference string, options image.CreateOptions) (io.ReadCloser, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ImageCreate", ctx, parentReference, options) + ret0, _ := ret[0].(io.ReadCloser) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ImageCreate indicates an expected call of ImageCreate. +func (mr *MockDockerClientMockRecorder) ImageCreate(ctx, parentReference, options any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImageCreate", reflect.TypeOf((*MockDockerClient)(nil).ImageCreate), ctx, parentReference, options) +} + +// ImageHistory mocks base method. +func (m *MockDockerClient) ImageHistory(ctx context.Context, image string) ([]image.HistoryResponseItem, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ImageHistory", ctx, image) + ret0, _ := ret[0].([]image.HistoryResponseItem) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ImageHistory indicates an expected call of ImageHistory. +func (mr *MockDockerClientMockRecorder) ImageHistory(ctx, image any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImageHistory", reflect.TypeOf((*MockDockerClient)(nil).ImageHistory), ctx, image) +} + +// ImageImport mocks base method. +func (m *MockDockerClient) ImageImport(ctx context.Context, source image.ImportSource, ref string, options image.ImportOptions) (io.ReadCloser, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ImageImport", ctx, source, ref, options) + ret0, _ := ret[0].(io.ReadCloser) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ImageImport indicates an expected call of ImageImport. +func (mr *MockDockerClientMockRecorder) ImageImport(ctx, source, ref, options any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImageImport", reflect.TypeOf((*MockDockerClient)(nil).ImageImport), ctx, source, ref, options) +} + +// ImageInspectWithRaw mocks base method. +func (m *MockDockerClient) ImageInspectWithRaw(ctx context.Context, image string) (types.ImageInspect, []byte, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ImageInspectWithRaw", ctx, image) + ret0, _ := ret[0].(types.ImageInspect) + ret1, _ := ret[1].([]byte) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// ImageInspectWithRaw indicates an expected call of ImageInspectWithRaw. +func (mr *MockDockerClientMockRecorder) ImageInspectWithRaw(ctx, image any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImageInspectWithRaw", reflect.TypeOf((*MockDockerClient)(nil).ImageInspectWithRaw), ctx, image) +} + +// ImageList mocks base method. +func (m *MockDockerClient) ImageList(ctx context.Context, options image.ListOptions) ([]image.Summary, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ImageList", ctx, options) + ret0, _ := ret[0].([]image.Summary) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ImageList indicates an expected call of ImageList. +func (mr *MockDockerClientMockRecorder) ImageList(ctx, options any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImageList", reflect.TypeOf((*MockDockerClient)(nil).ImageList), ctx, options) +} + +// ImageLoad mocks base method. +func (m *MockDockerClient) ImageLoad(ctx context.Context, input io.Reader, quiet bool) (image.LoadResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ImageLoad", ctx, input, quiet) + ret0, _ := ret[0].(image.LoadResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ImageLoad indicates an expected call of ImageLoad. +func (mr *MockDockerClientMockRecorder) ImageLoad(ctx, input, quiet any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImageLoad", reflect.TypeOf((*MockDockerClient)(nil).ImageLoad), ctx, input, quiet) +} + +// ImagePull mocks base method. +func (m *MockDockerClient) ImagePull(ctx context.Context, ref string, options image.PullOptions) (io.ReadCloser, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ImagePull", ctx, ref, options) + ret0, _ := ret[0].(io.ReadCloser) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ImagePull indicates an expected call of ImagePull. +func (mr *MockDockerClientMockRecorder) ImagePull(ctx, ref, options any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImagePull", reflect.TypeOf((*MockDockerClient)(nil).ImagePull), ctx, ref, options) +} + +// ImagePush mocks base method. +func (m *MockDockerClient) ImagePush(ctx context.Context, ref string, options image.PushOptions) (io.ReadCloser, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ImagePush", ctx, ref, options) + ret0, _ := ret[0].(io.ReadCloser) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ImagePush indicates an expected call of ImagePush. +func (mr *MockDockerClientMockRecorder) ImagePush(ctx, ref, options any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImagePush", reflect.TypeOf((*MockDockerClient)(nil).ImagePush), ctx, ref, options) +} + +// ImageRemove mocks base method. +func (m *MockDockerClient) ImageRemove(ctx context.Context, image string, options image.RemoveOptions) ([]image.DeleteResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ImageRemove", ctx, image, options) + ret0, _ := ret[0].([]image.DeleteResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ImageRemove indicates an expected call of ImageRemove. +func (mr *MockDockerClientMockRecorder) ImageRemove(ctx, image, options any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImageRemove", reflect.TypeOf((*MockDockerClient)(nil).ImageRemove), ctx, image, options) +} + +// ImageSave mocks base method. +func (m *MockDockerClient) ImageSave(ctx context.Context, images []string) (io.ReadCloser, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ImageSave", ctx, images) + ret0, _ := ret[0].(io.ReadCloser) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ImageSave indicates an expected call of ImageSave. +func (mr *MockDockerClientMockRecorder) ImageSave(ctx, images any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImageSave", reflect.TypeOf((*MockDockerClient)(nil).ImageSave), ctx, images) +} + +// ImageSearch mocks base method. +func (m *MockDockerClient) ImageSearch(ctx context.Context, term string, options registry.SearchOptions) ([]registry.SearchResult, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ImageSearch", ctx, term, options) + ret0, _ := ret[0].([]registry.SearchResult) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ImageSearch indicates an expected call of ImageSearch. +func (mr *MockDockerClientMockRecorder) ImageSearch(ctx, term, options any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImageSearch", reflect.TypeOf((*MockDockerClient)(nil).ImageSearch), ctx, term, options) +} + +// ImageTag mocks base method. +func (m *MockDockerClient) ImageTag(ctx context.Context, image, ref string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ImageTag", ctx, image, ref) + ret0, _ := ret[0].(error) + return ret0 +} + +// ImageTag indicates an expected call of ImageTag. +func (mr *MockDockerClientMockRecorder) ImageTag(ctx, image, ref any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImageTag", reflect.TypeOf((*MockDockerClient)(nil).ImageTag), ctx, image, ref) +} + +// ImagesPrune mocks base method. +func (m *MockDockerClient) ImagesPrune(ctx context.Context, pruneFilter filters.Args) (image.PruneReport, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ImagesPrune", ctx, pruneFilter) + ret0, _ := ret[0].(image.PruneReport) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ImagesPrune indicates an expected call of ImagesPrune. +func (mr *MockDockerClientMockRecorder) ImagesPrune(ctx, pruneFilter any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImagesPrune", reflect.TypeOf((*MockDockerClient)(nil).ImagesPrune), ctx, pruneFilter) +} + +// Info mocks base method. +func (m *MockDockerClient) Info(ctx context.Context) (system.Info, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Info", ctx) + ret0, _ := ret[0].(system.Info) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Info indicates an expected call of Info. +func (mr *MockDockerClientMockRecorder) Info(ctx any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockDockerClient)(nil).Info), ctx) +} + +// Ping mocks base method. +func (m *MockDockerClient) Ping(ctx context.Context) (types.Ping, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Ping", ctx) + ret0, _ := ret[0].(types.Ping) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Ping indicates an expected call of Ping. +func (mr *MockDockerClientMockRecorder) Ping(ctx any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Ping", reflect.TypeOf((*MockDockerClient)(nil).Ping), ctx) +} + +// RegistryLogin mocks base method. +func (m *MockDockerClient) RegistryLogin(ctx context.Context, auth registry.AuthConfig) (registry.AuthenticateOKBody, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "RegistryLogin", ctx, auth) + ret0, _ := ret[0].(registry.AuthenticateOKBody) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// RegistryLogin indicates an expected call of RegistryLogin. +func (mr *MockDockerClientMockRecorder) RegistryLogin(ctx, auth any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegistryLogin", reflect.TypeOf((*MockDockerClient)(nil).RegistryLogin), ctx, auth) +} diff --git a/dockerutil/image.go b/dockerutil/image.go index 55e9d2d..2cc09d9 100644 --- a/dockerutil/image.go +++ b/dockerutil/image.go @@ -9,9 +9,9 @@ import ( "strings" "time" - dockertypes "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/filters" + "github.com/docker/docker/api/types/image" "golang.org/x/xerrors" "github.com/coder/envbox/buildlog" @@ -51,7 +51,7 @@ func PullImage(ctx context.Context, config *PullImageConfig) error { pullImageFn := func() error { var rd io.ReadCloser - rd, err = config.Client.ImagePull(ctx, config.Image, dockertypes.ImagePullOptions{ + rd, err = config.Client.ImagePull(ctx, config.Image, image.PullOptions{ RegistryAuth: authStr, }) if err != nil { @@ -106,12 +106,12 @@ func PullImage(ctx context.Context, config *PullImageConfig) error { } // PruneImage runs a simple 'docker prune'. -func PruneImages(ctx context.Context, client DockerClient) (dockertypes.ImagesPruneReport, error) { +func PruneImages(ctx context.Context, client DockerClient) (image.PruneReport, error) { report, err := client.ImagesPrune(ctx, filters.NewArgs(filters.Arg("dangling", "false")), ) if err != nil { - return dockertypes.ImagesPruneReport{}, xerrors.Errorf("images prune: %w", err) + return image.PruneReport{}, xerrors.Errorf("images prune: %w", err) } return report, nil @@ -176,12 +176,12 @@ func GetImageMetadata(ctx context.Context, client DockerClient, image, username defer func() { // We wanna remove this, but it's not a huge deal if it fails. - _ = client.ContainerRemove(ctx, created.ID, dockertypes.ContainerRemoveOptions{ + _ = client.ContainerRemove(ctx, created.ID, container.RemoveOptions{ Force: true, }) }() - err = client.ContainerStart(ctx, created.ID, dockertypes.ContainerStartOptions{}) + err = client.ContainerStart(ctx, created.ID, container.StartOptions{}) if err != nil { return ImageMetadata{}, xerrors.Errorf("start container: %w", err) } diff --git a/go.mod b/go.mod index f68a705..eb6eb72 100644 --- a/go.mod +++ b/go.mod @@ -198,6 +198,7 @@ require ( go.opentelemetry.io/otel/trace v1.32.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/atomic v1.11.0 // indirect + go.uber.org/mock v0.5.0 // indirect go4.org/mem v0.0.0-20220726221520-4f986261bf13 // indirect go4.org/netipx v0.0.0-20230728180743-ad4cb58a6516 // indirect golang.org/x/net v0.30.0 // indirect diff --git a/go.sum b/go.sum index 9a84490..909b0d3 100644 --- a/go.sum +++ b/go.sum @@ -581,6 +581,8 @@ go.uber.org/goleak v1.3.1-0.20240429205332-517bace7cc29 h1:w0QrHuh0hhUZ++UTQaBM2 go.uber.org/goleak v1.3.1-0.20240429205332-517bace7cc29/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= +go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU= +go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM= go4.org/mem v0.0.0-20220726221520-4f986261bf13 h1:CbZeCBZ0aZj8EfVgnqQcYZgf0lpZ3H9rmp5nkDTAst8= go4.org/mem v0.0.0-20220726221520-4f986261bf13/go.mod h1:reUoABIJ9ikfM5sgtSF3Wushcza7+WeD01VB9Lirh3g= go4.org/netipx v0.0.0-20230728180743-ad4cb58a6516 h1:X66ZEoMN2SuaoI/dfZVYobB6E5zjZyyHUMWlCA7MgGE= From 93938bc9d3b2701710a2b4d65f79cc5bda33fa89 Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Tue, 26 Nov 2024 17:37:18 +0000 Subject: [PATCH 04/10] Revert "use mockgen" This reverts commit b46e63bd3d131ddd23a3e19544ad19161bdede7e. --- dockerutil/dockerfake/doc.go | 3 +- dockerutil/dockerfake/mock.go | 835 ---------------------------------- dockerutil/image.go | 12 +- go.mod | 1 - go.sum | 2 - 5 files changed, 7 insertions(+), 846 deletions(-) delete mode 100644 dockerutil/dockerfake/mock.go diff --git a/dockerutil/dockerfake/doc.go b/dockerutil/dockerfake/doc.go index 8c81260..3fd0ead 100644 --- a/dockerutil/dockerfake/doc.go +++ b/dockerutil/dockerfake/doc.go @@ -1,5 +1,4 @@ // Package dockerfake contains logic for mocking out Docker-related // functionality. -// -//go:generate mockgen -destination ./mock.go -package dockerfake github.com/coder/envbox/dockerutil DockerClient +//go:generate mockgen -destination ./mock.go -package dockerfake github.com/coder/envbox/dockerutil/dockerfake Client package dockerfake diff --git a/dockerutil/dockerfake/mock.go b/dockerutil/dockerfake/mock.go deleted file mode 100644 index 801232f..0000000 --- a/dockerutil/dockerfake/mock.go +++ /dev/null @@ -1,835 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/coder/envbox/dockerutil (interfaces: DockerClient) -// -// Generated by this command: -// -// mockgen -destination ./mock.go -package dockerfake github.com/coder/envbox/dockerutil DockerClient -// - -// Package dockerfake is a generated GoMock package. -package dockerfake - -import ( - context "context" - io "io" - reflect "reflect" - - types "github.com/docker/docker/api/types" - container "github.com/docker/docker/api/types/container" - events "github.com/docker/docker/api/types/events" - filters "github.com/docker/docker/api/types/filters" - image "github.com/docker/docker/api/types/image" - network "github.com/docker/docker/api/types/network" - registry "github.com/docker/docker/api/types/registry" - system "github.com/docker/docker/api/types/system" - v1 "github.com/opencontainers/image-spec/specs-go/v1" - gomock "go.uber.org/mock/gomock" -) - -// MockDockerClient is a mock of DockerClient interface. -type MockDockerClient struct { - ctrl *gomock.Controller - recorder *MockDockerClientMockRecorder - isgomock struct{} -} - -// MockDockerClientMockRecorder is the mock recorder for MockDockerClient. -type MockDockerClientMockRecorder struct { - mock *MockDockerClient -} - -// NewMockDockerClient creates a new mock instance. -func NewMockDockerClient(ctrl *gomock.Controller) *MockDockerClient { - mock := &MockDockerClient{ctrl: ctrl} - mock.recorder = &MockDockerClientMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockDockerClient) EXPECT() *MockDockerClientMockRecorder { - return m.recorder -} - -// BuildCachePrune mocks base method. -func (m *MockDockerClient) BuildCachePrune(ctx context.Context, opts types.BuildCachePruneOptions) (*types.BuildCachePruneReport, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "BuildCachePrune", ctx, opts) - ret0, _ := ret[0].(*types.BuildCachePruneReport) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// BuildCachePrune indicates an expected call of BuildCachePrune. -func (mr *MockDockerClientMockRecorder) BuildCachePrune(ctx, opts any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BuildCachePrune", reflect.TypeOf((*MockDockerClient)(nil).BuildCachePrune), ctx, opts) -} - -// BuildCancel mocks base method. -func (m *MockDockerClient) BuildCancel(ctx context.Context, id string) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "BuildCancel", ctx, id) - ret0, _ := ret[0].(error) - return ret0 -} - -// BuildCancel indicates an expected call of BuildCancel. -func (mr *MockDockerClientMockRecorder) BuildCancel(ctx, id any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BuildCancel", reflect.TypeOf((*MockDockerClient)(nil).BuildCancel), ctx, id) -} - -// ContainerAttach mocks base method. -func (m *MockDockerClient) ContainerAttach(ctx context.Context, container string, options container.AttachOptions) (types.HijackedResponse, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ContainerAttach", ctx, container, options) - ret0, _ := ret[0].(types.HijackedResponse) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ContainerAttach indicates an expected call of ContainerAttach. -func (mr *MockDockerClientMockRecorder) ContainerAttach(ctx, container, options any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerAttach", reflect.TypeOf((*MockDockerClient)(nil).ContainerAttach), ctx, container, options) -} - -// ContainerCommit mocks base method. -func (m *MockDockerClient) ContainerCommit(ctx context.Context, container string, options container.CommitOptions) (types.IDResponse, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ContainerCommit", ctx, container, options) - ret0, _ := ret[0].(types.IDResponse) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ContainerCommit indicates an expected call of ContainerCommit. -func (mr *MockDockerClientMockRecorder) ContainerCommit(ctx, container, options any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerCommit", reflect.TypeOf((*MockDockerClient)(nil).ContainerCommit), ctx, container, options) -} - -// ContainerCreate mocks base method. -func (m *MockDockerClient) ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *v1.Platform, containerName string) (container.CreateResponse, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ContainerCreate", ctx, config, hostConfig, networkingConfig, platform, containerName) - ret0, _ := ret[0].(container.CreateResponse) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ContainerCreate indicates an expected call of ContainerCreate. -func (mr *MockDockerClientMockRecorder) ContainerCreate(ctx, config, hostConfig, networkingConfig, platform, containerName any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerCreate", reflect.TypeOf((*MockDockerClient)(nil).ContainerCreate), ctx, config, hostConfig, networkingConfig, platform, containerName) -} - -// ContainerDiff mocks base method. -func (m *MockDockerClient) ContainerDiff(ctx context.Context, container string) ([]container.FilesystemChange, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ContainerDiff", ctx, container) - ret0, _ := ret[0].([]container.FilesystemChange) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ContainerDiff indicates an expected call of ContainerDiff. -func (mr *MockDockerClientMockRecorder) ContainerDiff(ctx, container any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerDiff", reflect.TypeOf((*MockDockerClient)(nil).ContainerDiff), ctx, container) -} - -// ContainerExecAttach mocks base method. -func (m *MockDockerClient) ContainerExecAttach(ctx context.Context, execID string, options container.ExecStartOptions) (types.HijackedResponse, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ContainerExecAttach", ctx, execID, options) - ret0, _ := ret[0].(types.HijackedResponse) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ContainerExecAttach indicates an expected call of ContainerExecAttach. -func (mr *MockDockerClientMockRecorder) ContainerExecAttach(ctx, execID, options any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerExecAttach", reflect.TypeOf((*MockDockerClient)(nil).ContainerExecAttach), ctx, execID, options) -} - -// ContainerExecCreate mocks base method. -func (m *MockDockerClient) ContainerExecCreate(ctx context.Context, container string, options container.ExecOptions) (types.IDResponse, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ContainerExecCreate", ctx, container, options) - ret0, _ := ret[0].(types.IDResponse) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ContainerExecCreate indicates an expected call of ContainerExecCreate. -func (mr *MockDockerClientMockRecorder) ContainerExecCreate(ctx, container, options any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerExecCreate", reflect.TypeOf((*MockDockerClient)(nil).ContainerExecCreate), ctx, container, options) -} - -// ContainerExecInspect mocks base method. -func (m *MockDockerClient) ContainerExecInspect(ctx context.Context, execID string) (container.ExecInspect, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ContainerExecInspect", ctx, execID) - ret0, _ := ret[0].(container.ExecInspect) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ContainerExecInspect indicates an expected call of ContainerExecInspect. -func (mr *MockDockerClientMockRecorder) ContainerExecInspect(ctx, execID any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerExecInspect", reflect.TypeOf((*MockDockerClient)(nil).ContainerExecInspect), ctx, execID) -} - -// ContainerExecResize mocks base method. -func (m *MockDockerClient) ContainerExecResize(ctx context.Context, execID string, options container.ResizeOptions) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ContainerExecResize", ctx, execID, options) - ret0, _ := ret[0].(error) - return ret0 -} - -// ContainerExecResize indicates an expected call of ContainerExecResize. -func (mr *MockDockerClientMockRecorder) ContainerExecResize(ctx, execID, options any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerExecResize", reflect.TypeOf((*MockDockerClient)(nil).ContainerExecResize), ctx, execID, options) -} - -// ContainerExecStart mocks base method. -func (m *MockDockerClient) ContainerExecStart(ctx context.Context, execID string, options container.ExecStartOptions) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ContainerExecStart", ctx, execID, options) - ret0, _ := ret[0].(error) - return ret0 -} - -// ContainerExecStart indicates an expected call of ContainerExecStart. -func (mr *MockDockerClientMockRecorder) ContainerExecStart(ctx, execID, options any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerExecStart", reflect.TypeOf((*MockDockerClient)(nil).ContainerExecStart), ctx, execID, options) -} - -// ContainerExport mocks base method. -func (m *MockDockerClient) ContainerExport(ctx context.Context, container string) (io.ReadCloser, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ContainerExport", ctx, container) - ret0, _ := ret[0].(io.ReadCloser) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ContainerExport indicates an expected call of ContainerExport. -func (mr *MockDockerClientMockRecorder) ContainerExport(ctx, container any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerExport", reflect.TypeOf((*MockDockerClient)(nil).ContainerExport), ctx, container) -} - -// ContainerInspect mocks base method. -func (m *MockDockerClient) ContainerInspect(ctx context.Context, container string) (types.ContainerJSON, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ContainerInspect", ctx, container) - ret0, _ := ret[0].(types.ContainerJSON) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ContainerInspect indicates an expected call of ContainerInspect. -func (mr *MockDockerClientMockRecorder) ContainerInspect(ctx, container any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerInspect", reflect.TypeOf((*MockDockerClient)(nil).ContainerInspect), ctx, container) -} - -// ContainerInspectWithRaw mocks base method. -func (m *MockDockerClient) ContainerInspectWithRaw(ctx context.Context, container string, getSize bool) (types.ContainerJSON, []byte, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ContainerInspectWithRaw", ctx, container, getSize) - ret0, _ := ret[0].(types.ContainerJSON) - ret1, _ := ret[1].([]byte) - ret2, _ := ret[2].(error) - return ret0, ret1, ret2 -} - -// ContainerInspectWithRaw indicates an expected call of ContainerInspectWithRaw. -func (mr *MockDockerClientMockRecorder) ContainerInspectWithRaw(ctx, container, getSize any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerInspectWithRaw", reflect.TypeOf((*MockDockerClient)(nil).ContainerInspectWithRaw), ctx, container, getSize) -} - -// ContainerKill mocks base method. -func (m *MockDockerClient) ContainerKill(ctx context.Context, container, signal string) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ContainerKill", ctx, container, signal) - ret0, _ := ret[0].(error) - return ret0 -} - -// ContainerKill indicates an expected call of ContainerKill. -func (mr *MockDockerClientMockRecorder) ContainerKill(ctx, container, signal any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerKill", reflect.TypeOf((*MockDockerClient)(nil).ContainerKill), ctx, container, signal) -} - -// ContainerList mocks base method. -func (m *MockDockerClient) ContainerList(ctx context.Context, options container.ListOptions) ([]types.Container, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ContainerList", ctx, options) - ret0, _ := ret[0].([]types.Container) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ContainerList indicates an expected call of ContainerList. -func (mr *MockDockerClientMockRecorder) ContainerList(ctx, options any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerList", reflect.TypeOf((*MockDockerClient)(nil).ContainerList), ctx, options) -} - -// ContainerLogs mocks base method. -func (m *MockDockerClient) ContainerLogs(ctx context.Context, container string, options container.LogsOptions) (io.ReadCloser, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ContainerLogs", ctx, container, options) - ret0, _ := ret[0].(io.ReadCloser) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ContainerLogs indicates an expected call of ContainerLogs. -func (mr *MockDockerClientMockRecorder) ContainerLogs(ctx, container, options any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerLogs", reflect.TypeOf((*MockDockerClient)(nil).ContainerLogs), ctx, container, options) -} - -// ContainerPause mocks base method. -func (m *MockDockerClient) ContainerPause(ctx context.Context, container string) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ContainerPause", ctx, container) - ret0, _ := ret[0].(error) - return ret0 -} - -// ContainerPause indicates an expected call of ContainerPause. -func (mr *MockDockerClientMockRecorder) ContainerPause(ctx, container any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerPause", reflect.TypeOf((*MockDockerClient)(nil).ContainerPause), ctx, container) -} - -// ContainerRemove mocks base method. -func (m *MockDockerClient) ContainerRemove(ctx context.Context, container string, options container.RemoveOptions) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ContainerRemove", ctx, container, options) - ret0, _ := ret[0].(error) - return ret0 -} - -// ContainerRemove indicates an expected call of ContainerRemove. -func (mr *MockDockerClientMockRecorder) ContainerRemove(ctx, container, options any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerRemove", reflect.TypeOf((*MockDockerClient)(nil).ContainerRemove), ctx, container, options) -} - -// ContainerRename mocks base method. -func (m *MockDockerClient) ContainerRename(ctx context.Context, container, newContainerName string) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ContainerRename", ctx, container, newContainerName) - ret0, _ := ret[0].(error) - return ret0 -} - -// ContainerRename indicates an expected call of ContainerRename. -func (mr *MockDockerClientMockRecorder) ContainerRename(ctx, container, newContainerName any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerRename", reflect.TypeOf((*MockDockerClient)(nil).ContainerRename), ctx, container, newContainerName) -} - -// ContainerResize mocks base method. -func (m *MockDockerClient) ContainerResize(ctx context.Context, container string, options container.ResizeOptions) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ContainerResize", ctx, container, options) - ret0, _ := ret[0].(error) - return ret0 -} - -// ContainerResize indicates an expected call of ContainerResize. -func (mr *MockDockerClientMockRecorder) ContainerResize(ctx, container, options any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerResize", reflect.TypeOf((*MockDockerClient)(nil).ContainerResize), ctx, container, options) -} - -// ContainerRestart mocks base method. -func (m *MockDockerClient) ContainerRestart(ctx context.Context, container string, options container.StopOptions) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ContainerRestart", ctx, container, options) - ret0, _ := ret[0].(error) - return ret0 -} - -// ContainerRestart indicates an expected call of ContainerRestart. -func (mr *MockDockerClientMockRecorder) ContainerRestart(ctx, container, options any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerRestart", reflect.TypeOf((*MockDockerClient)(nil).ContainerRestart), ctx, container, options) -} - -// ContainerStart mocks base method. -func (m *MockDockerClient) ContainerStart(ctx context.Context, container string, options container.StartOptions) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ContainerStart", ctx, container, options) - ret0, _ := ret[0].(error) - return ret0 -} - -// ContainerStart indicates an expected call of ContainerStart. -func (mr *MockDockerClientMockRecorder) ContainerStart(ctx, container, options any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerStart", reflect.TypeOf((*MockDockerClient)(nil).ContainerStart), ctx, container, options) -} - -// ContainerStatPath mocks base method. -func (m *MockDockerClient) ContainerStatPath(ctx context.Context, container, path string) (container.PathStat, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ContainerStatPath", ctx, container, path) - ret0, _ := ret[0].(container.PathStat) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ContainerStatPath indicates an expected call of ContainerStatPath. -func (mr *MockDockerClientMockRecorder) ContainerStatPath(ctx, container, path any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerStatPath", reflect.TypeOf((*MockDockerClient)(nil).ContainerStatPath), ctx, container, path) -} - -// ContainerStats mocks base method. -func (m *MockDockerClient) ContainerStats(ctx context.Context, container string, stream bool) (container.StatsResponseReader, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ContainerStats", ctx, container, stream) - ret0, _ := ret[0].(container.StatsResponseReader) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ContainerStats indicates an expected call of ContainerStats. -func (mr *MockDockerClientMockRecorder) ContainerStats(ctx, container, stream any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerStats", reflect.TypeOf((*MockDockerClient)(nil).ContainerStats), ctx, container, stream) -} - -// ContainerStatsOneShot mocks base method. -func (m *MockDockerClient) ContainerStatsOneShot(ctx context.Context, container string) (container.StatsResponseReader, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ContainerStatsOneShot", ctx, container) - ret0, _ := ret[0].(container.StatsResponseReader) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ContainerStatsOneShot indicates an expected call of ContainerStatsOneShot. -func (mr *MockDockerClientMockRecorder) ContainerStatsOneShot(ctx, container any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerStatsOneShot", reflect.TypeOf((*MockDockerClient)(nil).ContainerStatsOneShot), ctx, container) -} - -// ContainerStop mocks base method. -func (m *MockDockerClient) ContainerStop(ctx context.Context, container string, options container.StopOptions) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ContainerStop", ctx, container, options) - ret0, _ := ret[0].(error) - return ret0 -} - -// ContainerStop indicates an expected call of ContainerStop. -func (mr *MockDockerClientMockRecorder) ContainerStop(ctx, container, options any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerStop", reflect.TypeOf((*MockDockerClient)(nil).ContainerStop), ctx, container, options) -} - -// ContainerTop mocks base method. -func (m *MockDockerClient) ContainerTop(ctx context.Context, container string, arguments []string) (container.ContainerTopOKBody, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ContainerTop", ctx, container, arguments) - ret0, _ := ret[0].(container.ContainerTopOKBody) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ContainerTop indicates an expected call of ContainerTop. -func (mr *MockDockerClientMockRecorder) ContainerTop(ctx, container, arguments any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerTop", reflect.TypeOf((*MockDockerClient)(nil).ContainerTop), ctx, container, arguments) -} - -// ContainerUnpause mocks base method. -func (m *MockDockerClient) ContainerUnpause(ctx context.Context, container string) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ContainerUnpause", ctx, container) - ret0, _ := ret[0].(error) - return ret0 -} - -// ContainerUnpause indicates an expected call of ContainerUnpause. -func (mr *MockDockerClientMockRecorder) ContainerUnpause(ctx, container any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerUnpause", reflect.TypeOf((*MockDockerClient)(nil).ContainerUnpause), ctx, container) -} - -// ContainerUpdate mocks base method. -func (m *MockDockerClient) ContainerUpdate(ctx context.Context, container string, updateConfig container.UpdateConfig) (container.ContainerUpdateOKBody, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ContainerUpdate", ctx, container, updateConfig) - ret0, _ := ret[0].(container.ContainerUpdateOKBody) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ContainerUpdate indicates an expected call of ContainerUpdate. -func (mr *MockDockerClientMockRecorder) ContainerUpdate(ctx, container, updateConfig any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerUpdate", reflect.TypeOf((*MockDockerClient)(nil).ContainerUpdate), ctx, container, updateConfig) -} - -// ContainerWait mocks base method. -func (m *MockDockerClient) ContainerWait(ctx context.Context, container string, condition container.WaitCondition) (<-chan container.WaitResponse, <-chan error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ContainerWait", ctx, container, condition) - ret0, _ := ret[0].(<-chan container.WaitResponse) - ret1, _ := ret[1].(<-chan error) - return ret0, ret1 -} - -// ContainerWait indicates an expected call of ContainerWait. -func (mr *MockDockerClientMockRecorder) ContainerWait(ctx, container, condition any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerWait", reflect.TypeOf((*MockDockerClient)(nil).ContainerWait), ctx, container, condition) -} - -// ContainersPrune mocks base method. -func (m *MockDockerClient) ContainersPrune(ctx context.Context, pruneFilters filters.Args) (container.PruneReport, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ContainersPrune", ctx, pruneFilters) - ret0, _ := ret[0].(container.PruneReport) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ContainersPrune indicates an expected call of ContainersPrune. -func (mr *MockDockerClientMockRecorder) ContainersPrune(ctx, pruneFilters any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainersPrune", reflect.TypeOf((*MockDockerClient)(nil).ContainersPrune), ctx, pruneFilters) -} - -// CopyFromContainer mocks base method. -func (m *MockDockerClient) CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, container.PathStat, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CopyFromContainer", ctx, container, srcPath) - ret0, _ := ret[0].(io.ReadCloser) - ret1, _ := ret[1].(container.PathStat) - ret2, _ := ret[2].(error) - return ret0, ret1, ret2 -} - -// CopyFromContainer indicates an expected call of CopyFromContainer. -func (mr *MockDockerClientMockRecorder) CopyFromContainer(ctx, container, srcPath any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CopyFromContainer", reflect.TypeOf((*MockDockerClient)(nil).CopyFromContainer), ctx, container, srcPath) -} - -// CopyToContainer mocks base method. -func (m *MockDockerClient) CopyToContainer(ctx context.Context, container, path string, content io.Reader, options container.CopyToContainerOptions) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CopyToContainer", ctx, container, path, content, options) - ret0, _ := ret[0].(error) - return ret0 -} - -// CopyToContainer indicates an expected call of CopyToContainer. -func (mr *MockDockerClientMockRecorder) CopyToContainer(ctx, container, path, content, options any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CopyToContainer", reflect.TypeOf((*MockDockerClient)(nil).CopyToContainer), ctx, container, path, content, options) -} - -// DiskUsage mocks base method. -func (m *MockDockerClient) DiskUsage(ctx context.Context, options types.DiskUsageOptions) (types.DiskUsage, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "DiskUsage", ctx, options) - ret0, _ := ret[0].(types.DiskUsage) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// DiskUsage indicates an expected call of DiskUsage. -func (mr *MockDockerClientMockRecorder) DiskUsage(ctx, options any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DiskUsage", reflect.TypeOf((*MockDockerClient)(nil).DiskUsage), ctx, options) -} - -// Events mocks base method. -func (m *MockDockerClient) Events(ctx context.Context, options events.ListOptions) (<-chan events.Message, <-chan error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Events", ctx, options) - ret0, _ := ret[0].(<-chan events.Message) - ret1, _ := ret[1].(<-chan error) - return ret0, ret1 -} - -// Events indicates an expected call of Events. -func (mr *MockDockerClientMockRecorder) Events(ctx, options any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Events", reflect.TypeOf((*MockDockerClient)(nil).Events), ctx, options) -} - -// ImageBuild mocks base method. -func (m *MockDockerClient) ImageBuild(ctx context.Context, context io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ImageBuild", ctx, context, options) - ret0, _ := ret[0].(types.ImageBuildResponse) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ImageBuild indicates an expected call of ImageBuild. -func (mr *MockDockerClientMockRecorder) ImageBuild(ctx, context, options any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImageBuild", reflect.TypeOf((*MockDockerClient)(nil).ImageBuild), ctx, context, options) -} - -// ImageCreate mocks base method. -func (m *MockDockerClient) ImageCreate(ctx context.Context, parentReference string, options image.CreateOptions) (io.ReadCloser, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ImageCreate", ctx, parentReference, options) - ret0, _ := ret[0].(io.ReadCloser) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ImageCreate indicates an expected call of ImageCreate. -func (mr *MockDockerClientMockRecorder) ImageCreate(ctx, parentReference, options any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImageCreate", reflect.TypeOf((*MockDockerClient)(nil).ImageCreate), ctx, parentReference, options) -} - -// ImageHistory mocks base method. -func (m *MockDockerClient) ImageHistory(ctx context.Context, image string) ([]image.HistoryResponseItem, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ImageHistory", ctx, image) - ret0, _ := ret[0].([]image.HistoryResponseItem) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ImageHistory indicates an expected call of ImageHistory. -func (mr *MockDockerClientMockRecorder) ImageHistory(ctx, image any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImageHistory", reflect.TypeOf((*MockDockerClient)(nil).ImageHistory), ctx, image) -} - -// ImageImport mocks base method. -func (m *MockDockerClient) ImageImport(ctx context.Context, source image.ImportSource, ref string, options image.ImportOptions) (io.ReadCloser, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ImageImport", ctx, source, ref, options) - ret0, _ := ret[0].(io.ReadCloser) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ImageImport indicates an expected call of ImageImport. -func (mr *MockDockerClientMockRecorder) ImageImport(ctx, source, ref, options any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImageImport", reflect.TypeOf((*MockDockerClient)(nil).ImageImport), ctx, source, ref, options) -} - -// ImageInspectWithRaw mocks base method. -func (m *MockDockerClient) ImageInspectWithRaw(ctx context.Context, image string) (types.ImageInspect, []byte, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ImageInspectWithRaw", ctx, image) - ret0, _ := ret[0].(types.ImageInspect) - ret1, _ := ret[1].([]byte) - ret2, _ := ret[2].(error) - return ret0, ret1, ret2 -} - -// ImageInspectWithRaw indicates an expected call of ImageInspectWithRaw. -func (mr *MockDockerClientMockRecorder) ImageInspectWithRaw(ctx, image any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImageInspectWithRaw", reflect.TypeOf((*MockDockerClient)(nil).ImageInspectWithRaw), ctx, image) -} - -// ImageList mocks base method. -func (m *MockDockerClient) ImageList(ctx context.Context, options image.ListOptions) ([]image.Summary, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ImageList", ctx, options) - ret0, _ := ret[0].([]image.Summary) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ImageList indicates an expected call of ImageList. -func (mr *MockDockerClientMockRecorder) ImageList(ctx, options any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImageList", reflect.TypeOf((*MockDockerClient)(nil).ImageList), ctx, options) -} - -// ImageLoad mocks base method. -func (m *MockDockerClient) ImageLoad(ctx context.Context, input io.Reader, quiet bool) (image.LoadResponse, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ImageLoad", ctx, input, quiet) - ret0, _ := ret[0].(image.LoadResponse) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ImageLoad indicates an expected call of ImageLoad. -func (mr *MockDockerClientMockRecorder) ImageLoad(ctx, input, quiet any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImageLoad", reflect.TypeOf((*MockDockerClient)(nil).ImageLoad), ctx, input, quiet) -} - -// ImagePull mocks base method. -func (m *MockDockerClient) ImagePull(ctx context.Context, ref string, options image.PullOptions) (io.ReadCloser, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ImagePull", ctx, ref, options) - ret0, _ := ret[0].(io.ReadCloser) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ImagePull indicates an expected call of ImagePull. -func (mr *MockDockerClientMockRecorder) ImagePull(ctx, ref, options any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImagePull", reflect.TypeOf((*MockDockerClient)(nil).ImagePull), ctx, ref, options) -} - -// ImagePush mocks base method. -func (m *MockDockerClient) ImagePush(ctx context.Context, ref string, options image.PushOptions) (io.ReadCloser, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ImagePush", ctx, ref, options) - ret0, _ := ret[0].(io.ReadCloser) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ImagePush indicates an expected call of ImagePush. -func (mr *MockDockerClientMockRecorder) ImagePush(ctx, ref, options any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImagePush", reflect.TypeOf((*MockDockerClient)(nil).ImagePush), ctx, ref, options) -} - -// ImageRemove mocks base method. -func (m *MockDockerClient) ImageRemove(ctx context.Context, image string, options image.RemoveOptions) ([]image.DeleteResponse, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ImageRemove", ctx, image, options) - ret0, _ := ret[0].([]image.DeleteResponse) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ImageRemove indicates an expected call of ImageRemove. -func (mr *MockDockerClientMockRecorder) ImageRemove(ctx, image, options any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImageRemove", reflect.TypeOf((*MockDockerClient)(nil).ImageRemove), ctx, image, options) -} - -// ImageSave mocks base method. -func (m *MockDockerClient) ImageSave(ctx context.Context, images []string) (io.ReadCloser, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ImageSave", ctx, images) - ret0, _ := ret[0].(io.ReadCloser) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ImageSave indicates an expected call of ImageSave. -func (mr *MockDockerClientMockRecorder) ImageSave(ctx, images any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImageSave", reflect.TypeOf((*MockDockerClient)(nil).ImageSave), ctx, images) -} - -// ImageSearch mocks base method. -func (m *MockDockerClient) ImageSearch(ctx context.Context, term string, options registry.SearchOptions) ([]registry.SearchResult, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ImageSearch", ctx, term, options) - ret0, _ := ret[0].([]registry.SearchResult) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ImageSearch indicates an expected call of ImageSearch. -func (mr *MockDockerClientMockRecorder) ImageSearch(ctx, term, options any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImageSearch", reflect.TypeOf((*MockDockerClient)(nil).ImageSearch), ctx, term, options) -} - -// ImageTag mocks base method. -func (m *MockDockerClient) ImageTag(ctx context.Context, image, ref string) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ImageTag", ctx, image, ref) - ret0, _ := ret[0].(error) - return ret0 -} - -// ImageTag indicates an expected call of ImageTag. -func (mr *MockDockerClientMockRecorder) ImageTag(ctx, image, ref any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImageTag", reflect.TypeOf((*MockDockerClient)(nil).ImageTag), ctx, image, ref) -} - -// ImagesPrune mocks base method. -func (m *MockDockerClient) ImagesPrune(ctx context.Context, pruneFilter filters.Args) (image.PruneReport, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ImagesPrune", ctx, pruneFilter) - ret0, _ := ret[0].(image.PruneReport) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ImagesPrune indicates an expected call of ImagesPrune. -func (mr *MockDockerClientMockRecorder) ImagesPrune(ctx, pruneFilter any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImagesPrune", reflect.TypeOf((*MockDockerClient)(nil).ImagesPrune), ctx, pruneFilter) -} - -// Info mocks base method. -func (m *MockDockerClient) Info(ctx context.Context) (system.Info, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Info", ctx) - ret0, _ := ret[0].(system.Info) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Info indicates an expected call of Info. -func (mr *MockDockerClientMockRecorder) Info(ctx any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockDockerClient)(nil).Info), ctx) -} - -// Ping mocks base method. -func (m *MockDockerClient) Ping(ctx context.Context) (types.Ping, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Ping", ctx) - ret0, _ := ret[0].(types.Ping) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Ping indicates an expected call of Ping. -func (mr *MockDockerClientMockRecorder) Ping(ctx any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Ping", reflect.TypeOf((*MockDockerClient)(nil).Ping), ctx) -} - -// RegistryLogin mocks base method. -func (m *MockDockerClient) RegistryLogin(ctx context.Context, auth registry.AuthConfig) (registry.AuthenticateOKBody, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "RegistryLogin", ctx, auth) - ret0, _ := ret[0].(registry.AuthenticateOKBody) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// RegistryLogin indicates an expected call of RegistryLogin. -func (mr *MockDockerClientMockRecorder) RegistryLogin(ctx, auth any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegistryLogin", reflect.TypeOf((*MockDockerClient)(nil).RegistryLogin), ctx, auth) -} diff --git a/dockerutil/image.go b/dockerutil/image.go index 2cc09d9..55e9d2d 100644 --- a/dockerutil/image.go +++ b/dockerutil/image.go @@ -9,9 +9,9 @@ import ( "strings" "time" + dockertypes "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/image" "golang.org/x/xerrors" "github.com/coder/envbox/buildlog" @@ -51,7 +51,7 @@ func PullImage(ctx context.Context, config *PullImageConfig) error { pullImageFn := func() error { var rd io.ReadCloser - rd, err = config.Client.ImagePull(ctx, config.Image, image.PullOptions{ + rd, err = config.Client.ImagePull(ctx, config.Image, dockertypes.ImagePullOptions{ RegistryAuth: authStr, }) if err != nil { @@ -106,12 +106,12 @@ func PullImage(ctx context.Context, config *PullImageConfig) error { } // PruneImage runs a simple 'docker prune'. -func PruneImages(ctx context.Context, client DockerClient) (image.PruneReport, error) { +func PruneImages(ctx context.Context, client DockerClient) (dockertypes.ImagesPruneReport, error) { report, err := client.ImagesPrune(ctx, filters.NewArgs(filters.Arg("dangling", "false")), ) if err != nil { - return image.PruneReport{}, xerrors.Errorf("images prune: %w", err) + return dockertypes.ImagesPruneReport{}, xerrors.Errorf("images prune: %w", err) } return report, nil @@ -176,12 +176,12 @@ func GetImageMetadata(ctx context.Context, client DockerClient, image, username defer func() { // We wanna remove this, but it's not a huge deal if it fails. - _ = client.ContainerRemove(ctx, created.ID, container.RemoveOptions{ + _ = client.ContainerRemove(ctx, created.ID, dockertypes.ContainerRemoveOptions{ Force: true, }) }() - err = client.ContainerStart(ctx, created.ID, container.StartOptions{}) + err = client.ContainerStart(ctx, created.ID, dockertypes.ContainerStartOptions{}) if err != nil { return ImageMetadata{}, xerrors.Errorf("start container: %w", err) } diff --git a/go.mod b/go.mod index eb6eb72..f68a705 100644 --- a/go.mod +++ b/go.mod @@ -198,7 +198,6 @@ require ( go.opentelemetry.io/otel/trace v1.32.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/atomic v1.11.0 // indirect - go.uber.org/mock v0.5.0 // indirect go4.org/mem v0.0.0-20220726221520-4f986261bf13 // indirect go4.org/netipx v0.0.0-20230728180743-ad4cb58a6516 // indirect golang.org/x/net v0.30.0 // indirect diff --git a/go.sum b/go.sum index 909b0d3..9a84490 100644 --- a/go.sum +++ b/go.sum @@ -581,8 +581,6 @@ go.uber.org/goleak v1.3.1-0.20240429205332-517bace7cc29 h1:w0QrHuh0hhUZ++UTQaBM2 go.uber.org/goleak v1.3.1-0.20240429205332-517bace7cc29/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= -go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU= -go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM= go4.org/mem v0.0.0-20220726221520-4f986261bf13 h1:CbZeCBZ0aZj8EfVgnqQcYZgf0lpZ3H9rmp5nkDTAst8= go4.org/mem v0.0.0-20220726221520-4f986261bf13/go.mod h1:reUoABIJ9ikfM5sgtSF3Wushcza7+WeD01VB9Lirh3g= go4.org/netipx v0.0.0-20230728180743-ad4cb58a6516 h1:X66ZEoMN2SuaoI/dfZVYobB6E5zjZyyHUMWlCA7MgGE= From 9edf405f518d03e5e4f4ed92ae3744f885b401a5 Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Tue, 26 Nov 2024 17:44:43 +0000 Subject: [PATCH 05/10] update fake --- cli/docker_test.go | 3 +- dockerutil/dockerfake/client.go | 283 ++++++++++++++++++++++++++++++++ dockerutil/dockerfake/doc.go | 1 + dockerutil/image.go | 7 +- 4 files changed, 290 insertions(+), 4 deletions(-) create mode 100644 dockerutil/dockerfake/client.go diff --git a/cli/docker_test.go b/cli/docker_test.go index 3c077e8..88e9bc3 100644 --- a/cli/docker_test.go +++ b/cli/docker_test.go @@ -15,6 +15,7 @@ import ( dockertypes "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" + "github.com/docker/docker/api/types/image" "github.com/docker/docker/api/types/network" v1 "github.com/opencontainers/image-spec/specs-go/v1" "github.com/spf13/afero" @@ -486,7 +487,7 @@ func TestDocker(t *testing.T) { authB64 := base64.URLEncoding.EncodeToString(raw) client := clitest.DockerClient(t, ctx) - client.ImagePullFn = func(_ context.Context, _ string, options dockertypes.ImagePullOptions) (io.ReadCloser, error) { + client.ImagePullFn = func(_ context.Context, _ string, options image.PullOptions) (io.ReadCloser, error) { // Assert that we call the image pull function with the credentials. require.Equal(t, authB64, options.RegistryAuth) return io.NopCloser(bytes.NewReader(nil)), nil diff --git a/dockerutil/dockerfake/client.go b/dockerutil/dockerfake/client.go new file mode 100644 index 0000000..beedf94 --- /dev/null +++ b/dockerutil/dockerfake/client.go @@ -0,0 +1,283 @@ +package dockerfake + +import ( + "context" + "io" + "strings" + + "github.com/docker/docker/api/types" + dockertypes "github.com/docker/docker/api/types" + containertypes "github.com/docker/docker/api/types/container" + "github.com/docker/docker/api/types/events" + "github.com/docker/docker/api/types/filters" + "github.com/docker/docker/api/types/image" + networktypes "github.com/docker/docker/api/types/network" + "github.com/docker/docker/api/types/registry" + "github.com/docker/docker/api/types/system" + specs "github.com/opencontainers/image-spec/specs-go/v1" + + "github.com/coder/envbox/dockerutil" +) + +var _ dockerutil.DockerClient = MockClient{} + +// MockClient provides overrides for functions that are called in envbox. +type MockClient struct { + ImagePullFn func(_ context.Context, ref string, options image.PullOptions) (io.ReadCloser, error) + ContainerCreateFn func(_ context.Context, config *containertypes.Config, hostConfig *containertypes.HostConfig, networkingConfig *networktypes.NetworkingConfig, _ *specs.Platform, containerName string) (containertypes.CreateResponse, error) + ImagePruneFn func(_ context.Context, pruneFilter filters.Args) (dockertypes.ImagesPruneReport, error) + ContainerStartFn func(_ context.Context, container string, options containertypes.StartOptions) error + ContainerExecAttachFn func(_ context.Context, execID string, config dockertypes.ExecStartCheck) (dockertypes.HijackedResponse, error) + ContainerExecCreateFn func(_ context.Context, container string, config dockertypes.ExecConfig) (dockertypes.IDResponse, error) + ContainerExecStartFn func(_ context.Context, execID string, config dockertypes.ExecStartCheck) error + ContainerExecInspectFn func(_ context.Context, execID string) (dockertypes.ContainerExecInspect, error) + ContainerInspectFn func(_ context.Context, container string) (dockertypes.ContainerJSON, error) + ContainerRemoveFn func(_ context.Context, container string, options containertypes.RemoveOptions) error + PingFn func(_ context.Context) (dockertypes.Ping, error) +} + +func (MockClient) ImageBuild(_ context.Context, _ io.Reader, _ dockertypes.ImageBuildOptions) (dockertypes.ImageBuildResponse, error) { + panic("not implemented") +} + +func (MockClient) BuildCachePrune(_ context.Context, _ dockertypes.BuildCachePruneOptions) (*dockertypes.BuildCachePruneReport, error) { + panic("not implemented") +} + +func (MockClient) BuildCancel(_ context.Context, _ string) error { + panic("not implemented") +} + +func (MockClient) ImageCreate(_ context.Context, _ string, _ image.CreateOptions) (io.ReadCloser, error) { + panic("not implemented") +} + +func (MockClient) ImageHistory(_ context.Context, _ string) ([]image.HistoryResponseItem, error) { + panic("not implemented") +} + +func (MockClient) ImageImport(_ context.Context, _ image.ImportSource, _ string, _ image.ImportOptions) (io.ReadCloser, error) { + panic("not implemented") +} + +func (MockClient) ImageInspectWithRaw(_ context.Context, _ string) (dockertypes.ImageInspect, []byte, error) { + panic("not implemented") +} + +func (MockClient) ImageList(_ context.Context, _ image.ListOptions) ([]image.Summary, error) { + panic("not implemented") +} + +func (MockClient) ImageLoad(_ context.Context, _ io.Reader, _ bool) (dockertypes.ImageLoadResponse, error) { + panic("not implemented") +} + +func (m MockClient) ImagePull(ctx context.Context, ref string, options image.PullOptions) (io.ReadCloser, error) { + if m.ImagePullFn == nil { + return io.NopCloser(strings.NewReader("")), nil + } + return m.ImagePullFn(ctx, ref, options) +} + +func (MockClient) ImagePush(_ context.Context, _ string, _ image.PushOptions) (io.ReadCloser, error) { + panic("not implemented") +} + +func (MockClient) ImageRemove(_ context.Context, _ string, _ image.RemoveOptions) ([]image.DeleteResponse, error) { + panic("not implemented") +} + +func (MockClient) ImageSearch(_ context.Context, _ string, _ dockertypes.ImageSearchOptions) ([]registry.SearchResult, error) { + panic("not implemented") +} + +func (MockClient) ImageSave(_ context.Context, _ []string) (io.ReadCloser, error) { + panic("not implemented") +} + +func (MockClient) ImageTag(_ context.Context, _ string, _ string) error { + panic("not implemented") +} + +func (m MockClient) ImagesPrune(ctx context.Context, pruneFilter filters.Args) (dockertypes.ImagesPruneReport, error) { + if m.ImagePruneFn == nil { + return dockertypes.ImagesPruneReport{}, nil + } + return m.ImagePruneFn(ctx, pruneFilter) +} + +func (MockClient) Events(_ context.Context, _ dockertypes.EventsOptions) (<-chan events.Message, <-chan error) { + panic("not implemented") +} + +func (MockClient) Info(_ context.Context) (system.Info, error) { + panic("not implemented") +} + +func (MockClient) RegistryLogin(_ context.Context, _ registry.AuthConfig) (registry.AuthenticateOKBody, error) { + panic("not implemented") +} + +func (MockClient) DiskUsage(_ context.Context, _ dockertypes.DiskUsageOptions) (dockertypes.DiskUsage, error) { + panic("not implemented") +} + +func (m MockClient) Ping(ctx context.Context) (dockertypes.Ping, error) { + if m.PingFn == nil { + return dockertypes.Ping{}, nil + } + return m.PingFn(ctx) +} + +func (MockClient) ContainerAttach(_ context.Context, _ string, _ containertypes.AttachOptions) (dockertypes.HijackedResponse, error) { + panic("not implemented") +} + +func (MockClient) ContainerCommit(_ context.Context, _ string, _ containertypes.CommitOptions) (dockertypes.IDResponse, error) { + panic("not implemented") +} + +func (m MockClient) ContainerCreate(ctx context.Context, config *containertypes.Config, hostConfig *containertypes.HostConfig, networkingConfig *networktypes.NetworkingConfig, pspecs *specs.Platform, containerName string) (containertypes.CreateResponse, error) { + if m.ContainerCreateFn == nil { + return containertypes.CreateResponse{}, nil + } + return m.ContainerCreateFn(ctx, config, hostConfig, networkingConfig, pspecs, containerName) +} + +func (MockClient) ContainerDiff(_ context.Context, _ string) ([]containertypes.FilesystemChange, error) { + panic("not implemented") +} + +func (m MockClient) ContainerExecAttach(ctx context.Context, execID string, config dockertypes.ExecStartCheck) (dockertypes.HijackedResponse, error) { + if m.ContainerExecAttachFn == nil { + return dockertypes.HijackedResponse{}, nil + } + return m.ContainerExecAttachFn(ctx, execID, config) +} + +func (m MockClient) ContainerExecCreate(ctx context.Context, name string, config dockertypes.ExecConfig) (dockertypes.IDResponse, error) { + if m.ContainerExecCreateFn == nil { + return dockertypes.IDResponse{}, nil + } + return m.ContainerExecCreateFn(ctx, name, config) +} + +func (m MockClient) ContainerExecInspect(ctx context.Context, id string) (dockertypes.ContainerExecInspect, error) { + if m.ContainerExecInspectFn == nil { + return dockertypes.ContainerExecInspect{}, nil + } + + return m.ContainerExecInspectFn(ctx, id) +} + +func (MockClient) ContainerExecResize(_ context.Context, _ string, _ containertypes.ResizeOptions) error { + panic("not implemented") +} + +func (m MockClient) ContainerExecStart(ctx context.Context, execID string, config dockertypes.ExecStartCheck) error { + if m.ContainerExecStartFn == nil { + return nil + } + return m.ContainerExecStartFn(ctx, execID, config) +} + +func (MockClient) ContainerExport(_ context.Context, _ string) (io.ReadCloser, error) { + panic("not implemented") +} + +func (m MockClient) ContainerInspect(ctx context.Context, name string) (dockertypes.ContainerJSON, error) { + if m.ContainerInspectFn == nil { + return dockertypes.ContainerJSON{}, nil + } + return m.ContainerInspectFn(ctx, name) +} + +func (MockClient) ContainerInspectWithRaw(_ context.Context, _ string, _ bool) (dockertypes.ContainerJSON, []byte, error) { + panic("not implemented") +} + +func (MockClient) ContainerKill(_ context.Context, _ string, _ string) error { + panic("not implemented") +} + +func (MockClient) ContainerList(_ context.Context, _ containertypes.ListOptions) ([]types.Container, error) { + panic("not implemented") +} + +func (MockClient) ContainerLogs(_ context.Context, _ string, _ containertypes.LogsOptions) (io.ReadCloser, error) { + panic("not implemented") +} + +func (MockClient) ContainerPause(_ context.Context, _ string) error { + panic("not implemented") +} + +func (m MockClient) ContainerRemove(ctx context.Context, name string, options containertypes.RemoveOptions) error { + if m.ContainerRemoveFn == nil { + return nil + } + return m.ContainerRemoveFn(ctx, name, options) +} + +func (MockClient) ContainerRename(_ context.Context, _ string, _ string) error { + panic("not implemented") +} + +func (MockClient) ContainerResize(_ context.Context, _ string, _ containertypes.ResizeOptions) error { + panic("not implemented") +} + +func (MockClient) ContainerRestart(_ context.Context, _ string, _ containertypes.StopOptions) error { + panic("not implemented") +} + +func (MockClient) ContainerStatPath(_ context.Context, _ string, _ string) (dockertypes.ContainerPathStat, error) { + panic("not implemented") +} + +func (MockClient) ContainerStats(_ context.Context, _ string, _ bool) (dockertypes.ContainerStats, error) { + panic("not implemented") +} + +func (m MockClient) ContainerStart(ctx context.Context, name string, options containertypes.StartOptions) error { + if m.ContainerStartFn == nil { + return nil + } + return m.ContainerStartFn(ctx, name, options) +} + +func (MockClient) ContainerStop(_ context.Context, _ string, _ containertypes.StopOptions) error { + panic("not implemented") +} + +func (MockClient) ContainerTop(_ context.Context, _ string, _ []string) (containertypes.ContainerTopOKBody, error) { + panic("not implemented") +} + +func (MockClient) ContainerUnpause(_ context.Context, _ string) error { + panic("not implemented") +} + +func (MockClient) ContainerUpdate(_ context.Context, _ string, _ containertypes.UpdateConfig) (containertypes.ContainerUpdateOKBody, error) { + panic("not implemented") +} + +func (MockClient) ContainerWait(_ context.Context, _ string, _ containertypes.WaitCondition) (<-chan containertypes.WaitResponse, <-chan error) { + panic("not implemented") +} + +func (MockClient) CopyFromContainer(_ context.Context, _ string, _ string) (io.ReadCloser, dockertypes.ContainerPathStat, error) { + panic("not implemented") +} + +func (MockClient) CopyToContainer(_ context.Context, _ string, _ string, _ io.Reader, _ dockertypes.CopyToContainerOptions) error { + panic("not implemented") +} + +func (MockClient) ContainersPrune(_ context.Context, _ filters.Args) (dockertypes.ContainersPruneReport, error) { + panic("not implemented") +} + +func (MockClient) ContainerStatsOneShot(_ context.Context, _ string) (dockertypes.ContainerStats, error) { + panic("not implemented") +} diff --git a/dockerutil/dockerfake/doc.go b/dockerutil/dockerfake/doc.go index 3fd0ead..b4aba8e 100644 --- a/dockerutil/dockerfake/doc.go +++ b/dockerutil/dockerfake/doc.go @@ -1,4 +1,5 @@ // Package dockerfake contains logic for mocking out Docker-related // functionality. +// //go:generate mockgen -destination ./mock.go -package dockerfake github.com/coder/envbox/dockerutil/dockerfake Client package dockerfake diff --git a/dockerutil/image.go b/dockerutil/image.go index 55e9d2d..dc941ad 100644 --- a/dockerutil/image.go +++ b/dockerutil/image.go @@ -12,6 +12,7 @@ import ( dockertypes "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/filters" + "github.com/docker/docker/api/types/image" "golang.org/x/xerrors" "github.com/coder/envbox/buildlog" @@ -51,7 +52,7 @@ func PullImage(ctx context.Context, config *PullImageConfig) error { pullImageFn := func() error { var rd io.ReadCloser - rd, err = config.Client.ImagePull(ctx, config.Image, dockertypes.ImagePullOptions{ + rd, err = config.Client.ImagePull(ctx, config.Image, image.PullOptions{ RegistryAuth: authStr, }) if err != nil { @@ -176,12 +177,12 @@ func GetImageMetadata(ctx context.Context, client DockerClient, image, username defer func() { // We wanna remove this, but it's not a huge deal if it fails. - _ = client.ContainerRemove(ctx, created.ID, dockertypes.ContainerRemoveOptions{ + _ = client.ContainerRemove(ctx, created.ID, container.RemoveOptions{ Force: true, }) }() - err = client.ContainerStart(ctx, created.ID, dockertypes.ContainerStartOptions{}) + err = client.ContainerStart(ctx, created.ID, container.StartOptions{}) if err != nil { return ImageMetadata{}, xerrors.Errorf("start container: %w", err) } From 10df3f0bc09413181155de867c4a1dfad223f4f4 Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Tue, 26 Nov 2024 17:45:21 +0000 Subject: [PATCH 06/10] move iface to correct file --- dockerutil/client.go | 6 ++++++ dockerutil/container.go | 7 ------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/dockerutil/client.go b/dockerutil/client.go index f6ce1c4..6e5d600 100644 --- a/dockerutil/client.go +++ b/dockerutil/client.go @@ -13,6 +13,12 @@ import ( "golang.org/x/xerrors" ) +type DockerClient interface { + dockerclient.SystemAPIClient + dockerclient.ContainerAPIClient + dockerclient.ImageAPIClient +} + type clientKey struct{} // WithClient sets the provided DockerClient on the context. diff --git a/dockerutil/container.go b/dockerutil/container.go index a10a371..87cabe2 100644 --- a/dockerutil/container.go +++ b/dockerutil/container.go @@ -10,7 +10,6 @@ import ( "time" "github.com/docker/docker/api/types/container" - dockerclient "github.com/docker/docker/client" "github.com/spf13/afero" "golang.org/x/xerrors" @@ -25,12 +24,6 @@ const ( DefaultCPUPeriod uint64 = 1e5 ) -type DockerClient interface { - dockerclient.SystemAPIClient - dockerclient.ContainerAPIClient - dockerclient.ImageAPIClient -} - type ContainerConfig struct { Log slog.Logger Mounts []xunix.Mount From f1c1114aa5e1a509d2e6f47f9304faaaa2f69601 Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Tue, 26 Nov 2024 17:46:15 +0000 Subject: [PATCH 07/10] rename client --- cli/clitest/cli.go | 4 ++-- cli/clitest/fake.go | 2 +- cli/docker.go | 4 ++-- dockerutil/client.go | 10 +++++----- dockerutil/container.go | 4 ++-- dockerutil/daemon.go | 2 +- dockerutil/dockerfake/client.go | 2 +- dockerutil/exec.go | 2 +- dockerutil/image.go | 6 +++--- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/cli/clitest/cli.go b/cli/clitest/cli.go index d288d74..fb29dd4 100644 --- a/cli/clitest/cli.go +++ b/cli/clitest/cli.go @@ -35,7 +35,7 @@ func Mounter(ctx context.Context) *mount.FakeMounter { func DockerClient(t *testing.T, ctx context.Context) *dockerfake.MockClient { t.Helper() - client, err := dockerutil.Client(ctx) + client, err := dockerutil.ExtractClient(ctx) require.NoError(t, err) //nolint we should panic if this isn't the case. return client.(*dockerfake.MockClient) @@ -71,7 +71,7 @@ func New(t *testing.T, cmd string, args ...string) (context.Context, *cobra.Comm return ctx, root } -func ctx(t *testing.T, fs xunix.FS, ex xunix.Execer, mnt mount.Interface, client dockerutil.DockerClient) context.Context { +func ctx(t *testing.T, fs xunix.FS, ex xunix.Execer, mnt mount.Interface, client dockerutil.Client) context.Context { t.Helper() ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) diff --git a/cli/clitest/fake.go b/cli/clitest/fake.go index 048b804..61a31ef 100644 --- a/cli/clitest/fake.go +++ b/cli/clitest/fake.go @@ -30,7 +30,7 @@ func NewFakeExecer() *xunixfake.FakeExec { } } -func NewFakeDockerClient() dockerutil.DockerClient { +func NewFakeDockerClient() dockerutil.Client { client := &dockerfake.MockClient{} client.ContainerInspectFn = func(_ context.Context, _ string) (dockertypes.ContainerJSON, error) { diff --git a/cli/docker.go b/cli/docker.go index 9fd436d..f48ea64 100644 --- a/cli/docker.go +++ b/cli/docker.go @@ -243,7 +243,7 @@ func dockerCmd() *cobra.Command { return xerrors.Errorf("wait for sysbox-mgr: %w", err) } - client, err := dockerutil.Client(ctx) + client, err := dockerutil.ExtractClient(ctx) if err != nil { return xerrors.Errorf("new docker client: %w", err) } @@ -387,7 +387,7 @@ func dockerCmd() *cobra.Command { return cmd } -func runDockerCVM(ctx context.Context, log slog.Logger, client dockerutil.DockerClient, blog buildlog.Logger, flags flags) error { +func runDockerCVM(ctx context.Context, log slog.Logger, client dockerutil.Client, blog buildlog.Logger, flags flags) error { fs := xunix.GetFS(ctx) // Set our OOM score to something really unfavorable to avoid getting killed diff --git a/dockerutil/client.go b/dockerutil/client.go index 6e5d600..4f719c3 100644 --- a/dockerutil/client.go +++ b/dockerutil/client.go @@ -13,7 +13,7 @@ import ( "golang.org/x/xerrors" ) -type DockerClient interface { +type Client interface { dockerclient.SystemAPIClient dockerclient.ContainerAPIClient dockerclient.ImageAPIClient @@ -23,13 +23,13 @@ type clientKey struct{} // WithClient sets the provided DockerClient on the context. // It should only be used for tests. -func WithClient(ctx context.Context, client DockerClient) context.Context { +func WithClient(ctx context.Context, client Client) context.Context { return context.WithValue(ctx, clientKey{}, client) } -// Client returns the DockerClient set on the context. If one can't be +// ExtractClient returns the DockerClient set on the context. If one can't be // found a default client is returned. -func Client(ctx context.Context) (DockerClient, error) { +func ExtractClient(ctx context.Context) (Client, error) { client := ctx.Value(clientKey{}) if client == nil { client, err := dockerclient.NewClientWithOpts(dockerclient.FromEnv) @@ -41,7 +41,7 @@ func Client(ctx context.Context) (DockerClient, error) { } //nolint we should panic if this isn't the case. - return client.(DockerClient), nil + return client.(Client), nil } type AuthConfig registry.AuthConfig diff --git a/dockerutil/container.go b/dockerutil/container.go index 87cabe2..2731cbc 100644 --- a/dockerutil/container.go +++ b/dockerutil/container.go @@ -41,7 +41,7 @@ type ContainerConfig struct { } // CreateContainer creates a sysbox-runc container. -func CreateContainer(ctx context.Context, client DockerClient, conf *ContainerConfig) (string, error) { +func CreateContainer(ctx context.Context, client Client, conf *ContainerConfig) (string, error) { host := &container.HostConfig{ Runtime: runtime, AutoRemove: true, @@ -99,7 +99,7 @@ type BootstrapConfig struct { // BoostrapContainer runs a script inside the container as the provided user. // If conf.Script is empty then it is a noop. -func BootstrapContainer(ctx context.Context, client DockerClient, conf BootstrapConfig) error { +func BootstrapContainer(ctx context.Context, client Client, conf BootstrapConfig) error { if conf.Script == "" { return nil } diff --git a/dockerutil/daemon.go b/dockerutil/daemon.go index 476a866..45a602e 100644 --- a/dockerutil/daemon.go +++ b/dockerutil/daemon.go @@ -9,7 +9,7 @@ import ( // WaitForDaemon waits for a Docker daemon to startup. It waits a max // of 5m before giving up. -func WaitForDaemon(ctx context.Context, client DockerClient) error { +func WaitForDaemon(ctx context.Context, client Client) error { ticker := time.NewTicker(time.Millisecond * 250) defer ticker.Stop() diff --git a/dockerutil/dockerfake/client.go b/dockerutil/dockerfake/client.go index beedf94..cac310f 100644 --- a/dockerutil/dockerfake/client.go +++ b/dockerutil/dockerfake/client.go @@ -19,7 +19,7 @@ import ( "github.com/coder/envbox/dockerutil" ) -var _ dockerutil.DockerClient = MockClient{} +var _ dockerutil.Client = MockClient{} // MockClient provides overrides for functions that are called in envbox. type MockClient struct { diff --git a/dockerutil/exec.go b/dockerutil/exec.go index 6f78822..8f27f47 100644 --- a/dockerutil/exec.go +++ b/dockerutil/exec.go @@ -24,7 +24,7 @@ type ExecConfig struct { // ExecContainer runs a command in a container. It returns the output and any error. // If an error occurs during the execution of the command, the output is appended to the error. -func ExecContainer(ctx context.Context, client DockerClient, config ExecConfig) ([]byte, error) { +func ExecContainer(ctx context.Context, client Client, config ExecConfig) ([]byte, error) { exec, err := client.ContainerExecCreate(ctx, config.ContainerID, dockertypes.ExecConfig{ Detach: true, Cmd: append([]string{config.Cmd}, config.Args...), diff --git a/dockerutil/image.go b/dockerutil/image.go index dc941ad..dc1a0bb 100644 --- a/dockerutil/image.go +++ b/dockerutil/image.go @@ -23,7 +23,7 @@ import ( const diskFullStorageDriver = "vfs" type PullImageConfig struct { - Client DockerClient + Client Client Image string Auth AuthConfig ProgressFn ImagePullProgressFn @@ -107,7 +107,7 @@ func PullImage(ctx context.Context, config *PullImageConfig) error { } // PruneImage runs a simple 'docker prune'. -func PruneImages(ctx context.Context, client DockerClient) (dockertypes.ImagesPruneReport, error) { +func PruneImages(ctx context.Context, client Client) (dockertypes.ImagesPruneReport, error) { report, err := client.ImagesPrune(ctx, filters.NewArgs(filters.Arg("dangling", "false")), ) @@ -156,7 +156,7 @@ type ImageMetadata struct { // GetImageMetadata returns metadata about an image such as the UID/GID of the // provided username and whether it contains an /sbin/init that we should run. -func GetImageMetadata(ctx context.Context, client DockerClient, image, username string) (ImageMetadata, error) { +func GetImageMetadata(ctx context.Context, client Client, image, username string) (ImageMetadata, error) { // Creating a dummy container to inspect the filesystem. created, err := client.ContainerCreate(ctx, &container.Config{ From cc2ce09ba590645cfd377124d82ef0956886fc88 Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Tue, 26 Nov 2024 17:50:02 +0000 Subject: [PATCH 08/10] go.mod --- go.mod | 5 +++-- go.sum | 10 ++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index f68a705..232b1d1 100644 --- a/go.mod +++ b/go.mod @@ -36,6 +36,7 @@ require ( require ( cloud.google.com/go/compute/metadata v0.5.0 // indirect + dario.cat/mergo v1.0.1 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/DataDog/appsec-internal-go v1.5.0 // indirect @@ -83,7 +84,7 @@ require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/distribution/reference v0.6.0 // indirect - github.com/docker/cli v23.0.5+incompatible // indirect + github.com/docker/cli v27.3.1+incompatible // indirect github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect @@ -97,6 +98,7 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-sql-driver/mysql v1.8.1 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect @@ -121,7 +123,6 @@ require ( github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/illarion/gonotify v1.0.1 // indirect - github.com/imdario/mergo v0.3.15 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/insomniacslk/dhcp v0.0.0-20231206064809-8c70d406f6d2 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect diff --git a/go.sum b/go.sum index 9a84490..0d08904 100644 --- a/go.sum +++ b/go.sum @@ -7,6 +7,8 @@ cloud.google.com/go/logging v1.9.0 h1:iEIOXFO9EmSiTjDmfpbRjOxECO7R8C7b8IXUGOj7xZ cloud.google.com/go/logging v1.9.0/go.mod h1:1Io0vnZv4onoUnsVUQY3HZ3Igb1nBchky0A0y7BBBhE= cloud.google.com/go/longrunning v0.5.6 h1:xAe8+0YaWoCKr9t1+aWe+OeQgN/iJK1fEgZSXmjuEaE= cloud.google.com/go/longrunning v0.5.6/go.mod h1:vUaDrWYOMKRuhiv6JBnn49YxCPz2Ayn9GqyjaBT8/mA= +dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s= +dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= filippo.io/mkcert v1.4.4 h1:8eVbbwfVlaqUM7OwuftKc2nuYOoTDQWqsoXmzoXZdbc= @@ -142,8 +144,8 @@ github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WA github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/docker/cli v23.0.5+incompatible h1:ufWmAOuD3Vmr7JP2G5K3cyuNC4YZWiAsuDEvFVVDafE= -github.com/docker/cli v23.0.5+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v27.3.1+incompatible h1:qEGdFBF3Xu6SCvCYhc7CzaQTlBmqDuzxPDpigSyeKQQ= +github.com/docker/cli v27.3.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/docker v27.3.1+incompatible h1:KttF0XoteNTicmUtBO0L2tP+J7FGRFTjaEF4k6WdhfI= github.com/docker/docker v27.3.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= @@ -199,6 +201,8 @@ github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpv github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= @@ -301,8 +305,6 @@ github.com/iancoleman/orderedmap v0.3.0 h1:5cbR2grmZR/DiVt+VJopEhtVs9YGInGIxAoMJ github.com/iancoleman/orderedmap v0.3.0/go.mod h1:XuLcCUkdL5owUCQeF2Ue9uuw1EptkJDkXXS7VoV7XGE= github.com/illarion/gonotify v1.0.1 h1:F1d+0Fgbq/sDWjj/r66ekjDG+IDeecQKUFH4wNwsoio= github.com/illarion/gonotify v1.0.1/go.mod h1:zt5pmDofZpU1f8aqlK0+95eQhoEAn/d4G4B/FjVW4jE= -github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM= -github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/insomniacslk/dhcp v0.0.0-20231206064809-8c70d406f6d2 h1:9K06NfxkBh25x56yVhWWlKFE8YpicaSfHwoV8SFbueA= From ba18d080aac57aed8007e4fd9a7515a77cf7f5a4 Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Tue, 26 Nov 2024 17:53:23 +0000 Subject: [PATCH 09/10] lint --- dockerutil/client.go | 6 +++--- dockerutil/dockerfake/client.go | 3 +-- dockerutil/image.go | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/dockerutil/client.go b/dockerutil/client.go index 4f719c3..00dc4b9 100644 --- a/dockerutil/client.go +++ b/dockerutil/client.go @@ -73,8 +73,8 @@ func AuthConfigFromString(raw string, reg string) (AuthConfig, error) { return parseConfig(cfg, reg) } -func parseConfig(cfg dockercfg.Config, registry string) (AuthConfig, error) { - hostname := dockercfg.ResolveRegistryHost(registry) +func parseConfig(cfg dockercfg.Config, reg string) (AuthConfig, error) { + hostname := dockercfg.ResolveRegistryHost(reg) username, secret, err := cfg.GetRegistryCredentials(hostname) if err != nil { @@ -93,5 +93,5 @@ func parseConfig(cfg dockercfg.Config, registry string) (AuthConfig, error) { }, nil } - return AuthConfig{}, xerrors.Errorf("no auth config found for registry %s: %w", registry, os.ErrNotExist) + return AuthConfig{}, xerrors.Errorf("no auth config found for registry %s: %w", reg, os.ErrNotExist) } diff --git a/dockerutil/dockerfake/client.go b/dockerutil/dockerfake/client.go index cac310f..7c7d012 100644 --- a/dockerutil/dockerfake/client.go +++ b/dockerutil/dockerfake/client.go @@ -5,7 +5,6 @@ import ( "io" "strings" - "github.com/docker/docker/api/types" dockertypes "github.com/docker/docker/api/types" containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/events" @@ -200,7 +199,7 @@ func (MockClient) ContainerKill(_ context.Context, _ string, _ string) error { panic("not implemented") } -func (MockClient) ContainerList(_ context.Context, _ containertypes.ListOptions) ([]types.Container, error) { +func (MockClient) ContainerList(_ context.Context, _ containertypes.ListOptions) ([]dockertypes.Container, error) { panic("not implemented") } diff --git a/dockerutil/image.go b/dockerutil/image.go index dc1a0bb..ffb2bdb 100644 --- a/dockerutil/image.go +++ b/dockerutil/image.go @@ -156,11 +156,11 @@ type ImageMetadata struct { // GetImageMetadata returns metadata about an image such as the UID/GID of the // provided username and whether it contains an /sbin/init that we should run. -func GetImageMetadata(ctx context.Context, client Client, image, username string) (ImageMetadata, error) { +func GetImageMetadata(ctx context.Context, client Client, img, username string) (ImageMetadata, error) { // Creating a dummy container to inspect the filesystem. created, err := client.ContainerCreate(ctx, &container.Config{ - Image: image, + Image: img, Entrypoint: []string{ "sleep", }, From d83b832d29930bbfe13b5b4f0802b1b2d998c692 Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Tue, 26 Nov 2024 18:01:24 +0000 Subject: [PATCH 10/10] bump docker --- deploy/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/Dockerfile b/deploy/Dockerfile index f952dcd..a8435c6 100644 --- a/deploy/Dockerfile +++ b/deploy/Dockerfile @@ -22,7 +22,7 @@ LABEL \ ARG DEBIAN_FRONTEND=noninteractive # Pin docker to avoid any breaking API changes between the Go client and # the server. -ARG DOCKER_VERSION="5:27.1.2-1~ubuntu.22.04~jammy" +ARG DOCKER_VERSION="5:27.3.1-1~ubuntu.22.04~jammy" # Ignore other repositories, as some require HTTPS RUN apt-get update --quiet --option Dir::Etc::SourceParts="" && \ apt-get upgrade -y && \