Skip to content

Commit

Permalink
Add support for a default config file (#64)
Browse files Browse the repository at this point in the history
* Add support for a default config file

We want to be able to set config without making mist changes and also without cycling pods which is required for environment variable changes. This way we can add the config file via our existing mechanism to running pods and uploader will pick it up automatically

* remove unnecessary nil check

Co-authored-by: Victor Elias <[email protected]>

---------

Co-authored-by: Victor Elias <[email protected]>
  • Loading branch information
mjh1 and victorges authored Jun 28, 2024
1 parent 790e8a0 commit 541cfaf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion catalyst-uploader.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ func run() int {
timeout := fs.Duration("t", 30*time.Second, "Upload timeout")
storageFallbackURLs := CommaMapFlag(fs, "storage-fallback-urls", `Comma-separated map of primary to backup storage URLs. If a file fails uploading to one of the primary storages (detected by prefix), it will fallback to the corresponding backup URL after having the prefix replaced`)

_ = fs.String("config", "", "config file (optional)")
defaultConfigFile := "/etc/livepeer/catalyst_uploader.conf"
if _, err := os.Stat(defaultConfigFile); os.IsNotExist(err) {
defaultConfigFile = ""
}
_ = fs.String("config", defaultConfigFile, "config file (optional)")

err = ff.Parse(fs, os.Args[1:],
ff.WithConfigFileFlag("config"),
Expand Down

0 comments on commit 541cfaf

Please sign in to comment.