Skip to content

Feature request: Support for NATS_CONTEXTS_PATHS #1661

Description

@mathroc

Proposed change

when set Nats would also look in those folders when listing/selecting contexts, and stop looking into ~/.config/nats/context/. it can be added to NATS_CONTEXTS_PATHS if needed

contexts with conflicting name will be resolved by priority, first folder in the list wins

multiple folders can be specified by separating them with colons (à la $PATH)

Use case

I have 2 use cases for this:

  • in dev, I want to have per-project contexts, so I could set this variable in .envrc. so whenever I go to a different project natscli would have a the appropriate contexts ready ( Feature request: Support for NATS_CURRENT_CONTEXT_PATH #1660 would complements this well bu making it possible to also save the current context in a per-project location)
  • on test environments deployed via kubernetes, some pods have a volume mounted at ~/.config so the pod can't be pre-populated with predefined contexts as the volums overrides ~/.config/nats/

Contribution

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalEnhancement idea or proposal

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions