mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Exit early with error message on checkpoint/pause w/ hostinet.
PiperOrigin-RevId: 381964660
This commit is contained in:
@@ -334,6 +334,11 @@ func (cm *containerManager) ExecuteAsync(args *control.ExecArgs, pid *int32) err
|
||||
// Checkpoint pauses a sandbox and saves its state.
|
||||
func (cm *containerManager) Checkpoint(o *control.SaveOpts, _ *struct{}) error {
|
||||
log.Debugf("containerManager.Checkpoint")
|
||||
// TODO(gvisor.dev/issues/6243): save/restore not supported w/ hostinet
|
||||
if cm.l.root.conf.Network == config.NetworkHost {
|
||||
return errors.New("checkpoint not supported when using hostinet")
|
||||
}
|
||||
|
||||
state := control.State{
|
||||
Kernel: cm.l.k,
|
||||
Watchdog: cm.l.watchdog,
|
||||
@@ -344,6 +349,10 @@ func (cm *containerManager) Checkpoint(o *control.SaveOpts, _ *struct{}) error {
|
||||
// Pause suspends a container.
|
||||
func (cm *containerManager) Pause(_, _ *struct{}) error {
|
||||
log.Debugf("containerManager.Pause")
|
||||
// TODO(gvisor.dev/issues/6243): save/restore not supported w/ hostinet
|
||||
if cm.l.root.conf.Network == config.NetworkHost {
|
||||
return errors.New("pause not supported when using hostinet")
|
||||
}
|
||||
cm.l.k.Pause()
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user