diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index a88f26a2..a96b7cf5 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -167,7 +167,7 @@ func (w *Worker) exec(index int, config *api.Worker) error { // setup the executor // - // https://godoc.org/github.com/go-vela/worker/executor#New + // https://pkg.go.dev/github.com/go-vela/worker/executor#New _executor, err := executor.New(&executor.Setup{ Logger: logger, Mock: w.Config.Mock, diff --git a/cmd/vela-worker/validate.go b/cmd/vela-worker/validate.go index de4b87e6..86e45fc5 100644 --- a/cmd/vela-worker/validate.go +++ b/cmd/vela-worker/validate.go @@ -57,7 +57,7 @@ func (w *Worker) Validate() error { // verify the runtime configuration // - // https://godoc.org/github.com/go-vela/worker/runtime#Setup.Validate + // https://pkg.go.dev/github.com/go-vela/worker/runtime#Setup.Validate err := w.Config.Runtime.Validate() if err != nil { return err diff --git a/go.mod b/go.mod index 5d48dbd3..da69f4f1 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ toolchain go1.22.2 require ( github.com/Masterminds/semver/v3 v3.2.1 github.com/distribution/reference v0.5.0 - github.com/docker/docker v24.0.9+incompatible + github.com/docker/docker v26.0.0+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.9.1 github.com/go-vela/sdk-go v0.23.3-0.20240411165353-c3fdc7210625 @@ -42,19 +42,21 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect github.com/containerd/containerd v1.7.11 // indirect + github.com/containerd/log v0.1.0 // indirect github.com/coreos/go-semver v0.3.1 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect - github.com/docker/distribution v2.8.3+incompatible // indirect github.com/docker/go-connections v0.4.0 // indirect github.com/drone/envsubst v1.0.3 // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect github.com/evanphx/json-patch v5.6.0+incompatible // indirect + github.com/felixge/httpsnoop v1.0.3 // indirect github.com/gabriel-vasile/mimetype v1.4.2 // indirect github.com/ghodss/yaml v1.0.0 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/go-logr/logr v1.3.0 // indirect + github.com/go-logr/stdr v1.2.2 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/swag v0.22.3 // indirect @@ -84,6 +86,7 @@ require ( github.com/mattn/go-isatty v0.0.20 // indirect github.com/mitchellh/copystructure v1.0.0 // indirect github.com/mitchellh/reflectwalk v1.0.1 // indirect + github.com/moby/docker-image-spec v1.3.1 // indirect github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect @@ -105,6 +108,10 @@ require ( github.com/ugorji/go/codec v1.2.11 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yuin/gopher-lua v1.1.1 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 // indirect + go.opentelemetry.io/otel v1.19.0 // indirect + go.opentelemetry.io/otel/metric v1.19.0 // indirect + go.opentelemetry.io/otel/trace v1.19.0 // indirect go.starlark.net v0.0.0-20240314022150-ee8ed142361c // indirect golang.org/x/arch v0.3.0 // indirect golang.org/x/crypto v0.21.0 // indirect diff --git a/go.sum b/go.sum index 9f9225fc..a04c251a 100644 --- a/go.sum +++ b/go.sum @@ -30,6 +30,8 @@ github.com/buildkite/yaml v0.0.0-20230306222819-0e4e032d4835/go.mod h1:AV5wtJnn1 github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s= github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= +github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= +github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= 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/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= @@ -40,6 +42,8 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5P github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/containerd/containerd v1.7.11 h1:lfGKw3eU35sjV0aG2eYZTiwFEY1pCzxdzicHP3SZILw= github.com/containerd/containerd v1.7.11/go.mod h1:5UluHxHTX2rdvYuZ5OJTC5m/KJNs0Zs9wVoJm9zf5ZE= +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-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= @@ -53,10 +57,8 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= -github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker 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 v26.0.0+incompatible h1:Ng2qi+gdKADUa/VM+6b6YaY2nlZhk/lVJiKR/2bMudU= +github.com/docker/docker v26.0.0+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= @@ -67,6 +69,8 @@ github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxER github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= +github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= @@ -75,8 +79,11 @@ github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= @@ -133,6 +140,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/goware/urlx v0.3.2 h1:gdoo4kBHlkqZNaf6XlQ12LGtQOmpKJrR04Rc3RnpJEo= github.com/goware/urlx v0.3.2/go.mod h1:h8uwbJy68o+tQXCGZNa9D73WN8n0r9OBae5bUnLcgjw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9Kz84aCaG7AsGZnLjhHbUqwPg= 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= @@ -178,6 +187,8 @@ github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFW github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.1 h1:FVzMWA5RllMAKIdUSC8mdWo3XtwoecrH79BY70sEEpE= github.com/mitchellh/reflectwalk v1.0.1/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/term v0.0.0-20201216013528-df9cb8a40635 h1:rzf0wL0CHVc8CEsgyygG0Mn9CNCCPZqOPaz8RiiHYQk= github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -256,6 +267,22 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M= github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 h1:x8Z78aZx8cOF0+Kkazoc7lwUNMGy0LrzEMxTm4BbTxg= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0/go.mod h1:62CPTSry9QZtOaSsE3tOzhx6LzDhHnXJ6xHeMNNiM6Q= +go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= +go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= +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/exporters/otlp/otlptrace/otlptracehttp v1.19.0 h1:IeMeyr1aBvBiPVYihXIaeIZba6b8E1bYp7lbdxK8CQg= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0/go.mod h1:oVdCUtjq9MK9BlS7TtucsQwUcXcymNiEDjgDD2jMtZU= +go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE= +go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= +go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJi3o= +go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A= +go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= +go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= +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.starlark.net v0.0.0-20240314022150-ee8ed142361c h1:roAjH18hZcwI4hHStHbkXjF5b7UUyZ/0SG3hXNN1SjA= go.starlark.net v0.0.0-20240314022150-ee8ed142361c/go.mod h1:YKMCv9b1WrfWmeqdV5MAuEHWsu5iC+fe6kYl2sQjdI8= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= @@ -336,6 +363,13 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 h1:wpZ8pe2x1Q3f2KyT5f8oP/fa9rHAKgFPr/HZdNuS+PQ= +google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 h1:JpwMPBpFN3uKhdaekDpiNlImDdkUAyiJ6ez/uxGaUSo= +google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f h1:ultW7fxlIvee4HYrtnaRPon9HpEgFk5zYpmfMgtKB5I= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f/go.mod h1:L9KNLi232K1/xB6f7AlSX692koaRnKaWSR0stBki0Yc= +google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= +google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= 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.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= diff --git a/mock/docker/container.go b/mock/docker/container.go index 24014d41..53ff57f0 100644 --- a/mock/docker/container.go +++ b/mock/docker/container.go @@ -32,7 +32,7 @@ type ContainerService struct{} // Docker container. // // https://pkg.go.dev/github.com/docker/docker/client#Client.ContainerAttach -func (c *ContainerService) ContainerAttach(ctx context.Context, ctn string, options types.ContainerAttachOptions) (types.HijackedResponse, error) { +func (c *ContainerService) ContainerAttach(ctx context.Context, ctn string, options container.AttachOptions) (types.HijackedResponse, error) { return types.HijackedResponse{}, nil } @@ -40,7 +40,7 @@ func (c *ContainerService) ContainerAttach(ctx context.Context, ctn string, opti // a mocked call to apply changes to a Docker container. // // https://pkg.go.dev/github.com/docker/docker/client#Client.ContainerCommit -func (c *ContainerService) ContainerCommit(ctx context.Context, ctn string, options types.ContainerCommitOptions) (types.IDResponse, error) { +func (c *ContainerService) ContainerCommit(ctx context.Context, ctn string, options container.CommitOptions) (types.IDResponse, error) { return types.IDResponse{}, nil } @@ -96,7 +96,7 @@ func (c *ContainerService) ContainerCreate(ctx context.Context, config *containe // filesystem between two Docker containers. // // https://pkg.go.dev/github.com/docker/docker/client#Client.ContainerDiff -func (c *ContainerService) ContainerDiff(ctx context.Context, ctn string) ([]container.ContainerChangeResponseItem, error) { +func (c *ContainerService) ContainerDiff(ctx context.Context, ctn string) ([]container.FilesystemChange, error) { return nil, nil } @@ -132,7 +132,7 @@ func (c *ContainerService) ContainerExecInspect(ctx context.Context, execID stri // inside a Docker container. // // https://pkg.go.dev/github.com/docker/docker/client#Client.ContainerExecResize -func (c *ContainerService) ContainerExecResize(ctx context.Context, execID string, options types.ResizeOptions) error { +func (c *ContainerService) ContainerExecResize(ctx context.Context, execID string, options container.ResizeOptions) error { return nil } @@ -264,7 +264,7 @@ func (c *ContainerService) ContainerKill(ctx context.Context, ctn, signal string // a mocked call to list Docker containers. // // https://pkg.go.dev/github.com/docker/docker/client#Client.ContainerList -func (c *ContainerService) ContainerList(ctx context.Context, options types.ContainerListOptions) ([]types.Container, error) { +func (c *ContainerService) ContainerList(ctx context.Context, options container.ListOptions) ([]types.Container, error) { return nil, nil } @@ -273,7 +273,7 @@ func (c *ContainerService) ContainerList(ctx context.Context, options types.Cont // Docker container. // // https://pkg.go.dev/github.com/docker/docker/client#Client.ContainerLogs -func (c *ContainerService) ContainerLogs(ctx context.Context, ctn string, options types.ContainerLogsOptions) (io.ReadCloser, error) { +func (c *ContainerService) ContainerLogs(ctx context.Context, ctn string, options container.LogsOptions) (io.ReadCloser, error) { // verify a container was provided if len(ctn) == 0 { return nil, errors.New("no container provided") @@ -320,7 +320,7 @@ func (c *ContainerService) ContainerPause(ctx context.Context, ctn string) error // a mocked call to remove a Docker container. // // https://pkg.go.dev/github.com/docker/docker/client#Client.ContainerRemove -func (c *ContainerService) ContainerRemove(ctx context.Context, ctn string, options types.ContainerRemoveOptions) error { +func (c *ContainerService) ContainerRemove(ctx context.Context, ctn string, options container.RemoveOptions) error { // verify a container was provided if len(ctn) == 0 { return errors.New("no container provided") @@ -347,7 +347,7 @@ func (c *ContainerService) ContainerRename(ctx context.Context, container, newCo // a mocked call to resize a Docker container. // // https://pkg.go.dev/github.com/docker/docker/client#Client.ContainerResize -func (c *ContainerService) ContainerResize(ctx context.Context, ctn string, options types.ResizeOptions) error { +func (c *ContainerService) ContainerResize(ctx context.Context, ctn string, options container.ResizeOptions) error { return nil } @@ -363,7 +363,7 @@ func (c *ContainerService) ContainerRestart(ctx context.Context, ctn string, opt // a mocked call to start a Docker container. // // https://pkg.go.dev/github.com/docker/docker/client#Client.ContainerStart -func (c *ContainerService) ContainerStart(ctx context.Context, ctn string, options types.ContainerStartOptions) error { +func (c *ContainerService) ContainerStart(ctx context.Context, ctn string, options container.StartOptions) error { // verify a container was provided if len(ctn) == 0 { return errors.New("no container provided") diff --git a/mock/docker/docker.go b/mock/docker/docker.go index c70bf39b..4f7923c0 100644 --- a/mock/docker/docker.go +++ b/mock/docker/docker.go @@ -13,10 +13,10 @@ package docker // // For example (use the compatibility matrix above for reference): // -// * the Docker version of v24.0 has a maximum API version of v1.43 -// * to maintain n-1, the API version is pinned to v1.42 +// * the Docker version of v26.0 has a maximum API version of v1.45 +// * to maintain n-1, the API version is pinned to v1.44 // . -const Version = "v1.42" +const Version = "v1.44" // New returns a client that is capable of handling // Docker client calls and returning stub responses. diff --git a/mock/docker/image.go b/mock/docker/image.go index a5702b67..91c4a26d 100644 --- a/mock/docker/image.go +++ b/mock/docker/image.go @@ -50,7 +50,7 @@ func (i *ImageService) ImageBuild(ctx context.Context, context io.Reader, option // a mocked call to create a Docker image. // // https://pkg.go.dev/github.com/docker/docker/client#Client.ImageCreate -func (i *ImageService) ImageCreate(ctx context.Context, parentReference string, options types.ImageCreateOptions) (io.ReadCloser, error) { +func (i *ImageService) ImageCreate(ctx context.Context, parentReference string, options image.CreateOptions) (io.ReadCloser, error) { return nil, nil } @@ -67,7 +67,7 @@ func (i *ImageService) ImageHistory(ctx context.Context, image string) ([]image. // a mocked call to import a Docker image. // // https://pkg.go.dev/github.com/docker/docker/client#Client.ImageImport -func (i *ImageService) ImageImport(ctx context.Context, source types.ImageImportSource, ref string, options types.ImageImportOptions) (io.ReadCloser, error) { +func (i *ImageService) ImageImport(ctx context.Context, source types.ImageImportSource, ref string, options image.ImportOptions) (io.ReadCloser, error) { return nil, nil } @@ -76,19 +76,19 @@ func (i *ImageService) ImageImport(ctx context.Context, source types.ImageImport // the raw body received from the API. // // https://pkg.go.dev/github.com/docker/docker/client#Client.ImageInspectWithRaw -func (i *ImageService) ImageInspectWithRaw(ctx context.Context, image string) (types.ImageInspect, []byte, error) { +func (i *ImageService) ImageInspectWithRaw(ctx context.Context, img string) (types.ImageInspect, []byte, error) { // verify an image was provided - if len(image) == 0 { + if len(img) == 0 { return types.ImageInspect{}, nil, errors.New("no image provided") } // check if the image is not found - if strings.Contains(image, "notfound") || strings.Contains(image, "not-found") { + if strings.Contains(img, "notfound") || strings.Contains(img, "not-found") { return types.ImageInspect{}, nil, errdefs.NotFound( //nolint:stylecheck // messsage is capitalized to match Docker messages - fmt.Errorf("Error response from daemon: manifest for %s not found: manifest unknown", image), + fmt.Errorf("Error response from daemon: manifest for %s not found: manifest unknown", img), ) } @@ -118,7 +118,7 @@ func (i *ImageService) ImageInspectWithRaw(ctx context.Context, image string) (t Type: "layers", Layers: []string{fmt.Sprintf("sha256:%s", stringid.GenerateRandomID())}, }, - Metadata: types.ImageMetadata{LastTagTime: time.Now()}, + Metadata: image.Metadata{LastTagTime: time.Now()}, } // marshal response into raw bytes @@ -134,7 +134,7 @@ func (i *ImageService) ImageInspectWithRaw(ctx context.Context, image string) (t // a mocked call to list Docker images. // // https://pkg.go.dev/github.com/docker/docker/client#Client.ImageList -func (i *ImageService) ImageList(ctx context.Context, options types.ImageListOptions) ([]types.ImageSummary, error) { +func (i *ImageService) ImageList(ctx context.Context, options image.ListOptions) ([]image.Summary, error) { return nil, nil } @@ -150,7 +150,7 @@ func (i *ImageService) ImageLoad(ctx context.Context, input io.Reader, quiet boo // a mocked call to pull a Docker image. // // https://pkg.go.dev/github.com/docker/docker/client#Client.ImagePull -func (i *ImageService) ImagePull(ctx context.Context, image string, options types.ImagePullOptions) (io.ReadCloser, error) { +func (i *ImageService) ImagePull(ctx context.Context, image string, options image.PullOptions) (io.ReadCloser, error) { // verify an image was provided if len(image) == 0 { return nil, errors.New("no container provided") @@ -199,7 +199,7 @@ func (i *ImageService) ImagePull(ctx context.Context, image string, options type // a mocked call to push a Docker image. // // https://pkg.go.dev/github.com/docker/docker/client#Client.ImagePush -func (i *ImageService) ImagePush(ctx context.Context, ref string, options types.ImagePushOptions) (io.ReadCloser, error) { +func (i *ImageService) ImagePush(ctx context.Context, ref string, options image.PushOptions) (io.ReadCloser, error) { return nil, nil } @@ -207,7 +207,7 @@ func (i *ImageService) ImagePush(ctx context.Context, ref string, options types. // a mocked call to remove a Docker image. // // https://pkg.go.dev/github.com/docker/docker/client#Client.ImageRemove -func (i *ImageService) ImageRemove(ctx context.Context, image string, options types.ImageRemoveOptions) ([]types.ImageDeleteResponseItem, error) { +func (i *ImageService) ImageRemove(ctx context.Context, image string, options image.RemoveOptions) ([]image.DeleteResponse, error) { return nil, nil } diff --git a/mock/docker/service.go b/mock/docker/service.go index 8e6ffc36..b2bb83e1 100644 --- a/mock/docker/service.go +++ b/mock/docker/service.go @@ -7,6 +7,7 @@ import ( "io" "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/client" ) @@ -20,8 +21,8 @@ type ServiceService struct{} // Docker swarm cluster. // // https://pkg.go.dev/github.com/docker/docker/client#Client.ServiceCreate -func (s *ServiceService) ServiceCreate(ctx context.Context, service swarm.ServiceSpec, options types.ServiceCreateOptions) (types.ServiceCreateResponse, error) { - return types.ServiceCreateResponse{}, nil +func (s *ServiceService) ServiceCreate(ctx context.Context, service swarm.ServiceSpec, options types.ServiceCreateOptions) (swarm.ServiceCreateResponse, error) { + return swarm.ServiceCreateResponse{}, nil } // ServiceInspectWithRaw is a helper function to simulate @@ -47,7 +48,7 @@ func (s *ServiceService) ServiceList(ctx context.Context, options types.ServiceL // service for a Docker swarm cluster. // // https://pkg.go.dev/github.com/docker/docker/client#Client.ServiceLogs -func (s *ServiceService) ServiceLogs(ctx context.Context, serviceID string, options types.ContainerLogsOptions) (io.ReadCloser, error) { +func (s *ServiceService) ServiceLogs(ctx context.Context, serviceID string, options container.LogsOptions) (io.ReadCloser, error) { return nil, nil } @@ -65,8 +66,8 @@ func (s *ServiceService) ServiceRemove(ctx context.Context, serviceID string) er // Docker swarm cluster. // // https://pkg.go.dev/github.com/docker/docker/client#Client.ServiceUpdate -func (s *ServiceService) ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options types.ServiceUpdateOptions) (types.ServiceUpdateResponse, error) { - return types.ServiceUpdateResponse{}, nil +func (s *ServiceService) ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options types.ServiceUpdateOptions) (swarm.ServiceUpdateResponse, error) { + return swarm.ServiceUpdateResponse{}, nil } // TaskInspectWithRaw is a helper function to simulate @@ -90,7 +91,7 @@ func (s *ServiceService) TaskList(ctx context.Context, options types.TaskListOpt // TaskLogs is a helper function to simulate // a mocked call to capture the logs from a // task for a Docker swarm cluster. -func (s *ServiceService) TaskLogs(ctx context.Context, taskID string, options types.ContainerLogsOptions) (io.ReadCloser, error) { +func (s *ServiceService) TaskLogs(ctx context.Context, taskID string, options container.LogsOptions) (io.ReadCloser, error) { return nil, nil } diff --git a/mock/docker/system.go b/mock/docker/system.go index 62ebfae3..49e560ae 100644 --- a/mock/docker/system.go +++ b/mock/docker/system.go @@ -8,6 +8,7 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/events" "github.com/docker/docker/api/types/registry" + "github.com/docker/docker/api/types/system" "github.com/docker/docker/client" ) @@ -38,8 +39,8 @@ func (s *SystemService) Events(ctx context.Context, options types.EventsOptions) // information from the Docker daemon. // // https://pkg.go.dev/github.com/docker/docker/client#Client.Info -func (s *SystemService) Info(ctx context.Context) (types.Info, error) { - return types.Info{}, nil +func (s *SystemService) Info(ctx context.Context) (system.Info, error) { + return system.Info{}, nil } // Ping is a helper function to simulate @@ -56,7 +57,7 @@ func (s *SystemService) Ping(ctx context.Context) (types.Ping, error) { // daemon against a Docker registry. // // https://pkg.go.dev/github.com/docker/docker/client#Client.RegistryLogin -func (s *SystemService) RegistryLogin(ctx context.Context, auth types.AuthConfig) (registry.AuthenticateOKBody, error) { +func (s *SystemService) RegistryLogin(ctx context.Context, auth registry.AuthConfig) (registry.AuthenticateOKBody, error) { return registry.AuthenticateOKBody{}, nil } diff --git a/runtime/docker/container.go b/runtime/docker/container.go index 1c896f1d..b4733350 100644 --- a/runtime/docker/container.go +++ b/runtime/docker/container.go @@ -10,8 +10,7 @@ import ( "github.com/go-vela/types/constants" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/container" + dockerContainerTypes "github.com/docker/docker/api/types/container" docker "github.com/docker/docker/client" "github.com/docker/docker/pkg/stdcopy" @@ -25,7 +24,7 @@ func (c *client) InspectContainer(ctx context.Context, ctn *pipeline.Container) // send API call to inspect the container // - // https://godoc.org/github.com/docker/docker/client#Client.ContainerInspect + // https://pkg.go.dev/github.com/docker/docker/client#Client.ContainerInspect container, err := c.Docker.ContainerInspect(ctx, ctn.ID) if err != nil { return err @@ -33,7 +32,7 @@ func (c *client) InspectContainer(ctx context.Context, ctn *pipeline.Container) // capture the container exit code // - // https://godoc.org/github.com/docker/docker/api/types#ContainerState + // https://pkg.go.dev/github.com/docker/docker/api/types#ContainerState ctn.ExitCode = container.State.ExitCode return nil @@ -45,7 +44,7 @@ func (c *client) RemoveContainer(ctx context.Context, ctn *pipeline.Container) e // send API call to inspect the container // - // https://godoc.org/github.com/docker/docker/client#Client.ContainerInspect + // https://pkg.go.dev/github.com/docker/docker/client#Client.ContainerInspect container, err := c.Docker.ContainerInspect(ctx, ctn.ID) if err != nil { return err @@ -53,13 +52,13 @@ func (c *client) RemoveContainer(ctx context.Context, ctn *pipeline.Container) e // if the container is paused, restarting or running // - // https://godoc.org/github.com/docker/docker/api/types#ContainerState + // https://pkg.go.dev/github.com/docker/docker/api/types#ContainerState if container.State.Paused || container.State.Restarting || container.State.Running { // send API call to kill the container // - // https://godoc.org/github.com/docker/docker/client#Client.ContainerKill + // https://pkg.go.dev/github.com/docker/docker/client#Client.ContainerKill err := c.Docker.ContainerKill(ctx, ctn.ID, "SIGKILL") if err != nil { return err @@ -68,8 +67,8 @@ func (c *client) RemoveContainer(ctx context.Context, ctn *pipeline.Container) e // create options for removing container // - // https://godoc.org/github.com/docker/docker/api/types#ContainerRemoveOptions - opts := types.ContainerRemoveOptions{ + // https://pkg.go.dev/github.com/docker/docker/api/types/container#RemoveOptions + opts := dockerContainerTypes.RemoveOptions{ Force: true, RemoveLinks: false, RemoveVolumes: true, @@ -77,7 +76,7 @@ func (c *client) RemoveContainer(ctx context.Context, ctn *pipeline.Container) e // send API call to remove the container // - // https://godoc.org/github.com/docker/docker/client#Client.ContainerRemove + // https://pkg.go.dev/github.com/docker/docker/client#Client.ContainerRemove err = c.Docker.ContainerRemove(ctx, ctn.ID, opts) if err != nil { return err @@ -151,7 +150,7 @@ func (c *client) RunContainer(ctx context.Context, ctn *pipeline.Container, b *p // send API call to create the container // - // https://godoc.org/github.com/docker/docker/client#Client.ContainerCreate + // https://pkg.go.dev/github.com/docker/docker/client#Client.ContainerCreate _, err := c.Docker.ContainerCreate( ctx, containerConf, @@ -166,12 +165,12 @@ func (c *client) RunContainer(ctx context.Context, ctn *pipeline.Container, b *p // create options for starting container // - // https://godoc.org/github.com/docker/docker/api/types#ContainerStartOptions - opts := types.ContainerStartOptions{} + // https://pkg.go.dev/github.com/docker/docker/api/types/container#StartOptions + opts := dockerContainerTypes.StartOptions{} // send API call to start the container // - // https://godoc.org/github.com/docker/docker/client#Client.ContainerStart + // https://pkg.go.dev/github.com/docker/docker/client#Client.ContainerStart err = c.Docker.ContainerStart(ctx, ctn.ID, opts) if err != nil { return err @@ -212,7 +211,7 @@ func (c *client) SetupContainer(ctx context.Context, ctn *pipeline.Container) er // check if the container image exists on the host // - // https://godoc.org/github.com/docker/docker/client#Client.ImageInspectWithRaw + // https://pkg.go.dev/github.com/docker/docker/client#Client.ImageInspectWithRaw _, _, err = c.Docker.ImageInspectWithRaw(ctx, _image) if err == nil { return nil @@ -221,7 +220,7 @@ func (c *client) SetupContainer(ctx context.Context, ctn *pipeline.Container) er // if the container image does not exist on the host // we attempt to capture it for executing the pipeline // - // https://godoc.org/github.com/docker/docker/client#IsErrNotFound + // https://pkg.go.dev/github.com/docker/docker/client#IsErrNotFound if docker.IsErrNotFound(err) { // send API call to create the image return c.CreateImage(ctx, ctn) @@ -236,8 +235,8 @@ func (c *client) TailContainer(ctx context.Context, ctn *pipeline.Container) (io // create options for capturing container logs // - // https://godoc.org/github.com/docker/docker/api/types#ContainerLogsOptions - opts := types.ContainerLogsOptions{ + // https://pkg.go.dev/github.com/docker/docker/api/types/container#LogsOptions + opts := dockerContainerTypes.LogsOptions{ Follow: true, ShowStdout: true, ShowStderr: true, @@ -247,7 +246,7 @@ func (c *client) TailContainer(ctx context.Context, ctn *pipeline.Container) (io // send API call to capture the container logs // - // https://godoc.org/github.com/docker/docker/client#Client.ContainerLogs + // https://pkg.go.dev/github.com/docker/docker/client#Client.ContainerLogs logs, err := c.Docker.ContainerLogs(ctx, ctn.ID, opts) if err != nil { return nil, err @@ -262,7 +261,7 @@ func (c *client) TailContainer(ctx context.Context, ctn *pipeline.Container) (io // copy container stdout and stderr logs to our in-memory pipe // - // https://godoc.org/github.com/docker/docker/pkg/stdcopy#StdCopy + // https://pkg.go.dev/github.com/docker/docker/pkg/stdcopy#StdCopy _, err := stdcopy.StdCopy(wc, wc, logs) if err != nil { c.Logger.Errorf("unable to copy logs for container: %v", err) @@ -284,8 +283,8 @@ func (c *client) WaitContainer(ctx context.Context, ctn *pipeline.Container) err // send API call to wait for the container completion // - // https://godoc.org/github.com/docker/docker/client#Client.ContainerWait - wait, errC := c.Docker.ContainerWait(ctx, ctn.ID, container.WaitConditionNotRunning) + // https://pkg.go.dev/github.com/docker/docker/client#Client.ContainerWait + wait, errC := c.Docker.ContainerWait(ctx, ctn.ID, dockerContainerTypes.WaitConditionNotRunning) select { case <-wait: @@ -298,11 +297,11 @@ func (c *client) WaitContainer(ctx context.Context, ctn *pipeline.Container) err // ctnConfig is a helper function to // generate the container config. -func ctnConfig(ctn *pipeline.Container) *container.Config { +func ctnConfig(ctn *pipeline.Container) *dockerContainerTypes.Config { // create container config object // - // https://godoc.org/github.com/docker/docker/api/types/container#Config - config := &container.Config{ + // https://pkg.go.dev/github.com/docker/docker/api/types/container#Config + config := &dockerContainerTypes.Config{ Image: image.Parse(ctn.Image), WorkingDir: ctn.Directory, AttachStdin: false, diff --git a/runtime/docker/docker.go b/runtime/docker/docker.go index 43a918f0..fcbc467e 100644 --- a/runtime/docker/docker.go +++ b/runtime/docker/docker.go @@ -35,7 +35,7 @@ type config struct { type client struct { config *config - // https://godoc.org/github.com/docker/docker/client#CommonAPIClient + // https://pkg.go.dev/github.com/docker/docker/client#CommonAPIClient Docker docker.CommonAPIClient // https://pkg.go.dev/github.com/sirupsen/logrus#Entry Logger *logrus.Entry @@ -72,7 +72,7 @@ func New(opts ...ClientOpt) (*client, error) { // create new Docker client from environment // - // https://godoc.org/github.com/docker/docker/client#NewClientWithOpts + // https://pkg.go.dev/github.com/docker/docker/client#NewClientWithOpts _docker, err := docker.NewClientWithOpts(docker.FromEnv) if err != nil { return nil, err @@ -83,7 +83,7 @@ func New(opts ...ClientOpt) (*client, error) { // typically this would be inherited from the host environment // but this ensures the version of client being used // - // https://godoc.org/github.com/docker/docker/client#WithVersion + // https://pkg.go.dev/github.com/docker/docker/client#WithVersion _ = docker.WithVersion(Version)(_docker) // set the Docker client in the runtime client diff --git a/runtime/docker/image.go b/runtime/docker/image.go index 136cd233..987c1213 100644 --- a/runtime/docker/image.go +++ b/runtime/docker/image.go @@ -9,7 +9,8 @@ import ( "os" "strings" - "github.com/docker/docker/api/types" + dockerImageTypes "github.com/docker/docker/api/types/image" + "github.com/go-vela/types/constants" "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/image" @@ -30,12 +31,12 @@ func (c *client) CreateImage(ctx context.Context, ctn *pipeline.Container) error // create options for pulling image // - // https://godoc.org/github.com/docker/docker/api/types#ImagePullOptions - opts := types.ImagePullOptions{} + // https://pkg.go.dev/github.com/docker/docker/api/types/image#PullOptions + opts := dockerImageTypes.PullOptions{} // send API call to pull the image for the container // - // https://godoc.org/github.com/docker/docker/client#Client.ImagePull + // https://pkg.go.dev/github.com/docker/docker/client#Client.ImagePull reader, err := c.Docker.ImagePull(ctx, _image, opts) if err != nil { return err @@ -86,7 +87,7 @@ func (c *client) InspectImage(ctx context.Context, ctn *pipeline.Container) ([]b // send API call to inspect the image // - // https://godoc.org/github.com/docker/docker/client#Client.ImageInspectWithRaw + // https://pkg.go.dev/github.com/docker/docker/client#Client.ImageInspectWithRaw i, _, err := c.Docker.ImageInspectWithRaw(ctx, _image) if err != nil { return output, err diff --git a/runtime/docker/network.go b/runtime/docker/network.go index edb5406d..1d45bc63 100644 --- a/runtime/docker/network.go +++ b/runtime/docker/network.go @@ -19,14 +19,14 @@ func (c *client) CreateNetwork(ctx context.Context, b *pipeline.Build) error { // create options for creating network // - // https://godoc.org/github.com/docker/docker/api/types#NetworkCreate + // https://pkg.go.dev/github.com/docker/docker/api/types#NetworkCreate opts := types.NetworkCreate{ Driver: "bridge", } // send API call to create the network // - // https://godoc.org/github.com/docker/docker/client#Client.NetworkCreate + // https://pkg.go.dev/github.com/docker/docker/client#Client.NetworkCreate _, err := c.Docker.NetworkCreate(ctx, b.ID, opts) if err != nil { return err @@ -41,7 +41,7 @@ func (c *client) InspectNetwork(ctx context.Context, b *pipeline.Build) ([]byte, // create options for inspecting network // - // https://godoc.org/github.com/docker/docker/api/types#NetworkInspectOptions + // https://pkg.go.dev/github.com/docker/docker/api/types#NetworkInspectOptions opts := types.NetworkInspectOptions{} // create output for inspecting network @@ -51,7 +51,7 @@ func (c *client) InspectNetwork(ctx context.Context, b *pipeline.Build) ([]byte, // send API call to inspect the network // - // https://godoc.org/github.com/docker/docker/client#Client.NetworkInspect + // https://pkg.go.dev/github.com/docker/docker/client#Client.NetworkInspect n, err := c.Docker.NetworkInspect(ctx, b.ID, opts) if err != nil { return output, err @@ -59,7 +59,7 @@ func (c *client) InspectNetwork(ctx context.Context, b *pipeline.Build) ([]byte, // convert network type NetworkResource to bytes with pretty print // - // https://godoc.org/github.com/docker/docker/api/types#NetworkResource + // https://pkg.go.dev/github.com/docker/docker/api/types#NetworkResource network, err := json.MarshalIndent(n, "", " ") if err != nil { return output, err @@ -75,7 +75,7 @@ func (c *client) RemoveNetwork(ctx context.Context, b *pipeline.Build) error { // send API call to remove the network // - // https://godoc.org/github.com/docker/docker/client#Client.NetworkRemove + // https://pkg.go.dev/github.com/docker/docker/client#Client.NetworkRemove err := c.Docker.NetworkRemove(ctx, b.ID) if err != nil { return err @@ -91,7 +91,7 @@ func netConfig(id, alias string) *network.NetworkingConfig { // set pipeline id for endpoint with alias // - // https://godoc.org/github.com/docker/docker/api/types/network#EndpointSettings + // https://pkg.go.dev/github.com/docker/docker/api/types/network#EndpointSettings endpoints[id] = &network.EndpointSettings{ NetworkID: id, Aliases: []string{alias}, @@ -99,7 +99,7 @@ func netConfig(id, alias string) *network.NetworkingConfig { // return network config with configured endpoints // - // https://godoc.org/github.com/docker/docker/api/types/network#NetworkingConfig + // https://pkg.go.dev/github.com/docker/docker/api/types/network#NetworkingConfig return &network.NetworkingConfig{ EndpointsConfig: endpoints, } diff --git a/runtime/docker/volume.go b/runtime/docker/volume.go index f48e3306..ea09ae9d 100644 --- a/runtime/docker/volume.go +++ b/runtime/docker/volume.go @@ -25,7 +25,7 @@ func (c *client) CreateVolume(ctx context.Context, b *pipeline.Build) error { // create options for creating volume // - // https://godoc.org/github.com/docker/docker/api/types/volume#CreateOptions + // https://pkg.go.dev/github.com/docker/docker/api/types/volume#CreateOptions opts := volume.CreateOptions{ Name: b.ID, Driver: "local", @@ -33,7 +33,7 @@ func (c *client) CreateVolume(ctx context.Context, b *pipeline.Build) error { // send API call to create the volume // - // https://godoc.org/github.com/docker/docker/client#Client.VolumeCreate + // https://pkg.go.dev/github.com/docker/docker/client#Client.VolumeCreate _, err := c.Docker.VolumeCreate(ctx, opts) if err != nil { return err @@ -53,7 +53,7 @@ func (c *client) InspectVolume(ctx context.Context, b *pipeline.Build) ([]byte, // send API call to inspect the volume // - // https://godoc.org/github.com/docker/docker/client#Client.VolumeInspect + // https://pkg.go.dev/github.com/docker/docker/client#Client.VolumeInspect v, err := c.Docker.VolumeInspect(ctx, b.ID) if err != nil { return output, err @@ -61,7 +61,7 @@ func (c *client) InspectVolume(ctx context.Context, b *pipeline.Build) ([]byte, // convert volume type Volume to bytes with pretty print // - // https://godoc.org/github.com/docker/docker/api/types#Volume + // https://pkg.go.dev/github.com/docker/docker/api/types#Volume volume, err := json.MarshalIndent(v, "", " ") if err != nil { return output, err @@ -77,7 +77,7 @@ func (c *client) RemoveVolume(ctx context.Context, b *pipeline.Build) error { // send API call to remove the volume // - // https://godoc.org/github.com/docker/docker/client#Client.VolumeRemove + // https://pkg.go.dev/github.com/docker/docker/client#Client.VolumeRemove err := c.Docker.VolumeRemove(ctx, b.ID, true) if err != nil { return err @@ -133,14 +133,14 @@ func hostConfig(logger *logrus.Entry, id string, ulimits pipeline.UlimitSlice, v } } - // https://godoc.org/github.com/docker/docker/api/types/container#HostConfig + // https://pkg.go.dev/github.com/docker/docker/api/types/container#HostConfig return &container.HostConfig{ - // https://godoc.org/github.com/docker/docker/api/types/container#LogConfig + // https://pkg.go.dev/github.com/docker/docker/api/types/container#LogConfig LogConfig: container.LogConfig{ Type: "json-file", }, Privileged: false, - // https://godoc.org/github.com/docker/docker/api/types/mount#Mount + // https://pkg.go.dev/github.com/docker/docker/api/types/mount#Mount Mounts: mounts, // https://pkg.go.dev/github.com/docker/docker/api/types/container#Resources.Ulimits Resources: resources,