mirror of
https://github.com/containers/podman
synced 2024-10-21 17:53:44 +00:00
libpod: container create: init variable: do not deep copy spec
Do not create an expensive deep copy for the provided spec.Spec when creating a container. No API should be expected to create deep copies of arguments unless explicitly documented. This removes the last call to JSONDeepCopy in a simple `podman run --rm -d busybox true`. [NO TESTS NEEDED] Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
parent
5ea369adef
commit
ccff77025c
|
@ -193,10 +193,7 @@ func (r *Runtime) initContainerVariables(rSpec *spec.Spec, config *ContainerConf
|
|||
ctr.config.LogPath = ""
|
||||
}
|
||||
|
||||
ctr.config.Spec = new(spec.Spec)
|
||||
if err := JSONDeepCopy(rSpec, ctr.config.Spec); err != nil {
|
||||
return nil, errors.Wrapf(err, "error copying runtime spec while creating container")
|
||||
}
|
||||
ctr.config.Spec = rSpec
|
||||
ctr.config.CreatedTime = time.Now()
|
||||
|
||||
ctr.state.BindMounts = make(map[string]string)
|
||||
|
|
Loading…
Reference in a new issue