Skip to content

Commit

Permalink
Merge pull request #173 from grafana/andreas/fix-settings-config
Browse files Browse the repository at this point in the history
Fix settings config
  • Loading branch information
aangelisc authored Sep 5, 2024
2 parents 7e14ab0 + dc5d2b5 commit a023552
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## v2.1.2

- Dependency updates
- Fix bug where `AzureAuthEnabled` setting was not correctly picked up from context

## v2.1.1

- Dependency updates
Expand Down
6 changes: 5 additions & 1 deletion azsettings/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,22 @@ func ReadFromContext(ctx context.Context) (*AzureSettings, bool) {
return settings, false
}

hasSettings := false
if v := cfg.Get(AzureAuthEnabled); v == strconv.FormatBool(true) {
settings.AzureAuthEnabled = true
hasSettings = true
}

if customCloudsJSON := cfg.Get(AzureCustomCloudsConfig); customCloudsJSON != "" {
// this method will parse the JSON and set the custom cloud list in one go
if err := settings.SetCustomClouds(customCloudsJSON); err != nil {
backend.Logger.Error("Error setting custom clouds: %w", err)
}
if settings.CustomCloudListJSON != "" {
hasSettings = true
}
}

hasSettings := false
if v := cfg.Get(AzureCloud); v != "" {
settings.Cloud = v
hasSettings = true
Expand Down

0 comments on commit a023552

Please sign in to comment.