daemon/monitor_windows.go
94d70d83
 package daemon
 
 import (
818a5198
 	"fmt"
 
94d70d83
 	"github.com/docker/docker/container"
 	"github.com/docker/docker/libcontainerd"
 )
 
 // platformConstructExitStatus returns a platform specific exit status structure
 func platformConstructExitStatus(e libcontainerd.StateInfo) *container.ExitStatus {
 	return &container.ExitStatus{
 		ExitCode: int(e.ExitCode),
 	}
 }
818a5198
 
 // postRunProcessing perfoms any processing needed on the container after it has stopped.
 func (daemon *Daemon) postRunProcessing(container *container.Container, e libcontainerd.StateInfo) error {
2266e7f2
 	if e.ExitCode == 0 && e.UpdatePending {
da92dad5
 		spec, err := daemon.createSpec(container)
 		if err != nil {
 			return err
 		}
 
7c29103a
 		// Turn on servicing
 		spec.Windows.Servicing = true
78540d0d
 
 		copts, err := daemon.getLibcontainerdCreateOptions(container)
 		if err != nil {
 			return err
 		}
 
da92dad5
 		// Create a new servicing container, which will start, complete the update, and merge back the
 		// results if it succeeded, all as part of the below function call.
7c29103a
 		if err := daemon.containerd.Create((container.ID + "_servicing"), "", "", *spec, container.InitializeStdio, copts...); err != nil {
dcfe9927
 			container.SetExitCode(-1)
da92dad5
 			return fmt.Errorf("Post-run update servicing failed: %s", err)
 		}
818a5198
 	}
 	return nil
 }