diff options
author | John Howard <jhoward@microsoft.com> | 2017-05-16 14:19:19 -0700 |
---|---|---|
committer | John Howard <jhoward@microsoft.com> | 2017-06-20 19:49:51 -0700 |
commit | f97fbba5cec3d27099e230f7c1dc278c54180d74 (patch) | |
tree | 021587b8bef513c1f7c16e315f4b6ccdba2fb09b /container | |
parent | ed4d2aa981a9057766a9cec53c3bd19be4eef059 (diff) | |
download | docker-f97fbba5cec3d27099e230f7c1dc278c54180d74.tar.gz |
LCOW: Add platform to container, init on FromDisk()
Signed-off-by: John Howard <jhoward@microsoft.com>
Diffstat (limited to 'container')
-rw-r--r-- | container/container.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/container/container.go b/container/container.go index 02bfea59e2..4d99362311 100644 --- a/container/container.go +++ b/container/container.go @@ -7,6 +7,7 @@ import ( "net" "os" "path/filepath" + "runtime" "strconv" "strings" "sync" @@ -77,6 +78,7 @@ type Container struct { LogPath string Name string Driver string + Platform string // MountLabel contains the options for the 'mount' command MountLabel string ProcessLabel string @@ -142,6 +144,13 @@ func (container *Container) FromDisk() error { return err } + // Ensure the platform is set if blank. Assume it is the platform of the + // host OS if not, to ensure containers created before multiple-platform + // support are migrated + if container.Platform == "" { + container.Platform = runtime.GOOS + } + if err := label.ReserveLabel(container.ProcessLabel); err != nil { return err } |