Skip to content

Directory mapping allows conflicting environment variables #3

@DBX12

Description

@DBX12

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions