Expose old config field for api < 1.19

Signed-off-by: Antonio Murdaca <me@runcom.ninja>
This commit is contained in:
Antonio Murdaca
2015-06-02 23:37:59 +02:00
parent 63b5d5fadc
commit 6deaa58ba5
3 changed files with 66 additions and 5 deletions
+22 -2
View File
@@ -195,12 +195,11 @@ type ContainerState struct {
}
// GET "/containers/{name:.*}/json"
type ContainerJSON struct {
type ContainerJSONBase struct {
Id string
Created time.Time
Path string
Args []string
Config *runconfig.Config
State *ContainerState
Image string
NetworkSettings *network.Settings
@@ -220,3 +219,24 @@ type ContainerJSON struct {
ExecIDs []string
HostConfig *runconfig.HostConfig
}
type ContainerJSON struct {
*ContainerJSONBase
Config *runconfig.Config
}
// backcompatibility struct along with ContainerConfig
type ContainerJSONRaw struct {
*ContainerJSONBase
Config *ContainerConfig
}
type ContainerConfig struct {
*runconfig.Config
// backward compatibility, they now live in HostConfig
Memory int64
MemorySwap int64
CpuShares int64
Cpuset string
}