Skip to content

Commit 6eb8b3c

Browse files
committed
Add list of test zones that support f1-micro instances
1 parent cbf3a03 commit 6eb8b3c

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

modules/gcp/compute_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ const DEFAULT_MACHINE_TYPE = "f1-micro"
2222
const DEFAULT_IMAGE_FAMILY_PROJECT_NAME = "ubuntu-os-cloud"
2323
const DEFAULT_IMAGE_FAMILY_NAME = "family/ubuntu-1804-lts"
2424

25-
// Regions that don't support running f1-micro instances
26-
var RegionsToAvoid = []string{"asia-east2", "southamerica-west1", "europe-west8", "europe-southwest1", "us-east5-a"}
25+
// Zones that support running f1-micro instances
26+
var ZonesThatSupportF1Micro = []string{"us-central1-a", "us-east1-b", "us-west1-a", "europe-north1-a", "europe-west1-b", "europe-central2-a"}
2727

2828
func TestGetPublicIpOfInstance(t *testing.T) {
2929
t.Parallel()
3030

3131
instanceName := RandomValidGcpName()
3232
projectID := GetGoogleProjectIDFromEnvVar(t)
33-
zone := GetRandomZone(t, projectID, nil, nil, RegionsToAvoid)
33+
zone := GetRandomZone(t, projectID, ZonesThatSupportF1Micro, nil, nil)
3434

3535
createComputeInstance(t, projectID, zone, instanceName)
3636
defer deleteComputeInstance(t, projectID, zone, instanceName)
@@ -77,7 +77,7 @@ func TestGetAndSetLabels(t *testing.T) {
7777
instanceName := RandomValidGcpName()
7878
projectID := GetGoogleProjectIDFromEnvVar(t)
7979

80-
zone := GetRandomZone(t, projectID, nil, nil, RegionsToAvoid)
80+
zone := GetRandomZone(t, projectID, ZonesThatSupportF1Micro, nil, nil)
8181

8282
createComputeInstance(t, projectID, zone, instanceName)
8383
defer deleteComputeInstance(t, projectID, zone, instanceName)
@@ -113,7 +113,7 @@ func TestGetAndSetMetadata(t *testing.T) {
113113
projectID := GetGoogleProjectIDFromEnvVar(t)
114114
instanceName := RandomValidGcpName()
115115

116-
zone := GetRandomZone(t, projectID, nil, nil, RegionsToAvoid)
116+
zone := GetRandomZone(t, projectID, ZonesThatSupportF1Micro, nil, nil)
117117

118118
// Create a new Compute Instance
119119
createComputeInstance(t, projectID, zone, instanceName)

test/gcp/packer_gcp_basic_example_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ var DefaultRetryablePackerErrors = map[string]string{
2222
}
2323
var DefaultTimeBetweenPackerRetries = 15 * time.Second
2424

25-
// Regions that don't support n1-standard-1 instances
26-
var RegionsToAvoid = []string{"asia-east2", "southamerica-west1", "europe-west8", "europe-southwest1", "us-east5-a"}
25+
// Zones that support running f1-micro instances
26+
var ZonesThatSupportF1Micro = []string{"us-central1-a", "us-east1-b", "us-west1-a", "europe-north1-a", "europe-west1-b", "europe-central2-a"}
2727

2828
const DefaultMaxPackerRetries = 3
2929

@@ -35,7 +35,7 @@ func TestPackerGCPBasicExample(t *testing.T) {
3535
projectID := gcp.GetGoogleProjectIDFromEnvVar(t)
3636

3737
// Pick a random GCP zone to test in. This helps ensure your code works in all regions.
38-
zone := gcp.GetRandomZone(t, projectID, nil, nil, RegionsToAvoid)
38+
zone := gcp.GetRandomZone(t, projectID, ZonesThatSupportF1Micro, nil, nil)
3939

4040
packerOptions := &packer.Options{
4141
// The path to where the Packer template is located

0 commit comments

Comments
 (0)