@@ -58,8 +58,7 @@ type natSettings struct {
5858
5959type networkConnection struct {
6060 NetworkName string
61- //EnableNat bool
62- Nat natSettings
61+ Nat natSettings
6362}
6463type networkSettings struct {
6564 MacAddress string
@@ -77,7 +76,7 @@ type mappedDir struct {
7776 ReadOnly bool
7877}
7978
80- // TODO Windows RTM : @darrenstahlmsft Add ProcessorCount
79+ // TODO Windows: @darrenstahlmsft Add ProcessorCount
8180type containerInit struct {
8281 SystemType string // HCS requires this to be hard-coded to "Container"
8382 Name string // Name of the container. We use the docker ID.
@@ -153,10 +152,13 @@ func (clnt *client) Create(containerID string, spec Spec, options ...CreateOptio
153152 }
154153 }
155154
156- // TODO Ultimately need to set the path from HvRuntime.ImagePath
157155 cu .HvPartition = (spec .Windows .HvRuntime != nil )
156+
157+ // TODO Windows @jhowardmsft. FIXME post TP5.
158158 // if spec.Windows.HvRuntime != nil {
159- // cu.HvPartition = len(spec.Windows.HvRuntime.ImagePath) > 0
159+ // if spec.WIndows.HVRuntime.ImagePath != "" {
160+ // cu.TBD = spec.Windows.HvRuntime.ImagePath
161+ // }
160162 // }
161163
162164 if cu .HvPartition {
@@ -498,80 +500,20 @@ func (clnt *client) Stats(containerID string) (*Stats, error) {
498500
499501// Restore is the handler for restoring a container
500502func (clnt * client ) Restore (containerID string , unusedOnWindows ... CreateOption ) error {
501-
503+ // TODO Windows: Implement this. For now, just tell the backend the container exited.
502504 logrus .Debugf ("lcd Restore %s" , containerID )
503505 return clnt .backend .StateChanged (containerID , StateInfo {
504506 State : StateExit ,
505507 ExitCode : 1 << 31 ,
506508 })
507-
508- // var err error
509- // clnt.lock(containerID)
510- // defer clnt.unlock(containerID)
511-
512- // logrus.Debugf("restore container %s state %s", containerID)
513-
514- // if _, err := clnt.getContainer(containerID); err == nil {
515- // return fmt.Errorf("container %s is aleady active", containerID)
516- // }
517-
518- // defer func() {
519- // if err != nil {
520- // clnt.deleteContainer(containerID)
521- // }
522- // }()
523-
524- // // ====> BUGBUG Where does linux get the pid from systemPid: pid,
525- // container := &container{
526- // containerCommon: containerCommon{
527- // process: process{
528- // processCommon: processCommon{
529- // containerID: containerID,
530- // client: clnt,
531- // friendlyName: InitFriendlyName,
532- // },
533- // },
534- // processes: make(map[string]*process),
535- // },
536- // }
537-
538- // container.systemPid = systemPid(cont)
539-
540- // var terminal bool
541- // for _, p := range cont.Processes {
542- // if p.Pid == InitFriendlyName {
543- // terminal = p.Terminal
544- // }
545- // }
546-
547- // iopipe, err := container.openFifos(terminal)
548- // if err != nil {
549- // return err
550- // }
551-
552- // if err := clnt.backend.AttachStreams(containerID, *iopipe); err != nil {
553- // return err
554- // }
555-
556- // clnt.appendContainer(container)
557-
558- // err = clnt.backend.StateChanged(containerID, StateInfo{
559- // State: StateRestore,
560- // Pid: container.systemPid,
561- // })
562-
563- // if err != nil {
564- // return err
565- // }
566-
567- // return nil
568509}
569510
570511// GetPidsForContainers is not implemented on Windows.
571512func (clnt * client ) GetPidsForContainer (containerID string ) ([]int , error ) {
572513 return nil , errors .New ("GetPidsForContainer: GetPidsForContainer() not implemented" )
573514}
574515
516+ // UpdateResources updates resources for a running container.
575517func (clnt * client ) UpdateResources (containerID string , resources Resources ) error {
576518 // Updating resource isn't supported on Windows
577519 // but we should return nil for enabling updating container
0 commit comments