Skip to content
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

Options.Environment: Do not merge with default env #353

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

oxzi
Copy link
Contributor

@oxzi oxzi commented Dec 18, 2024

The commit 6f3a5c0 from PR #349, merged between the last two releases, changed the parsing logic for Options, especially allowing to merge map types. While this was already the case for Options.FuncMap, this breaks the API promise of Options.Environment to set "[e]nvironment keys and values that will be accessible for the service". In particular, this allowed an environment bleed while explicitly setting a custom environment, e.g., for testing purposes.

This change reverts merging a custom Options.Environment with the default environment, if set.

The commit 6f3a5c0 from PR caarlos0#349, merged
between the last two releases, changed the parsing logic for Options,
especially allowing to merge map types. While this was already the case
for Options.FuncMap, this breaks the API promise of Options.Environment
to set "[e]nvironment keys and values that will be accessible for the
service". In particular, this allowed an environment bleed while
explicitly setting a custom environment, e.g., for testing purposes.

This change reverts merging a custom Options.Environment with the
default environment, if set.
@caarlos0
Copy link
Owner

oh, good catch! thanks! gonna release this asap :)

@oxzi oxzi deleted the no-env-bleed-not-merge branch December 27, 2024 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants