From 52428b546bc44b7f0e0051c64f217fc4774d97b7 Mon Sep 17 00:00:00 2001 From: arshadda Date: Mon, 18 Nov 2024 11:39:25 +0530 Subject: [PATCH] Add Chennai region and zones and update sysTypes --- region.go | 20 +++++++++++++++----- region_test.go | 6 ++++++ 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/region.go b/region.go index d226892..8a5de17 100644 --- a/region.go +++ b/region.go @@ -16,8 +16,6 @@ func GetRegion(zone string) (region string, err error) { region = "sao" case strings.HasPrefix(zone, "us-east"): region = "us-east" - case strings.HasPrefix(zone, "tor"): - region = "tor" case strings.HasPrefix(zone, "eu-de-"): region = "eu-de" case strings.HasPrefix(zone, "lon"): @@ -36,6 +34,8 @@ func GetRegion(zone string) (region string, err error) { region = "wdc" case strings.HasPrefix(zone, "tor"): region = "tor" + case strings.HasPrefix(zone, "che"): + region = "che" default: return "", fmt.Errorf("region not found for the zone, talk to the developer to add the support into the tool: %s", zone) } @@ -95,7 +95,7 @@ var Regions = map[string]Region{ "mad02", "mad04", }, - SysTypes: []string{"s1022"}, + SysTypes: []string{"s1022", "e980"}, VPCZones: []string{"eu-es-1", "eu-es-2", "eu-es-3"}, }, "mon": { @@ -141,7 +141,7 @@ var Regions = map[string]Region{ VPCRegion: "jp-tok", COSRegion: "jp-tok", Zones: []string{"tok04"}, - SysTypes: []string{"s922", "e980"}, + SysTypes: []string{"s922", "e980", "s1022"}, VPCZones: []string{"jp-tok-1", "jp-tok-2", "jp-tok-3"}, }, "tor": { @@ -167,7 +167,7 @@ var Regions = map[string]Region{ Zones: []string{ "us-south", }, - SysTypes: []string{"s922", "e980"}, + SysTypes: []string{"s922", "e980", "e880"}, VPCZones: []string{"us-south-1", "us-south-2", "us-south-3"}, }, "wdc": { @@ -181,6 +181,16 @@ var Regions = map[string]Region{ SysTypes: []string{"s922", "e980"}, VPCZones: []string{"us-east-1", "us-east-2", "us-east-3"}, }, + "che": { + Description: "Chennai, India", + VPCRegion: "", + COSRegion: "", + Zones: []string{ + "che01", + }, + SysTypes: []string{"s922", "e980"}, + VPCZones: []string{}, + }, } // COSRegionForVPCRegion returns the corresponding COS region for the given VPC region diff --git a/region_test.go b/region_test.go index 8bc8a3b..13e1f9b 100644 --- a/region_test.go +++ b/region_test.go @@ -116,6 +116,12 @@ func TestGetRegion(t *testing.T) { "mad", false, }, + { + "Chennai", + args{"che01"}, + "che", + false, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) {