Skip to content

Commit 400dfa3

Browse files
committed
Add ConsoleSocket to RestoreOpts
It is required to restore a container with a console. Signed-off-by: Andrei Vagin <[email protected]>
1 parent bcb223a commit 400dfa3

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

console.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func NewConsoleSocket(path string) (*Socket, error) {
4343
return nil, err
4444
}
4545
return &Socket{
46-
l: l,
46+
l: l,
4747
}, nil
4848
}
4949

runc.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -512,10 +512,11 @@ type RestoreOpts struct {
512512
CheckpointOpts
513513
IO
514514

515-
Detach bool
516-
PidFile string
517-
NoSubreaper bool
518-
NoPivot bool
515+
Detach bool
516+
PidFile string
517+
NoSubreaper bool
518+
NoPivot bool
519+
ConsoleSocket ConsoleSocket
519520
}
520521

521522
func (o *RestoreOpts) args() ([]string, error) {
@@ -530,6 +531,9 @@ func (o *RestoreOpts) args() ([]string, error) {
530531
}
531532
out = append(out, "--pid-file", abs)
532533
}
534+
if o.ConsoleSocket != nil {
535+
out = append(out, "--console-socket", o.ConsoleSocket.Path())
536+
}
533537
if o.NoPivot {
534538
out = append(out, "--no-pivot")
535539
}

0 commit comments

Comments
 (0)