Azure: get custom cloud list from grafana-azure-sdk-go package (#86717)

* Get custom cloud list from grafana-azure-sdk-go for frontend settings

* Remove getAzureClouds() and call CustomClouds() directly

* remove unused type
pull/87224/head
Jon Cole 1 year ago committed by GitHub
parent 5e4722fe2e
commit 8e96821c16
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 12
      pkg/api/dtos/frontend_settings.go
  2. 1
      pkg/api/frontendsettings.go

@ -1,6 +1,7 @@
package dtos
import (
"github.com/grafana/grafana-azure-sdk-go/v2/azsettings"
"github.com/grafana/grafana/pkg/plugins"
"github.com/grafana/grafana/pkg/setting"
)
@ -65,11 +66,12 @@ type FrontendSettingsLicenseInfoDTO struct {
}
type FrontendSettingsAzureDTO struct {
Cloud string `json:"cloud"`
ManagedIdentityEnabled bool `json:"managedIdentityEnabled"`
WorkloadIdentityEnabled bool `json:"workloadIdentityEnabled"`
UserIdentityEnabled bool `json:"userIdentityEnabled"`
UserIdentityFallbackCredentialsEnabled bool `json:"userIdentityFallbackCredentialsEnabled"`
Cloud string `json:"cloud"`
Clouds []azsettings.AzureCloudInfo `json:"clouds"`
ManagedIdentityEnabled bool `json:"managedIdentityEnabled"`
WorkloadIdentityEnabled bool `json:"workloadIdentityEnabled"`
UserIdentityEnabled bool `json:"userIdentityEnabled"`
UserIdentityFallbackCredentialsEnabled bool `json:"userIdentityFallbackCredentialsEnabled"`
}
type FrontendSettingsCachingDTO struct {

@ -270,6 +270,7 @@ func (hs *HTTPServer) getFrontendSettings(c *contextmodel.ReqContext) (*dtos.Fro
Azure: dtos.FrontendSettingsAzureDTO{
Cloud: hs.Cfg.Azure.Cloud,
Clouds: hs.Cfg.Azure.CustomClouds(),
ManagedIdentityEnabled: hs.Cfg.Azure.ManagedIdentityEnabled,
WorkloadIdentityEnabled: hs.Cfg.Azure.WorkloadIdentityEnabled,
UserIdentityEnabled: hs.Cfg.Azure.UserIdentityEnabled,

Loading…
Cancel
Save