mirror of
https://github.com/containers/podman.git
synced 2025-06-28 14:29:04 +08:00
libpod: do not call (*container).Spec()
Access the container's spec field directly inside of libpod instead of calling Spec() which in turn creates expensive JSON deep copies. Accessing the field directly drops memory consumption of a simple podman run --rm busybox true from ~700kB to ~600kB. [NO TESTS NEEDED] Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
@ -424,7 +424,7 @@ func containerToV1Container(ctx context.Context, c *Container) (v1.Container, []
|
||||
// NOTE: a privileged container mounts all of /dev/*.
|
||||
if !c.Privileged() && len(c.config.Spec.Linux.Devices) > 0 {
|
||||
// TODO Enable when we can support devices and their names
|
||||
kubeContainer.VolumeDevices = generateKubeVolumeDeviceFromLinuxDevice(c.Spec().Linux.Devices)
|
||||
kubeContainer.VolumeDevices = generateKubeVolumeDeviceFromLinuxDevice(c.config.Spec.Linux.Devices)
|
||||
return kubeContainer, kubeVolumes, nil, errors.Wrapf(define.ErrNotImplemented, "linux devices")
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user