mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
Address feedback from Tonis
Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
@@ -17,6 +17,7 @@ import (
|
||||
"github.com/docker/docker/image"
|
||||
"github.com/docker/docker/layer"
|
||||
"github.com/docker/docker/pkg/ioutils"
|
||||
"github.com/docker/docker/pkg/system"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
@@ -149,6 +150,9 @@ func (daemon *Daemon) Commit(name string, c *backend.ContainerCommitConfig) (str
|
||||
daemon.containerPause(container)
|
||||
defer daemon.containerUnpause(container)
|
||||
}
|
||||
if !system.IsOSSupported(container.OS) {
|
||||
return "", system.ErrNotSupportedOperatingSystem
|
||||
}
|
||||
|
||||
if c.MergeConfigs && c.Config == nil {
|
||||
c.Config = container.Config
|
||||
@@ -251,6 +255,7 @@ func (daemon *Daemon) Commit(name string, c *backend.ContainerCommitConfig) (str
|
||||
}
|
||||
|
||||
func (daemon *Daemon) exportContainerRw(container *container.Container) (arch io.ReadCloser, err error) {
|
||||
// Note: Indexing by OS is safe as only called from `Commit` which has already performed validation
|
||||
rwlayer, err := daemon.layerStores[container.OS].GetRWLayer(container.ID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user