mirror of
https://github.com/grafana/grafana.git
synced 2024-11-23 09:26:43 -06:00
cloudwatch: return a distinct list of regions
This commit is contained in:
parent
518e485e36
commit
52f398e7f7
@ -249,7 +249,18 @@ func (e *CloudWatchExecutor) handleGetRegions(ctx context.Context, parameters *s
|
||||
plog.Error("Failed to get regions", "error", err)
|
||||
} else {
|
||||
for _, region := range r.Regions {
|
||||
regions = append(regions, *region.RegionName)
|
||||
exists := false
|
||||
|
||||
for _, existingRegion := range regions {
|
||||
if existingRegion == *region.RegionName {
|
||||
exists = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if !exists {
|
||||
regions = append(regions, *region.RegionName)
|
||||
}
|
||||
}
|
||||
}
|
||||
sort.Strings(regions)
|
||||
|
Loading…
Reference in New Issue
Block a user