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

Directory mapping allows conflicting environment variables #3

Open
DBX12 opened this issue Nov 21, 2023 · 0 comments
Open

Directory mapping allows conflicting environment variables #3

DBX12 opened this issue Nov 21, 2023 · 0 comments

Comments

@DBX12
Copy link
Owner

DBX12 commented Nov 21, 2023

Actual behavior
If two profiles define the same environment variable and both profiles are loaded, the last profile wins and overwrites the earlier loaded environment variables.

Expected behavior
An error message / warning is shown when one profile overwrites a variable set by another profile during the same load command.

Additional notes

  • The check should only be performed during one load operation (e.g. envManager load profA profB)
  • It is particularly easy to "achieve" this with directory mappings since they are another redirection
  • This condition can probably also be reached via dependencies

How to to reproduce
Config:

storage:
  pass:
    type: pass
profiles:
  profA:
    storage: pass
    path: credA
    constEnv:
      CONST_ENV: i-am-from-profile-A
  profB:
    storage: pass
    path: credB
    constEnv:
      CONST_ENV: i-am-from-profile-B
directoryMapping:
  /tmp:
    - profA
    - profB
  • Run envManager load profA profB and you see CONST_ENV=i-am-from-profile-B. Swap the profile names and you see the value of profile A
  • Run envManager load while in /tmp and see again the value from profile B
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

No branches or pull requests

1 participant