diff options
author | Adrian Reber <areber@redhat.com> | 2021-07-12 11:43:45 +0000 |
---|---|---|
committer | Adrian Reber <adrian@lisas.de> | 2021-07-27 16:10:44 +0200 |
commit | eb94467780eab06a452586c9751fc4f571d9e089 (patch) | |
tree | 7fd60bf5369ae2da6c4661ba2c20e80267abf0c5 /pkg/bindings | |
parent | 3375cbb198c74e895624eada148edff514b64d35 (diff) | |
download | podman-eb94467780eab06a452586c9751fc4f571d9e089.tar.gz podman-eb94467780eab06a452586c9751fc4f571d9e089.tar.bz2 podman-eb94467780eab06a452586c9751fc4f571d9e089.zip |
Support checkpoint/restore with pods
This adds support to checkpoint containers out of pods and restore
container into pods.
It is only possible to restore a container into a pod if it has been
checkpointed out of pod. It is also not possible to restore a non pod
container into a pod.
The main reason this does not work is the PID namespace. If a non pod
container is being restored in a pod with a shared PID namespace, at
least one process in the restored container uses PID 1 which is already
in use by the infrastructure container. If someone tries to restore
container from a pod with a shared PID namespace without a shared PID
namespace it will also fail because the resulting PID namespace will not
have a PID 1.
Signed-off-by: Adrian Reber <areber@redhat.com>
Diffstat (limited to 'pkg/bindings')
-rw-r--r-- | pkg/bindings/containers/types.go | 1 | ||||
-rw-r--r-- | pkg/bindings/containers/types_restore_options.go | 16 |
2 files changed, 17 insertions, 0 deletions
diff --git a/pkg/bindings/containers/types.go b/pkg/bindings/containers/types.go index 1058c7a48..b74a938d1 100644 --- a/pkg/bindings/containers/types.go +++ b/pkg/bindings/containers/types.go @@ -62,6 +62,7 @@ type RestoreOptions struct { Keep *bool Name *string TCPEstablished *bool + Pod *string } //go:generate go run ../generator/generator.go CreateOptions diff --git a/pkg/bindings/containers/types_restore_options.go b/pkg/bindings/containers/types_restore_options.go index ea6c810a2..820a7696f 100644 --- a/pkg/bindings/containers/types_restore_options.go +++ b/pkg/bindings/containers/types_restore_options.go @@ -131,3 +131,19 @@ func (o *RestoreOptions) GetTCPEstablished() bool { } return *o.TCPEstablished } + +// WithPod +func (o *RestoreOptions) WithPod(value string) *RestoreOptions { + v := &value + o.Pod = v + return o +} + +// GetPod +func (o *RestoreOptions) GetPod() string { + var pod string + if o.Pod == nil { + return pod + } + return *o.Pod +} |