From 958759a71955860b01b17bd3bebf38f9dae1018e Mon Sep 17 00:00:00 2001 From: cdoern Date: Fri, 13 May 2022 10:52:57 -0400 Subject: podman pod clone implement podman pod clone, a command to create an exact copy of a pod while changing certain config elements current supported flags are: --name change the pod name --destroy remove the original pod --start run the new pod on creation and all infra-container related flags from podman pod create (namespaces etc) resolves #12843 Signed-off-by: cdoern --- libpod/pod.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'libpod') diff --git a/libpod/pod.go b/libpod/pod.go index 108317637..2502c41a9 100644 --- a/libpod/pod.go +++ b/libpod/pod.go @@ -450,3 +450,14 @@ func (p *Pod) initContainers() ([]*Container, error) { } return initCons, nil } + +func (p *Pod) Config() (*PodConfig, error) { + p.lock.Lock() + defer p.lock.Unlock() + + conf := &PodConfig{} + + err := JSONDeepCopy(p.config, conf) + + return conf, err +} -- cgit v1.2.3-54-g00ecf