From 81dd0842a59ef0996513eae8b11427a59b1914cc Mon Sep 17 00:00:00 2001 From: Denis O Date: Fri, 3 Feb 2023 20:27:04 +0000 Subject: [PATCH 1/4] Updated helm chart used in tests --- modules/helm/install_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/helm/install_test.go b/modules/helm/install_test.go index b5d7ce8a5..d0bc6f79c 100644 --- a/modules/helm/install_test.go +++ b/modules/helm/install_test.go @@ -26,7 +26,7 @@ import ( const ( remoteChartSource = "https://charts.bitnami.com/bitnami" remoteChartName = "nginx" - remoteChartVersion = "9.7.4" + remoteChartVersion = "13.2.23" ) // Test that we can install a remote chart (e.g bitnami/nginx) From cbf3a03010a7735975ea3d0ac8075844a465b5da Mon Sep 17 00:00:00 2001 From: Denis O Date: Fri, 3 Feb 2023 20:47:26 +0000 Subject: [PATCH 2/4] Updated list of GCP regions that can't supports f1-micro --- modules/gcp/compute_test.go | 2 +- test/gcp/packer_gcp_basic_example_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/gcp/compute_test.go b/modules/gcp/compute_test.go index 8c1242eb4..21a1831eb 100644 --- a/modules/gcp/compute_test.go +++ b/modules/gcp/compute_test.go @@ -23,7 +23,7 @@ const DEFAULT_IMAGE_FAMILY_PROJECT_NAME = "ubuntu-os-cloud" const DEFAULT_IMAGE_FAMILY_NAME = "family/ubuntu-1804-lts" // Regions that don't support running f1-micro instances -var RegionsToAvoid = []string{"asia-east2", "southamerica-west1", "europe-west8", "europe-southwest1"} +var RegionsToAvoid = []string{"asia-east2", "southamerica-west1", "europe-west8", "europe-southwest1", "us-east5-a"} func TestGetPublicIpOfInstance(t *testing.T) { t.Parallel() diff --git a/test/gcp/packer_gcp_basic_example_test.go b/test/gcp/packer_gcp_basic_example_test.go index 1032db4e9..f5c3d439f 100644 --- a/test/gcp/packer_gcp_basic_example_test.go +++ b/test/gcp/packer_gcp_basic_example_test.go @@ -23,7 +23,7 @@ var DefaultRetryablePackerErrors = map[string]string{ var DefaultTimeBetweenPackerRetries = 15 * time.Second // Regions that don't support n1-standard-1 instances -var RegionsToAvoid = []string{"asia-east2", "southamerica-west1", "europe-west8", "europe-southwest1"} +var RegionsToAvoid = []string{"asia-east2", "southamerica-west1", "europe-west8", "europe-southwest1", "us-east5-a"} const DefaultMaxPackerRetries = 3 From 6eb8b3c52c1e6d05782872fbf01df3dbd20379d7 Mon Sep 17 00:00:00 2001 From: Denis O Date: Mon, 6 Feb 2023 19:33:13 +0000 Subject: [PATCH 3/4] Add list of test zones that support f1-micro instances --- modules/gcp/compute_test.go | 10 +++++----- test/gcp/packer_gcp_basic_example_test.go | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/gcp/compute_test.go b/modules/gcp/compute_test.go index 21a1831eb..b94da5198 100644 --- a/modules/gcp/compute_test.go +++ b/modules/gcp/compute_test.go @@ -22,15 +22,15 @@ const DEFAULT_MACHINE_TYPE = "f1-micro" const DEFAULT_IMAGE_FAMILY_PROJECT_NAME = "ubuntu-os-cloud" const DEFAULT_IMAGE_FAMILY_NAME = "family/ubuntu-1804-lts" -// Regions that don't support running f1-micro instances -var RegionsToAvoid = []string{"asia-east2", "southamerica-west1", "europe-west8", "europe-southwest1", "us-east5-a"} +// Zones that support running f1-micro instances +var ZonesThatSupportF1Micro = []string{"us-central1-a", "us-east1-b", "us-west1-a", "europe-north1-a", "europe-west1-b", "europe-central2-a"} func TestGetPublicIpOfInstance(t *testing.T) { t.Parallel() instanceName := RandomValidGcpName() projectID := GetGoogleProjectIDFromEnvVar(t) - zone := GetRandomZone(t, projectID, nil, nil, RegionsToAvoid) + zone := GetRandomZone(t, projectID, ZonesThatSupportF1Micro, nil, nil) createComputeInstance(t, projectID, zone, instanceName) defer deleteComputeInstance(t, projectID, zone, instanceName) @@ -77,7 +77,7 @@ func TestGetAndSetLabels(t *testing.T) { instanceName := RandomValidGcpName() projectID := GetGoogleProjectIDFromEnvVar(t) - zone := GetRandomZone(t, projectID, nil, nil, RegionsToAvoid) + zone := GetRandomZone(t, projectID, ZonesThatSupportF1Micro, nil, nil) createComputeInstance(t, projectID, zone, instanceName) defer deleteComputeInstance(t, projectID, zone, instanceName) @@ -113,7 +113,7 @@ func TestGetAndSetMetadata(t *testing.T) { projectID := GetGoogleProjectIDFromEnvVar(t) instanceName := RandomValidGcpName() - zone := GetRandomZone(t, projectID, nil, nil, RegionsToAvoid) + zone := GetRandomZone(t, projectID, ZonesThatSupportF1Micro, nil, nil) // Create a new Compute Instance createComputeInstance(t, projectID, zone, instanceName) diff --git a/test/gcp/packer_gcp_basic_example_test.go b/test/gcp/packer_gcp_basic_example_test.go index f5c3d439f..5a5a2ae8b 100644 --- a/test/gcp/packer_gcp_basic_example_test.go +++ b/test/gcp/packer_gcp_basic_example_test.go @@ -22,8 +22,8 @@ var DefaultRetryablePackerErrors = map[string]string{ } var DefaultTimeBetweenPackerRetries = 15 * time.Second -// Regions that don't support n1-standard-1 instances -var RegionsToAvoid = []string{"asia-east2", "southamerica-west1", "europe-west8", "europe-southwest1", "us-east5-a"} +// Zones that support running f1-micro instances +var ZonesThatSupportF1Micro = []string{"us-central1-a", "us-east1-b", "us-west1-a", "europe-north1-a", "europe-west1-b", "europe-central2-a"} const DefaultMaxPackerRetries = 3 @@ -35,7 +35,7 @@ func TestPackerGCPBasicExample(t *testing.T) { projectID := gcp.GetGoogleProjectIDFromEnvVar(t) // Pick a random GCP zone to test in. This helps ensure your code works in all regions. - zone := gcp.GetRandomZone(t, projectID, nil, nil, RegionsToAvoid) + zone := gcp.GetRandomZone(t, projectID, ZonesThatSupportF1Micro, nil, nil) packerOptions := &packer.Options{ // The path to where the Packer template is located From a4c8231521a98c5d71d1e21c08163119bad76798 Mon Sep 17 00:00:00 2001 From: Denis O Date: Mon, 6 Feb 2023 19:54:56 +0000 Subject: [PATCH 4/4] Update GCP test --- test/gcp/packer_gcp_basic_example_test.go | 3 +++ test/gcp/terraform_gcp_example_test.go | 2 +- test/gcp/terraform_gcp_ig_example_test.go | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/test/gcp/packer_gcp_basic_example_test.go b/test/gcp/packer_gcp_basic_example_test.go index 5a5a2ae8b..4386ca84b 100644 --- a/test/gcp/packer_gcp_basic_example_test.go +++ b/test/gcp/packer_gcp_basic_example_test.go @@ -22,6 +22,9 @@ var DefaultRetryablePackerErrors = map[string]string{ } var DefaultTimeBetweenPackerRetries = 15 * time.Second +// Regions that support running f1-micro instances +var RegionsThatSupportF1Micro = []string{"us-central1", "us-east1", "us-west1", "europe-west1"} + // Zones that support running f1-micro instances var ZonesThatSupportF1Micro = []string{"us-central1-a", "us-east1-b", "us-west1-a", "europe-north1-a", "europe-west1-b", "europe-central2-a"} diff --git a/test/gcp/terraform_gcp_example_test.go b/test/gcp/terraform_gcp_example_test.go index b934d58f8..389c42d87 100644 --- a/test/gcp/terraform_gcp_example_test.go +++ b/test/gcp/terraform_gcp_example_test.go @@ -109,7 +109,7 @@ func TestSshAccessToComputeInstance(t *testing.T) { // Setup values for our Terraform apply projectID := gcp.GetGoogleProjectIDFromEnvVar(t) randomValidGcpName := gcp.RandomValidGcpName() - zone := gcp.GetRandomZone(t, projectID, nil, nil, RegionsToAvoid) + zone := gcp.GetRandomZone(t, projectID, ZonesThatSupportF1Micro, nil, nil) terraformOptions := &terraform.Options{ // The path to where our Terraform code is located diff --git a/test/gcp/terraform_gcp_ig_example_test.go b/test/gcp/terraform_gcp_ig_example_test.go index 8ae1b8105..54612570c 100644 --- a/test/gcp/terraform_gcp_ig_example_test.go +++ b/test/gcp/terraform_gcp_ig_example_test.go @@ -24,7 +24,7 @@ func TestTerraformGcpInstanceGroupExample(t *testing.T) { // Setup values for our Terraform apply projectId := gcp.GetGoogleProjectIDFromEnvVar(t) - region := gcp.GetRandomRegion(t, projectId, nil, RegionsToAvoid) + region := gcp.GetRandomRegion(t, projectId, RegionsThatSupportF1Micro, nil) randomValidGcpName := gcp.RandomValidGcpName() clusterSize := 3