Commit c4c606b
authored
Bridge: load config from string (env var or cli flag) (#999)
## 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.2 files changed
+45
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
126 | 132 | | |
127 | | - | |
128 | | - | |
| 133 | + | |
| 134 | + | |
129 | 135 | | |
130 | | - | |
131 | | - | |
132 | | - | |
| 136 | + | |
| 137 | + | |
133 | 138 | | |
134 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
135 | 142 | | |
136 | 143 | | |
137 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
151 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
152 | 159 | | |
153 | 160 | | |
154 | 161 | | |
155 | 162 | | |
156 | 163 | | |
157 | 164 | | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
| 165 | + | |
163 | 166 | | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
171 | 189 | | |
172 | 190 | | |
173 | 191 | | |
| |||
0 commit comments