Commit 52f398e7 by Marcus Efraimsson

cloudwatch: return a distinct list of regions

parent 518e485e
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment