Skip to content

Commit

Permalink
Consistent naming for region constants
Browse files Browse the repository at this point in the history
  • Loading branch information
errordeveloper committed Dec 18, 2018
1 parent 3a15f74 commit 74752c8
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const (
deleteTimeout = 15 * time.Minute
getTimeout = 1 * time.Minute
scaleTimeout = 5 * time.Minute
region = api.DefaultEKSRegion
region = api.DefaultRegion
)

var (
Expand Down
6 changes: 3 additions & 3 deletions pkg/eks/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func (c *ClusterProvider) SetAvailabilityZones(spec *api.ClusterConfig, given []
if len(given) == 0 {
logger.Debug("determining availability zones")
azSelector := az.NewSelectorWithDefaults(c.Provider.EC2())
if c.Provider.Region() == api.EKSRegionUSEast1 {
if c.Provider.Region() == api.RegionUSEast1 {
azSelector = az.NewSelectorWithMinRequired(c.Provider.EC2())
}
zones, err := azSelector.SelectZones(c.Provider.Region())
Expand Down Expand Up @@ -278,8 +278,8 @@ func (c *ClusterProvider) newSession(spec *api.ProviderConfig, endpoint string,
spec.Region = *s.Config.Region
} else {
// if session config doesn't have region set, make recursive call forcing default region
logger.Debug("no region specified in flags or config, setting to %s", api.DefaultEKSRegion)
spec.Region = api.DefaultEKSRegion
logger.Debug("no region specified in flags or config, setting to %s", api.DefaultRegion)
spec.Region = api.DefaultRegion
return c.newSession(spec, endpoint, credentials)
}
}
Expand Down
34 changes: 17 additions & 17 deletions pkg/eks/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,33 @@ const (
// AWSDebugLevel defines the LogLevel for AWS produced logs
AWSDebugLevel = 5

// EKSRegionUSWest2 represents the US West Region Oregon
EKSRegionUSWest2 = "us-west-2"
// RegionUSWest2 represents the US West Region Oregon
RegionUSWest2 = "us-west-2"

// EKSRegionUSEast1 represents the US East Region North Virgina
EKSRegionUSEast1 = "us-east-1"
// RegionUSEast1 represents the US East Region North Virgina
RegionUSEast1 = "us-east-1"

// EKSRegionUSEast2 represents the US East Region Ohio
EKSRegionUSEast2 = "us-east-2"
// RegionUSEast2 represents the US East Region Ohio
RegionUSEast2 = "us-east-2"

// EKSRegionEUWest1 represents the EU West Region Ireland
EKSRegionEUWest1 = "eu-west-1"
// RegionEUWest1 represents the EU West Region Ireland
RegionEUWest1 = "eu-west-1"

// EKSRegionEUNorth1 represents the EU North Region Stockholm
EKSRegionEUNorth1 = "eu-north-1"
// RegionEUNorth1 represents the EU North Region Stockholm
RegionEUNorth1 = "eu-north-1"

// DefaultEKSRegion defines the default region, where to deploy the EKS cluster
DefaultEKSRegion = EKSRegionUSWest2
// DefaultRegion defines the default region, where to deploy the EKS cluster
DefaultRegion = RegionUSWest2
)

// SupportedRegions are the regions where EKS is available
func SupportedRegions() []string {
return []string{
EKSRegionUSWest2,
EKSRegionUSEast1,
EKSRegionUSEast2,
EKSRegionEUWest1,
EKSRegionEUNorth1,
RegionUSWest2,
RegionUSEast1,
RegionUSEast2,
RegionEUWest1,
RegionEUNorth1,
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/testutils/mock_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func NewMockProvider() *MockProvider {

// ProviderConfig holds current global config
var ProviderConfig = &api.ProviderConfig{
Region: api.DefaultEKSRegion,
Region: api.DefaultRegion,
Profile: "default",
Version: "1.10",
WaitTimeout: 1200000000000,
Expand Down

0 comments on commit 74752c8

Please sign in to comment.