From befdb41995ca39a94203413ee2ab5f516e5cf56b Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Wed, 20 Sep 2023 11:01:09 +0200 Subject: [PATCH] libpod: remove unused ContainerState() fucntion First that function claims to deep copy but then actually return the original state so it does not work correctly, given that there are no users just remove it instead of fixing it. Signed-off-by: Paul Holzinger --- libpod/container.go | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/libpod/container.go b/libpod/container.go index d1f0c983c3..966b9e2cc7 100644 --- a/libpod/container.go +++ b/libpod/container.go @@ -1220,23 +1220,6 @@ func (c *Container) HostNetwork() bool { return true } -// ContainerState returns containerstate struct -func (c *Container) ContainerState() (*ContainerState, error) { - if !c.batched { - c.lock.Lock() - defer c.lock.Unlock() - - if err := c.syncContainer(); err != nil { - return nil, err - } - } - returnConfig := new(ContainerState) - if err := JSONDeepCopy(c.state, returnConfig); err != nil { - return nil, fmt.Errorf("copying container %s state: %w", c.ID(), err) - } - return c.state, nil -} - // HasHealthCheck returns bool as to whether there is a health check // defined for the container func (c *Container) HasHealthCheck() bool {