From 2389760e958663c8f975bdf25237f604e103f9af Mon Sep 17 00:00:00 2001 From: Xian Chaobo Date: Sun, 7 Jun 2015 21:25:01 +0800 Subject: [PATCH] refresh config fields Signed-off-by: Xian Chaobo Signed-off-by: Victor Vieux --- Godeps/Godeps.json | 2 +- .../github.com/samalba/dockerclient/types.go | 39 +++++++++++++++---- test/integration/api/run.bats | 32 ++++++++++++++- 3 files changed, 63 insertions(+), 10 deletions(-) diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 75fbf84b9d..46d04c5a06 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -106,7 +106,7 @@ }, { "ImportPath": "github.com/samalba/dockerclient", - "Rev": "142d8fe0150952d52867ac222e3a02eb17916f01" + "Rev": "48d211b4bab6028425b0cd34606c974634836986" }, { "ImportPath": "github.com/samuel/go-zookeeper/zk", diff --git a/Godeps/_workspace/src/github.com/samalba/dockerclient/types.go b/Godeps/_workspace/src/github.com/samalba/dockerclient/types.go index dae3c8d15c..57150641e8 100644 --- a/Godeps/_workspace/src/github.com/samalba/dockerclient/types.go +++ b/Godeps/_workspace/src/github.com/samalba/dockerclient/types.go @@ -11,28 +11,31 @@ type ContainerConfig struct { Hostname string Domainname string User string - Memory int64 - MemorySwap int64 - CpuShares int64 - Cpuset string AttachStdin bool AttachStdout bool AttachStderr bool - PortSpecs []string ExposedPorts map[string]struct{} - MacAddress string Tty bool OpenStdin bool StdinOnce bool Env []string Cmd []string Image string - Labels map[string]string Volumes map[string]struct{} + VolumeDriver string WorkingDir string Entrypoint []string NetworkDisabled bool + MacAddress string OnBuild []string + Labels map[string]string + + // FIXME: Compatibility + Memory int64 + MemorySwap int64 + CpuShares int64 + Cpuset string + PortSpecs []string // This is used only by the create command HostConfig HostConfig @@ -45,19 +48,39 @@ type HostConfig struct { Memory int64 MemorySwap int64 CpuShares int64 + CpuPeriod int64 CpusetCpus string + CpusetMems string + CpuQuota int64 + BlkioWeight int64 + OomKillDisable bool Privileged bool PortBindings map[string][]PortBinding Links []string PublishAllPorts bool Dns []string DnsSearch []string + ExtraHosts []string VolumesFrom []string - SecurityOpt []string + Devices []DeviceMapping NetworkMode string + IpcMode string + PidMode string + UTSMode string + CapAdd []string + CapDrop []string RestartPolicy RestartPolicy + SecurityOpt []string + ReadonlyRootfs bool Ulimits []Ulimit LogConfig LogConfig + CgroupParent string +} + +type DeviceMapping struct { + PathOnHost string `json:"PathOnHost"` + PathInContainer string `json:"PathInContainer"` + CgroupPermissions string `json:"CgroupPermissions"` } type ExecConfig struct { diff --git a/test/integration/api/run.bats b/test/integration/api/run.bats index 6f782be5c6..ddcebed6ad 100644 --- a/test/integration/api/run.bats +++ b/test/integration/api/run.bats @@ -27,8 +27,38 @@ function teardown() { swarm_manage # run - docker_swarm run -d --name test_container -c 1 busybox sleep 100 + docker_swarm run -d --name test_container \ + --add-host=host-test:127.0.0.1 \ + --cap-add=NET_ADMIN \ + --cap-drop=MKNOD \ + --label=com.example.version=1.0 \ + --read-only=true \ + --ulimit=nofile=10 \ + --device=/dev/loop0:/dev/loop0 \ + --ipc=host \ + --pid=host \ + busybox sleep 1000 # verify, container is running [ -n $(docker_swarm ps -q --filter=name=test_container --filter=status=running) ] + + run docker_swarm inspect test_container + # label + [[ "${output}" == *"com.example.version"* ]] + # add-host + [[ "${output}" == *"host-test:127.0.0.1"* ]] + # cap-add + [[ "${output}" == *"NET_ADMIN"* ]] + # cap-drop + [[ "${output}" == *"MKNOD"* ]] + # read-only + [[ "${output}" == *"\"ReadonlyRootfs\": true"* ]] + # ulimit + [[ "${output}" == *"nofile"* ]] + # device + [[ "${output}" == *"/dev/loop0"* ]] + # ipc + [[ "${output}" == *"\"IpcMode\": \"host\""* ]] + # pid + [[ "${output}" == *"\"PidMode\": \"host\""* ]] }