Skip to content

Commit

Permalink
internal/config: make feature flags optional
Browse files Browse the repository at this point in the history
The community clowdenv doesn't have feature flag support, so don't crash
if it's nil.
  • Loading branch information
croissanne authored and ezr-ondrej committed Jan 17, 2025
1 parent 9e0a236 commit 8bdd9bc
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions internal/config/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,17 @@ func LoadConfigFromEnv(conf *ImageBuilderConfig) error {
}

// feature flags
conf.UnleashURL = fmt.Sprintf(
"%s://%s:%d/api",
clowder.LoadedConfig.FeatureFlags.Scheme,
clowder.LoadedConfig.FeatureFlags.Hostname,
clowder.LoadedConfig.FeatureFlags.Port,
)
if clowder.LoadedConfig.FeatureFlags.ClientAccessToken != nil {
conf.UnleashToken = *clowder.LoadedConfig.FeatureFlags.ClientAccessToken
if clowder.LoadedConfig.FeatureFlags != nil {
conf.UnleashURL = fmt.Sprintf(
"%s://%s:%d/api",
clowder.LoadedConfig.FeatureFlags.Scheme,
clowder.LoadedConfig.FeatureFlags.Hostname,
clowder.LoadedConfig.FeatureFlags.Port,
)
if clowder.LoadedConfig.FeatureFlags.ClientAccessToken != nil {
conf.UnleashToken = *clowder.LoadedConfig.FeatureFlags.ClientAccessToken
}
}

}

return nil
Expand Down

0 comments on commit 8bdd9bc

Please sign in to comment.