diff options
author | openshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com> | 2021-07-30 15:48:14 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-30 15:48:14 +0000 |
commit | aaf02cfbd41e7d7fbd009a4f01a0fa45b3e49f61 (patch) | |
tree | 997bf585beb9bbfa97878a425b693a40cbc64568 /libpod/runtime_ctr.go | |
parent | 4429c7c713677a304a5ea62eec3cd1524bd2ce3f (diff) | |
parent | 2a484e782a23ad67c98e22121fde2b83b4072d1a (diff) | |
download | podman-aaf02cfbd41e7d7fbd009a4f01a0fa45b3e49f61.tar.gz podman-aaf02cfbd41e7d7fbd009a4f01a0fa45b3e49f61.tar.bz2 podman-aaf02cfbd41e7d7fbd009a4f01a0fa45b3e49f61.zip |
Merge pull request #11075 from flouthoc/ps-filter-network-by-container
ps: support the `container...` notation for `ps --filter network=...`
Diffstat (limited to 'libpod/runtime_ctr.go')
-rw-r--r-- | libpod/runtime_ctr.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go index ce4c5d758..31e2d09ce 100644 --- a/libpod/runtime_ctr.go +++ b/libpod/runtime_ctr.go @@ -894,6 +894,18 @@ func (r *Runtime) LookupContainer(idOrName string) (*Container, error) { return r.state.LookupContainer(idOrName) } +// LookupContainerId looks up a container id by its name or a partial ID +// If a partial ID is not unique, an error will be returned +func (r *Runtime) LookupContainerID(idOrName string) (string, error) { + r.lock.RLock() + defer r.lock.RUnlock() + + if !r.valid { + return "", define.ErrRuntimeStopped + } + return r.state.LookupContainerID(idOrName) +} + // GetContainers retrieves all containers from the state // Filters can be provided which will determine what containers are included in // the output. Multiple filters are handled by ANDing their output, so only |