Bridge: load config from string (env var or cli flag) #999
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Writing out config data to disk can sometimes be awkward. Users of the Bridge docker image would either need to customize, using the bridge image as a base then add their config file to the fs, or otherwise use a volume mount (or similar).
k8s users have the benefit of config maps, which can be represented as files on disk, but this is not always a good option.
Solution
Allows Bridge to load its config data from a string, which can be supplied as an env var or directly on the cli with
--cfg
.The original flag for specifying an alternative file path to read config data from (formerly
--cfg
or-c
) has been renamed to--cfg-file
.Sorry that's so confusing!
--cfg
to pass config as string--cfg-file
to read from file, non-default loctionAdditionally, a naive "search path" has been provided to look for the default config file using a series of names:
svix-bridge.yaml
svix-bridge.yml
svix-bridge.json
This was done specifically to formalize the fact we're advertising "we accept json config data" in the readme.