summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-04-12 09:38:48 -0700
committerGitHub <noreply@github.com>2019-04-12 09:38:48 -0700
commit61fa40b25679f864db5b5b375d512a9f1264e31f (patch)
tree8986c1a4718a34129393fed8a2cfb21864b93d21
parent6ddc67c694dc60641606955364fe23b1c38406ac (diff)
parentf7951c8776cea5eeddd8838ac6a4f41f518032fd (diff)
downloadpodman-61fa40b25679f864db5b5b375d512a9f1264e31f.tar.gz
podman-61fa40b25679f864db5b5b375d512a9f1264e31f.tar.bz2
podman-61fa40b25679f864db5b5b375d512a9f1264e31f.zip
Merge pull request #2913 from mheon/get_instead_of_lookup
Use GetContainer instead of LookupContainer for full ID
-rw-r--r--libpod/container.go2
-rw-r--r--libpod/container_internal.go2
-rw-r--r--libpod/kube.go2
-rw-r--r--libpod/runtime_ctr.go10
4 files changed, 3 insertions, 13 deletions
diff --git a/libpod/container.go b/libpod/container.go
index de4674222..4bf9a1ba9 100644
--- a/libpod/container.go
+++ b/libpod/container.go
@@ -614,7 +614,7 @@ func (c *Container) NewNetNS() bool {
func (c *Container) PortMappings() ([]ocicni.PortMapping, error) {
// First check if the container belongs to a network namespace (like a pod)
if len(c.config.NetNsCtr) > 0 {
- netNsCtr, err := c.runtime.LookupContainer(c.config.NetNsCtr)
+ netNsCtr, err := c.runtime.GetContainer(c.config.NetNsCtr)
if err != nil {
return nil, errors.Wrapf(err, "unable to lookup network namespace for container %s", c.ID())
}
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index 36b5e01df..aa6448f4a 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -676,7 +676,7 @@ func (c *Container) getAllDependencies(visited map[string]*Container) error {
}
for _, depID := range depIDs {
if _, ok := visited[depID]; !ok {
- dep, err := c.runtime.state.LookupContainer(depID)
+ dep, err := c.runtime.state.Container(depID)
if err != nil {
return err
}
diff --git a/libpod/kube.go b/libpod/kube.go
index 484127870..260269b2e 100644
--- a/libpod/kube.go
+++ b/libpod/kube.go
@@ -69,7 +69,7 @@ func (p *Pod) getInfraContainer() (*Container, error) {
if err != nil {
return nil, err
}
- return p.runtime.LookupContainer(infraID)
+ return p.runtime.GetContainer(infraID)
}
// GenerateKubeServiceFromV1Pod creates a v1 service object from a v1 pod object
diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go
index 85b860268..48c254c0f 100644
--- a/libpod/runtime_ctr.go
+++ b/libpod/runtime_ctr.go
@@ -548,16 +548,6 @@ func (r *Runtime) GetLatestContainer() (*Container, error) {
return ctrs[lastCreatedIndex], nil
}
-// Export is the libpod portion of exporting a container to a tar file
-func (r *Runtime) Export(name string, path string) error {
- ctr, err := r.LookupContainer(name)
- if err != nil {
- return err
- }
- return ctr.Export(path)
-
-}
-
// RemoveContainersFromStorage attempt to remove containers from storage that do not exist in libpod database
func (r *Runtime) RemoveContainersFromStorage(ctrs []string) {
for _, i := range ctrs {