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:
Vincent Demeester
2016-04-19 16:56:54 +02:00
parent 04bb3a2f45
commit 7534f17261
20 changed files with 51 additions and 56 deletions

View File

@@ -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