mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
LCOW: Add platform to container, init on FromDisk()
Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
parent
ed4d2aa981
commit
f97fbba5ce
1 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue