mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
Update code for latest engine-api
- Update CopyToContainer uses - Use engine-api/types/versions instead of pkg/version Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
@@ -9,8 +9,8 @@ import (
|
||||
|
||||
"github.com/docker/docker/api/types/backend"
|
||||
"github.com/docker/docker/pkg/ioutils"
|
||||
"github.com/docker/docker/pkg/version"
|
||||
"github.com/docker/engine-api/types"
|
||||
"github.com/docker/engine-api/types/versions"
|
||||
"github.com/docker/engine-api/types/versions/v1p20"
|
||||
)
|
||||
|
||||
@@ -21,7 +21,7 @@ func (daemon *Daemon) ContainerStats(ctx context.Context, prefixOrName string, c
|
||||
return errors.New("Windows does not support stats")
|
||||
}
|
||||
// Remote API version (used for backwards compatibility)
|
||||
apiVersion := version.Version(config.Version)
|
||||
apiVersion := config.Version
|
||||
|
||||
container, err := daemon.GetContainer(prefixOrName)
|
||||
if err != nil {
|
||||
@@ -65,7 +65,7 @@ func (daemon *Daemon) ContainerStats(ctx context.Context, prefixOrName string, c
|
||||
|
||||
var statsJSON interface{}
|
||||
statsJSONPost120 := getStatJSON(v)
|
||||
if apiVersion.LessThan("1.21") {
|
||||
if versions.LessThan(apiVersion, "1.21") {
|
||||
var (
|
||||
rxBytes uint64
|
||||
rxPackets uint64
|
||||
|
||||
Reference in New Issue
Block a user