diff --git a/daemon/stats.go b/daemon/stats.go index 33a9e723a1..7ebae41dc7 100644 --- a/daemon/stats.go +++ b/daemon/stats.go @@ -43,11 +43,11 @@ func (daemon *Daemon) ContainerStats(ctx context.Context, prefixOrName string, c var preCPUStats types.CPUStats getStatJSON := func(v interface{}) *types.StatsJSON { - ss := v.(*types.StatsJSON) + ss := v.(types.StatsJSON) ss.PreCPUStats = preCPUStats // ss.MemoryStats.Limit = uint64(update.MemoryLimit) preCPUStats = ss.CPUStats - return ss + return &ss } enc := json.NewEncoder(outStream) diff --git a/daemon/stats_collector_unix.go b/daemon/stats_collector_unix.go index fb1931dfb8..1f016322df 100644 --- a/daemon/stats_collector_unix.go +++ b/daemon/stats_collector_unix.go @@ -135,7 +135,7 @@ func (s *statsCollector) run() { // FIXME: move to containerd stats.CPUStats.SystemUsage = systemUsage - pair.publisher.Publish(stats) + pair.publisher.Publish(*stats) } } }