Merge pull request #34448 from Microsoft/jjh/donotblockexport
LCOW: Don't block export
This commit is contained in:
commit
ac87bb3f85
|
@ -13,15 +13,15 @@ import (
|
||||||
// ContainerExport writes the contents of the container to the given
|
// ContainerExport writes the contents of the container to the given
|
||||||
// writer. An error is returned if the container cannot be found.
|
// writer. An error is returned if the container cannot be found.
|
||||||
func (daemon *Daemon) ContainerExport(name string, out io.Writer) error {
|
func (daemon *Daemon) ContainerExport(name string, out io.Writer) error {
|
||||||
if runtime.GOOS == "windows" {
|
|
||||||
return fmt.Errorf("the daemon on this platform does not support export of a container")
|
|
||||||
}
|
|
||||||
|
|
||||||
container, err := daemon.GetContainer(name)
|
container, err := daemon.GetContainer(name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if runtime.GOOS == "windows" && container.Platform == "windows" {
|
||||||
|
return fmt.Errorf("the daemon on this platform does not support exporting Windows containers")
|
||||||
|
}
|
||||||
|
|
||||||
data, err := daemon.containerExport(container)
|
data, err := daemon.containerExport(container)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error exporting container %s: %v", name, err)
|
return fmt.Errorf("Error exporting container %s: %v", name, err)
|
||||||
|
|
Loading…
Reference in New Issue