mirror of
https://github.com/docker/compose.git
synced 2025-07-22 13:14:29 +02:00
Merge pull request #9925 from glours/update-docker-dependencies
bump docker dependencies version
This commit is contained in:
commit
32ae036fd0
35
e2e/go.mod
35
e2e/go.mod
@ -26,7 +26,7 @@ require (
|
|||||||
github.com/compose-spec/compose-go v1.6.0 // indirect
|
github.com/compose-spec/compose-go v1.6.0 // indirect
|
||||||
github.com/containerd/console v1.0.3 // indirect
|
github.com/containerd/console v1.0.3 // indirect
|
||||||
github.com/containerd/containerd v1.6.8 // indirect
|
github.com/containerd/containerd v1.6.8 // indirect
|
||||||
github.com/containerd/continuity v0.2.3-0.20220330195504-d132b287edc8 // indirect
|
github.com/containerd/continuity v0.3.0 // indirect
|
||||||
github.com/containerd/ttrpc v1.1.0 // indirect
|
github.com/containerd/ttrpc v1.1.0 // indirect
|
||||||
github.com/containerd/typeurl v1.0.2 // indirect
|
github.com/containerd/typeurl v1.0.2 // indirect
|
||||||
github.com/cucumber/gherkin-go/v19 v19.0.3 // indirect
|
github.com/cucumber/gherkin-go/v19 v19.0.3 // indirect
|
||||||
@ -34,10 +34,10 @@ require (
|
|||||||
github.com/cyberphone/json-canonicalization v0.0.0-20210303052042-6bc126869bf4 // indirect
|
github.com/cyberphone/json-canonicalization v0.0.0-20210303052042-6bc126869bf4 // indirect
|
||||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||||
github.com/distribution/distribution/v3 v3.0.0-20220907155224-78b9c98c5c31 // indirect
|
github.com/distribution/distribution/v3 v3.0.0-20220907155224-78b9c98c5c31 // indirect
|
||||||
github.com/docker/buildx v0.8.2 // indirect
|
github.com/docker/buildx v0.9.1 // indirect
|
||||||
github.com/docker/cli v20.10.17+incompatible // indirect
|
github.com/docker/cli v20.10.19+incompatible // indirect
|
||||||
github.com/docker/distribution v2.8.1+incompatible // indirect
|
github.com/docker/distribution v2.8.1+incompatible // indirect
|
||||||
github.com/docker/docker v20.10.17+incompatible // indirect
|
github.com/docker/docker v20.10.19+incompatible // indirect
|
||||||
github.com/docker/docker-credential-helpers v0.6.4 // indirect
|
github.com/docker/docker-credential-helpers v0.6.4 // indirect
|
||||||
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c // indirect
|
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c // indirect
|
||||||
github.com/docker/go-connections v0.4.0 // indirect
|
github.com/docker/go-connections v0.4.0 // indirect
|
||||||
@ -70,42 +70,46 @@ require (
|
|||||||
github.com/inconshreveable/mousetrap v1.0.1 // indirect
|
github.com/inconshreveable/mousetrap v1.0.1 // indirect
|
||||||
github.com/json-iterator/go v1.1.12 // indirect
|
github.com/json-iterator/go v1.1.12 // indirect
|
||||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
|
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
|
||||||
github.com/klauspost/compress v1.15.1 // indirect
|
github.com/klauspost/compress v1.15.9 // indirect
|
||||||
github.com/mattn/go-colorable v0.1.12 // indirect
|
github.com/mattn/go-colorable v0.1.12 // indirect
|
||||||
github.com/mattn/go-isatty v0.0.16 // indirect
|
github.com/mattn/go-isatty v0.0.16 // indirect
|
||||||
|
github.com/mattn/go-runewidth v0.0.14 // indirect
|
||||||
github.com/mattn/go-shellwords v1.0.12 // indirect
|
github.com/mattn/go-shellwords v1.0.12 // indirect
|
||||||
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
|
github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
|
||||||
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
|
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
|
||||||
github.com/miekg/pkcs11 v1.1.1 // indirect
|
github.com/miekg/pkcs11 v1.1.1 // indirect
|
||||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||||
github.com/moby/buildkit v0.10.4 // indirect
|
github.com/moby/buildkit v0.10.4 // indirect
|
||||||
github.com/moby/locker v1.0.1 // indirect
|
github.com/moby/locker v1.0.1 // indirect
|
||||||
|
github.com/moby/patternmatcher v0.5.0 // indirect
|
||||||
github.com/moby/spdystream v0.2.0 // indirect
|
github.com/moby/spdystream v0.2.0 // indirect
|
||||||
github.com/moby/sys/signal v0.6.0 // indirect
|
github.com/moby/sys/sequential v0.5.0 // indirect
|
||||||
|
github.com/moby/sys/signal v0.7.0 // indirect
|
||||||
github.com/moby/sys/symlink v0.2.0 // indirect
|
github.com/moby/sys/symlink v0.2.0 // indirect
|
||||||
github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae // indirect
|
github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae // indirect
|
||||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||||
github.com/morikuni/aec v1.0.0 // indirect
|
github.com/morikuni/aec v1.0.0 // indirect
|
||||||
github.com/opencontainers/go-digest v1.0.0 // indirect
|
github.com/opencontainers/go-digest v1.0.0 // indirect
|
||||||
github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799 // indirect
|
github.com/opencontainers/image-spec v1.0.3-0.20220303224323-02efb9a75ee1 // indirect
|
||||||
github.com/opencontainers/runc v1.1.2 // indirect
|
github.com/opencontainers/runc v1.1.3 // indirect
|
||||||
github.com/pelletier/go-toml v1.9.4 // indirect
|
github.com/pelletier/go-toml v1.9.4 // indirect
|
||||||
github.com/pkg/errors v0.9.1 // indirect
|
github.com/pkg/errors v0.9.1 // indirect
|
||||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||||
github.com/prometheus/client_golang v1.12.1 // indirect
|
github.com/prometheus/client_golang v1.12.2 // indirect
|
||||||
github.com/prometheus/client_model v0.2.0 // indirect
|
github.com/prometheus/client_model v0.2.0 // indirect
|
||||||
github.com/prometheus/common v0.32.1 // indirect
|
github.com/prometheus/common v0.32.1 // indirect
|
||||||
github.com/prometheus/procfs v0.7.3 // indirect
|
github.com/prometheus/procfs v0.7.3 // indirect
|
||||||
github.com/qri-io/jsonpointer v0.1.1 // indirect
|
github.com/qri-io/jsonpointer v0.1.1 // indirect
|
||||||
github.com/qri-io/jsonschema v0.2.2-0.20210831022256-780655b2ba0e // indirect
|
github.com/qri-io/jsonschema v0.2.2-0.20210831022256-780655b2ba0e // indirect
|
||||||
|
github.com/rivo/uniseg v0.2.0 // indirect
|
||||||
github.com/serialx/hashring v0.0.0-20190422032157-8b2912629002 // indirect
|
github.com/serialx/hashring v0.0.0-20190422032157-8b2912629002 // indirect
|
||||||
github.com/sirupsen/logrus v1.9.0 // indirect
|
github.com/sirupsen/logrus v1.9.0 // indirect
|
||||||
github.com/spf13/cobra v1.6.0 // indirect
|
github.com/spf13/cobra v1.6.0 // indirect
|
||||||
github.com/spf13/pflag v1.0.5 // indirect
|
github.com/spf13/pflag v1.0.5 // indirect
|
||||||
github.com/stretchr/testify v1.8.0 // indirect
|
github.com/stretchr/testify v1.8.0 // indirect
|
||||||
github.com/theupdateframework/notary v0.7.0 // indirect
|
github.com/theupdateframework/notary v0.7.0 // indirect
|
||||||
github.com/tonistiigi/fsutil v0.0.0-20220315205639-9ed612626da3 // indirect
|
github.com/tonistiigi/fsutil v0.0.0-20220930225714-4638ad635be5 // indirect
|
||||||
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea // indirect
|
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea // indirect
|
||||||
github.com/tonistiigi/vt100 v0.0.0-20210615222946-8066bb97264f // indirect
|
github.com/tonistiigi/vt100 v0.0.0-20210615222946-8066bb97264f // indirect
|
||||||
github.com/weppos/publicsuffix-go v0.20.0 // indirect
|
github.com/weppos/publicsuffix-go v0.20.0 // indirect
|
||||||
@ -125,7 +129,7 @@ require (
|
|||||||
go.opentelemetry.io/otel/sdk v1.4.1 // indirect
|
go.opentelemetry.io/otel/sdk v1.4.1 // indirect
|
||||||
go.opentelemetry.io/otel/trace v1.11.0 // indirect
|
go.opentelemetry.io/otel/trace v1.11.0 // indirect
|
||||||
go.opentelemetry.io/proto/otlp v0.12.0 // indirect
|
go.opentelemetry.io/proto/otlp v0.12.0 // indirect
|
||||||
golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect
|
golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect
|
||||||
golang.org/x/net v0.0.0-20220906165146-f3363e06e74c // indirect
|
golang.org/x/net v0.0.0-20220906165146-f3363e06e74c // indirect
|
||||||
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
|
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
|
||||||
golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde // indirect
|
golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde // indirect
|
||||||
@ -135,7 +139,7 @@ require (
|
|||||||
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
|
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
|
||||||
google.golang.org/appengine v1.6.7 // indirect
|
google.golang.org/appengine v1.6.7 // indirect
|
||||||
google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106 // indirect
|
google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106 // indirect
|
||||||
google.golang.org/grpc v1.45.0 // indirect
|
google.golang.org/grpc v1.47.0 // indirect
|
||||||
google.golang.org/protobuf v1.27.1 // indirect
|
google.golang.org/protobuf v1.27.1 // indirect
|
||||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||||
@ -150,8 +154,9 @@ require (
|
|||||||
)
|
)
|
||||||
|
|
||||||
replace (
|
replace (
|
||||||
github.com/docker/cli => github.com/docker/cli v20.10.3-0.20220309205733-2b52f62e9627+incompatible
|
github.com/docker/cli => github.com/docker/cli v20.10.3-0.20221013132413-1d6c6e2367e2+incompatible // 22.06 master branch
|
||||||
github.com/docker/docker => github.com/docker/docker v20.10.3-0.20220309172631-83b51522df43+incompatible
|
github.com/docker/docker => github.com/docker/docker v20.10.3-0.20221013203545-33ab36d6b304+incompatible // 22.06 branch
|
||||||
|
github.com/moby/buildkit => github.com/moby/buildkit v0.10.1-0.20220816171719-55ba9d14360a // same as buildx
|
||||||
|
|
||||||
github.com/opencontainers/runc => github.com/opencontainers/runc v1.1.2 // Can be removed on next bump of containerd to > 1.6.4
|
github.com/opencontainers/runc => github.com/opencontainers/runc v1.1.2 // Can be removed on next bump of containerd to > 1.6.4
|
||||||
|
|
||||||
|
1308
e2e/go.sum
1308
e2e/go.sum
File diff suppressed because it is too large
Load Diff
37
go.mod
37
go.mod
@ -10,10 +10,10 @@ require (
|
|||||||
github.com/containerd/console v1.0.3
|
github.com/containerd/console v1.0.3
|
||||||
github.com/containerd/containerd v1.6.8
|
github.com/containerd/containerd v1.6.8
|
||||||
github.com/distribution/distribution/v3 v3.0.0-20220907155224-78b9c98c5c31
|
github.com/distribution/distribution/v3 v3.0.0-20220907155224-78b9c98c5c31
|
||||||
github.com/docker/buildx v0.8.2 // when updating, also update the replace rules accordingly
|
github.com/docker/buildx v0.9.1 // when updating, also update the replace rules accordingly
|
||||||
github.com/docker/cli v20.10.17+incompatible
|
github.com/docker/cli v20.10.19+incompatible
|
||||||
github.com/docker/cli-docs-tool v0.5.0
|
github.com/docker/cli-docs-tool v0.5.0
|
||||||
github.com/docker/docker v20.10.17+incompatible
|
github.com/docker/docker v20.10.19+incompatible
|
||||||
github.com/docker/go-connections v0.4.0
|
github.com/docker/go-connections v0.4.0
|
||||||
github.com/docker/go-units v0.5.0
|
github.com/docker/go-units v0.5.0
|
||||||
github.com/golang/mock v1.6.0
|
github.com/golang/mock v1.6.0
|
||||||
@ -25,7 +25,7 @@ require (
|
|||||||
github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae
|
github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae
|
||||||
github.com/morikuni/aec v1.0.0
|
github.com/morikuni/aec v1.0.0
|
||||||
github.com/opencontainers/go-digest v1.0.0
|
github.com/opencontainers/go-digest v1.0.0
|
||||||
github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799
|
github.com/opencontainers/image-spec v1.0.3-0.20220303224323-02efb9a75ee1
|
||||||
github.com/pkg/errors v0.9.1
|
github.com/pkg/errors v0.9.1
|
||||||
github.com/sirupsen/logrus v1.9.0
|
github.com/sirupsen/logrus v1.9.0
|
||||||
github.com/spf13/cobra v1.6.0
|
github.com/spf13/cobra v1.6.0
|
||||||
@ -45,7 +45,7 @@ require (
|
|||||||
github.com/beorn7/perks v1.0.1 // indirect
|
github.com/beorn7/perks v1.0.1 // indirect
|
||||||
github.com/cespare/xxhash/v2 v2.1.2 // indirect
|
github.com/cespare/xxhash/v2 v2.1.2 // indirect
|
||||||
github.com/cnabio/cnab-go v0.23.4 // indirect
|
github.com/cnabio/cnab-go v0.23.4 // indirect
|
||||||
github.com/containerd/continuity v0.2.3-0.20220330195504-d132b287edc8 // indirect
|
github.com/containerd/continuity v0.3.0 // indirect
|
||||||
github.com/containerd/ttrpc v1.1.0 // indirect
|
github.com/containerd/ttrpc v1.1.0 // indirect
|
||||||
github.com/containerd/typeurl v1.0.2 // indirect
|
github.com/containerd/typeurl v1.0.2 // indirect
|
||||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||||
@ -72,27 +72,27 @@ require (
|
|||||||
github.com/inconshreveable/mousetrap v1.0.1 // indirect
|
github.com/inconshreveable/mousetrap v1.0.1 // indirect
|
||||||
github.com/json-iterator/go v1.1.12 // indirect
|
github.com/json-iterator/go v1.1.12 // indirect
|
||||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
|
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
|
||||||
github.com/klauspost/compress v1.15.1 // indirect
|
github.com/klauspost/compress v1.15.9 // indirect
|
||||||
github.com/mattn/go-colorable v0.1.12 // indirect
|
github.com/mattn/go-colorable v0.1.12 // indirect
|
||||||
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
|
github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
|
||||||
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
|
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
|
||||||
github.com/miekg/pkcs11 v1.1.1 // indirect
|
github.com/miekg/pkcs11 v1.1.1 // indirect
|
||||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||||
github.com/moby/locker v1.0.1 // indirect
|
github.com/moby/locker v1.0.1 // indirect
|
||||||
github.com/moby/sys/signal v0.6.0 // indirect
|
github.com/moby/sys/signal v0.7.0 // indirect
|
||||||
github.com/moby/sys/symlink v0.2.0 // indirect
|
github.com/moby/sys/symlink v0.2.0 // indirect
|
||||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||||
github.com/opencontainers/runc v1.1.2 // indirect
|
github.com/opencontainers/runc v1.1.3 // indirect
|
||||||
github.com/pelletier/go-toml v1.9.4 // indirect
|
github.com/pelletier/go-toml v1.9.4 // indirect
|
||||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||||
github.com/prometheus/client_golang v1.12.1 // indirect
|
github.com/prometheus/client_golang v1.12.2 // indirect
|
||||||
github.com/prometheus/client_model v0.2.0 // indirect
|
github.com/prometheus/client_model v0.2.0 // indirect
|
||||||
github.com/prometheus/common v0.32.1 // indirect
|
github.com/prometheus/common v0.32.1 // indirect
|
||||||
github.com/prometheus/procfs v0.7.3 // indirect
|
github.com/prometheus/procfs v0.7.3 // indirect
|
||||||
github.com/qri-io/jsonpointer v0.1.1 // indirect
|
github.com/qri-io/jsonpointer v0.1.1 // indirect
|
||||||
github.com/qri-io/jsonschema v0.2.2-0.20210831022256-780655b2ba0e // indirect
|
github.com/qri-io/jsonschema v0.2.2-0.20210831022256-780655b2ba0e // indirect
|
||||||
github.com/tonistiigi/fsutil v0.0.0-20220315205639-9ed612626da3 // indirect
|
github.com/tonistiigi/fsutil v0.0.0-20220930225714-4638ad635be5 // indirect
|
||||||
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea // indirect
|
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea // indirect
|
||||||
github.com/tonistiigi/vt100 v0.0.0-20210615222946-8066bb97264f // indirect
|
github.com/tonistiigi/vt100 v0.0.0-20210615222946-8066bb97264f // indirect
|
||||||
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
|
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
|
||||||
@ -108,7 +108,7 @@ require (
|
|||||||
go.opentelemetry.io/otel/sdk v1.4.1 // indirect
|
go.opentelemetry.io/otel/sdk v1.4.1 // indirect
|
||||||
go.opentelemetry.io/otel/trace v1.11.0 // indirect
|
go.opentelemetry.io/otel/trace v1.11.0 // indirect
|
||||||
go.opentelemetry.io/proto/otlp v0.12.0 // indirect
|
go.opentelemetry.io/proto/otlp v0.12.0 // indirect
|
||||||
golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect
|
golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect
|
||||||
golang.org/x/net v0.0.0-20220906165146-f3363e06e74c // indirect
|
golang.org/x/net v0.0.0-20220906165146-f3363e06e74c // indirect
|
||||||
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
|
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
|
||||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab // indirect
|
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab // indirect
|
||||||
@ -117,7 +117,7 @@ require (
|
|||||||
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
|
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
|
||||||
google.golang.org/appengine v1.6.7 // indirect
|
google.golang.org/appengine v1.6.7 // indirect
|
||||||
google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106 // indirect
|
google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106 // indirect
|
||||||
google.golang.org/grpc v1.45.0 // indirect
|
google.golang.org/grpc v1.47.0 // indirect
|
||||||
google.golang.org/protobuf v1.27.1 // indirect
|
google.golang.org/protobuf v1.27.1 // indirect
|
||||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
@ -133,7 +133,11 @@ require (
|
|||||||
github.com/cenkalti/backoff/v4 v4.1.2 // indirect
|
github.com/cenkalti/backoff/v4 v4.1.2 // indirect
|
||||||
github.com/cyberphone/json-canonicalization v0.0.0-20210303052042-6bc126869bf4 // indirect
|
github.com/cyberphone/json-canonicalization v0.0.0-20210303052042-6bc126869bf4 // indirect
|
||||||
github.com/googleapis/gnostic v0.5.5 // indirect
|
github.com/googleapis/gnostic v0.5.5 // indirect
|
||||||
|
github.com/mattn/go-runewidth v0.0.14 // indirect
|
||||||
|
github.com/moby/patternmatcher v0.5.0 // indirect
|
||||||
github.com/moby/spdystream v0.2.0 // indirect
|
github.com/moby/spdystream v0.2.0 // indirect
|
||||||
|
github.com/moby/sys/sequential v0.5.0 // indirect
|
||||||
|
github.com/rivo/uniseg v0.2.0 // indirect
|
||||||
github.com/serialx/hashring v0.0.0-20190422032157-8b2912629002 // indirect
|
github.com/serialx/hashring v0.0.0-20190422032157-8b2912629002 // indirect
|
||||||
github.com/zmap/zcrypto v0.0.0-20220605182715-4dfcec6e9a8c // indirect
|
github.com/zmap/zcrypto v0.0.0-20220605182715-4dfcec6e9a8c // indirect
|
||||||
github.com/zmap/zlint v1.1.0 // indirect
|
github.com/zmap/zlint v1.1.0 // indirect
|
||||||
@ -143,11 +147,10 @@ require (
|
|||||||
k8s.io/api v0.24.1 // indirect
|
k8s.io/api v0.24.1 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
require github.com/gofrs/uuid v4.2.0+incompatible // indirect
|
|
||||||
|
|
||||||
replace (
|
replace (
|
||||||
github.com/docker/cli => github.com/docker/cli v20.10.3-0.20220309205733-2b52f62e9627+incompatible
|
github.com/docker/cli => github.com/docker/cli v20.10.3-0.20221013132413-1d6c6e2367e2+incompatible // 22.06 master branch
|
||||||
github.com/docker/docker => github.com/docker/docker v20.10.3-0.20220309172631-83b51522df43+incompatible
|
github.com/docker/docker => github.com/docker/docker v20.10.3-0.20221013203545-33ab36d6b304+incompatible // 22.06 branch
|
||||||
|
github.com/moby/buildkit => github.com/moby/buildkit v0.10.1-0.20220816171719-55ba9d14360a // same as buildx
|
||||||
|
|
||||||
github.com/opencontainers/runc => github.com/opencontainers/runc v1.1.2 // Can be removed on next bump of containerd to > 1.6.4
|
github.com/opencontainers/runc => github.com/opencontainers/runc v1.1.2 // Can be removed on next bump of containerd to > 1.6.4
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ import (
|
|||||||
_ "github.com/docker/buildx/driver/docker" // required to get default driver registered
|
_ "github.com/docker/buildx/driver/docker" // required to get default driver registered
|
||||||
"github.com/docker/buildx/util/buildflags"
|
"github.com/docker/buildx/util/buildflags"
|
||||||
xprogress "github.com/docker/buildx/util/progress"
|
xprogress "github.com/docker/buildx/util/progress"
|
||||||
"github.com/docker/docker/pkg/urlutil"
|
"github.com/docker/docker/builder/remotecontext/urlutil"
|
||||||
bclient "github.com/moby/buildkit/client"
|
bclient "github.com/moby/buildkit/client"
|
||||||
"github.com/moby/buildkit/session"
|
"github.com/moby/buildkit/session"
|
||||||
"github.com/moby/buildkit/session/auth/authprovider"
|
"github.com/moby/buildkit/session/auth/authprovider"
|
||||||
@ -249,7 +249,7 @@ func (s *composeService) toBuildOptions(project *types.Project, service types.Se
|
|||||||
}
|
}
|
||||||
|
|
||||||
sessionConfig := []session.Attachable{
|
sessionConfig := []session.Attachable{
|
||||||
authprovider.NewDockerAuthProvider(s.stderr()),
|
authprovider.NewDockerAuthProvider(s.configFile()),
|
||||||
}
|
}
|
||||||
if len(sshKeys) > 0 || len(service.Build.SSH) > 0 {
|
if len(sshKeys) > 0 || len(service.Build.SSH) > 0 {
|
||||||
sshAgentProvider, err := sshAgentProvider(append(service.Build.SSH, sshKeys...))
|
sshAgentProvider, err := sshAgentProvider(append(service.Build.SSH, sshKeys...))
|
||||||
|
@ -95,7 +95,7 @@ func (s *composeService) getDrivers(ctx context.Context) ([]build.DriverInfo, er
|
|||||||
dis := make([]build.DriverInfo, len(ng.Nodes))
|
dis := make([]build.DriverInfo, len(ng.Nodes))
|
||||||
var f driver.Factory
|
var f driver.Factory
|
||||||
if ng.Driver != "" {
|
if ng.Driver != "" {
|
||||||
factories := driver.GetFactories()
|
factories := driver.GetFactories(true)
|
||||||
for _, fac := range factories {
|
for _, fac := range factories {
|
||||||
if fac.Name() == ng.Driver {
|
if fac.Name() == ng.Driver {
|
||||||
f = fac
|
f = fac
|
||||||
@ -103,8 +103,8 @@ func (s *composeService) getDrivers(ctx context.Context) ([]build.DriverInfo, er
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if f == nil {
|
if f == nil {
|
||||||
if f = driver.GetFactory(ng.Driver, true); f == nil {
|
if f, err = driver.GetFactory(ng.Driver, true); f == nil || err != nil {
|
||||||
return nil, fmt.Errorf("failed to find buildx driver %q", ng.Driver)
|
return nil, fmt.Errorf("failed to find buildx driver %q, error: %w", ng.Driver, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -113,7 +113,7 @@ func (s *composeService) getDrivers(ctx context.Context) ([]build.DriverInfo, er
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
f, err = driver.GetDefaultFactory(ctx, dockerapi, false)
|
f, err = driver.GetDefaultFactory(ctx, ep, dockerapi, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -176,7 +176,7 @@ func (s *composeService) getDrivers(ctx context.Context) ([]build.DriverInfo, er
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
d, err := driver.GetDriver(ctx, "buildx_buildkit_"+n.Name, f, dockerapi, imageopt.Auth, kcc, n.Flags, n.Files, n.DriverOpts, n.Platforms, "")
|
d, err := driver.GetDriver(ctx, "buildx_buildkit_"+n.Name, f, n.Endpoint, dockerapi, imageopt.Auth, kcc, n.Flags, n.Files, n.DriverOpts, n.Platforms, "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
di.Err = err
|
di.Err = err
|
||||||
return nil
|
return nil
|
||||||
|
@ -30,13 +30,13 @@ import (
|
|||||||
buildx "github.com/docker/buildx/build"
|
buildx "github.com/docker/buildx/build"
|
||||||
"github.com/docker/cli/cli/command/image/build"
|
"github.com/docker/cli/cli/command/image/build"
|
||||||
dockertypes "github.com/docker/docker/api/types"
|
dockertypes "github.com/docker/docker/api/types"
|
||||||
|
"github.com/docker/docker/builder/remotecontext/urlutil"
|
||||||
"github.com/docker/docker/cli"
|
"github.com/docker/docker/cli"
|
||||||
"github.com/docker/docker/pkg/archive"
|
"github.com/docker/docker/pkg/archive"
|
||||||
"github.com/docker/docker/pkg/idtools"
|
"github.com/docker/docker/pkg/idtools"
|
||||||
"github.com/docker/docker/pkg/jsonmessage"
|
"github.com/docker/docker/pkg/jsonmessage"
|
||||||
"github.com/docker/docker/pkg/progress"
|
"github.com/docker/docker/pkg/progress"
|
||||||
"github.com/docker/docker/pkg/streamformatter"
|
"github.com/docker/docker/pkg/streamformatter"
|
||||||
"github.com/docker/docker/pkg/urlutil"
|
|
||||||
"github.com/hashicorp/go-multierror"
|
"github.com/hashicorp/go-multierror"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ import (
|
|||||||
"github.com/compose-spec/compose-go/types"
|
"github.com/compose-spec/compose-go/types"
|
||||||
"github.com/containerd/containerd/platforms"
|
"github.com/containerd/containerd/platforms"
|
||||||
moby "github.com/docker/docker/api/types"
|
moby "github.com/docker/docker/api/types"
|
||||||
|
containerType "github.com/docker/docker/api/types/container"
|
||||||
"github.com/docker/docker/api/types/filters"
|
"github.com/docker/docker/api/types/filters"
|
||||||
"github.com/docker/docker/api/types/network"
|
"github.com/docker/docker/api/types/network"
|
||||||
specs "github.com/opencontainers/image-spec/specs-go/v1"
|
specs "github.com/opencontainers/image-spec/specs-go/v1"
|
||||||
@ -180,7 +181,10 @@ func (c *convergence) ensureService(ctx context.Context, project *types.Project,
|
|||||||
// Scale Down
|
// Scale Down
|
||||||
container := container
|
container := container
|
||||||
eg.Go(func() error {
|
eg.Go(func() error {
|
||||||
err := c.service.apiClient().ContainerStop(ctx, container.ID, timeout)
|
timeoutInSecond := utils.DurationSecondToInt(timeout)
|
||||||
|
err := c.service.apiClient().ContainerStop(ctx, container.ID, containerType.StopOptions{
|
||||||
|
Timeout: timeoutInSecond,
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -412,7 +416,8 @@ func (s *composeService) recreateContainer(ctx context.Context, project *types.P
|
|||||||
var created moby.Container
|
var created moby.Container
|
||||||
w := progress.ContextWriter(ctx)
|
w := progress.ContextWriter(ctx)
|
||||||
w.Event(progress.NewEvent(getContainerProgressName(replaced), progress.Working, "Recreate"))
|
w.Event(progress.NewEvent(getContainerProgressName(replaced), progress.Working, "Recreate"))
|
||||||
err := s.apiClient().ContainerStop(ctx, replaced.ID, timeout)
|
timeoutInSecond := utils.DurationSecondToInt(timeout)
|
||||||
|
err := s.apiClient().ContainerStop(ctx, replaced.ID, containerType.StopOptions{Timeout: timeoutInSecond})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return created, err
|
return created, err
|
||||||
}
|
}
|
||||||
|
@ -1155,7 +1155,7 @@ func (s *composeService) createVolume(ctx context.Context, volume types.VolumeCo
|
|||||||
eventName := fmt.Sprintf("Volume %q", volume.Name)
|
eventName := fmt.Sprintf("Volume %q", volume.Name)
|
||||||
w := progress.ContextWriter(ctx)
|
w := progress.ContextWriter(ctx)
|
||||||
w.Event(progress.CreatingEvent(eventName))
|
w.Event(progress.CreatingEvent(eventName))
|
||||||
_, err := s.apiClient().VolumeCreate(ctx, volume_api.VolumeCreateBody{
|
_, err := s.apiClient().VolumeCreate(ctx, volume_api.CreateOptions{
|
||||||
Labels: volume.Labels,
|
Labels: volume.Labels,
|
||||||
Name: volume.Name,
|
Name: volume.Name,
|
||||||
Driver: volume.Driver,
|
Driver: volume.Driver,
|
||||||
|
@ -22,8 +22,11 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/docker/compose/v2/pkg/utils"
|
||||||
|
|
||||||
"github.com/compose-spec/compose-go/types"
|
"github.com/compose-spec/compose-go/types"
|
||||||
moby "github.com/docker/docker/api/types"
|
moby "github.com/docker/docker/api/types"
|
||||||
|
containerType "github.com/docker/docker/api/types/container"
|
||||||
"github.com/docker/docker/api/types/filters"
|
"github.com/docker/docker/api/types/filters"
|
||||||
"github.com/docker/docker/errdefs"
|
"github.com/docker/docker/errdefs"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
@ -241,7 +244,8 @@ func (s *composeService) stopContainers(ctx context.Context, w progress.Writer,
|
|||||||
eg.Go(func() error {
|
eg.Go(func() error {
|
||||||
eventName := getContainerProgressName(container)
|
eventName := getContainerProgressName(container)
|
||||||
w.Event(progress.StoppingEvent(eventName))
|
w.Event(progress.StoppingEvent(eventName))
|
||||||
err := s.apiClient().ContainerStop(ctx, container.ID, timeout)
|
timeoutInSecond := utils.DurationSecondToInt(timeout)
|
||||||
|
err := s.apiClient().ContainerStop(ctx, container.ID, containerType.StopOptions{Timeout: timeoutInSecond})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
w.Event(progress.ErrorMessageEvent(eventName, "Error while Stopping"))
|
w.Event(progress.ErrorMessageEvent(eventName, "Error while Stopping"))
|
||||||
return err
|
return err
|
||||||
|
@ -24,6 +24,7 @@ import (
|
|||||||
|
|
||||||
"github.com/compose-spec/compose-go/types"
|
"github.com/compose-spec/compose-go/types"
|
||||||
moby "github.com/docker/docker/api/types"
|
moby "github.com/docker/docker/api/types"
|
||||||
|
containerType "github.com/docker/docker/api/types/container"
|
||||||
"github.com/docker/docker/api/types/filters"
|
"github.com/docker/docker/api/types/filters"
|
||||||
"github.com/docker/docker/api/types/volume"
|
"github.com/docker/docker/api/types/volume"
|
||||||
"github.com/docker/docker/errdefs"
|
"github.com/docker/docker/errdefs"
|
||||||
@ -53,7 +54,7 @@ func TestDown(t *testing.T) {
|
|||||||
testContainer("service_orphan", "321", true),
|
testContainer("service_orphan", "321", true),
|
||||||
}, nil)
|
}, nil)
|
||||||
api.EXPECT().VolumeList(gomock.Any(), filters.NewArgs(projectFilter(strings.ToLower(testProject)))).
|
api.EXPECT().VolumeList(gomock.Any(), filters.NewArgs(projectFilter(strings.ToLower(testProject)))).
|
||||||
Return(volume.VolumeListOKBody{}, nil)
|
Return(volume.ListResponse{}, nil)
|
||||||
|
|
||||||
// network names are not guaranteed to be unique, ensure Compose handles
|
// network names are not guaranteed to be unique, ensure Compose handles
|
||||||
// cleanup properly if duplicates are inadvertently created
|
// cleanup properly if duplicates are inadvertently created
|
||||||
@ -63,9 +64,10 @@ func TestDown(t *testing.T) {
|
|||||||
{ID: "def456", Name: "myProject_default"},
|
{ID: "def456", Name: "myProject_default"},
|
||||||
}, nil)
|
}, nil)
|
||||||
|
|
||||||
api.EXPECT().ContainerStop(gomock.Any(), "123", nil).Return(nil)
|
stopOptions := containerType.StopOptions{}
|
||||||
api.EXPECT().ContainerStop(gomock.Any(), "456", nil).Return(nil)
|
api.EXPECT().ContainerStop(gomock.Any(), "123", stopOptions).Return(nil)
|
||||||
api.EXPECT().ContainerStop(gomock.Any(), "789", nil).Return(nil)
|
api.EXPECT().ContainerStop(gomock.Any(), "456", stopOptions).Return(nil)
|
||||||
|
api.EXPECT().ContainerStop(gomock.Any(), "789", stopOptions).Return(nil)
|
||||||
|
|
||||||
api.EXPECT().ContainerRemove(gomock.Any(), "123", moby.ContainerRemoveOptions{Force: true}).Return(nil)
|
api.EXPECT().ContainerRemove(gomock.Any(), "123", moby.ContainerRemoveOptions{Force: true}).Return(nil)
|
||||||
api.EXPECT().ContainerRemove(gomock.Any(), "456", moby.ContainerRemoveOptions{Force: true}).Return(nil)
|
api.EXPECT().ContainerRemove(gomock.Any(), "456", moby.ContainerRemoveOptions{Force: true}).Return(nil)
|
||||||
@ -102,13 +104,14 @@ func TestDownRemoveOrphans(t *testing.T) {
|
|||||||
testContainer("service_orphan", "321", true),
|
testContainer("service_orphan", "321", true),
|
||||||
}, nil)
|
}, nil)
|
||||||
api.EXPECT().VolumeList(gomock.Any(), filters.NewArgs(projectFilter(strings.ToLower(testProject)))).
|
api.EXPECT().VolumeList(gomock.Any(), filters.NewArgs(projectFilter(strings.ToLower(testProject)))).
|
||||||
Return(volume.VolumeListOKBody{}, nil)
|
Return(volume.ListResponse{}, nil)
|
||||||
api.EXPECT().NetworkList(gomock.Any(), moby.NetworkListOptions{Filters: filters.NewArgs(projectFilter(strings.ToLower(testProject)))}).
|
api.EXPECT().NetworkList(gomock.Any(), moby.NetworkListOptions{Filters: filters.NewArgs(projectFilter(strings.ToLower(testProject)))}).
|
||||||
Return([]moby.NetworkResource{{Name: "myProject_default"}}, nil)
|
Return([]moby.NetworkResource{{Name: "myProject_default"}}, nil)
|
||||||
|
|
||||||
api.EXPECT().ContainerStop(gomock.Any(), "123", nil).Return(nil)
|
stopOptions := containerType.StopOptions{}
|
||||||
api.EXPECT().ContainerStop(gomock.Any(), "789", nil).Return(nil)
|
api.EXPECT().ContainerStop(gomock.Any(), "123", stopOptions).Return(nil)
|
||||||
api.EXPECT().ContainerStop(gomock.Any(), "321", nil).Return(nil)
|
api.EXPECT().ContainerStop(gomock.Any(), "789", stopOptions).Return(nil)
|
||||||
|
api.EXPECT().ContainerStop(gomock.Any(), "321", stopOptions).Return(nil)
|
||||||
|
|
||||||
api.EXPECT().ContainerRemove(gomock.Any(), "123", moby.ContainerRemoveOptions{Force: true}).Return(nil)
|
api.EXPECT().ContainerRemove(gomock.Any(), "123", moby.ContainerRemoveOptions{Force: true}).Return(nil)
|
||||||
api.EXPECT().ContainerRemove(gomock.Any(), "789", moby.ContainerRemoveOptions{Force: true}).Return(nil)
|
api.EXPECT().ContainerRemove(gomock.Any(), "789", moby.ContainerRemoveOptions{Force: true}).Return(nil)
|
||||||
@ -137,13 +140,13 @@ func TestDownRemoveVolumes(t *testing.T) {
|
|||||||
api.EXPECT().ContainerList(gomock.Any(), projectFilterListOpt(false)).Return(
|
api.EXPECT().ContainerList(gomock.Any(), projectFilterListOpt(false)).Return(
|
||||||
[]moby.Container{testContainer("service1", "123", false)}, nil)
|
[]moby.Container{testContainer("service1", "123", false)}, nil)
|
||||||
api.EXPECT().VolumeList(gomock.Any(), filters.NewArgs(projectFilter(strings.ToLower(testProject)))).
|
api.EXPECT().VolumeList(gomock.Any(), filters.NewArgs(projectFilter(strings.ToLower(testProject)))).
|
||||||
Return(volume.VolumeListOKBody{
|
Return(volume.ListResponse{
|
||||||
Volumes: []*moby.Volume{{Name: "myProject_volume"}},
|
Volumes: []*volume.Volume{{Name: "myProject_volume"}},
|
||||||
}, nil)
|
}, nil)
|
||||||
api.EXPECT().NetworkList(gomock.Any(), moby.NetworkListOptions{Filters: filters.NewArgs(projectFilter(strings.ToLower(testProject)))}).
|
api.EXPECT().NetworkList(gomock.Any(), moby.NetworkListOptions{Filters: filters.NewArgs(projectFilter(strings.ToLower(testProject)))}).
|
||||||
Return(nil, nil)
|
Return(nil, nil)
|
||||||
|
|
||||||
api.EXPECT().ContainerStop(gomock.Any(), "123", nil).Return(nil)
|
api.EXPECT().ContainerStop(gomock.Any(), "123", containerType.StopOptions{}).Return(nil)
|
||||||
api.EXPECT().ContainerRemove(gomock.Any(), "123", moby.ContainerRemoveOptions{Force: true, RemoveVolumes: true}).Return(nil)
|
api.EXPECT().ContainerRemove(gomock.Any(), "123", moby.ContainerRemoveOptions{Force: true, RemoveVolumes: true}).Return(nil)
|
||||||
|
|
||||||
api.EXPECT().VolumeRemove(gomock.Any(), "myProject_volume", true).Return(nil)
|
api.EXPECT().VolumeRemove(gomock.Any(), "myProject_volume", true).Return(nil)
|
||||||
@ -274,8 +277,8 @@ func TestDownRemoveImages_NoLabel(t *testing.T) {
|
|||||||
[]moby.Container{container}, nil)
|
[]moby.Container{container}, nil)
|
||||||
|
|
||||||
api.EXPECT().VolumeList(gomock.Any(), filters.NewArgs(projectFilter(strings.ToLower(testProject)))).
|
api.EXPECT().VolumeList(gomock.Any(), filters.NewArgs(projectFilter(strings.ToLower(testProject)))).
|
||||||
Return(volume.VolumeListOKBody{
|
Return(volume.ListResponse{
|
||||||
Volumes: []*moby.Volume{{Name: "myProject_volume"}},
|
Volumes: []*volume.Volume{{Name: "myProject_volume"}},
|
||||||
}, nil)
|
}, nil)
|
||||||
api.EXPECT().NetworkList(gomock.Any(), moby.NetworkListOptions{Filters: filters.NewArgs(projectFilter(strings.ToLower(testProject)))}).
|
api.EXPECT().NetworkList(gomock.Any(), moby.NetworkListOptions{Filters: filters.NewArgs(projectFilter(strings.ToLower(testProject)))}).
|
||||||
Return(nil, nil)
|
Return(nil, nil)
|
||||||
@ -292,7 +295,7 @@ func TestDownRemoveImages_NoLabel(t *testing.T) {
|
|||||||
api.EXPECT().ImageInspectWithRaw(gomock.Any(), "testproject-service1").
|
api.EXPECT().ImageInspectWithRaw(gomock.Any(), "testproject-service1").
|
||||||
Return(moby.ImageInspect{}, nil, nil)
|
Return(moby.ImageInspect{}, nil, nil)
|
||||||
|
|
||||||
api.EXPECT().ContainerStop(gomock.Any(), "123", nil).Return(nil)
|
api.EXPECT().ContainerStop(gomock.Any(), "123", containerType.StopOptions{}).Return(nil)
|
||||||
api.EXPECT().ContainerRemove(gomock.Any(), "123", moby.ContainerRemoveOptions{Force: true}).Return(nil)
|
api.EXPECT().ContainerRemove(gomock.Any(), "123", moby.ContainerRemoveOptions{Force: true}).Return(nil)
|
||||||
|
|
||||||
api.EXPECT().ImageRemove(gomock.Any(), "testproject-service1:latest", moby.ImageRemoveOptions{}).Return(nil, nil)
|
api.EXPECT().ImageRemove(gomock.Any(), "testproject-service1:latest", moby.ImageRemoveOptions{}).Return(nil, nil)
|
||||||
|
@ -54,7 +54,7 @@ func TestKillAll(t *testing.T) {
|
|||||||
}).Return(
|
}).Return(
|
||||||
[]moby.Container{testContainer("service1", "123", false), testContainer("service1", "456", false), testContainer("service2", "789", false)}, nil)
|
[]moby.Container{testContainer("service1", "123", false), testContainer("service1", "456", false), testContainer("service2", "789", false)}, nil)
|
||||||
api.EXPECT().VolumeList(gomock.Any(), filters.NewArgs(projectFilter(strings.ToLower(testProject)))).
|
api.EXPECT().VolumeList(gomock.Any(), filters.NewArgs(projectFilter(strings.ToLower(testProject)))).
|
||||||
Return(volume.VolumeListOKBody{}, nil)
|
Return(volume.ListResponse{}, nil)
|
||||||
api.EXPECT().NetworkList(gomock.Any(), moby.NetworkListOptions{Filters: filters.NewArgs(projectFilter(strings.ToLower(testProject)))}).
|
api.EXPECT().NetworkList(gomock.Any(), moby.NetworkListOptions{Filters: filters.NewArgs(projectFilter(strings.ToLower(testProject)))}).
|
||||||
Return([]moby.NetworkResource{
|
Return([]moby.NetworkResource{
|
||||||
{ID: "abc123", Name: "testProject_default"},
|
{ID: "abc123", Name: "testProject_default"},
|
||||||
@ -87,7 +87,7 @@ func TestKillSignal(t *testing.T) {
|
|||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
api.EXPECT().ContainerList(ctx, listOptions).Return([]moby.Container{testContainer(serviceName, "123", false)}, nil)
|
api.EXPECT().ContainerList(ctx, listOptions).Return([]moby.Container{testContainer(serviceName, "123", false)}, nil)
|
||||||
api.EXPECT().VolumeList(gomock.Any(), filters.NewArgs(projectFilter(strings.ToLower(testProject)))).
|
api.EXPECT().VolumeList(gomock.Any(), filters.NewArgs(projectFilter(strings.ToLower(testProject)))).
|
||||||
Return(volume.VolumeListOKBody{}, nil)
|
Return(volume.ListResponse{}, nil)
|
||||||
api.EXPECT().NetworkList(gomock.Any(), moby.NetworkListOptions{Filters: filters.NewArgs(projectFilter(strings.ToLower(testProject)))}).
|
api.EXPECT().NetworkList(gomock.Any(), moby.NetworkListOptions{Filters: filters.NewArgs(projectFilter(strings.ToLower(testProject)))}).
|
||||||
Return([]moby.NetworkResource{
|
Return([]moby.NetworkResource{
|
||||||
{ID: "abc123", Name: "testProject_default"},
|
{ID: "abc123", Name: "testProject_default"},
|
||||||
|
@ -51,7 +51,7 @@ func TestPs(t *testing.T) {
|
|||||||
c2, inspect2 := containerDetails("service1", "456", "running", "", 0)
|
c2, inspect2 := containerDetails("service1", "456", "running", "", 0)
|
||||||
c2.Ports = []moby.Port{{PublicPort: 80, PrivatePort: 90, IP: "localhost"}}
|
c2.Ports = []moby.Port{{PublicPort: 80, PrivatePort: 90, IP: "localhost"}}
|
||||||
c3, inspect3 := containerDetails("service2", "789", "exited", "", 130)
|
c3, inspect3 := containerDetails("service2", "789", "exited", "", 130)
|
||||||
api.EXPECT().VolumeList(ctx, gomock.Any()).Return(volume.VolumeListOKBody{}, nil)
|
api.EXPECT().VolumeList(ctx, gomock.Any()).Return(volume.ListResponse{}, nil)
|
||||||
api.EXPECT().NetworkList(ctx, gomock.Any()).Return([]moby.NetworkResource{}, nil)
|
api.EXPECT().NetworkList(ctx, gomock.Any()).Return([]moby.NetworkResource{}, nil)
|
||||||
api.EXPECT().ContainerList(ctx, listOpts).Return([]moby.Container{c1, c2, c3}, nil)
|
api.EXPECT().ContainerList(ctx, listOpts).Return([]moby.Container{c1, c2, c3}, nil)
|
||||||
api.EXPECT().ContainerInspect(anyCancellableContext(), "123").Return(inspect1, nil)
|
api.EXPECT().ContainerInspect(anyCancellableContext(), "123").Return(inspect1, nil)
|
||||||
|
@ -21,10 +21,10 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/docker/compose/v2/pkg/api"
|
"github.com/docker/compose/v2/pkg/api"
|
||||||
"golang.org/x/sync/errgroup"
|
|
||||||
|
|
||||||
"github.com/docker/compose/v2/pkg/progress"
|
"github.com/docker/compose/v2/pkg/progress"
|
||||||
"github.com/docker/compose/v2/pkg/utils"
|
"github.com/docker/compose/v2/pkg/utils"
|
||||||
|
containerType "github.com/docker/docker/api/types/container"
|
||||||
|
"golang.org/x/sync/errgroup"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s *composeService) Restart(ctx context.Context, projectName string, options api.RestartOptions) error {
|
func (s *composeService) Restart(ctx context.Context, projectName string, options api.RestartOptions) error {
|
||||||
@ -62,7 +62,8 @@ func (s *composeService) restart(ctx context.Context, projectName string, option
|
|||||||
eg.Go(func() error {
|
eg.Go(func() error {
|
||||||
eventName := getContainerProgressName(container)
|
eventName := getContainerProgressName(container)
|
||||||
w.Event(progress.RestartingEvent(eventName))
|
w.Event(progress.RestartingEvent(eventName))
|
||||||
err := s.apiClient().ContainerRestart(ctx, container.ID, options.Timeout)
|
timeout := utils.DurationSecondToInt(options.Timeout)
|
||||||
|
err := s.apiClient().ContainerRestart(ctx, container.ID, containerType.StopOptions{Timeout: timeout})
|
||||||
if err == nil {
|
if err == nil {
|
||||||
w.Event(progress.StartedEvent(eventName))
|
w.Event(progress.StartedEvent(eventName))
|
||||||
}
|
}
|
||||||
|
@ -22,8 +22,11 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/docker/compose/v2/pkg/utils"
|
||||||
|
|
||||||
compose "github.com/docker/compose/v2/pkg/api"
|
compose "github.com/docker/compose/v2/pkg/api"
|
||||||
"github.com/docker/compose/v2/pkg/mocks"
|
"github.com/docker/compose/v2/pkg/mocks"
|
||||||
|
containerType "github.com/docker/docker/api/types/container"
|
||||||
|
|
||||||
moby "github.com/docker/docker/api/types"
|
moby "github.com/docker/docker/api/types"
|
||||||
"github.com/docker/docker/api/types/filters"
|
"github.com/docker/docker/api/types/filters"
|
||||||
@ -51,14 +54,15 @@ func TestStopTimeout(t *testing.T) {
|
|||||||
testContainer("service2", "789", false),
|
testContainer("service2", "789", false),
|
||||||
}, nil)
|
}, nil)
|
||||||
api.EXPECT().VolumeList(gomock.Any(), filters.NewArgs(projectFilter(strings.ToLower(testProject)))).
|
api.EXPECT().VolumeList(gomock.Any(), filters.NewArgs(projectFilter(strings.ToLower(testProject)))).
|
||||||
Return(volume.VolumeListOKBody{}, nil)
|
Return(volume.ListResponse{}, nil)
|
||||||
api.EXPECT().NetworkList(gomock.Any(), moby.NetworkListOptions{Filters: filters.NewArgs(projectFilter(strings.ToLower(testProject)))}).
|
api.EXPECT().NetworkList(gomock.Any(), moby.NetworkListOptions{Filters: filters.NewArgs(projectFilter(strings.ToLower(testProject)))}).
|
||||||
Return([]moby.NetworkResource{}, nil)
|
Return([]moby.NetworkResource{}, nil)
|
||||||
|
|
||||||
timeout := time.Duration(2) * time.Second
|
timeout := 2 * time.Second
|
||||||
api.EXPECT().ContainerStop(gomock.Any(), "123", &timeout).Return(nil)
|
stopConfig := containerType.StopOptions{Timeout: utils.DurationSecondToInt(&timeout)}
|
||||||
api.EXPECT().ContainerStop(gomock.Any(), "456", &timeout).Return(nil)
|
api.EXPECT().ContainerStop(gomock.Any(), "123", stopConfig).Return(nil)
|
||||||
api.EXPECT().ContainerStop(gomock.Any(), "789", &timeout).Return(nil)
|
api.EXPECT().ContainerStop(gomock.Any(), "456", stopConfig).Return(nil)
|
||||||
|
api.EXPECT().ContainerStop(gomock.Any(), "789", stopConfig).Return(nil)
|
||||||
|
|
||||||
err := tested.Stop(ctx, strings.ToLower(testProject), compose.StopOptions{
|
err := tested.Stop(ctx, strings.ToLower(testProject), compose.StopOptions{
|
||||||
Timeout: &timeout,
|
Timeout: &timeout,
|
||||||
|
@ -10,7 +10,6 @@ import (
|
|||||||
net "net"
|
net "net"
|
||||||
http "net/http"
|
http "net/http"
|
||||||
reflect "reflect"
|
reflect "reflect"
|
||||||
time "time"
|
|
||||||
|
|
||||||
types "github.com/docker/docker/api/types"
|
types "github.com/docker/docker/api/types"
|
||||||
container "github.com/docker/docker/api/types/container"
|
container "github.com/docker/docker/api/types/container"
|
||||||
@ -253,10 +252,10 @@ func (mr *MockAPIClientMockRecorder) ContainerCommit(arg0, arg1, arg2 interface{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ContainerCreate mocks base method.
|
// ContainerCreate mocks base method.
|
||||||
func (m *MockAPIClient) ContainerCreate(arg0 context.Context, arg1 *container.Config, arg2 *container.HostConfig, arg3 *network.NetworkingConfig, arg4 *v1.Platform, arg5 string) (container.ContainerCreateCreatedBody, error) {
|
func (m *MockAPIClient) ContainerCreate(arg0 context.Context, arg1 *container.Config, arg2 *container.HostConfig, arg3 *network.NetworkingConfig, arg4 *v1.Platform, arg5 string) (container.CreateResponse, error) {
|
||||||
m.ctrl.T.Helper()
|
m.ctrl.T.Helper()
|
||||||
ret := m.ctrl.Call(m, "ContainerCreate", arg0, arg1, arg2, arg3, arg4, arg5)
|
ret := m.ctrl.Call(m, "ContainerCreate", arg0, arg1, arg2, arg3, arg4, arg5)
|
||||||
ret0, _ := ret[0].(container.ContainerCreateCreatedBody)
|
ret0, _ := ret[0].(container.CreateResponse)
|
||||||
ret1, _ := ret[1].(error)
|
ret1, _ := ret[1].(error)
|
||||||
return ret0, ret1
|
return ret0, ret1
|
||||||
}
|
}
|
||||||
@ -502,7 +501,7 @@ func (mr *MockAPIClientMockRecorder) ContainerResize(arg0, arg1, arg2 interface{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ContainerRestart mocks base method.
|
// ContainerRestart mocks base method.
|
||||||
func (m *MockAPIClient) ContainerRestart(arg0 context.Context, arg1 string, arg2 *time.Duration) error {
|
func (m *MockAPIClient) ContainerRestart(arg0 context.Context, arg1 string, arg2 container.StopOptions) error {
|
||||||
m.ctrl.T.Helper()
|
m.ctrl.T.Helper()
|
||||||
ret := m.ctrl.Call(m, "ContainerRestart", arg0, arg1, arg2)
|
ret := m.ctrl.Call(m, "ContainerRestart", arg0, arg1, arg2)
|
||||||
ret0, _ := ret[0].(error)
|
ret0, _ := ret[0].(error)
|
||||||
@ -575,7 +574,7 @@ func (mr *MockAPIClientMockRecorder) ContainerStatsOneShot(arg0, arg1 interface{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ContainerStop mocks base method.
|
// ContainerStop mocks base method.
|
||||||
func (m *MockAPIClient) ContainerStop(arg0 context.Context, arg1 string, arg2 *time.Duration) error {
|
func (m *MockAPIClient) ContainerStop(arg0 context.Context, arg1 string, arg2 container.StopOptions) error {
|
||||||
m.ctrl.T.Helper()
|
m.ctrl.T.Helper()
|
||||||
ret := m.ctrl.Call(m, "ContainerStop", arg0, arg1, arg2)
|
ret := m.ctrl.Call(m, "ContainerStop", arg0, arg1, arg2)
|
||||||
ret0, _ := ret[0].(error)
|
ret0, _ := ret[0].(error)
|
||||||
@ -633,10 +632,10 @@ func (mr *MockAPIClientMockRecorder) ContainerUpdate(arg0, arg1, arg2 interface{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ContainerWait mocks base method.
|
// ContainerWait mocks base method.
|
||||||
func (m *MockAPIClient) ContainerWait(arg0 context.Context, arg1 string, arg2 container.WaitCondition) (<-chan container.ContainerWaitOKBody, <-chan error) {
|
func (m *MockAPIClient) ContainerWait(arg0 context.Context, arg1 string, arg2 container.WaitCondition) (<-chan container.WaitResponse, <-chan error) {
|
||||||
m.ctrl.T.Helper()
|
m.ctrl.T.Helper()
|
||||||
ret := m.ctrl.Call(m, "ContainerWait", arg0, arg1, arg2)
|
ret := m.ctrl.Call(m, "ContainerWait", arg0, arg1, arg2)
|
||||||
ret0, _ := ret[0].(<-chan container.ContainerWaitOKBody)
|
ret0, _ := ret[0].(<-chan container.WaitResponse)
|
||||||
ret1, _ := ret[1].(<-chan error)
|
ret1, _ := ret[1].(<-chan error)
|
||||||
return ret0, ret1
|
return ret0, ret1
|
||||||
}
|
}
|
||||||
@ -1723,10 +1722,10 @@ func (mr *MockAPIClientMockRecorder) TaskLogs(arg0, arg1, arg2 interface{}) *gom
|
|||||||
}
|
}
|
||||||
|
|
||||||
// VolumeCreate mocks base method.
|
// VolumeCreate mocks base method.
|
||||||
func (m *MockAPIClient) VolumeCreate(arg0 context.Context, arg1 volume.VolumeCreateBody) (types.Volume, error) {
|
func (m *MockAPIClient) VolumeCreate(arg0 context.Context, arg1 volume.CreateOptions) (volume.Volume, error) {
|
||||||
m.ctrl.T.Helper()
|
m.ctrl.T.Helper()
|
||||||
ret := m.ctrl.Call(m, "VolumeCreate", arg0, arg1)
|
ret := m.ctrl.Call(m, "VolumeCreate", arg0, arg1)
|
||||||
ret0, _ := ret[0].(types.Volume)
|
ret0, _ := ret[0].(volume.Volume)
|
||||||
ret1, _ := ret[1].(error)
|
ret1, _ := ret[1].(error)
|
||||||
return ret0, ret1
|
return ret0, ret1
|
||||||
}
|
}
|
||||||
@ -1738,10 +1737,10 @@ func (mr *MockAPIClientMockRecorder) VolumeCreate(arg0, arg1 interface{}) *gomoc
|
|||||||
}
|
}
|
||||||
|
|
||||||
// VolumeInspect mocks base method.
|
// VolumeInspect mocks base method.
|
||||||
func (m *MockAPIClient) VolumeInspect(arg0 context.Context, arg1 string) (types.Volume, error) {
|
func (m *MockAPIClient) VolumeInspect(arg0 context.Context, arg1 string) (volume.Volume, error) {
|
||||||
m.ctrl.T.Helper()
|
m.ctrl.T.Helper()
|
||||||
ret := m.ctrl.Call(m, "VolumeInspect", arg0, arg1)
|
ret := m.ctrl.Call(m, "VolumeInspect", arg0, arg1)
|
||||||
ret0, _ := ret[0].(types.Volume)
|
ret0, _ := ret[0].(volume.Volume)
|
||||||
ret1, _ := ret[1].(error)
|
ret1, _ := ret[1].(error)
|
||||||
return ret0, ret1
|
return ret0, ret1
|
||||||
}
|
}
|
||||||
@ -1753,10 +1752,10 @@ func (mr *MockAPIClientMockRecorder) VolumeInspect(arg0, arg1 interface{}) *gomo
|
|||||||
}
|
}
|
||||||
|
|
||||||
// VolumeInspectWithRaw mocks base method.
|
// VolumeInspectWithRaw mocks base method.
|
||||||
func (m *MockAPIClient) VolumeInspectWithRaw(arg0 context.Context, arg1 string) (types.Volume, []byte, error) {
|
func (m *MockAPIClient) VolumeInspectWithRaw(arg0 context.Context, arg1 string) (volume.Volume, []byte, error) {
|
||||||
m.ctrl.T.Helper()
|
m.ctrl.T.Helper()
|
||||||
ret := m.ctrl.Call(m, "VolumeInspectWithRaw", arg0, arg1)
|
ret := m.ctrl.Call(m, "VolumeInspectWithRaw", arg0, arg1)
|
||||||
ret0, _ := ret[0].(types.Volume)
|
ret0, _ := ret[0].(volume.Volume)
|
||||||
ret1, _ := ret[1].([]byte)
|
ret1, _ := ret[1].([]byte)
|
||||||
ret2, _ := ret[2].(error)
|
ret2, _ := ret[2].(error)
|
||||||
return ret0, ret1, ret2
|
return ret0, ret1, ret2
|
||||||
@ -1769,10 +1768,10 @@ func (mr *MockAPIClientMockRecorder) VolumeInspectWithRaw(arg0, arg1 interface{}
|
|||||||
}
|
}
|
||||||
|
|
||||||
// VolumeList mocks base method.
|
// VolumeList mocks base method.
|
||||||
func (m *MockAPIClient) VolumeList(arg0 context.Context, arg1 filters.Args) (volume.VolumeListOKBody, error) {
|
func (m *MockAPIClient) VolumeList(arg0 context.Context, arg1 filters.Args) (volume.ListResponse, error) {
|
||||||
m.ctrl.T.Helper()
|
m.ctrl.T.Helper()
|
||||||
ret := m.ctrl.Call(m, "VolumeList", arg0, arg1)
|
ret := m.ctrl.Call(m, "VolumeList", arg0, arg1)
|
||||||
ret0, _ := ret[0].(volume.VolumeListOKBody)
|
ret0, _ := ret[0].(volume.ListResponse)
|
||||||
ret1, _ := ret[1].(error)
|
ret1, _ := ret[1].(error)
|
||||||
return ret0, ret1
|
return ret0, ret1
|
||||||
}
|
}
|
||||||
@ -1797,6 +1796,20 @@ func (mr *MockAPIClientMockRecorder) VolumeRemove(arg0, arg1, arg2 interface{})
|
|||||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VolumeRemove", reflect.TypeOf((*MockAPIClient)(nil).VolumeRemove), arg0, arg1, arg2)
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VolumeRemove", reflect.TypeOf((*MockAPIClient)(nil).VolumeRemove), arg0, arg1, arg2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// VolumeUpdate mocks base method.
|
||||||
|
func (m *MockAPIClient) VolumeUpdate(arg0 context.Context, arg1 string, arg2 swarm.Version, arg3 volume.UpdateOptions) error {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "VolumeUpdate", arg0, arg1, arg2, arg3)
|
||||||
|
ret0, _ := ret[0].(error)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// VolumeUpdate indicates an expected call of VolumeUpdate.
|
||||||
|
func (mr *MockAPIClientMockRecorder) VolumeUpdate(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VolumeUpdate", reflect.TypeOf((*MockAPIClient)(nil).VolumeUpdate), arg0, arg1, arg2, arg3)
|
||||||
|
}
|
||||||
|
|
||||||
// VolumesPrune mocks base method.
|
// VolumesPrune mocks base method.
|
||||||
func (m *MockAPIClient) VolumesPrune(arg0 context.Context, arg1 filters.Args) (types.VolumesPruneReport, error) {
|
func (m *MockAPIClient) VolumesPrune(arg0 context.Context, arg1 filters.Args) (types.VolumesPruneReport, error) {
|
||||||
m.ctrl.T.Helper()
|
m.ctrl.T.Helper()
|
||||||
|
@ -91,20 +91,6 @@ func (mr *MockCliMockRecorder) Client() *gomock.Call {
|
|||||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Client", reflect.TypeOf((*MockCli)(nil).Client))
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Client", reflect.TypeOf((*MockCli)(nil).Client))
|
||||||
}
|
}
|
||||||
|
|
||||||
// ClientInfo mocks base method.
|
|
||||||
func (m *MockCli) ClientInfo() command.ClientInfo {
|
|
||||||
m.ctrl.T.Helper()
|
|
||||||
ret := m.ctrl.Call(m, "ClientInfo")
|
|
||||||
ret0, _ := ret[0].(command.ClientInfo)
|
|
||||||
return ret0
|
|
||||||
}
|
|
||||||
|
|
||||||
// ClientInfo indicates an expected call of ClientInfo.
|
|
||||||
func (mr *MockCliMockRecorder) ClientInfo() *gomock.Call {
|
|
||||||
mr.mock.ctrl.T.Helper()
|
|
||||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientInfo", reflect.TypeOf((*MockCli)(nil).ClientInfo))
|
|
||||||
}
|
|
||||||
|
|
||||||
// ConfigFile mocks base method.
|
// ConfigFile mocks base method.
|
||||||
func (m *MockCli) ConfigFile() *configfile.ConfigFile {
|
func (m *MockCli) ConfigFile() *configfile.ConfigFile {
|
||||||
m.ctrl.T.Helper()
|
m.ctrl.T.Helper()
|
||||||
|
@ -405,15 +405,15 @@ func (m *MockLogConsumer) EXPECT() *MockLogConsumerMockRecorder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Log mocks base method.
|
// Log mocks base method.
|
||||||
func (m *MockLogConsumer) Log(service, container, message string) {
|
func (m *MockLogConsumer) Log(containerName, service, message string) {
|
||||||
m.ctrl.T.Helper()
|
m.ctrl.T.Helper()
|
||||||
m.ctrl.Call(m, "Log", service, container, message)
|
m.ctrl.Call(m, "Log", containerName, service, message)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Log indicates an expected call of Log.
|
// Log indicates an expected call of Log.
|
||||||
func (mr *MockLogConsumerMockRecorder) Log(service, container, message interface{}) *gomock.Call {
|
func (mr *MockLogConsumerMockRecorder) Log(containerName, service, message interface{}) *gomock.Call {
|
||||||
mr.mock.ctrl.T.Helper()
|
mr.mock.ctrl.T.Helper()
|
||||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Log", reflect.TypeOf((*MockLogConsumer)(nil).Log), service, container, message)
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Log", reflect.TypeOf((*MockLogConsumer)(nil).Log), containerName, service, message)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Register mocks base method.
|
// Register mocks base method.
|
||||||
|
27
pkg/utils/durationutils.go
Normal file
27
pkg/utils/durationutils.go
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2020 Docker Compose CLI authors
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package utils
|
||||||
|
|
||||||
|
import "time"
|
||||||
|
|
||||||
|
func DurationSecondToInt(d *time.Duration) *int {
|
||||||
|
if d == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
timeout := int(d.Seconds())
|
||||||
|
return &timeout
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user