mirror of
https://github.com/containers/podman.git
synced 2025-06-28 22:53:21 +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:
@ -90,7 +90,7 @@ func (p *Pod) GenerateForKube(ctx context.Context) (*v1.Pod, []v1.ServicePort, e
|
||||
// so set it at here
|
||||
for _, ctr := range allContainers {
|
||||
if !ctr.IsInfra() {
|
||||
switch ctr.Config().RestartPolicy {
|
||||
switch ctr.config.RestartPolicy {
|
||||
case define.RestartPolicyAlways:
|
||||
pod.Spec.RestartPolicy = v1.RestartPolicyAlways
|
||||
case define.RestartPolicyOnFailure:
|
||||
|
Reference in New Issue
Block a user