mirror of
https://github.com/containers/podman.git
synced 2025-08-06 03:19:52 +08: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:
@ -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)
|
||||
|
Reference in New Issue
Block a user