summaryrefslogtreecommitdiff
path: root/libpod/state_test.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2021-04-13 13:46:44 -0400
committerMatthew Heon <matthew.heon@pm.me>2021-04-13 14:00:38 -0400
commit40e5ae30d59f070874322a523c800e57a0ee8825 (patch)
tree4e15ba3f3d3631a36f6c69c09a75ed1a52d6fd76 /libpod/state_test.go
parent21d6b12689cc38823fef3772327990f9692d4379 (diff)
downloadpodman-40e5ae30d59f070874322a523c800e57a0ee8825.tar.gz
podman-40e5ae30d59f070874322a523c800e57a0ee8825.tar.bz2
podman-40e5ae30d59f070874322a523c800e57a0ee8825.zip
Remove in-memory state implementation
We originally added this in the *very early* days of Podman, before a proper persistent state was written, so we had something to test with. It was retained after the original SQLite state (and current BoltDB state) were written so it could be used for testing Libpod in unit tests with no requirement for on-disk storage. Well, such unit tests never materialized, and if we were to write some now the requirement to have a temporary directory for storing data on disk is not that bad. I can basically guarantee there are no users of this in the wild because, even if you managed to figure out how to configure it when we don't document it, it's completely unusable with Podman since all your containers and pods will disappear every time Podman exits. Given all this, and since it's an ongoing maintenance burden I no longer wish to deal with, let's just remove it. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'libpod/state_test.go')
-rw-r--r--libpod/state_test.go28
1 files changed, 1 insertions, 27 deletions
diff --git a/libpod/state_test.go b/libpod/state_test.go
index 559c84d1e..4799d7b8d 100644
--- a/libpod/state_test.go
+++ b/libpod/state_test.go
@@ -28,8 +28,7 @@ const (
var (
testedStates = map[string]emptyStateFunc{
- "in-memory": getEmptyInMemoryState,
- "boltdb": getEmptyBoltState,
+ "boltdb": getEmptyBoltState,
}
)
@@ -65,31 +64,6 @@ func getEmptyBoltState() (_ State, _ string, _ lock.Manager, retErr error) {
return state, tmpDir, lockManager, nil
}
-// Get an empty in-memory state for use in tests
-func getEmptyInMemoryState() (_ State, _ string, _ lock.Manager, retErr error) {
- tmpDir, err := ioutil.TempDir("", tmpDirPrefix)
- if err != nil {
- return nil, "", nil, err
- }
- defer func() {
- if retErr != nil {
- os.RemoveAll(tmpDir)
- }
- }()
-
- state, err := NewInMemoryState()
- if err != nil {
- return nil, "", nil, err
- }
-
- lockManager, err := lock.NewInMemoryManager(16)
- if err != nil {
- return nil, "", nil, err
- }
-
- return state, tmpDir, lockManager, nil
-}
-
func runForAllStates(t *testing.T, testFunc func(*testing.T, State, lock.Manager)) {
for stateName, stateFunc := range testedStates {
state, path, manager, err := stateFunc()