Test PERSISTENCE env vars#195
Merged
anisaoshafi merged 4 commits intomainfrom Apr 27, 2026
Merged
Conversation
3a62f31 to
4077b74
Compare
| envVars := containerEnvToMap(inspect.Config.Env) | ||
| assert.Equal(t, "1", envVars["PERSISTENCE"]) | ||
| } | ||
|
|
Collaborator
There was a problem hiding this comment.
praise: good call adding a test to make sure we can enable persistence from config
| strings.HasPrefix(e, "PERSISTENCE=") || | ||
| strings.HasPrefix(e, "SNAPSHOT_SAVE_STRATEGY=") || | ||
| strings.HasPrefix(e, "SNAPSHOT_LOAD_STRATEGY=") || | ||
| strings.HasPrefix(e, "SNAPSHOT_FLUSH_INTERVAL=") { |
Collaborator
There was a problem hiding this comment.
issue: I'm not convinced we should explicitly forward PERSISTENCE (and the other vars here).
- We should already forward all vars prefixed with
LOCALSTACK_soLOCALSTACK_PERSISTENCE=1should work without code changes (maybe worth adding an integration test) - We can also set
PERSISTENCE=1inconfig.toml(and you've added a test for it)
Isn't this enough? My concern is that it does not really scale to whitelist env vars and we also don't want to blindly forward all vars in the env because it can contain secrets or other unrelated vars.
Contributor
Author
There was a problem hiding this comment.
Good point, I will take a look and adjust this 🏃🏼
Contributor
Author
There was a problem hiding this comment.
The PR is now just a couple of tests since these configurations were already supported - thanks for poining that out. Feel free to take another look.
4077b74 to
8069e2a
Compare
e2ecf79 to
1a7e11c
Compare
carole-lavillonniere
approved these changes
Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Persistence and related snapshot configuration vars may be passed in host env prefixed with LOCALSTACK* or through config.toml env vars.
This PR adds a couple of related tests.