diff --git a/container/container.go b/container/container.go index 3cc248c315..3a95d6ca84 100644 --- a/container/container.go +++ b/container/container.go @@ -264,12 +264,6 @@ func (container *Container) WriteHostConfig() (*containertypes.HostConfig, error // SetupWorkingDirectory sets up the container's working directory as set in container.Config.WorkingDir func (container *Container) SetupWorkingDirectory(rootIdentity idtools.Identity) error { - // TODO: LCOW Support. This will need revisiting. - // We will need to do remote filesystem operations here. - if container.OS != runtime.GOOS { - return nil - } - if container.Config.WorkingDir == "" { return nil } @@ -727,14 +721,14 @@ func getConfigTargetPath(r *swarmtypes.ConfigReference) string { // CreateDaemonEnvironment creates a new environment variable slice for this container. func (container *Container) CreateDaemonEnvironment(tty bool, linkedEnv []string) []string { // Setup environment - os := container.OS - if os == "" { - os = runtime.GOOS + ctrOS := container.OS + if ctrOS == "" { + ctrOS = runtime.GOOS } // Figure out what size slice we need so we can allocate this all at once. envSize := len(container.Config.Env) - if runtime.GOOS != "windows" || (runtime.GOOS == "windows" && os == "linux") { + if runtime.GOOS != "windows" { envSize += 2 + len(linkedEnv) } if tty { @@ -743,7 +737,7 @@ func (container *Container) CreateDaemonEnvironment(tty bool, linkedEnv []string env := make([]string, 0, envSize) if runtime.GOOS != "windows" { - env = append(env, "PATH="+system.DefaultPathEnv(os)) + env = append(env, "PATH="+system.DefaultPathEnv(ctrOS)) env = append(env, "HOSTNAME="+container.Config.Hostname) if tty { env = append(env, "TERM=xterm") diff --git a/image/tarexport/save.go b/image/tarexport/save.go index 1a3fe03be4..e802552b0f 100644 --- a/image/tarexport/save.go +++ b/image/tarexport/save.go @@ -217,9 +217,7 @@ func (s *saveSession) save(outStream io.Writer) error { for _, l := range imageDescr.layers { // IMPORTANT: We use path, not filepath here to ensure the layers - // in the manifest use Unix-style forward-slashes. Otherwise, a - // Linux image saved from LCOW won't be able to be imported on - // LCOL. + // in the manifest use Unix-style forward-slashes. layers = append(layers, path.Join(l, legacyLayerFileName)) } diff --git a/pkg/archive/copy.go b/pkg/archive/copy.go index 4b9f504d7d..8a4cee908d 100644 --- a/pkg/archive/copy.go +++ b/pkg/archive/copy.go @@ -374,9 +374,6 @@ func RebaseArchiveEntries(srcContent io.Reader, oldBase, newBase string) io.Read return rebased } -// TODO @gupta-ak. These might have to be changed in the future to be -// continuity driver aware as well to support LCOW. - // CopyResource performs an archive copy from the given source path to the // given destination path. The source path MUST exist and the destination // path's parent directory must exist. diff --git a/pkg/containerfs/containerfs.go b/pkg/containerfs/containerfs.go index d25826ddbb..cf2d39c82e 100644 --- a/pkg/containerfs/containerfs.go +++ b/pkg/containerfs/containerfs.go @@ -28,8 +28,7 @@ type ContainerFS interface { // Driver combines both continuity's Driver and PathDriver interfaces with a Platform // field to determine the OS. type Driver interface { - // OS returns the OS where the rootfs is located. Essentially, - // runtime.GOOS for everything aside from LCOW, which is "linux" + // OS returns the OS where the rootfs is located. Essentially, runtime.GOOS. OS() string // Architecture returns the hardware architecture where the