mirror of
https://github.com/containers/podman.git
synced 2025-07-31 12:22:29 +08:00
libpod: do not call (*container).Config()
Access the container's config field directly inside of libpod instead of calling `Config()` which in turn creates expensive JSON deep copies. Accessing the field directly drops memory consumption of a simple `podman run --rm busybox true` from 1245kB to 410kB. [NO TESTS NEEDED] Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
@ -1150,7 +1150,7 @@ func (r *ConmonOCIRuntime) createOCIContainer(ctr *Container, restoreOptions *Co
|
||||
|
||||
if ctr.config.NetMode.IsSlirp4netns() || rootless.IsRootless() {
|
||||
if ctr.config.PostConfigureNetNS {
|
||||
havePortMapping := len(ctr.Config().PortMappings) > 0
|
||||
havePortMapping := len(ctr.config.PortMappings) > 0
|
||||
if havePortMapping {
|
||||
ctr.rootlessPortSyncR, ctr.rootlessPortSyncW, err = os.Pipe()
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user