summaryrefslogtreecommitdiff
path: root/pkg/domain/infra
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2020-09-23 13:33:17 +0200
committerValentin Rothberg <rothberg@redhat.com>2020-09-24 14:09:55 +0200
commit762b787fbf741eec0e59d81aaebbfc467351ceaa (patch)
tree7e18776a8fb6c843609487a27f1e0dd4da788122 /pkg/domain/infra
parent376ba349bfadc47a938084ccb3c2d112c92f09ca (diff)
downloadpodman-762b787fbf741eec0e59d81aaebbfc467351ceaa.tar.gz
podman-762b787fbf741eec0e59d81aaebbfc467351ceaa.tar.bz2
podman-762b787fbf741eec0e59d81aaebbfc467351ceaa.zip
new endpoint: /libpod/containers/stats
Add a new endpoint for container stats allowing for batch operations on more than one container. The new endpoint deprecates the single-container endpoint which will eventually be removed with the next major release. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'pkg/domain/infra')
-rw-r--r--pkg/domain/infra/abi/containers.go2
-rw-r--r--pkg/domain/infra/tunnel/containers.go3
2 files changed, 3 insertions, 2 deletions
diff --git a/pkg/domain/infra/abi/containers.go b/pkg/domain/infra/abi/containers.go
index d55bc5c17..c77d27cb2 100644
--- a/pkg/domain/infra/abi/containers.go
+++ b/pkg/domain/infra/abi/containers.go
@@ -1216,7 +1216,7 @@ func (ic *ContainerEngine) ContainerStats(ctx context.Context, namesOrIds []stri
report.Stats, report.Error = computeStats()
statsChan <- report
- if options.NoStream {
+ if report.Error != nil || options.NoStream {
return
}
diff --git a/pkg/domain/infra/tunnel/containers.go b/pkg/domain/infra/tunnel/containers.go
index 60136faae..41fb62ab6 100644
--- a/pkg/domain/infra/tunnel/containers.go
+++ b/pkg/domain/infra/tunnel/containers.go
@@ -683,5 +683,6 @@ func (ic *ContainerEngine) Shutdown(_ context.Context) {
}
func (ic *ContainerEngine) ContainerStats(ctx context.Context, namesOrIds []string, options entities.ContainerStatsOptions) (statsChan chan entities.ContainerStatsReport, err error) {
- return nil, errors.New("not implemented")
+ stream := !options.NoStream
+ return containers.Stats(ic.ClientCxt, namesOrIds, &stream)
}