Skip to content

Commit

Permalink
chore(deps): Bump github.com/docker/docker from 25.0.5+incompatible t…
Browse files Browse the repository at this point in the history
…o 27.1.1+incompatible (#15681)
  • Loading branch information
dependabot[bot] committed Jul 31, 2024
1 parent 094eff6 commit a978110
Show file tree
Hide file tree
Showing 17 changed files with 116 additions and 113 deletions.
2 changes: 2 additions & 0 deletions docs/LICENSE_OF_DEPENDENCIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ following works:
- github.com/cloudevents/sdk-go [Apache License 2.0](https://github.com/cloudevents/sdk-go/blob/main/LICENSE)
- github.com/compose-spec/compose-go [Apache License 2.0](https://github.com/compose-spec/compose-go/blob/master/LICENSE)
- github.com/containerd/containerd [Apache License 2.0](https://github.com/containerd/containerd/blob/master/LICENSE)
- github.com/containerd/errdefs [Apache License 2.0](https://github.com/containerd/errdefs/blob/main/LICENSE)
- github.com/containerd/log [Apache License 2.0](https://github.com/containerd/log/blob/main/LICENSE)
- github.com/coocood/freecache [MIT License](https://github.com/coocood/freecache/blob/master/LICENSE)
- github.com/coreos/go-semver [Apache License 2.0](https://github.com/coreos/go-semver/blob/main/LICENSE)
Expand Down Expand Up @@ -269,6 +270,7 @@ following works:
- github.com/mitchellh/go-homedir [MIT License](https://github.com/mitchellh/go-homedir/blob/master/LICENSE)
- github.com/mitchellh/mapstructure [MIT License](https://github.com/mitchellh/mapstructure/blob/master/LICENSE)
- github.com/mitchellh/reflectwalk [MIT License](https://github.com/mitchellh/reflectwalk/blob/master/LICENSE)
- github.com/moby/docker-image-spec [Apache License 2.0](https://github.com/moby/docker-image-spec/blob/main/LICENSE)
- github.com/moby/ipvs [Apache License 2.0](https://github.com/moby/ipvs/blob/master/LICENSE)
- github.com/moby/patternmatcher [Apache License 2.0](https://github.com/moby/patternmatcher/blob/main/LICENSE)
- github.com/moby/sys/sequential [Apache License 2.0](https://github.com/moby/sys/blob/main/LICENSE)
Expand Down
16 changes: 9 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ require (
github.com/digitalocean/go-libvirt v0.0.0-20240513153900-2d13115a1625
github.com/dimchansky/utfbom v1.1.1
github.com/djherbis/times v1.6.0
github.com/docker/docker v25.0.5+incompatible
github.com/docker/docker v27.1.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
Expand Down Expand Up @@ -187,8 +187,8 @@ require (
github.com/srebhan/protobufquery v0.0.0-20230803132024-ae4c0d878e55
github.com/stretchr/testify v1.9.0
github.com/tbrandon/mbserver v0.0.0-20170611213546-993e1772cc62
github.com/testcontainers/testcontainers-go v0.31.0
github.com/testcontainers/testcontainers-go/modules/kafka v0.31.0
github.com/testcontainers/testcontainers-go v0.32.0
github.com/testcontainers/testcontainers-go/modules/kafka v0.32.0
github.com/thomasklein94/packer-plugin-libvirt v0.5.0
github.com/tidwall/gjson v1.17.0
github.com/tidwall/wal v1.1.7
Expand Down Expand Up @@ -265,8 +265,8 @@ require (
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/Max-Sum/base32768 v0.0.0-20230304063302-18e6ce5945fd // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/Microsoft/hcsshim v0.11.4 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/Microsoft/hcsshim v0.11.5 // indirect
github.com/abbot/go-http-auth v0.4.0 // indirect
github.com/alecthomas/participle v0.4.1 // indirect
github.com/andybalholm/brotli v1.1.0 // indirect
Expand Down Expand Up @@ -302,7 +302,8 @@ require (
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58 // indirect
github.com/containerd/containerd v1.7.15 // indirect
github.com/containerd/containerd v1.7.18 // indirect
github.com/containerd/errdefs v0.1.0 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/couchbase/gomemcached v0.1.3 // indirect
github.com/couchbase/goutils v0.1.0 // indirect
Expand All @@ -313,7 +314,7 @@ require (
github.com/dennwc/varint v1.0.0 // indirect
github.com/devigned/tab v0.1.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/distribution/reference v0.5.0 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/dvsekhvalnov/jose2go v1.6.0 // indirect
github.com/eapache/go-resiliency v1.6.0 // indirect
Expand Down Expand Up @@ -410,6 +411,7 @@ require (
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/patternmatcher v0.6.0 // indirect
github.com/moby/sys/sequential v0.5.0 // indirect
github.com/moby/sys/user v0.1.0 // indirect
Expand Down
32 changes: 18 additions & 14 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -749,10 +749,10 @@ github.com/Mellanox/rdmamap v1.1.0 h1:A/W1wAXw+6vm58f3VklrIylgV+eDJlPVIMaIKuxgUT
github.com/Mellanox/rdmamap v1.1.0/go.mod h1:fN+/V9lf10ABnDCwTaXRjeeWijLt2iVLETnK+sx/LY8=
github.com/Microsoft/go-winio v0.4.15/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw=
github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY=
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/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8=
github.com/Microsoft/hcsshim v0.11.4/go.mod h1:smjE4dvqPX9Zldna+t5FG3rnoHhaB7QYxPRqGcpAD9w=
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
github.com/Microsoft/hcsshim v0.11.5 h1:haEcLNpj9Ka1gd3B3tAEs9CpE0c+1IhoL59w/exYU38=
github.com/Microsoft/hcsshim v0.11.5/go.mod h1:MV8xMfmECjl5HdO7U/3/hFVnkmSBjAjmA09d4bExKcU=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/PaesslerAG/gval v1.2.2 h1:Y7iBzhgE09IGTt5QgGQ2IdaYYYOU134YGHBThD+wm9E=
github.com/PaesslerAG/gval v1.2.2/go.mod h1:XRFLwvmkTEdYziLdaCeCa5ImcGVrfQbeNUbVR+C6xac=
Expand Down Expand Up @@ -1053,8 +1053,10 @@ github.com/colinmarc/hdfs/v2 v2.4.0 h1:v6R8oBx/Wu9fHpdPoJJjpGSUxo8NhHIwrwsfhFvU9
github.com/colinmarc/hdfs/v2 v2.4.0/go.mod h1:0NAO+/3knbMx6+5pCv+Hcbaz4xn/Zzbn9+WIib2rKVI=
github.com/compose-spec/compose-go v1.20.2 h1:u/yfZHn4EaHGdidrZycWpxXgFffjYULlTbRfJ51ykjQ=
github.com/compose-spec/compose-go v1.20.2/go.mod h1:+MdqXV4RA7wdFsahh/Kb8U0pAJqkg7mr4PM9tFKU8RM=
github.com/containerd/containerd v1.7.15 h1:afEHXdil9iAm03BmhjzKyXnnEBtjaLJefdU7DV0IFes=
github.com/containerd/containerd v1.7.15/go.mod h1:ISzRRTMF8EXNpJlTzyr2XMhN+j9K302C21/+cr3kUnY=
github.com/containerd/containerd v1.7.18 h1:jqjZTQNfXGoEaZdW1WwPU0RqSn1Bm2Ay/KJPUuO8nao=
github.com/containerd/containerd v1.7.18/go.mod h1:IYEk9/IO6wAPUz2bCMVUbsfXjzw5UNP5fLz4PsUygQ4=
github.com/containerd/errdefs v0.1.0 h1:m0wCRBiu1WJT/Fr+iOoQHMQS/eP5myQ8lCv4Dz5ZURM=
github.com/containerd/errdefs v0.1.0/go.mod h1:YgWiiHtLmSeBrvpw+UfPijzbLaB77mEG1WwJTDETIV0=
github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=
github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo=
github.com/coocood/freecache v1.2.4 h1:UdR6Yz/X1HW4fZOuH0Z94KwG851GWOSknua5VUbb/5M=
Expand Down Expand Up @@ -1109,16 +1111,16 @@ github.com/digitalocean/godo v1.104.1 h1:SZNxjAsskM/su0YW9P8Wx3gU0W1Z13b6tZlYNpl
github.com/digitalocean/godo v1.104.1/go.mod h1:VAI/L5YDzMuPRU01lEEUSQ/sp5Z//1HnnFv/RBTEdbg=
github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U=
github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE=
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/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/djherbis/times v1.6.0 h1:w2ctJ92J8fBvWPxugmXIv7Nz7Q3iDMKNx9v5ocVH20c=
github.com/djherbis/times v1.6.0/go.mod h1:gOHeRAz2h+VJNZ5Gmc/o7iD9k4wW7NMVqieYCY99oc0=
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 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 v27.1.1+incompatible h1:hO/M4MtV36kzKldqnA37IWhebRA+LnqqcqDja6kVaKY=
github.com/docker/docker v27.1.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=
Expand Down Expand Up @@ -1927,6 +1929,8 @@ github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4/go.mod h1
github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
github.com/moby/ipvs v1.1.0 h1:ONN4pGaZQgAx+1Scz5RvWV4Q7Gb+mvfRh3NsPS+1XQQ=
github.com/moby/ipvs v1.1.0/go.mod h1:4VJMWuf098bsUMmZEiD4Tjk/O7mOn3l1PTD3s4OoYAs=
github.com/moby/moby v24.0.6+incompatible/go.mod h1:fDXVQ6+S340veQPv35CzDahGBmHsiclFwfEygB/TWMc=
Expand Down Expand Up @@ -2327,10 +2331,10 @@ github.com/t3rm1n4l/go-mega v0.0.0-20240219080617-d494b6a8ace7/go.mod h1:suDIky6
github.com/tbrandon/mbserver v0.0.0-20170611213546-993e1772cc62 h1:Oj2e7Sae4XrOsk3ij21QjjEgAcVSeo9nkp0dI//cD2o=
github.com/tbrandon/mbserver v0.0.0-20170611213546-993e1772cc62/go.mod h1:qUzPVlSj2UgxJkVbH0ZwuuiR46U8RBMDT5KLY78Ifpw=
github.com/tedsuo/ifrit v0.0.0-20180802180643-bea94bb476cc/go.mod h1:eyZnKCc955uh98WQvzOm0dgAeLnf2O0Rz0LPoC5ze+0=
github.com/testcontainers/testcontainers-go v0.31.0 h1:W0VwIhcEVhRflwL9as3dhY6jXjVCA27AkmbnZ+UTh3U=
github.com/testcontainers/testcontainers-go v0.31.0/go.mod h1:D2lAoA0zUFiSY+eAflqK5mcUx/A5hrrORaEQrd0SefI=
github.com/testcontainers/testcontainers-go/modules/kafka v0.31.0 h1:8B1u+sDwYhTUoMI271wPjnCg9mz3dHGLMWpP7YyF7kE=
github.com/testcontainers/testcontainers-go/modules/kafka v0.31.0/go.mod h1:W1+yLUfUl8VLTzvmApP2FBHgCk8I5SKKjDWjxWEc33U=
github.com/testcontainers/testcontainers-go v0.32.0 h1:ug1aK08L3gCHdhknlTTwWjPHPS+/alvLJU/DRxTD/ME=
github.com/testcontainers/testcontainers-go v0.32.0/go.mod h1:CRHrzHLQhlXUsa5gXjTOfqIEJcrK5+xMDmBr/WMI88E=
github.com/testcontainers/testcontainers-go/modules/kafka v0.32.0 h1:OeqTsdtPhwVQbq0pP35okVY2Qb6vb/5LaOBqewTWlGk=
github.com/testcontainers/testcontainers-go/modules/kafka v0.32.0/go.mod h1:GCPw9ky5rQpMk81DyNaETjbfZiAwA7j5LLeVPnIvgII=
github.com/thomasklein94/packer-plugin-libvirt v0.5.0 h1:aj2HLHZZM/ClGLIwVp9rrgh+2TOU/w4EiaZHAwCpOgs=
github.com/thomasklein94/packer-plugin-libvirt v0.5.0/go.mod h1:GwN82FQ6KxCNKtS8LNUgLbwTZs90GGhBzCmTNkrTCrY=
github.com/tidwall/gjson v1.10.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
Expand Down
4 changes: 2 additions & 2 deletions plugins/inputs/docker/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var (
type Client interface {
Info(ctx context.Context) (system.Info, error)
ContainerList(ctx context.Context, options container.ListOptions) ([]types.Container, error)
ContainerStats(ctx context.Context, containerID string, stream bool) (types.ContainerStats, error)
ContainerStats(ctx context.Context, containerID string, stream bool) (container.StatsResponseReader, error)
ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error)
ServiceList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error)
TaskList(ctx context.Context, options types.TaskListOptions) ([]swarm.Task, error)
Expand Down Expand Up @@ -65,7 +65,7 @@ func (c *SocketClient) Info(ctx context.Context) (system.Info, error) {
func (c *SocketClient) ContainerList(ctx context.Context, options container.ListOptions) ([]types.Container, error) {
return c.client.ContainerList(ctx, options)
}
func (c *SocketClient) ContainerStats(ctx context.Context, containerID string, stream bool) (types.ContainerStats, error) {
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) {
Expand Down
10 changes: 5 additions & 5 deletions plugins/inputs/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ func (d *Docker) gatherContainer(
container types.Container,
acc telegraf.Accumulator,
) error {
var v *types.StatsJSON
var v *typeContainer.StatsResponse

cname := parseContainerName(container.Names)

Expand Down Expand Up @@ -533,7 +533,7 @@ func (d *Docker) gatherContainerInspect(
acc telegraf.Accumulator,
tags map[string]string,
daemonOSType string,
v *types.StatsJSON,
v *typeContainer.StatsResponse,
) error {
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(d.Timeout))
defer cancel()
Expand Down Expand Up @@ -605,7 +605,7 @@ func (d *Docker) gatherContainerInspect(
}

func (d *Docker) parseContainerStats(
stat *types.StatsJSON,
stat *typeContainer.StatsResponse,
acc telegraf.Accumulator,
tags map[string]string,
id string,
Expand Down Expand Up @@ -782,7 +782,7 @@ func (d *Docker) parseContainerStats(
}

// Make a map of devices to their block io stats
func getDeviceStatMap(blkioStats types.BlkioStats) map[string]map[string]interface{} {
func getDeviceStatMap(blkioStats typeContainer.BlkioStats) map[string]map[string]interface{} {
deviceStatMap := make(map[string]map[string]interface{})

for _, metric := range blkioStats.IoServiceBytesRecursive {
Expand Down Expand Up @@ -845,7 +845,7 @@ func getDeviceStatMap(blkioStats types.BlkioStats) map[string]map[string]interfa

func (d *Docker) gatherBlockIOMetrics(
acc telegraf.Accumulator,
stat *types.StatsJSON,
stat *typeContainer.StatsResponse,
tags map[string]string,
tm time.Time,
id string,
Expand Down
20 changes: 10 additions & 10 deletions plugins/inputs/docker/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
type MockClient struct {
InfoF func() (system.Info, error)
ContainerListF func(options typeContainer.ListOptions) ([]types.Container, error)
ContainerStatsF func(containerID string) (types.ContainerStats, error)
ContainerStatsF func(containerID string) (typeContainer.StatsResponseReader, error)
ContainerInspectF func() (types.ContainerJSON, error)
ServiceListF func() ([]swarm.Service, error)
TaskListF func() ([]swarm.Task, error)
Expand All @@ -42,7 +42,7 @@ func (c *MockClient) ContainerList(_ context.Context, options typeContainer.List
return c.ContainerListF(options)
}

func (c *MockClient) ContainerStats(_ context.Context, containerID string, _ bool) (types.ContainerStats, error) {
func (c *MockClient) ContainerStats(_ context.Context, containerID string, _ bool) (typeContainer.StatsResponseReader, error) {
return c.ContainerStatsF(containerID)
}

Expand Down Expand Up @@ -81,7 +81,7 @@ var baseClient = MockClient{
ContainerListF: func(typeContainer.ListOptions) ([]types.Container, error) {
return containerList, nil
},
ContainerStatsF: func(s string) (types.ContainerStats, error) {
ContainerStatsF: func(s string) (typeContainer.StatsResponseReader, error) {
return containerStats(s), nil
},
ContainerInspectF: func() (types.ContainerJSON, error) {
Expand Down Expand Up @@ -429,7 +429,7 @@ func TestDocker_WindowsMemoryContainerStats(t *testing.T) {
ContainerListF: func(typeContainer.ListOptions) ([]types.Container, error) {
return containerList, nil
},
ContainerStatsF: func(string) (types.ContainerStats, error) {
ContainerStatsF: func(string) (typeContainer.StatsResponseReader, error) {
return containerStatsWindows(), nil
},
ContainerInspectF: func() (types.ContainerJSON, error) {
Expand Down Expand Up @@ -684,7 +684,7 @@ func TestContainerNames(t *testing.T) {
client.ContainerListF = func(typeContainer.ListOptions) ([]types.Container, error) {
return containerList, nil
}
client.ContainerStatsF = func(s string) (types.ContainerStats, error) {
client.ContainerStatsF = func(s string) (typeContainer.StatsResponseReader, error) {
return containerStats(s), nil
}

Expand Down Expand Up @@ -1219,8 +1219,8 @@ func TestContainerName(t *testing.T) {
})
return containers, nil
}
client.ContainerStatsF = func(string) (types.ContainerStats, error) {
return types.ContainerStats{
client.ContainerStatsF = func(string) (typeContainer.StatsResponseReader, error) {
return typeContainer.StatsResponseReader{
Body: io.NopCloser(strings.NewReader(`{"name": "logspout"}`)),
}, nil
}
Expand All @@ -1239,8 +1239,8 @@ func TestContainerName(t *testing.T) {
})
return containers, nil
}
client.ContainerStatsF = func(string) (types.ContainerStats, error) {
return types.ContainerStats{
client.ContainerStatsF = func(string) (typeContainer.StatsResponseReader, error) {
return typeContainer.StatsResponseReader{
Body: io.NopCloser(strings.NewReader(`{}`)),
}, nil
}
Expand Down Expand Up @@ -1304,7 +1304,7 @@ func TestHostnameFromID(t *testing.T) {

func Test_parseContainerStatsPerDeviceAndTotal(t *testing.T) {
type args struct {
stat *types.StatsJSON
stat *typeContainer.StatsResponse
tags map[string]string
id string
perDeviceInclude []string
Expand Down
24 changes: 12 additions & 12 deletions plugins/inputs/docker/docker_testdata.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ var NodeList = []swarm.Node{
},
}

func containerStats(s string) types.ContainerStats {
var stat types.ContainerStats
func containerStats(s string) container.StatsResponseReader {
var stat container.StatsResponseReader
var name string
switch s {
case "e2173b9478a6ae55e237d4d74f8bbb753f0817192b5081334dc78476296b7dfb":
Expand Down Expand Up @@ -370,10 +370,10 @@ func containerStats(s string) types.ContainerStats {
return stat
}

func testStats() *types.StatsJSON {
stats := &types.StatsJSON{}
func testStats() *container.StatsResponse {
stats := &container.StatsResponse{}
stats.Read = time.Now()
stats.Networks = make(map[string]types.NetworkStats)
stats.Networks = make(map[string]container.NetworkStats)
stats.CPUStats.OnlineCPUs = 2
stats.CPUStats.CPUUsage.PercpuUsage = []uint64{1, 1002, 0, 0}
stats.CPUStats.CPUUsage.UsageInUsermode = 100
Expand Down Expand Up @@ -421,7 +421,7 @@ func testStats() *types.StatsJSON {
stats.MemoryStats.Failcnt = 1
stats.MemoryStats.Limit = 2000

stats.Networks["eth0"] = types.NetworkStats{
stats.Networks["eth0"] = container.NetworkStats{
RxDropped: 1,
RxBytes: 2,
RxErrors: 3,
Expand All @@ -432,7 +432,7 @@ func testStats() *types.StatsJSON {
TxBytes: 4,
}

stats.Networks["eth1"] = types.NetworkStats{
stats.Networks["eth1"] = container.NetworkStats{
RxDropped: 5,
RxBytes: 6,
RxErrors: 7,
Expand All @@ -443,19 +443,19 @@ func testStats() *types.StatsJSON {
TxBytes: 8,
}

sbr := types.BlkioStatEntry{
sbr := container.BlkioStatEntry{
Major: 6,
Minor: 0,
Op: "read",
Value: 100,
}
sr := types.BlkioStatEntry{
sr := container.BlkioStatEntry{
Major: 6,
Minor: 0,
Op: "write",
Value: 101,
}
sr2 := types.BlkioStatEntry{
sr2 := container.BlkioStatEntry{
Major: 6,
Minor: 1,
Op: "write",
Expand All @@ -472,8 +472,8 @@ func testStats() *types.StatsJSON {
return stats
}

func containerStatsWindows() types.ContainerStats {
var stat types.ContainerStats
func containerStatsWindows() container.StatsResponseReader {
var stat container.StatsResponseReader
jsonStat := `
{
"read":"2017-01-11T08:32:46.2413794Z",
Expand Down
Loading

0 comments on commit a978110

Please sign in to comment.