Skip to content
This repository was archived by the owner on Sep 30, 2020. It is now read-only.

Commit 8cad104

Browse files
authored
Merge pull request #398 from mumoshu/fix-ec2-public-hostnames-in-us-east-1
Fix assumed public hostnames for EC2 instances in us-east-1
2 parents d299961 + d7afc76 commit 8cad104

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

model/derived/etcd_cluster_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func TestEtcdClusterDNSNames(t *testing.T) {
6565
t.Run("us-east-1", func(t *testing.T) {
6666
cluster := NewEtcdCluster(config, usEast1, etcdNet, etcdCount)
6767
actual := cluster.DNSNames()
68-
expected := []string{"*.us-east-1.compute.amazonaws.com"}
68+
expected := []string{"*.compute-1.amazonaws.com"}
6969
if !reflect.DeepEqual(actual, expected) {
7070
t.Errorf("invalid dns names: expecetd=%v, got=%v", expected, actual)
7171
}

model/region.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ func (r regionImpl) PrivateDomainName() string {
2828
}
2929

3030
func (r regionImpl) PublicDomainName() string {
31+
if r.name == "us-east-1" {
32+
return "compute-1.amazonaws.com"
33+
}
3134
return fmt.Sprintf("%s.compute.amazonaws.com", r.name)
3235
}
3336

0 commit comments

Comments
 (0)