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

Bridge: load config from string (env var or cli flag) #999

Merged
merged 1 commit into from
Jul 10, 2023

Conversation

svix-onelson
Copy link
Contributor

@svix-onelson svix-onelson commented Jul 10, 2023

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!

  • Use --cfg to pass config as string
  • Use --cfg-file to read from file, non-default loction

Additionally, 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.

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!

- Use `--cfg` to pass config as string
- Use `--cfg-file` to read from file, non-default loction

Additionally, 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.
@svix-onelson svix-onelson merged commit c4c606b into main Jul 10, 2023
3 checks passed
@svix-onelson svix-onelson deleted the onelson/config-from-env branch July 10, 2023 22:56
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

Successfully merging this pull request may close these issues.

2 participants