ContainerEngine.SetupRootless(): Avoid calling container.Config()

This is a very expensive call as it deep duplicates the Config, and
we just need to read a single member, so use ConfigNoCopy() instead.

[NO NEW TESTS NEEDED] Just minor performance effects

Signed-off-by: Alexander Larsson <alexl@redhat.com>
This commit is contained in:
Alexander Larsson
2022-10-12 10:33:24 +02:00
parent 03c5f9d02f
commit d08b4c1339

View File

@ -136,7 +136,7 @@ func (ic *ContainerEngine) SetupRootless(_ context.Context, noMoveProcess bool)
paths := []string{} paths := []string{}
for _, ctr := range ctrs { for _, ctr := range ctrs {
paths = append(paths, ctr.Config().ConmonPidFile) paths = append(paths, ctr.ConfigNoCopy().ConmonPidFile)
} }
if len(paths) > 0 { if len(paths) > 0 {