-
Notifications
You must be signed in to change notification settings - Fork 31
Replace direct viper access with param module calls #2926
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
base: main
Are you sure you want to change the base?
Changes from 3 commits
ae3306b
44c9ba4
180df4e
e299827
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,7 +25,6 @@ import ( | |
|
|
||
| "github.com/pkg/errors" | ||
| log "github.com/sirupsen/logrus" | ||
| "github.com/spf13/viper" | ||
|
|
||
| "github.com/pelicanplatform/pelican/metrics" | ||
| "github.com/pelicanplatform/pelican/param" | ||
|
|
@@ -68,10 +67,14 @@ func CheckDefaults(server server_structs.XRootDServer) error { | |
|
|
||
| if managerHost := param.Xrootd_ManagerHost.GetString(); managerHost == "" { | ||
| log.Debug("No manager host specified for the cmsd process in origin; assuming no xrootd protocol support") | ||
| viper.SetDefault("Origin.EnableCmsd", false) | ||
| if err := param.Set("Origin.EnableCmsd", false); err != nil { | ||
|
||
| log.Warningf("Failed to set Origin.EnableCmsd: %v", err) | ||
| } | ||
| metrics.DeleteComponentHealthStatus("cmsd") | ||
| } else { | ||
| viper.SetDefault("Origin.EnableCmsd", true) | ||
| if err := param.Set("Origin.EnableCmsd", true); err != nil { | ||
| log.Warningf("Failed to set Origin.EnableCmsd: %v", err) | ||
| } | ||
| } | ||
|
|
||
| // TODO: Could upgrade this to a check for a cert in the file... | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use
paraminstead of looking at the environment.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in e299827. Added
Director.MaxMindKeyparameter to docs/parameters.yaml and updated code to useparam.Director_MaxMindKey.GetString()instead ofos.Getenv().