summaryrefslogtreecommitdiff
path: root/libpod/container_copy_linux.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2021-09-28 17:01:22 +0200
committerValentin Rothberg <rothberg@redhat.com>2021-09-28 17:18:02 +0200
commit5d6ea90e756cd48c90d9549d25c0150c9bb5c50c (patch)
treeffe239b2f0456df0489bf99dfc9d6399bb8b3561 /libpod/container_copy_linux.go
parent381ab48c2586a96932701a1fe270ebd2c32a04d4 (diff)
downloadpodman-5d6ea90e756cd48c90d9549d25c0150c9bb5c50c.tar.gz
podman-5d6ea90e756cd48c90d9549d25c0150c9bb5c50c.tar.bz2
podman-5d6ea90e756cd48c90d9549d25c0150c9bb5c50c.zip
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>
Diffstat (limited to 'libpod/container_copy_linux.go')
-rw-r--r--libpod/container_copy_linux.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/libpod/container_copy_linux.go b/libpod/container_copy_linux.go
index a35824289..7d4dd0d46 100644
--- a/libpod/container_copy_linux.go
+++ b/libpod/container_copy_linux.go
@@ -174,7 +174,7 @@ func (c *Container) copyToArchive(ctx context.Context, path string, writer io.Wr
// getContainerUser returns the specs.User and ID mappings of the container.
func getContainerUser(container *Container, mountPoint string) (specs.User, error) {
- userspec := container.Config().User
+ userspec := container.config.User
uid, gid, _, err := chrootuser.GetUser(mountPoint, userspec)
u := specs.User{