Skip to content

fix: LIMA_SHELLENV_ALLOW doesn't remove variables#4827

Closed
mikerhodes wants to merge 1 commit into
lima-vm:masterfrom
mikerhodes:fix/4826-LIMA_SHELLENV_ALLOW-behavior
Closed

fix: LIMA_SHELLENV_ALLOW doesn't remove variables#4827
mikerhodes wants to merge 1 commit into
lima-vm:masterfrom
mikerhodes:fix/4826-LIMA_SHELLENV_ALLOW-behavior

Conversation

@mikerhodes
Copy link
Copy Markdown

When LIMA_SHELLENV_ALLOW was set, limactl shell --preserve-env didn't remove environment variables that were not on the list specified by LIMA_SHELLENV_ALLOW. This didn't match the documented behavior.

This commit updates the code to filter out all variables not on the allowlist, if the allowlist is configured.

Fix the associated test to match the expected behavior.

Fixes #4826.

When LIMA_SHELLENV_ALLOW was set, limactl shell --preserve-env didn't
remove environment variables not on the list specified by
LIMA_SHELLENV_ALLOW. This didn't match the documented behavior.

This commit updates the code to filter out all variables not on
the allowlist, if the allowlist is configured.

Fix the associated test to match the expected behavior.

Fixes lima-vm#4826.

Signed-off-by: Mike Rhodes <mike.rhodes@gmail.com>
Copy link
Copy Markdown
Member

@jandubois jandubois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I've commented in #4826 (comment), it is unfortunately the documentation, that is out-of-date, and not the code.

We should change the documentation to match the intent of the feature.

Sorry for wasting your time on the code change! 😞

@mikerhodes
Copy link
Copy Markdown
Author

Ach, no problem! Closing.

@mikerhodes mikerhodes closed this Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LIMA_SHELLENV_ALLOW doesn't remove environment variables not in the list

2 participants