chore(deps): Bump github.com/testcontainers/testcontainers-go from 0.35.0 to 0.36.0 (#16709)

This commit is contained in:
dependabot[bot] 2025-04-09 15:35:59 +02:00 committed by GitHub
parent 297376f982
commit ffb4a8cedb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 698 additions and 714 deletions

View File

@ -357,7 +357,6 @@ following works:
- github.com/seancfoley/ipaddress-go [Apache License 2.0](https://github.com/seancfoley/ipaddress-go/blob/master/LICENSE)
- github.com/segmentio/asm [MIT License](https://github.com/segmentio/asm/blob/main/LICENSE)
- github.com/shirou/gopsutil [BSD 3-Clause Clear License](https://github.com/shirou/gopsutil/blob/master/LICENSE)
- github.com/shoenig/go-m1cpu [Mozilla Public License 2.0](https://github.com/shoenig/go-m1cpu/blob/main/LICENSE)
- github.com/shopspring/decimal [MIT License](https://github.com/shopspring/decimal/blob/master/LICENSE)
- github.com/showwin/speedtest-go [MIT License](https://github.com/showwin/speedtest-go/blob/master/LICENSE)
- github.com/signalfx/com_signalfx_metrics_protobuf [Apache License 2.0](https://github.com/signalfx/com_signalfx_metrics_protobuf/blob/master/LICENSE)

18
go.mod
View File

@ -76,7 +76,7 @@ require (
github.com/digitalocean/go-libvirt v0.0.0-20241216201552-9fbdb61a21af
github.com/dimchansky/utfbom v1.1.1
github.com/djherbis/times v1.6.0
github.com/docker/docker v27.4.1+incompatible
github.com/docker/docker v28.0.1+incompatible
github.com/docker/go-connections v0.5.0
github.com/dustin/go-humanize v1.0.1
github.com/dynatrace-oss/dynatrace-metric-utils-go v0.5.0
@ -183,7 +183,7 @@ require (
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1
github.com/seancfoley/ipaddress-go v1.7.0
github.com/sensu/sensu-go/api/core/v2 v2.16.0
github.com/shirou/gopsutil/v4 v4.24.12
github.com/shirou/gopsutil/v4 v4.25.1
github.com/showwin/speedtest-go v1.7.10
github.com/signalfx/golib/v3 v3.3.54
github.com/sijms/go-ora/v2 v2.8.22
@ -195,7 +195,7 @@ require (
github.com/stretchr/testify v1.10.0
github.com/tbrandon/mbserver v0.0.0-20170611213546-993e1772cc62
github.com/tdrn-org/go-hue v0.3.0
github.com/testcontainers/testcontainers-go v0.35.0
github.com/testcontainers/testcontainers-go v0.36.0
github.com/testcontainers/testcontainers-go/modules/azurite v0.35.0
github.com/testcontainers/testcontainers-go/modules/kafka v0.34.0
github.com/thomasklein94/packer-plugin-libvirt v0.5.0
@ -330,7 +330,7 @@ require (
github.com/eapache/go-resiliency v1.7.0 // indirect
github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect
github.com/eapache/queue v1.1.0 // indirect
github.com/ebitengine/purego v0.8.1 // indirect
github.com/ebitengine/purego v0.8.2 // indirect
github.com/echlebek/timeproxy v1.0.0 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/envoyproxy/go-control-plane/envoy v1.32.4 // indirect
@ -449,7 +449,7 @@ require (
github.com/oapi-codegen/runtime v1.1.1 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.101.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/opencontainers/image-spec v1.1.1 // indirect
github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492 // indirect
github.com/paulmach/orb v0.11.1 // indirect
github.com/philhofer/fwd v1.1.3-0.20240612014219-fbbf4953d986 // indirect
@ -473,8 +473,6 @@ require (
github.com/samber/lo v1.47.0 // indirect
github.com/seancfoley/bintree v1.3.1 // indirect
github.com/segmentio/asm v1.2.0 // indirect
github.com/shirou/gopsutil/v3 v3.24.5 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/shopspring/decimal v1.4.0 // indirect
github.com/signalfx/com_signalfx_metrics_protobuf v0.0.3 // indirect
github.com/signalfx/gohistogram v0.0.0-20160107210732-1ccfd2ff5083 // indirect
@ -515,10 +513,10 @@ require (
go.opentelemetry.io/contrib/detectors/gcp v1.34.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 // indirect
go.opentelemetry.io/otel v1.34.0 // indirect
go.opentelemetry.io/otel/metric v1.34.0 // indirect
go.opentelemetry.io/otel v1.35.0 // indirect
go.opentelemetry.io/otel/metric v1.35.0 // indirect
go.opentelemetry.io/otel/sdk v1.34.0 // indirect
go.opentelemetry.io/otel/trace v1.34.0 // indirect
go.opentelemetry.io/otel/trace v1.35.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect

38
go.sum
View File

@ -1106,8 +1106,8 @@ github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI=
github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ=
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v24.0.6+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v27.4.1+incompatible h1:ZJvcY7gfwHn1JF48PfbyXg7Jyt9ZCWDW+GGXOIxEwp4=
github.com/docker/docker v27.4.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v28.0.1+incompatible h1:FCHjSRdXhNRFjlHMTv4jUNlIBbTeRjrWfeFuJp7jpo0=
github.com/docker/docker v28.0.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c=
github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc=
@ -1134,8 +1134,8 @@ github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 h1:Oy0F4A
github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3/go.mod h1:YvSRo5mw33fLEx1+DlK6L2VV43tJt5Eyel9n9XBcR+0=
github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc=
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE=
github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ=
github.com/ebitengine/purego v0.8.2 h1:jPPGWs2sZ1UgOSgD2bClL0MJIqu58nOmIcBuXr62z1I=
github.com/ebitengine/purego v0.8.2/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ=
github.com/echlebek/crock v1.0.1 h1:KbzamClMIfVIkkjq/GTXf+N16KylYBpiaTitO3f1ujg=
github.com/echlebek/crock v1.0.1/go.mod h1:/kvwHRX3ZXHj/kHWJkjXDmzzRow54EJuHtQ/PapL/HI=
github.com/echlebek/timeproxy v1.0.0 h1:V41/v8tmmMDNMA2GrBPI45nlXb3F7+OY+nJz1BqKsCk=
@ -2023,8 +2023,8 @@ github.com/openconfig/ygot v0.20.0/go.mod h1:7ZiBFNc4n/1Hkv2v2dAEpxisqDznp0JVpLR
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/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/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040=
github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M=
github.com/opensearch-project/opensearch-go/v2 v2.3.0 h1:nQIEMr+A92CkhHrZgUhcfsrZjibvB3APXf2a1VwCmMQ=
github.com/opensearch-project/opensearch-go/v2 v2.3.0/go.mod h1:8LDr9FCgUTVoT+5ESjc2+iaZuldqE+23Iq0r1XeNue8=
github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492 h1:lM6RxxfUMrYL/f8bWEUqdXrANWtrL7Nndbm9iFN0DlU=
@ -2201,14 +2201,8 @@ github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys=
github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs=
github.com/sensu/sensu-go/api/core/v2 v2.16.0 h1:HOq4rFkQ1S5ZjxmMTLc5J5mAbECrnKWvtXXbMqr3j9s=
github.com/sensu/sensu-go/api/core/v2 v2.16.0/go.mod h1:MjM7+MCGEyTAgaZ589SiGHwYiaYF7N/58dU0J070u/0=
github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI=
github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk=
github.com/shirou/gopsutil/v4 v4.24.12 h1:qvePBOk20e0IKA1QXrIIU+jmk+zEiYVVx06WjBRlZo4=
github.com/shirou/gopsutil/v4 v4.24.12/go.mod h1:DCtMPAad2XceTeIAbGyVfycbYQNBGk2P8cvDi7/VN9o=
github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM=
github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ=
github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU=
github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k=
github.com/shirou/gopsutil/v4 v4.25.1 h1:QSWkTc+fu9LTAWfkZwZ6j8MSUk4A2LV7rbH0ZqmLjXs=
github.com/shirou/gopsutil/v4 v4.25.1/go.mod h1:RoUCUpndaJFtT+2zsZzzmhvbfGoDCJ7nFXKJf8GqJbI=
github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
@ -2314,8 +2308,8 @@ github.com/tdrn-org/go-nsdp v0.5.0/go.mod h1:zp7CxiCPcyXHo+s6tn+wrNBr1qQe1G/hOh/
github.com/tdrn-org/go-tr064 v0.2.2 h1:rDybEK1m2xfV5QPWHtnIJOt+xG4GFSkQSwA6FS2bQC4=
github.com/tdrn-org/go-tr064 v0.2.2/go.mod h1:P2WWUiBcXDGOo+sqJ4hWn4YXYH9kWaYjZo74EdFDSS0=
github.com/tedsuo/ifrit v0.0.0-20180802180643-bea94bb476cc/go.mod h1:eyZnKCc955uh98WQvzOm0dgAeLnf2O0Rz0LPoC5ze+0=
github.com/testcontainers/testcontainers-go v0.35.0 h1:uADsZpTKFAtp8SLK+hMwSaa+X+JiERHtd4sQAFmXeMo=
github.com/testcontainers/testcontainers-go v0.35.0/go.mod h1:oEVBj5zrfJTrgjwONs1SsRbnBtH9OKl+IGl3UMcr2B4=
github.com/testcontainers/testcontainers-go v0.36.0 h1:YpffyLuHtdp5EUsI5mT4sRw8GZhO/5ozyDT1xWGXt00=
github.com/testcontainers/testcontainers-go v0.36.0/go.mod h1:yk73GVJ0KUZIHUtFna6MO7QS144qYpoY8lEEtU9Hed0=
github.com/testcontainers/testcontainers-go/modules/azurite v0.35.0 h1:gUZ25e1DVE/0+ZZ0nupsIo+C1j7UNloN7Pkg3w6tceI=
github.com/testcontainers/testcontainers-go/modules/azurite v0.35.0/go.mod h1:2Fc67EpyOEexLAF99zhSuzu9H22zd83pkjxEHHTtHf4=
github.com/testcontainers/testcontainers-go/modules/kafka v0.34.0 h1:LrMlsBH+nKJ2c6M7rOjbi7UivgofgAQo+LAwsWttR+Q=
@ -2469,8 +2463,8 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.5
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0/go.mod h1:ijPqXp5P6IRRByFVVg9DY8P5HkxkHE5ARIa+86aXPf4=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 h1:CV7UdSGJt/Ao6Gp4CXckLxVRRsRgDHoI8XjbL3PDl8s=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0/go.mod h1:FRmFuRJfag1IZ2dPkHnEoSFVgTVPUd2qf5Vi69hLb8I=
go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY=
go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI=
go.opentelemetry.io/otel v1.35.0 h1:xKWKPxrxB6OtMCbmMY021CqC45J+3Onta9MqjhnusiQ=
go.opentelemetry.io/otel v1.35.0/go.mod h1:UEqy8Zp11hpkUrL73gSlELM0DupHoiq72dR+Zqel/+Y=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.44.0 h1:jd0+5t/YynESZqsSyPz+7PAFdEop0dlN0+PkyHYo8oI=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.44.0/go.mod h1:U707O40ee1FpQGyhvqnzmCJm1Wh6OX6GGBVn0E6Uyyk=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 h1:3Q/xZUyC1BBkualc9ROb4G8qkH90LXEIICcs5zv1OYY=
@ -2479,14 +2473,14 @@ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0 h1:j9+03
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0/go.mod h1:Y5+XiUG4Emn1hTfciPzGPJaSI+RpDts6BnCIir0SLqk=
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0 h1:WDdP9acbMYjbKIyJUhTvtzj601sVJOqgWdUxSdR/Ysc=
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0/go.mod h1:BLbf7zbNIONBLPwvFnwNHGj4zge8uTCM/UPIVW1Mq2I=
go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ=
go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE=
go.opentelemetry.io/otel/metric v1.35.0 h1:0znxYu2SNyuMSQT4Y9WDWej0VpcsxkuklLa4/siN90M=
go.opentelemetry.io/otel/metric v1.35.0/go.mod h1:nKVFgxBZ2fReX6IlyW28MgZojkoAkJGaE8CpgeAU3oE=
go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A=
go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU=
go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk=
go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w=
go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k=
go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE=
go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt/xgMs=
go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc=
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U=
go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U=

View File

@ -18,9 +18,9 @@ var (
type dockerClient interface {
Info(ctx context.Context) (system.Info, error)
ContainerList(ctx context.Context, options container.ListOptions) ([]types.Container, error)
ContainerList(ctx context.Context, options container.ListOptions) ([]container.Summary, error)
ContainerStats(ctx context.Context, containerID string, stream bool) (container.StatsResponseReader, error)
ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error)
ContainerInspect(ctx context.Context, containerID string) (container.InspectResponse, error)
ServiceList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error)
TaskList(ctx context.Context, options types.TaskListOptions) ([]swarm.Task, error)
NodeList(ctx context.Context, options types.NodeListOptions) ([]swarm.Node, error)
@ -62,13 +62,13 @@ type socketClient struct {
func (c *socketClient) Info(ctx context.Context) (system.Info, error) {
return c.client.Info(ctx)
}
func (c *socketClient) ContainerList(ctx context.Context, options container.ListOptions) ([]types.Container, error) {
func (c *socketClient) ContainerList(ctx context.Context, options container.ListOptions) ([]container.Summary, error) {
return c.client.ContainerList(ctx, options)
}
func (c *socketClient) ContainerStats(ctx context.Context, containerID string, stream bool) (container.StatsResponseReader, error) {
return c.client.ContainerStats(ctx, containerID, stream)
}
func (c *socketClient) ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error) {
func (c *socketClient) ContainerInspect(ctx context.Context, containerID string) (container.InspectResponse, error) {
return c.client.ContainerInspect(ctx, containerID)
}
func (c *socketClient) ServiceList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error) {

View File

@ -236,7 +236,7 @@ func (d *Docker) Gather(acc telegraf.Accumulator) error {
var wg sync.WaitGroup
wg.Add(len(containers))
for _, cntnr := range containers {
go func(c types.Container) {
go func(c container.Summary) {
defer wg.Done()
if err := d.gatherContainer(c, acc); err != nil {
acc.AddError(err)
@ -479,7 +479,7 @@ func parseContainerName(containerNames []string) string {
}
func (d *Docker) gatherContainer(
cntnr types.Container,
cntnr container.Summary,
acc telegraf.Accumulator,
) error {
var v *container.StatsResponse
@ -540,7 +540,7 @@ func (d *Docker) gatherContainer(
}
func (d *Docker) gatherContainerInspect(
cntnr types.Container,
cntnr container.Summary,
acc telegraf.Accumulator,
tags map[string]string,
daemonOSType string,

View File

@ -23,9 +23,9 @@ import (
type mockClient struct {
InfoF func() (system.Info, error)
ContainerListF func(options container.ListOptions) ([]types.Container, error)
ContainerListF func(options container.ListOptions) ([]container.Summary, error)
ContainerStatsF func(containerID string) (container.StatsResponseReader, error)
ContainerInspectF func() (types.ContainerJSON, error)
ContainerInspectF func() (container.InspectResponse, error)
ServiceListF func() ([]swarm.Service, error)
TaskListF func() ([]swarm.Task, error)
NodeListF func() ([]swarm.Node, error)
@ -38,7 +38,7 @@ func (c *mockClient) Info(context.Context) (system.Info, error) {
return c.InfoF()
}
func (c *mockClient) ContainerList(_ context.Context, options container.ListOptions) ([]types.Container, error) {
func (c *mockClient) ContainerList(_ context.Context, options container.ListOptions) ([]container.Summary, error) {
return c.ContainerListF(options)
}
@ -46,7 +46,7 @@ func (c *mockClient) ContainerStats(_ context.Context, containerID string, _ boo
return c.ContainerStatsF(containerID)
}
func (c *mockClient) ContainerInspect(context.Context, string) (types.ContainerJSON, error) {
func (c *mockClient) ContainerInspect(context.Context, string) (container.InspectResponse, error) {
return c.ContainerInspectF()
}
@ -78,13 +78,13 @@ var baseClient = mockClient{
InfoF: func() (system.Info, error) {
return info, nil
},
ContainerListF: func(container.ListOptions) ([]types.Container, error) {
ContainerListF: func(container.ListOptions) ([]container.Summary, error) {
return containerList, nil
},
ContainerStatsF: func(s string) (container.StatsResponseReader, error) {
return containerStats(s), nil
},
ContainerInspectF: func() (types.ContainerJSON, error) {
ContainerInspectF: func() (container.InspectResponse, error) {
return containerInspect(), nil
},
ServiceListF: func() ([]swarm.Service, error) {
@ -426,13 +426,13 @@ func TestDocker_WindowsMemoryContainerStats(t *testing.T) {
InfoF: func() (system.Info, error) {
return info, nil
},
ContainerListF: func(container.ListOptions) ([]types.Container, error) {
ContainerListF: func(container.ListOptions) ([]container.Summary, error) {
return containerList, nil
},
ContainerStatsF: func(string) (container.StatsResponseReader, error) {
return containerStatsWindows(), nil
},
ContainerInspectF: func() (types.ContainerJSON, error) {
ContainerInspectF: func() (container.InspectResponse, error) {
return containerInspect(), nil
},
ServiceListF: func() ([]swarm.Service, error) {
@ -463,7 +463,7 @@ func TestDocker_WindowsMemoryContainerStats(t *testing.T) {
func TestContainerLabels(t *testing.T) {
var tests = []struct {
name string
container types.Container
container container.Summary
include []string
exclude []string
expected map[string]string
@ -555,8 +555,8 @@ func TestContainerLabels(t *testing.T) {
newClientFunc := func(string, *tls.Config) (dockerClient, error) {
client := baseClient
client.ContainerListF = func(container.ListOptions) ([]types.Container, error) {
return []types.Container{tt.container}, nil
client.ContainerListF = func(container.ListOptions) ([]container.Summary, error) {
return []container.Summary{tt.container}, nil
}
return &client, nil
}
@ -588,7 +588,7 @@ func TestContainerLabels(t *testing.T) {
}
}
func genContainerLabeled(labels map[string]string) types.Container {
func genContainerLabeled(labels map[string]string) container.Summary {
c := containerList[0]
c.Labels = labels
return c
@ -666,7 +666,7 @@ func TestContainerNames(t *testing.T) {
newClientFunc := func(string, *tls.Config) (dockerClient, error) {
client := baseClient
client.ContainerListF = func(container.ListOptions) ([]types.Container, error) {
client.ContainerListF = func(container.ListOptions) ([]container.Summary, error) {
return containerList, nil
}
client.ContainerStatsF = func(s string) (container.StatsResponseReader, error) {
@ -719,7 +719,7 @@ func TestContainerStatus(t *testing.T) {
var tests = []struct {
name string
now func() time.Time
inspect types.ContainerJSON
inspect container.InspectResponse
expected []telegraf.Metric
}{
{
@ -760,7 +760,7 @@ func TestContainerStatus(t *testing.T) {
now: func() time.Time {
return time.Date(2018, 6, 14, 5, 51, 53, 266176036, time.UTC)
},
inspect: func() types.ContainerJSON {
inspect: func() container.InspectResponse {
i := containerInspect()
i.ContainerJSONBase.State.FinishedAt = "2018-06-14T05:53:53.266176036Z"
return i
@ -798,7 +798,7 @@ func TestContainerStatus(t *testing.T) {
now: func() time.Time {
return time.Date(2018, 6, 14, 5, 51, 53, 266176036, time.UTC)
},
inspect: func() types.ContainerJSON {
inspect: func() container.InspectResponse {
i := containerInspect()
i.ContainerJSONBase.State.StartedAt = ""
i.ContainerJSONBase.State.FinishedAt = "2018-06-14T05:53:53.266176036Z"
@ -835,7 +835,7 @@ func TestContainerStatus(t *testing.T) {
now: func() time.Time {
return time.Date(2019, 1, 1, 0, 0, 3, 0, time.UTC)
},
inspect: func() types.ContainerJSON {
inspect: func() container.InspectResponse {
i := containerInspect()
i.ContainerJSONBase.State.StartedAt = "2019-01-01T00:00:02Z"
i.ContainerJSONBase.State.FinishedAt = "2019-01-01T00:00:01Z"
@ -876,10 +876,10 @@ func TestContainerStatus(t *testing.T) {
acc testutil.Accumulator
newClientFunc = func(string, *tls.Config) (dockerClient, error) {
client := baseClient
client.ContainerListF = func(container.ListOptions) ([]types.Container, error) {
client.ContainerListF = func(container.ListOptions) ([]container.Summary, error) {
return containerList[:1], nil
}
client.ContainerInspectF = func() (types.ContainerJSON, error) {
client.ContainerInspectF = func() (container.InspectResponse, error) {
return tt.inspect, nil
}
@ -1187,7 +1187,7 @@ func TestContainerStateFilter(t *testing.T) {
newClientFunc := func(string, *tls.Config) (dockerClient, error) {
client := baseClient
client.ContainerListF = func(options container.ListOptions) ([]types.Container, error) {
client.ContainerListF = func(options container.ListOptions) ([]container.Summary, error) {
for k, v := range tt.expected {
actual := options.Filters.Get(k)
sort.Strings(actual)
@ -1223,9 +1223,9 @@ func TestContainerName(t *testing.T) {
name: "container stats name is preferred",
clientFunc: func(string, *tls.Config) (dockerClient, error) {
client := baseClient
client.ContainerListF = func(container.ListOptions) ([]types.Container, error) {
var containers []types.Container
containers = append(containers, types.Container{
client.ContainerListF = func(container.ListOptions) ([]container.Summary, error) {
var containers []container.Summary
containers = append(containers, container.Summary{
Names: []string{"/logspout/foo"},
})
return containers, nil
@ -1243,9 +1243,9 @@ func TestContainerName(t *testing.T) {
name: "container stats without name uses container list name",
clientFunc: func(string, *tls.Config) (dockerClient, error) {
client := baseClient
client.ContainerListF = func(container.ListOptions) ([]types.Container, error) {
var containers []types.Container
containers = append(containers, types.Container{
client.ContainerListF = func(container.ListOptions) ([]container.Summary, error) {
var containers []container.Summary
containers = append(containers, container.Summary{
Names: []string{"/logspout"},
})
return containers, nil

View File

@ -81,7 +81,7 @@ var info = system.Info{
ServerVersion: "17.09.0-ce",
}
var containerList = []types.Container{
var containerList = []container.Summary{
{
ID: "e2173b9478a6ae55e237d4d74f8bbb753f0817192b5081334dc78476296b7dfb",
Names: []string{"/etcd"},
@ -89,7 +89,7 @@ var containerList = []types.Container{
Command: "/etcd -name etcd0 -advertise-client-urls http://localhost:2379 -listen-client-urls http://0.0.0.0:2379",
Created: 1455941930,
Status: "Up 4 hours",
Ports: []types.Port{
Ports: []container.Port{
{
PrivatePort: 7001,
PublicPort: 0,
@ -126,7 +126,7 @@ var containerList = []types.Container{
Command: "/etcd -name etcd2 -advertise-client-urls http://localhost:2379 -listen-client-urls http://0.0.0.0:2379",
Created: 1455941933,
Status: "Up 4 hours",
Ports: []types.Port{
Ports: []container.Port{
{
PrivatePort: 7002,
PublicPort: 0,
@ -539,8 +539,8 @@ func containerStatsWindows() container.StatsResponseReader {
return stat
}
func containerInspect() types.ContainerJSON {
return types.ContainerJSON{
func containerInspect() container.InspectResponse {
return container.InspectResponse{
Config: &container.Config{
Env: []string{
"ENVVAR1=loremipsum",
@ -554,9 +554,9 @@ func containerInspect() types.ContainerJSON {
"PATH=/bin:/sbin",
},
},
ContainerJSONBase: &types.ContainerJSONBase{
State: &types.ContainerState{
Health: &types.Health{
ContainerJSONBase: &container.ContainerJSONBase{
State: &container.State{
Health: &container.Health{
FailingStreak: 1,
Status: "Unhealthy",
},
@ -573,7 +573,7 @@ func containerInspect() types.ContainerJSON {
var diskUsage = types.DiskUsage{
LayersSize: 1e10,
Containers: []*types.Container{
Containers: []*container.Summary{
{Names: []string{"/some_container"}, Image: "some_image:1.0.0-alpine", SizeRw: 0, SizeRootFs: 123456789},
},
Images: []*image.Summary{

View File

@ -6,7 +6,6 @@ import (
"io"
"net/http"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
docker "github.com/docker/docker/client"
)
@ -18,9 +17,9 @@ var (
)
type dockerClient interface {
ContainerList(ctx context.Context, options container.ListOptions) ([]types.Container, error)
ContainerList(ctx context.Context, options container.ListOptions) ([]container.Summary, error)
ContainerLogs(ctx context.Context, containerID string, options container.LogsOptions) (io.ReadCloser, error)
ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error)
ContainerInspect(ctx context.Context, containerID string) (container.InspectResponse, error)
}
func newEnvClient() (dockerClient, error) {
@ -52,13 +51,13 @@ type socketClient struct {
client *docker.Client
}
func (c *socketClient) ContainerList(ctx context.Context, options container.ListOptions) ([]types.Container, error) {
func (c *socketClient) ContainerList(ctx context.Context, options container.ListOptions) ([]container.Summary, error) {
return c.client.ContainerList(ctx, options)
}
func (c *socketClient) ContainerLogs(ctx context.Context, containerID string, options container.LogsOptions) (io.ReadCloser, error) {
return c.client.ContainerLogs(ctx, containerID, options)
}
func (c *socketClient) ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error) {
func (c *socketClient) ContainerInspect(ctx context.Context, containerID string) (container.InspectResponse, error) {
return c.client.ContainerInspect(ctx, containerID)
}

View File

@ -15,7 +15,6 @@ import (
"time"
"unicode"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/pkg/stdcopy"
@ -183,7 +182,7 @@ func (d *DockerLogs) Gather(acc telegraf.Accumulator) error {
// Start a new goroutine for every new container that has logs to collect
d.wg.Add(1)
go func(container types.Container) {
go func(container container.Summary) {
defer d.wg.Done()
defer d.removeFromContainerList(container.ID)
@ -243,7 +242,7 @@ func (d *DockerLogs) matchedContainerName(names []string) string {
return ""
}
func (d *DockerLogs) hasTTY(ctx context.Context, cntnr types.Container) (bool, error) {
func (d *DockerLogs) hasTTY(ctx context.Context, cntnr container.Summary) (bool, error) {
ctx, cancel := context.WithTimeout(ctx, time.Duration(d.Timeout))
defer cancel()
c, err := d.client.ContainerInspect(ctx, cntnr.ID)
@ -256,7 +255,7 @@ func (d *DockerLogs) hasTTY(ctx context.Context, cntnr types.Container) (bool, e
func (d *DockerLogs) tailContainerLogs(
ctx context.Context,
acc telegraf.Accumulator,
cntnr types.Container,
cntnr container.Summary,
containerName string,
) error {
imageName, imageVersion := docker.ParseImage(cntnr.Image)

View File

@ -8,7 +8,6 @@ import (
"testing"
"time"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/pkg/stdcopy"
"github.com/stretchr/testify/require"
@ -19,16 +18,16 @@ import (
)
type mockClient struct {
ContainerListF func() ([]types.Container, error)
ContainerInspectF func() (types.ContainerJSON, error)
ContainerListF func() ([]container.Summary, error)
ContainerInspectF func() (container.InspectResponse, error)
ContainerLogsF func() (io.ReadCloser, error)
}
func (c *mockClient) ContainerList(context.Context, container.ListOptions) ([]types.Container, error) {
func (c *mockClient) ContainerList(context.Context, container.ListOptions) ([]container.Summary, error) {
return c.ContainerListF()
}
func (c *mockClient) ContainerInspect(context.Context, string) (types.ContainerJSON, error) {
func (c *mockClient) ContainerInspect(context.Context, string) (container.InspectResponse, error) {
return c.ContainerInspectF()
}
@ -61,7 +60,7 @@ func Test(t *testing.T) {
{
name: "no containers",
client: &mockClient{
ContainerListF: func() ([]types.Container, error) {
ContainerListF: func() ([]container.Summary, error) {
return nil, nil
},
},
@ -69,8 +68,8 @@ func Test(t *testing.T) {
{
name: "one container tty",
client: &mockClient{
ContainerListF: func() ([]types.Container, error) {
return []types.Container{
ContainerListF: func() ([]container.Summary, error) {
return []container.Summary{
{
ID: "deadbeef",
Names: []string{"/telegraf"},
@ -78,8 +77,8 @@ func Test(t *testing.T) {
},
}, nil
},
ContainerInspectF: func() (types.ContainerJSON, error) {
return types.ContainerJSON{
ContainerInspectF: func() (container.InspectResponse, error) {
return container.InspectResponse{
Config: &container.Config{
Tty: true,
},
@ -110,8 +109,8 @@ func Test(t *testing.T) {
{
name: "one container multiplex",
client: &mockClient{
ContainerListF: func() ([]types.Container, error) {
return []types.Container{
ContainerListF: func() ([]container.Summary, error) {
return []container.Summary{
{
ID: "deadbeef",
Names: []string{"/telegraf"},
@ -119,8 +118,8 @@ func Test(t *testing.T) {
},
}, nil
},
ContainerInspectF: func() (types.ContainerJSON, error) {
return types.ContainerJSON{
ContainerInspectF: func() (container.InspectResponse, error) {
return container.InspectResponse{
Config: &container.Config{
Tty: false,
},

View File

@ -30,7 +30,6 @@ func mustParseNano(value string) time.Time {
var validStats = map[string]*container.StatsResponse{
pauseStatsKey: {
Stats: container.Stats{
Read: pauseStatsRead,
PreRead: pauseStatsPreRead,
BlkioStats: container.BlkioStats{
@ -343,7 +342,6 @@ var validStats = map[string]*container.StatsResponse{
Usage: 1343488,
Limit: 1033658368,
},
},
Networks: map[string]container.NetworkStats{
"eth0": {
RxBytes: uint64(5338),
@ -368,7 +366,6 @@ var validStats = map[string]*container.StatsResponse{
},
},
nginxStatsKey: {
Stats: container.Stats{
Read: nginxStatsRead,
PreRead: nginxStatsPreRead,
BlkioStats: container.BlkioStats{
@ -686,7 +683,6 @@ var validStats = map[string]*container.StatsResponse{
Limit: 1033658368,
},
},
},
}
// meta