mirror of
https://github.com/containers/podman.git
synced 2025-08-06 03:19:52 +08:00
Remove ulele/deepcopier in favor of JSON deep copy
We have a very high performance JSON library that doesn't need to perform code generation. Let's use it instead of our questionably performant, reflection-dependent deep copy library. Most changes because some functions can now return errors. Also converts cmd/podman to use jsoniter, instead of pkg/json, for increased performance. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
This commit is contained in:
@ -19,7 +19,6 @@ import (
|
||||
opentracing "github.com/opentracing/opentracing-go"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/ulule/deepcopier"
|
||||
)
|
||||
|
||||
// CtrRemoveTimeout is the default number of seconds to wait after stopping a container
|
||||
@ -63,7 +62,9 @@ func (r *Runtime) newContainer(ctx context.Context, rSpec *spec.Spec, options ..
|
||||
ctr.config.ID = stringid.GenerateNonCryptoID()
|
||||
|
||||
ctr.config.Spec = new(spec.Spec)
|
||||
deepcopier.Copy(rSpec).To(ctr.config.Spec)
|
||||
if err := JSONDeepCopy(rSpec, ctr.config.Spec); err != nil {
|
||||
return nil, errors.Wrapf(err, "error copying runtime spec while creating container")
|
||||
}
|
||||
ctr.config.CreatedTime = time.Now()
|
||||
|
||||
ctr.config.ShmSize = DefaultShmSize
|
||||
|
Reference in New Issue
Block a user