8000 deprecate env vars without prefix in CLI by alexrashed · Pull Request #11810 · localstack/localstack · GitHub
[go: up one dir, main page]

Skip to content

deprecate env vars without prefix in CLI #11810

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 20, 2024

Conversation

alexrashed
Copy link
Member
@alexrashed alexrashed commented Nov 7, 2024

Motivation

As announced in #11803, with LocalStack 4.0 we are deprecating the usage of non-prefixed environment variables in the CLI:

The LocalStack CLI is closely integrated with the runtime and needs to be able to determine which environment variables it should pass from the user's environment to the Docker container. This requirement restricts the CLI’s compatibility with new environment variables introduced in later LocalStack versions, often leading to issues that are challenging to debug. Using a well-known prefix (LOCALSTACK_) will enable forwards-compatibility for newer configuration options. To enhance flexibility, users are encouraged to use a variable prefix (LOCALSTACK_) for more straightforward management of environment variables across different versions.

This PR adds a deprecation warning to inform users about this change.

Changes

  • Add a warning if a non-prefixed environment variable is loaded to be forwarded to the runtime container.
  • Loads the env var "LOG" if "LS_LOG" is not present to allow setting "LOCALSTACK_LOG" instead of "LOCALSTACK_LS_LOG" in Docker mode.

TODO

  • Add prefix for environment variables defined in a profile.
  • Check where the best place to show the warning is.
    • Unfortunately, the place for the warning right now isn't the best, but we can properly separate this in upcoming iterations.

@alexrashed alexrashed added area: cli LocalStack CLI semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases labels Nov 7, 2024
@alexrashed alexrashed added this to the 4.0 milestone Nov 7, 2024
@alexrashed alexrashed self-assigned this Nov 7, 2024
Copy link
github-actions bot commented Nov 7, 2024

S3 Image Test Results (AMD64 / ARM64)

  2 files    2 suites   4m 11s ⏱️
421 tests 369 ✅  52 💤 0 ❌
842 runs  738 ✅ 104 💤 0 ❌

Results for commit ff88024.

♻️ This comment has been updated with latest results.

Copy link
github-actions bot commented Nov 7, 2024

LocalStack Community integration with Pro

    2 files  ±0      2 suites  ±0   1h 43m 23s ⏱️ - 2m 10s
3 552 tests ±0  3 145 ✅ ±0  407 💤 ±0  0 ❌ ±0 
3 554 runs  ±0  3 145 ✅ ±0  409 💤 ±0  0 ❌ ±0 

Results for commit ff88024. ± Comparison against base commit bf691b3.

♻️ This comment has been updated with latest results.

@alexrashed alexrashed force-pushed the deprecate-cli-non-prefixed-env branch from 6e17a60 to 2d5776f Compare November 19, 2024 11:28
@alexrashed alexrashed force-pushed the deprecate-cli-non-prefixed-env branch from 2d5776f to f52532f Compare November 19, 2024 12:45
@alexrashed alexrashed marked this pull request as ready for review November 19, 2024 14:22
@alexrashed alexrashed force-pushed the deprecate-cli-non-prefixed-env branch from a7666fa to ff88024 Compare November 19, 2024 15:29
@alexrashed alexrashed added semver: patch Non-breaking changes which can be included in patch releases and removed semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases labels Nov 19, 2024
Copy link
Member
@thrau thrau left a comment

Choose a reason for hiding this comment

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

LGTM!

@alexrashed alexrashed merged commit 86a8a8b into master Nov 20, 2024
42 checks passed
@alexrashed alexrashed deleted the deprecate-cli-non-prefixed-env branch November 20, 2024 06:24
@kapsiR kapsiR mentioned this pull request Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: cli LocalStack CLI semver: patch Non-breaking changes which can be included in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0