mirror of
https://github.com/containers/podman.git
synced 2025-08-06 11:32:07 +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:
@ -164,8 +164,7 @@ func (p *Pod) PidMode() string {
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
conf := infra.Config()
|
||||
ctrSpec := conf.Spec
|
||||
ctrSpec := infra.config.Spec
|
||||
if ctrSpec != nil && ctrSpec.Linux != nil {
|
||||
for _, ns := range ctrSpec.Linux.Namespaces {
|
||||
if ns.Type == specs.PIDNamespace {
|
||||
@ -186,8 +185,7 @@ func (p *Pod) UserNSMode() string {
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
conf := infra.Config()
|
||||
ctrSpec := conf.Spec
|
||||
ctrSpec := infra.config.Spec
|
||||
if ctrSpec != nil && ctrSpec.Linux != nil {
|
||||
for _, ns := range ctrSpec.Linux.Namespaces {
|
||||
if ns.Type == specs.UserNamespace {
|
||||
|
Reference in New Issue
Block a user