From c57fe5ef8122356f7a90ba666826a5f7b7c88f68 Mon Sep 17 00:00:00 2001 From: Karthik K N Date: Wed, 22 May 2024 14:56:35 +0530 Subject: [PATCH] Avoid importing upstream k8s packages --- go.mod | 2 -- go.sum | 2 -- region.go | 31 ++++++++++--------------------- 3 files changed, 10 insertions(+), 25 deletions(-) diff --git a/go.mod b/go.mod index 1680506..3dfe81a 100644 --- a/go.mod +++ b/go.mod @@ -3,5 +3,3 @@ module github.com/ppc64le-cloud/powervs-utils go 1.21 toolchain go1.21.4 - -require k8s.io/apimachinery v0.29.1 diff --git a/go.sum b/go.sum index 8488d5f..e69de29 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +0,0 @@ -k8s.io/apimachinery v0.29.1 h1:KY4/E6km/wLBguvCZv8cKTeOwwOBqFNjwJIdMkMbbRc= -k8s.io/apimachinery v0.29.1/go.mod h1:6HVkd1FwxIagpYrHSwJlQqZI3G9LfYWRPAkUvLnXTKU= diff --git a/region.go b/region.go index c573fc8..13debb1 100644 --- a/region.go +++ b/region.go @@ -3,8 +3,6 @@ package utils import ( "fmt" "strings" - - "k8s.io/apimachinery/pkg/util/sets" ) func GetRegion(zone string) (region string, err error) { @@ -57,11 +55,11 @@ var Regions = map[string]Region{ Description: "Dallas, USA", VPCRegion: "us-south", COSRegion: "us-south", - Zones: []string{ + Zones: []string{ "dal10", "dal12", }, - SysTypes: []string{"s922", "e980"}, + SysTypes: []string{"s922", "e980"}, }, "eu-de": { Description: "Frankfurt, Germany", @@ -71,7 +69,7 @@ var Regions = map[string]Region{ "eu-de-1", "eu-de-2", }, - SysTypes: []string{"s922", "e980"}, + SysTypes: []string{"s922", "e980"}, }, "lon": { Description: "London, UK.", @@ -81,17 +79,17 @@ var Regions = map[string]Region{ "lon04", "lon06", }, - SysTypes: []string{"s922", "e980"}, + SysTypes: []string{"s922", "e980"}, }, "mad": { Description: "Madrid, Spain", VPCRegion: "eu-es", - COSRegion: "eu-de", // @HACK - PowerVS says COS not supported in this region + COSRegion: "eu-de", // @HACK - PowerVS says COS not supported in this region Zones: []string{ "mad02", "mad04", }, - SysTypes: []string{"s1022"}, + SysTypes: []string{"s1022"}, }, "mon": { Description: "Montreal, Canada", @@ -115,17 +113,17 @@ var Regions = map[string]Region{ "syd04", "syd05", }, - SysTypes: []string{"s922", "e980"}, + SysTypes: []string{"s922", "e980"}, }, "sao": { Description: "São Paulo, Brazil", VPCRegion: "br-sao", COSRegion: "br-sao", - Zones: []string{ + Zones: []string{ "sao01", "sao04", }, - SysTypes: []string{"s922", "e980"}, + SysTypes: []string{"s922", "e980"}, }, "tok": { Description: "Tokyo, Japan", @@ -149,7 +147,7 @@ var Regions = map[string]Region{ "wdc06", "wdc07", }, - SysTypes: []string{"s922", "e980"}, + SysTypes: []string{"s922", "e980"}, }, } @@ -254,12 +252,3 @@ func AvailableSysTypes(region string) ([]string, error) { } return knownRegion.SysTypes, nil } - -// AllKnownSysTypes returns aggregated known system types from all regions. -func AllKnownSysTypes() sets.Set[string] { - sysTypes := sets.New[string]() - for _, region := range Regions { - sysTypes.Insert(region.SysTypes...) - } - return sysTypes -}