Skip to content

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

Merged
caarlos0 merged 1 commit intocaarlos0:mainfrom
oxzi:no-env-bleed-not-merge
Dec 20, 2024
Merged

Options.Environment: Do not merge with default env#353
caarlos0 merged 1 commit intocaarlos0:mainfrom
oxzi:no-env-bleed-not-merge

Conversation

@oxzi
Copy link
Copy Markdown
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
Copy Markdown
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