summaryrefslogtreecommitdiff
path: root/libpod/in_memory_state.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-01-29 04:59:25 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-02-09 15:01:34 +0000
commit4ecebf20b4e41720b9a0b55e0c22f05061c77e60 (patch)
treec1864f919fe7f4290b190ac2f330d97e466af58b /libpod/in_memory_state.go
parent0920e8de5a08328cceb70617ee04ef177b30d355 (diff)
downloadpodman-4ecebf20b4e41720b9a0b55e0c22f05061c77e60.tar.gz
podman-4ecebf20b4e41720b9a0b55e0c22f05061c77e60.tar.bz2
podman-4ecebf20b4e41720b9a0b55e0c22f05061c77e60.zip
Rework state tests to avoid boilerplate. Begin adding pod tests.
Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #268 Approved by: rhatdan
Diffstat (limited to 'libpod/in_memory_state.go')
-rw-r--r--libpod/in_memory_state.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/libpod/in_memory_state.go b/libpod/in_memory_state.go
index d85ea1399..c057f6804 100644
--- a/libpod/in_memory_state.go
+++ b/libpod/in_memory_state.go
@@ -8,9 +8,9 @@ import (
"github.com/projectatomic/libpod/pkg/registrar"
)
-// TODO: unified name/ID registry to ensure no name and ID conflicts between
-// containers and pods
-// This can probably be used to replace the existing trunc index and registrars
+// TODO: Maybe separate idIndex for pod/containers
+// As of right now, partial IDs used in Lookup... need to be unique as well
+// This may be undesirable?
// An InMemoryState is a purely in-memory state store
type InMemoryState struct {
@@ -486,7 +486,7 @@ func (s *InMemoryState) AddContainerToPod(pod *Pod, ctr *Container) error {
}
// Is the container already in the pod?
- if _, ok := podCtrs[ctr.ID()]; ok {
+ if _, ok = podCtrs[ctr.ID()]; ok {
return errors.Wrapf(ErrCtrExists, "container with ID %s already exists in pod %s", ctr.ID(), pod.ID())
}