Skip to content

Commit

Permalink
make Pyroscope override optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofel committed Jan 3, 2024
1 parent 8891d42 commit bbbdfda
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions config/overrides.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,17 @@ func MustConfigOverrideChainlinkVersion(config *ChainlinkImageConfig, target int
}
}

func MustConfigOverridePyroscopeKey(config *PyroscopeConfig, target interface{}) {
if config == nil {
panic("[Pyroscope] must be present")
func MightConfigOverridePyroscopeKey(config *PyroscopeConfig, target interface{}) {
if config == nil || *config.Key == "" {
return
}
if config.Key != nil && *config.Key != "" {
env := make(map[string]string)
env["CL_PYROSCOPE_AUTH_TOKEN"] = *config.Key

if err := mergo.Merge(target, map[string]interface{}{
"env": env,
}, mergo.WithOverride); err != nil {
panic(err)
}
env := make(map[string]string)
env["CL_PYROSCOPE_AUTH_TOKEN"] = *config.Key

if err := mergo.Merge(target, map[string]interface{}{
"env": env,
}, mergo.WithOverride); err != nil {
panic(err)
}
}

0 comments on commit bbbdfda

Please sign in to comment.