diff options
author | Matthew Heon <matthew.heon@pm.me> | 2019-05-21 16:42:41 -0400 |
---|---|---|
committer | Matthew Heon <mcs@bellerophon.lldp.net> | 2019-06-03 15:54:53 -0400 |
commit | 1be345bd9d82ac64d7ae3ceea41f72329f7bdebf (patch) | |
tree | 6339a03fd92edb07e694fd43c690c82a3b8ee006 /libpod/container_api.go | |
parent | 7c465d4d9738f25546d61b915d63bf8fff0ed14d (diff) | |
download | podman-1be345bd9d82ac64d7ae3ceea41f72329f7bdebf.tar.gz podman-1be345bd9d82ac64d7ae3ceea41f72329f7bdebf.tar.bz2 podman-1be345bd9d82ac64d7ae3ceea41f72329f7bdebf.zip |
Begin to break up pkg/inspect
Let's put inspect structs where they're actually being used. We
originally made pkg/inspect to solve circular import issues.
There are no more circular import issues.
Image structs remain for now, I'm focusing on container inspect.
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'libpod/container_api.go')
-rw-r--r-- | libpod/container_api.go | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/libpod/container_api.go b/libpod/container_api.go index eff5bfe5f..60333104e 100644 --- a/libpod/container_api.go +++ b/libpod/container_api.go @@ -10,9 +10,7 @@ import ( "sync" "time" - "github.com/containers/libpod/libpod/driver" "github.com/containers/libpod/libpod/events" - "github.com/containers/libpod/pkg/inspect" "github.com/containers/libpod/pkg/lookup" "github.com/containers/storage/pkg/stringid" "github.com/docker/docker/oci/caps" @@ -535,32 +533,6 @@ func (c *Container) RemoveArtifact(name string) error { return os.Remove(c.getArtifactPath(name)) } -// Inspect a container for low-level information -func (c *Container) Inspect(size bool) (*inspect.ContainerInspectData, error) { - if !c.batched { - c.lock.Lock() - defer c.lock.Unlock() - - if err := c.syncContainer(); err != nil { - return nil, err - } - } - - storeCtr, err := c.runtime.store.Container(c.ID()) - if err != nil { - return nil, errors.Wrapf(err, "error getting container from store %q", c.ID()) - } - layer, err := c.runtime.store.Layer(storeCtr.LayerID) - if err != nil { - return nil, errors.Wrapf(err, "error reading information about layer %q", storeCtr.LayerID) - } - driverData, err := driver.GetDriverData(c.runtime.store, layer.ID) - if err != nil { - return nil, errors.Wrapf(err, "error getting graph driver info %q", c.ID()) - } - return c.getContainerInspectData(size, driverData) -} - // Wait blocks until the container exits and returns its exit code. func (c *Container) Wait() (int32, error) { return c.WaitWithInterval(DefaultWaitInterval) |