diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 78c4782..9c3418f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: - name: Setup Golang uses: actions/setup-go@v3 with: - go-version: ~1.21.6 + go-version: ~1.22.3 - uses: actions/cache@v3 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 96e523a..e63d801 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ jobs: - name: Setup Golang uses: actions/setup-go@v3 with: - go-version: ~1.21.6 + go-version: ~1.22.3 - uses: actions/cache@v3 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4a813b6..787663c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: - name: Setup Golang uses: actions/setup-go@v3 with: - go-version: ~1.21.6 + go-version: ~1.22.3 - uses: actions/cache@v3 with: diff --git a/cmd/selenoid.go b/cmd/selenoid.go index 31b2e7c..6eb8c19 100644 --- a/cmd/selenoid.go +++ b/cmd/selenoid.go @@ -2,11 +2,12 @@ package cmd import ( "fmt" - "github.com/aerokube/cm/selenoid" - "github.com/spf13/cobra" "os" "runtime" "time" + + "github.com/aerokube/cm/selenoid" + "github.com/spf13/cobra" ) var ( @@ -89,7 +90,7 @@ func initFlags() { selenoidStatusCmd, } { c.Flags().StringVarP(&configDir, "config-dir", "c", selenoid.GetSelenoidConfigDir(), "directory to save files") - c.Flags().Uint16VarP(&port, "port", "p", selenoid.SelenoidDefaultPort, "override listen port") + c.Flags().Uint16VarP(&port, "port", "p", selenoid.DefaultPort, "override listen port") } for _, c := range []*cobra.Command{ selenoidDownloadUICmd, @@ -101,7 +102,7 @@ func initFlags() { selenoidUIStatusCmd, } { c.Flags().StringVarP(&uiConfigDir, "config-dir", "c", selenoid.GetSelenoidUIConfigDir(), "directory to save files") - c.Flags().Uint16VarP(&uiPort, "port", "p", selenoid.SelenoidUIDefaultPort, "override listen port") + c.Flags().Uint16VarP(&uiPort, "port", "p", selenoid.UIDefaultPort, "override listen port") } for _, c := range []*cobra.Command{ @@ -219,5 +220,5 @@ var selenoidCmd = &cobra.Command{ } func stderr(format string, a ...interface{}) { - fmt.Fprintf(os.Stderr, format, a) + _, _ = fmt.Fprintf(os.Stderr, format, a) } diff --git a/cmd/selenoid_args.go b/cmd/selenoid_args.go index 8d72ab1..7a3a9bb 100644 --- a/cmd/selenoid_args.go +++ b/cmd/selenoid_args.go @@ -1,9 +1,10 @@ package cmd import ( + "os" + "github.com/aerokube/cm/selenoid" "github.com/spf13/cobra" - "os" ) var selenoidArgsCmd = &cobra.Command{ diff --git a/cmd/selenoid_cleanup.go b/cmd/selenoid_cleanup.go index 6a1f400..d15de7a 100644 --- a/cmd/selenoid_cleanup.go +++ b/cmd/selenoid_cleanup.go @@ -1,9 +1,10 @@ package cmd import ( + "os" + "github.com/aerokube/cm/selenoid" "github.com/spf13/cobra" - "os" ) var selenoidCleanupCmd = &cobra.Command{ diff --git a/cmd/selenoid_configure.go b/cmd/selenoid_configure.go index 64b8f9c..a8b2a98 100644 --- a/cmd/selenoid_configure.go +++ b/cmd/selenoid_configure.go @@ -1,8 +1,9 @@ package cmd import ( - "github.com/spf13/cobra" "os" + + "github.com/spf13/cobra" ) var selenoidConfigureCmd = &cobra.Command{ diff --git a/cmd/selenoid_download.go b/cmd/selenoid_download.go index 80d0cc2..cea16f6 100644 --- a/cmd/selenoid_download.go +++ b/cmd/selenoid_download.go @@ -1,9 +1,10 @@ package cmd import ( + "os" + "github.com/aerokube/cm/selenoid" "github.com/spf13/cobra" - "os" ) var selenoidDownloadCmd = &cobra.Command{ diff --git a/cmd/selenoid_start.go b/cmd/selenoid_start.go index f38c10c..199d9c5 100644 --- a/cmd/selenoid_start.go +++ b/cmd/selenoid_start.go @@ -1,9 +1,10 @@ package cmd import ( + "os" + "github.com/aerokube/cm/selenoid" "github.com/spf13/cobra" - "os" ) var selenoidStartCmd = &cobra.Command{ diff --git a/cmd/selenoid_status.go b/cmd/selenoid_status.go index ff6d557..e74f549 100644 --- a/cmd/selenoid_status.go +++ b/cmd/selenoid_status.go @@ -1,8 +1,9 @@ package cmd import ( - "github.com/spf13/cobra" "os" + + "github.com/spf13/cobra" ) var selenoidStatusCmd = &cobra.Command{ diff --git a/cmd/selenoid_stop.go b/cmd/selenoid_stop.go index 619048d..b1deb35 100644 --- a/cmd/selenoid_stop.go +++ b/cmd/selenoid_stop.go @@ -1,9 +1,10 @@ package cmd import ( + "os" + "github.com/aerokube/cm/selenoid" "github.com/spf13/cobra" - "os" ) var selenoidStopCmd = &cobra.Command{ diff --git a/cmd/selenoid_ui_status.go b/cmd/selenoid_ui_status.go index 3bafd36..ee526f5 100644 --- a/cmd/selenoid_ui_status.go +++ b/cmd/selenoid_ui_status.go @@ -1,8 +1,9 @@ package cmd import ( - "github.com/spf13/cobra" "os" + + "github.com/spf13/cobra" ) var selenoidUIStatusCmd = &cobra.Command{ diff --git a/cmd/version.go b/cmd/version.go index a02ab6a..e1b39ca 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -2,8 +2,9 @@ package cmd import ( "fmt" - "github.com/spf13/cobra" "os" + + "github.com/spf13/cobra" ) var ( diff --git a/go.mod b/go.mod index 773773e..88ae44f 100644 --- a/go.mod +++ b/go.mod @@ -1,61 +1,63 @@ module github.com/aerokube/cm -go 1.21 +go 1.22 require ( github.com/Masterminds/semver/v3 v3.2.1 - github.com/aerokube/selenoid v0.0.0-20240109083731-079fe2dfad4f - github.com/docker/cli v23.0.1+incompatible - github.com/docker/docker v25.0.5+incompatible + github.com/aerokube/selenoid v0.0.0-20240520175821-773c202b01e3 + github.com/docker/cli v26.1.3+incompatible + github.com/docker/docker v26.1.3+incompatible github.com/docker/go-connections v0.5.0 github.com/docker/go-units v0.5.0 - github.com/fatih/color v1.14.1 - github.com/fvbommel/sortorder v1.0.2 + github.com/fatih/color v1.17.0 + github.com/fvbommel/sortorder v1.1.0 github.com/google/go-github v17.0.0+incompatible github.com/heroku/docker-registry-client v0.0.0-20211012143308-9463674c8930 github.com/mattn/go-colorable v0.1.13 github.com/mitchellh/go-ps v1.0.0 github.com/spf13/cobra v1.8.0 - github.com/stretchr/testify v1.8.4 + github.com/stretchr/testify v1.9.0 gopkg.in/cheggaaa/pb.v1 v1.0.28 ) require ( - github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect - github.com/Microsoft/go-winio v0.6.1 // indirect - github.com/containerd/log v0.1.0 // indirect + github.com/Microsoft/go-winio v0.6.2 // indirect + github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/distribution/reference v0.5.0 // indirect - github.com/docker/distribution v2.8.2+incompatible // indirect - github.com/docker/docker-credential-helpers v0.6.0 // indirect + github.com/distribution/reference v0.6.0 // indirect + github.com/docker/distribution v2.8.3+incompatible // indirect + github.com/docker/docker-credential-helpers v0.8.2 // indirect github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 // indirect github.com/felixge/httpsnoop v1.0.4 // 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/gogo/protobuf v1.3.2 // indirect - github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135 // indirect - github.com/imdario/mergo v0.3.13 // indirect + github.com/google/go-querystring v1.1.0 // indirect + github.com/imdario/mergo v0.3.15 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/mattn/go-isatty v0.0.17 // indirect - github.com/mattn/go-runewidth v0.0.2 // indirect - github.com/moby/term v0.5.0 // indirect - github.com/morikuni/aec v1.0.0 // indirect + github.com/kr/pretty v0.3.1 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-runewidth v0.0.15 // indirect + github.com/moby/docker-image-spec v1.3.1 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.0.2 // indirect + github.com/opencontainers/image-spec v1.1.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/rivo/uniseg v0.4.7 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/spf13/pflag v1.0.5 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect - go.opentelemetry.io/otel v1.22.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0 // indirect - go.opentelemetry.io/otel/metric v1.22.0 // indirect - go.opentelemetry.io/otel/sdk v1.22.0 // indirect - go.opentelemetry.io/otel/trace v1.22.0 // indirect - golang.org/x/mod v0.10.0 // indirect - golang.org/x/sys v0.16.0 // indirect - golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.9.1 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 // indirect + go.opentelemetry.io/otel v1.27.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0 // indirect + go.opentelemetry.io/otel/metric v1.27.0 // indirect + go.opentelemetry.io/otel/trace v1.27.0 // indirect + go.opentelemetry.io/proto/otlp v1.2.0 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/text v0.15.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e // indirect + google.golang.org/grpc v1.64.0 // indirect + google.golang.org/protobuf v1.34.1 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - gotest.tools/v3 v3.4.0 // indirect ) diff --git a/go.sum b/go.sum index cb0dd08..fc7bc4d 100644 --- a/go.sum +++ b/go.sum @@ -3,31 +3,32 @@ github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg6 github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= -github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= -github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= +github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OpenPeeDeeP/depguard v1.0.0/go.mod h1:7/4sitnI9YlQgTLLk734QlzXT8DuHVnAyztLplQjk+o= github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= -github.com/aerokube/selenoid v0.0.0-20240109083731-079fe2dfad4f h1:mux+7hc0wnoNEBQjs1NA0BcghJFkDyYFdnb0D1vp4kg= -github.com/aerokube/selenoid v0.0.0-20240109083731-079fe2dfad4f/go.mod h1:hfoEb4dPF4hZh1e6EQm5eJmnVJtf0J3odWK8T8f93Lo= -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/aerokube/selenoid v0.0.0-20240520175821-773c202b01e3 h1:HXyYRTxswu+w5a42CXQNhdCoBMow3fYevs7EJ1y0sOo= +github.com/aerokube/selenoid v0.0.0-20240520175821-773c202b01e3/go.mod h1:mS/E6/Mw0+8StGVKvI22xK+tg2sVNPRxreBQkoKF+kE= +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/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= -github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/docker/cli v23.0.1+incompatible h1:LRyWITpGzl2C9e9uGxzisptnxAn1zfZKXy13Ul2Q5oM= -github.com/docker/cli v23.0.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +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 v26.1.3+incompatible h1:bUpXT/N0kDE3VUHI2r5VMsYQgi38kYuoC0oL9yt3lqc= +github.com/docker/cli v26.1.3+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v0.0.0-20171011171712-7484e51bf6af/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -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 v25.0.5+incompatible h1:UmQydMduGkrD5nQde1mecF/YnSbTOaPeFIeP5C4W+DE= -github.com/docker/docker v25.0.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker-credential-helpers v0.6.0 h1:5bhDRLn1roGiNjz8IezRngHxMfoeaXGyr0BeMHq4rD8= -github.com/docker/docker-credential-helpers v0.6.0/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y= +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 v26.1.3+incompatible h1:lLCzRbrVZrljpVNobJu1J2FHk8V0s4BawoZippkc+xo= +github.com/docker/docker v26.1.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker-credential-helpers v0.8.2 h1:bX3YxiGzFP5sOXWc3bTPEXdEaZSeVMrFgOr3T+zrFAo= +github.com/docker/docker-credential-helpers v0.8.2/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= @@ -35,18 +36,18 @@ github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDD github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 h1:UhxFibDNY/bfvqU5CAUmr9zpesgbU6SWc8/B4mflAE4= github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= github.com/fatih/color v1.6.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.14.1 h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w= -github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg= +github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= +github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fvbommel/sortorder v1.0.2 h1:mV4o8B2hKboCdkJm+a7uX/SIpZob4JzUpc5GGnM45eo= -github.com/fvbommel/sortorder v1.0.2/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= +github.com/fvbommel/sortorder v1.1.0 h1:fUmoe+HLsBTctBDoaBwpQo5N+nrCp8g/BjKb/6ZQmYw= +github.com/fvbommel/sortorder v1.1.0/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= github.com/go-critic/go-critic v0.3.5-0.20190526074819-1df300866540/go.mod h1:+sE8vrLDS2M0pZkBk0wy6+nLdKexVDrl/jBqQOTDThA= github.com/go-lintpack/lintpack v0.5.2/go.mod h1:NwZuYi2nUHho8XEIZ6SIxihrnPoqBTDqfpXvXAN0sXM= 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.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= @@ -69,8 +70,6 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/mock v1.0.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4= github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk= github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6/go.mod h1:DbHgvLiFKX1Sh2T1w8Q/h4NAI8MHIpzCdnBUDTXU3I0= @@ -89,24 +88,24 @@ github.com/golangci/prealloc v0.0.0-20180630174525-215b22d4de21/go.mod h1:tf5+bz github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4= github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= -github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135 h1:zLTLjkaOFEFIOxY5BWLFLwh+cL8vOBW4XJ2aqLE/Tf0= -github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= +github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE= -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/grpc-ecosystem/grpc-gateway/v2 v2.19.1 h1:/c3QmbOGMGTOumP2iT/rCwB7b0QDGLKzqOmktBjT+Is= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1/go.mod h1:5SN9VR2LTsRFsrEC6FHgRbTWrTHu6tqPeKxEQv15giM= github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= github.com/heroku/docker-registry-client v0.0.0-20211012143308-9463674c8930 h1:mNL9ktJqBuzPTV/QP/fKd4y1uOFvfiv6zhe0G7lg9OA= github.com/heroku/docker-registry-client v0.0.0-20211012143308-9463674c8930/go.mod h1:Yho0S7KhsnHQRCC5lDraYF1SsLMeWtf/tKdufKu3TJA= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= -github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= +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.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= @@ -118,8 +117,10 @@ github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0 github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -131,16 +132,18 @@ github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxec github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-runewidth v0.0.2 h1:UnlwIPBGaTZfPQ6T1IGzPI0EkYAQmT9fAEJ/poFC63o= -github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= +github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-ps v0.0.0-20170309133038-4fdf99ab2936/go.mod h1:r1VsdOzOPt1ZSrGZWFoNhsAedKnEd6r9Np1+5blZCWk= github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc= github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg= github.com/mitchellh/mapstructure v0.0.0-20180220230111-00c29f56e238/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +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.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= @@ -155,16 +158,23 @@ github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1Cpa github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= -github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= +github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= +github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM= github.com/pelletier/go-toml v1.1.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1:5STLWrekHfjyYwxBRVRXNOSewLJ3PWfDJd1VyTS21fI= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= +github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/go-glob v0.0.0-20170128012129-256dc444b735/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/shirou/gopsutil v0.0.0-20180427012116-c95755e4bcd7/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= @@ -191,8 +201,8 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/timakin/bodyclose v0.0.0-20190721030226-87058b9bfcec/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= github.com/ultraware/funlen v0.0.1/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= @@ -201,30 +211,28 @@ github.com/valyala/quicktemplate v1.1.1/go.mod h1:EH+4AkTd43SvgIbQHYu59/cJyxDoOV github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 h1:sv9kVfal0MK0wBMCOGr+HeJm9v803BkJxGrk2au7j08= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0/go.mod h1:SK2UL73Zy1quvRPonmOmRDiWk1KBV3LyIeeIxcEApWw= -go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y= -go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 h1:9l89oX4ba9kHbBol3Xin3leYJ+252h0zszDtBwyKe2A= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0/go.mod h1:XLZfZboOJWHNKUv7eH0inh0E9VV6eWDFB/9yJyTLPp0= +go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= +go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0 h1:9M3+rhx7kZCIQQhQRYaZCdNu1V73tm4TvXs2ntl98C4= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0/go.mod h1:noq80iT8rrHP1SfybmPiRGc9dc5M8RPmGvtwo7Oo7tc= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0 h1:FyjCyI9jVEfqhUh2MoSkmolPjfh5fp2hnV0b0irxH4Q= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0/go.mod h1:hYwym2nDEeZfG/motx0p7L7J1N1vyzIThemQsb4g2qY= -go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg= -go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY= +go.opentelemetry.io/otel/metric v1.27.0 h1:hvj3vdEKyeCi4YaYfNjv2NUje8FqKqUY8IlF0FxV/ik= +go.opentelemetry.io/otel/metric v1.27.0/go.mod h1:mVFgmRlhljgBiuk/MP/oKylr4hs85GZAylncepAX/ak= go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw= go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc= -go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0= -go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo= -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.27.0 h1:IqYb813p7cmbHk0a5y6pD5JPakbVfftRXABGt5/Rscw= +go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4= +go.opentelemetry.io/proto/otlp v1.2.0 h1:pVeZGk7nXDC9O2hncA6nHldxEjm6LByfA2aN8IOkz94= +go.opentelemetry.io/proto/otlp v1.2.0/go.mod h1:gGpR8txAl5M03pDhMC79G6SdqNV26naRm/KDsgaHD8A= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 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/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= -golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20170915142106-8351a756f30f/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180911220305-26e67e76b6c3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -233,14 +241,12 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= 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= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= -golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20171026204733-164713f0dfce/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -248,19 +254,18 @@ golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= -golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.0.0-20170915090833-1cbadb444a80/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +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= golang.org/x/tools v0.0.0-20170915040203-e531a2a1c15f/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -274,25 +279,23 @@ golang.org/x/tools v0.0.0-20190521203540-521d6ed310dd/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo= -golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 h1:W18sezcAYs+3tDZX4F80yctqa12jcP1PUS2gQu1zTPU= -google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97/go.mod h1:iargEX0SFPm3xcfMI0d1domjg0ZF4Aa0p2awqyxhvF0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 h1:6GQBEOdGkX6MMTLT9V+TjtIRZCw9VPD5Z+yHY9wMgS0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97/go.mod h1:v7nGkzlmW8P3n/bKmWBn2WpBjpOEx8Q6gMueudAmKfY= -google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= -google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= -google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= -google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 h1:RFiFrvy37/mpSpdySBDrUdipW/dHwsRwh3J3+A9VgT4= +google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237/go.mod h1:Z5Iiy3jtmioajWHDGFk7CeugTyHtPvMHA4UTmUkyalE= +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.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= +google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= +google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.28 h1:n1tBJnnK2r7g9OW2btFH91V92STTUevLXYFb8gy9EMk= gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= @@ -303,11 +306,10 @@ gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bl gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= -gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= +gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= +gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc= mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4= mvdan.cc/unparam v0.0.0-20190209190245-fbb59629db34/go.mod h1:H6SUd1XjIs+qQCyskXg5OFSrilMRUkD8ePJpHKDPaeY= diff --git a/render/rewriter/rewriter.go b/render/rewriter/rewriter.go index 16d5958..299c9ac 100644 --- a/render/rewriter/rewriter.go +++ b/render/rewriter/rewriter.go @@ -1,4 +1,4 @@ -// original code from https://github.com/vbauerster/mpb +// Package rewriter original code was copied from https://github.com/vbauerster/mpb package rewriter import ( @@ -17,7 +17,7 @@ var ( clearCursorAndLine = cursorUp + clearLine ) -// Writer is a buffered the writer that updates the terminal. +// Rewriter is a buffered writer that updates the terminal. // The contents of writer will be flushed when Flush is called. type Rewriter struct { out io.Writer @@ -52,5 +52,5 @@ func (w *Rewriter) Write(b []byte) (n int, err error) { } func (w *Rewriter) clearLines() { - fmt.Fprint(w.out, strings.Repeat(clearCursorAndLine, w.lineCount)) + _, _ = fmt.Fprint(w.out, strings.Repeat(clearCursorAndLine, w.lineCount)) } diff --git a/render/rewriter/rewriter_test.go b/render/rewriter/rewriter_test.go index 7b91cbe..be0caf2 100644 --- a/render/rewriter/rewriter_test.go +++ b/render/rewriter/rewriter_test.go @@ -10,9 +10,9 @@ func TestWriter(t *testing.T) { b := &bytes.Buffer{} w := New(b) for i := 0; i < 2; i++ { - fmt.Fprintln(w, "foo") + _, _ = fmt.Fprintln(w, "foo") } - w.Flush() + _ = w.Flush() want := "foo\nfoo\n" if b.String() != want { t.Fatalf("want %q, got %q", want, b.String()) diff --git a/selenoid/base.go b/selenoid/base.go index 69d03b0..d8206c1 100644 --- a/selenoid/base.go +++ b/selenoid/base.go @@ -55,23 +55,23 @@ func (c *Logger) Printf(format string, v ...interface{}) { func (c *Logger) Titlef(format string, v ...interface{}) { if !c.Quiet { - fmt.Fprintf(colorable.NewColorableStdout(), color.GreenString("> ")+format+"\n", v...) + _, _ = fmt.Fprintf(colorable.NewColorableStdout(), color.GreenString("> ")+format+"\n", v...) } } func (c *Logger) Errorf(format string, v ...interface{}) { - fmt.Fprintf(colorable.NewColorableStdout(), color.RedString("x ")+format+"\n", v...) + _, _ = fmt.Fprintf(colorable.NewColorableStdout(), color.RedString("x ")+format+"\n", v...) } func (c *Logger) Pointf(format string, v ...interface{}) { if !c.Quiet { - fmt.Fprintf(colorable.NewColorableStdout(), color.HiBlackString("- ")+format+"\n", v...) + _, _ = fmt.Fprintf(colorable.NewColorableStdout(), color.HiBlackString("- ")+format+"\n", v...) } } func (c *Logger) Tracef(format string, v ...interface{}) { if !c.Quiet { - color.New(color.FgHiBlack).Fprintf(colorable.NewColorableStdout(), format+"\n", v...) + _, _ = color.New(color.FgHiBlack).Fprintf(colorable.NewColorableStdout(), format+"\n", v...) } } @@ -133,8 +133,8 @@ type LogsAware struct { } const ( - SelenoidDefaultPort = 4444 - SelenoidUIDefaultPort = 8080 + DefaultPort = 4444 + UIDefaultPort = 8080 DefaultRegistryUrl = "https://index.docker.io" DefaultDriversInfoURL = "https://raw.githubusercontent.com/aerokube/cm/master/browsers.json" ) diff --git a/selenoid/base_test.go b/selenoid/base_test.go index efd80c0..ed6dc79 100644 --- a/selenoid/base_test.go +++ b/selenoid/base_test.go @@ -1,9 +1,10 @@ package selenoid import ( - assert "github.com/stretchr/testify/require" "path/filepath" "testing" + + assert "github.com/stretchr/testify/require" ) func TestGetConfigDir(t *testing.T) { diff --git a/selenoid/docker.go b/selenoid/docker.go index 2097cd6..69f65ff 100644 --- a/selenoid/docker.go +++ b/selenoid/docker.go @@ -3,19 +3,26 @@ package selenoid import ( "bufio" "context" + "encoding/base64" "encoding/json" + "errors" "fmt" - "github.com/docker/docker/api" - "github.com/docker/go-units" + "io" "log" - "sort" - - "errors" + "net/http" + "net/url" "os" + "path/filepath" + "regexp" + "runtime" + "sort" "strconv" "strings" "time" + "github.com/docker/docker/api" + "github.com/docker/go-units" + "github.com/Masterminds/semver/v3" "github.com/aerokube/selenoid/config" authconfig "github.com/docker/cli/cli/config" @@ -23,6 +30,7 @@ import ( "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" "github.com/docker/docker/api/types/network" "github.com/docker/docker/api/types/strslice" "github.com/docker/docker/client" @@ -30,17 +38,9 @@ import ( "github.com/heroku/docker-registry-client/registry" "github.com/mattn/go-colorable" - "net/http" - "path/filepath" - "regexp" - "runtime" - - "encoding/base64" "github.com/aerokube/cm/render/rewriter" "github.com/fatih/color" . "github.com/fvbommel/sortorder" - "io" - "net/url" ) const ( @@ -296,7 +296,7 @@ func (c *DockerConfigurator) IsDownloaded() bool { return c.getSelenoidImage() != nil } -func (c *DockerConfigurator) getSelenoidImage() *types.ImageSummary { +func (c *DockerConfigurator) getSelenoidImage() *image.Summary { return c.getImage(selenoidImage, c.Version) } @@ -304,12 +304,12 @@ func (c *DockerConfigurator) IsUIDownloaded() bool { return c.getSelenoidUIImage() != nil } -func (c *DockerConfigurator) getSelenoidUIImage() *types.ImageSummary { +func (c *DockerConfigurator) getSelenoidUIImage() *image.Summary { return c.getImage(selenoidUIImage, c.Version) } -func (c *DockerConfigurator) getImage(name string, version string) *types.ImageSummary { - images, err := c.docker.ImageList(context.Background(), types.ImageListOptions{}) +func (c *DockerConfigurator) getImage(name string, version string) *image.Summary { + images, err := c.docker.ImageList(context.Background(), image.ListOptions{}) if err != nil { c.Errorf("Failed to list images: %v", err) return nil @@ -317,7 +317,7 @@ func (c *DockerConfigurator) getImage(name string, version string) *types.ImageS return findMatchingImage(images, name, version) } -func findMatchingImage(images []types.ImageSummary, name string, version string) *types.ImageSummary { +func findMatchingImage(images []image.Summary, name string, version string) *image.Summary { sort.Slice(images, func(i, j int) bool { return images[i].Created > images[j].Created }) @@ -424,15 +424,15 @@ func (c *DockerConfigurator) createConfig() SelenoidConfig { requestedBrowsers := parseRequestedBrowsers(&c.Logger, c.Browsers) browsersToIterate := c.getBrowsersToIterate(requestedBrowsers) browsers := make(map[string]config.Versions) - for browserName, image := range browsersToIterate { + for browserName, img := range browsersToIterate { c.Titlef(`Processing browser "%v"...`, color.GreenString(browserName)) - tags := c.fetchImageTags(image) + tags := c.fetchImageTags(img) if c.VNC { c.Pointf("Requested to download VNC images but this feature is now deprecated as all images contain VNC.") } versionConstraint := requestedBrowsers[browserName] pulledTags := c.filterTags(tags, versionConstraint) - fullyQualifiedImage := c.getFullyQualifiedImageRef(image) + fullyQualifiedImage := c.getFullyQualifiedImageRef(img) if c.DownloadNeeded { pulledTags = c.pullImages(fullyQualifiedImage, pulledTags) } @@ -488,8 +488,8 @@ func (c *DockerConfigurator) getBrowsersToIterate(requestedBrowsers map[string][ } ret := make(map[string]string) for browserName := range requestedBrowsers { - if image, ok := defaultBrowsers[browserName]; ok { - ret[browserName] = image + if img, ok := defaultBrowsers[browserName]; ok { + ret[browserName] = img continue } c.Errorf("Unsupported browser: %s", browserName) @@ -635,7 +635,7 @@ type JSONProgress struct { func (c *DockerConfigurator) pullImage(ctx context.Context, ref string) bool { c.Pointf("Pulling image %v", color.BlueString(ref)) - pullOptions := types.ImagePullOptions{} + pullOptions := image.PullOptions{} if c.authConfig != nil { buf, err := json.Marshal(c.authConfig) if err != nil { @@ -672,13 +672,13 @@ func (c *DockerConfigurator) pullImage(ctx context.Context, ref string) bool { { if row.Progress != nil { if row.Progress.Current != row.Progress.Total { - fmt.Fprintf(writer, "\t[%s]: %s %s\n", row.ID, row.Status, row.ProgressMessage) + _, _ = fmt.Fprintf(writer, "\t[%s]: %s %s\n", row.ID, row.Status, row.ProgressMessage) } else { - fmt.Fprint(writer, "\r") + _, _ = fmt.Fprint(writer, "\r") } } - writer.Flush() + _ = writer.Flush() } } } @@ -708,7 +708,7 @@ func (c *DockerConfigurator) getSelenoidUIContainer() *types.Container { func (c *DockerConfigurator) getContainer(name string) *types.Container { f := filters.NewArgs() f.Add("name", fmt.Sprintf("^/%s$", name)) - containers, err := c.docker.ContainerList(context.Background(), types.ContainerListOptions{Filters: f}) + containers, err := c.docker.ContainerList(context.Background(), container.ListOptions{Filters: f}) if err != nil { return nil } @@ -719,12 +719,12 @@ func (c *DockerConfigurator) getContainer(name string) *types.Container { } func (c *DockerConfigurator) PrintArgs() error { - image := c.getSelenoidImage() - if image == nil { + img := c.getSelenoidImage() + if img == nil { return errors.New("Selenoid image is not downloaded: this is probably a bug") } cfg := &containerConfig{ - Image: image, + Image: img, Cmd: []string{"--help"}, PrintLogs: true, } @@ -738,9 +738,9 @@ const ( ) func (c *DockerConfigurator) Start() error { - image := c.getSelenoidImage() - if image == nil { - return errors.New("Selenoid image is not downloaded: this is probably a bug") + img := c.getSelenoidImage() + if img == nil { + return errors.New("selenoid image is not downloaded: this is probably a bug") } volumeConfigDir := getVolumeConfigDir(c.ConfigDir, selenoidConfigDirElem) @@ -786,9 +786,9 @@ func (c *DockerConfigurator) Start() error { } cfg := &containerConfig{ Name: selenoidContainerName, - Image: image, + Image: img, HostPort: c.Port, - ServicePort: SelenoidDefaultPort, + ServicePort: DefaultPort, Volumes: volumes, Network: networkName, Cmd: cmd, @@ -856,12 +856,12 @@ func chooseVolumeConfigDir(defaultConfigDir string, elem []string) string { } func (c *DockerConfigurator) PrintUIArgs() error { - image := c.getSelenoidUIImage() - if image == nil { - return errors.New("Selenoid UI image is not downloaded: this is probably a bug") + img := c.getSelenoidUIImage() + if img == nil { + return errors.New("selenoid UI image is not downloaded: this is probably a bug") } cfg := &containerConfig{ - Image: image, + Image: img, Cmd: []string{"--help"}, PrintLogs: true, } @@ -869,9 +869,9 @@ func (c *DockerConfigurator) PrintUIArgs() error { } func (c *DockerConfigurator) StartUI() error { - image := c.getSelenoidUIImage() - if image == nil { - return errors.New("Selenoid UI image is not downloaded: this is probably a bug") + img := c.getSelenoidUIImage() + if img == nil { + return errors.New("selenoid ui image is not downloaded: this is probably a bug") } var cmd, candidates []string @@ -905,9 +905,9 @@ containers: overrideEnv := strings.Fields(c.Env) cfg := &containerConfig{ Name: selenoidUIContainerName, - Image: image, + Image: img, HostPort: c.Port, - ServicePort: SelenoidUIDefaultPort, + ServicePort: UIDefaultPort, Network: networkName, Cmd: cmd, OverrideEnv: overrideEnv, @@ -929,7 +929,7 @@ func validateEnviron(envs []string) []string { type containerConfig struct { Name string - Image *types.ImageSummary + Image *image.Summary HostPort int ServicePort int Volumes []string @@ -1002,14 +1002,14 @@ func (c *DockerConfigurator) startContainer(cfg *containerConfig) error { if err != nil { return fmt.Errorf("failed to create container: %v", err) } - err = c.docker.ContainerStart(ctx, ctr.ID, types.ContainerStartOptions{}) + err = c.docker.ContainerStart(ctx, ctr.ID, container.StartOptions{}) if err != nil { - c.removeContainer(ctr.ID) + _ = c.removeContainer(ctr.ID) return fmt.Errorf("failed to start container: %v", err) } if cfg.PrintLogs { defer c.removeContainer(ctr.ID) - r, err := c.docker.ContainerLogs(ctx, ctr.ID, types.ContainerLogsOptions{ + r, err := c.docker.ContainerLogs(ctx, ctr.ID, container.LogsOptions{ ShowStdout: true, ShowStderr: true, }) @@ -1017,7 +1017,7 @@ func (c *DockerConfigurator) startContainer(cfg *containerConfig) error { return fmt.Errorf("failed to read container logs: %v", err) } defer r.Close() - io.Copy(os.Stderr, r) + _, _ = io.Copy(os.Stderr, r) } return nil } @@ -1026,7 +1026,7 @@ func (c *DockerConfigurator) createNetworkIfNeeded(networkName string) error { ctx := context.Background() _, err := c.docker.NetworkInspect(ctx, networkName, types.NetworkInspectOptions{}) if err != nil { - _, err = c.docker.NetworkCreate(ctx, networkName, types.NetworkCreate{CheckDuplicate: true}) + _, err = c.docker.NetworkCreate(ctx, networkName, types.NetworkCreate{}) if err != nil { return fmt.Errorf("failed to create custom network %s: %v", networkName, err) } @@ -1040,11 +1040,11 @@ func (c *DockerConfigurator) removeContainer(id string) error { timeout := int(c.GracefulTimeout.Milliseconds() / 1000) err := c.docker.ContainerStop(ctx, id, container.StopOptions{Timeout: &timeout}) if err == nil { - return c.docker.ContainerRemove(ctx, id, types.ContainerRemoveOptions{RemoveVolumes: true}) + return c.docker.ContainerRemove(ctx, id, container.RemoveOptions{RemoveVolumes: true}) } return err } - return c.docker.ContainerRemove(ctx, id, types.ContainerRemoveOptions{RemoveVolumes: true, Force: true}) + return c.docker.ContainerRemove(ctx, id, container.RemoveOptions{RemoveVolumes: true, Force: true}) } func (c *DockerConfigurator) Stop() error { diff --git a/selenoid/docker_test.go b/selenoid/docker_test.go index b181022..535988d 100644 --- a/selenoid/docker_test.go +++ b/selenoid/docker_test.go @@ -3,14 +3,15 @@ package selenoid import ( "encoding/json" "fmt" - "github.com/aerokube/selenoid/config" - "github.com/docker/docker/api/types/image" - assert "github.com/stretchr/testify/require" "net/http" "net/http/httptest" "os" "path/filepath" "testing" + + "github.com/aerokube/selenoid/config" + "github.com/docker/docker/api/types/image" + assert "github.com/stretchr/testify/require" ) var ( @@ -49,7 +50,7 @@ func setPort(p int) { } func resetPort() { - setPort(SelenoidDefaultPort) + setPort(DefaultPort) } func mux() http.Handler { @@ -456,7 +457,7 @@ func TestSyncWithConfig(t *testing.T) { func TestStartStopContainer(t *testing.T) { c, err := NewDockerConfigurator(&LifecycleConfig{ RegistryUrl: mockDockerServer.URL, - Port: SelenoidDefaultPort, + Port: DefaultPort, Version: Latest, UserNS: "host", }) @@ -475,12 +476,12 @@ func TestStartStopUIContainer(t *testing.T) { }() c, err := NewDockerConfigurator(&LifecycleConfig{ RegistryUrl: mockDockerServer.URL, - Port: SelenoidUIDefaultPort, + Port: UIDefaultPort, }) assert.NoError(t, err) setContainerName(selenoidUIContainerName) setImageName(selenoidUIImage) - setPort(SelenoidUIDefaultPort) + setPort(UIDefaultPort) assert.True(t, c.IsUIRunning()) assert.NoError(t, c.StartUI()) c.UIStatus() diff --git a/selenoid/drivers.go b/selenoid/drivers.go index a46e289..90e5973 100644 --- a/selenoid/drivers.go +++ b/selenoid/drivers.go @@ -10,11 +10,6 @@ import ( "encoding/hex" "encoding/json" "fmt" - "github.com/aerokube/selenoid/config" - "github.com/fatih/color" - "github.com/google/go-github/github" - "github.com/mitchellh/go-ps" - "gopkg.in/cheggaaa/pb.v1" "io" "net/http" "net/url" @@ -26,6 +21,14 @@ import ( "strings" "syscall" "time" + + "github.com/aerokube/selenoid/config" + "github.com/fatih/color" + "github.com/google/go-github/github" + "github.com/mitchellh/go-ps" + "golang.org/x/text/cases" + "golang.org/x/text/language" + "gopkg.in/cheggaaa/pb.v1" ) const ( @@ -211,9 +214,13 @@ func (d *DriversConfigurator) DownloadUI() (string, error) { return outputFile, nil } +var ( + title = cases.Title(language.AmericanEnglish) +) + func (d *DriversConfigurator) getSelenoidUIUrl() (string, error) { d.Titlef("Getting Selenoid UI release information for version: %s", color.BlueString(d.Version)) - return d.getUrl(selenoidUIRepo, fmt.Errorf("Selenoid UI binary for %s %s is not available for specified release: %s", strings.Title(d.OS), d.Arch, d.Version)) + return d.getUrl(selenoidUIRepo, fmt.Errorf("selenoid ui binary for %s %s is not available for specified release: %s", title.String(d.OS), d.Arch, d.Version)) } func (d *DriversConfigurator) getUrl(repo string, missingBinaryError error) (string, error) { @@ -333,7 +340,7 @@ func downloadFile(url string) ([]byte, error) { if err != nil { return nil, err } - w.Flush() + _ = w.Flush() return b.Bytes(), nil } @@ -486,14 +493,16 @@ func untar(data []byte, fileName string, outputDir string) (string, error) { } return extractAndWriteFile(tr, header) } - err = fmt.Errorf("file %s does not exist in archive", fileName) } return "", err } func outputFile(outputPath string, mode os.FileMode, r io.Reader) error { - os.MkdirAll(filepath.Dir(outputPath), 0755) + err := os.MkdirAll(filepath.Dir(outputPath), 0755) + if err != nil { + return err + } f, err := os.OpenFile(outputPath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, mode) if err != nil { return err @@ -530,10 +539,10 @@ loop: goarch := runtime.GOARCH if architectures, ok := browser.Files[goos]; ok { if driver, ok := architectures[goarch]; ok { - d.Titlef("Processing browser \"%s\"...", color.GreenString(strings.Title(browserName))) + d.Titlef("Processing browser \"%s\"...", color.GreenString(title.String(browserName))) driverPath, err := d.downloadDriver(&driver, configDir) if err != nil { - d.Errorf("Failed to download %s driver: %v", strings.Title(browserName), err) + d.Errorf("Failed to download %s driver: %v", title.String(browserName), err) continue loop } ret = append(ret, downloadedDriver{ diff --git a/selenoid/drivers_test.go b/selenoid/drivers_test.go index 9679388..c78048e 100644 --- a/selenoid/drivers_test.go +++ b/selenoid/drivers_test.go @@ -3,9 +3,6 @@ package selenoid import ( "encoding/json" "fmt" - "github.com/aerokube/selenoid/config" - "github.com/google/go-github/github" - assert "github.com/stretchr/testify/require" "net/http" "net/http/httptest" "net/url" @@ -16,6 +13,10 @@ import ( "runtime" "testing" "time" + + "github.com/aerokube/selenoid/config" + "github.com/google/go-github/github" + assert "github.com/stretchr/testify/require" ) const ( @@ -89,7 +90,7 @@ func driversMux() http.Handler { }, } w.WriteHeader(http.StatusOK) - json.NewEncoder(w).Encode(&browsers) + _ = json.NewEncoder(w).Encode(&browsers) }, )) @@ -113,7 +114,7 @@ func driversMux() http.Handler { func(w http.ResponseWriter, r *http.Request) { version := r.URL.Query().Get(version) w.WriteHeader(http.StatusOK) - w.Write([]byte(version)) + _, _ = w.Write([]byte(version)) }, )) @@ -323,7 +324,7 @@ func getReleaseHandler(v string) func(http.ResponseWriter, *http.Request) { } data, _ := json.Marshal(&release) w.WriteHeader(http.StatusOK) - w.Write(data) + _, _ = w.Write(data) } } @@ -430,7 +431,7 @@ func TestStartStopProcess(t *testing.T) { OS: runtime.GOOS, Arch: runtime.GOARCH, Version: Latest, - Port: SelenoidDefaultPort, + Port: DefaultPort, } configurator := NewDriversConfigurator(&lcConfig) assert.True(t, configurator.IsRunning()) //This is probably true because test binary has name selenoid.test; no fake process is launched @@ -439,7 +440,7 @@ func TestStartStopProcess(t *testing.T) { assert.NoError(t, configurator.Stop()) assert.NoError(t, configurator.PrintArgs()) - lcConfig.Port = SelenoidUIDefaultPort + lcConfig.Port = UIDefaultPort assert.False(t, configurator.IsUIRunning()) assert.NoError(t, configurator.StartUI()) configurator.UIStatus() diff --git a/selenoid/lifecycle.go b/selenoid/lifecycle.go index cd8aa4a..8f15236 100644 --- a/selenoid/lifecycle.go +++ b/selenoid/lifecycle.go @@ -4,10 +4,11 @@ import ( "context" "errors" "fmt" - "github.com/docker/docker/client" - "github.com/fatih/color" "io" "time" + + "github.com/docker/docker/client" + "github.com/fatih/color" ) type LifecycleConfig struct { @@ -90,7 +91,7 @@ func NewLifecycle(config *LifecycleConfig) (*Lifecycle, error) { func (l *Lifecycle) Close() { if l.closer != nil { - l.closer.Close() + _ = l.closer.Close() } } diff --git a/selenoid/lifecycle_test.go b/selenoid/lifecycle_test.go index fa86bf9..c422eb4 100644 --- a/selenoid/lifecycle_test.go +++ b/selenoid/lifecycle_test.go @@ -1,12 +1,13 @@ package selenoid import ( - assert "github.com/stretchr/testify/require" "net/http" "net/http/httptest" "net/url" "os" "testing" + + assert "github.com/stretchr/testify/require" ) type MockStrategy struct {