From a60ecf57794ea684412e6a4f9200bb124f7b1c01 Mon Sep 17 00:00:00 2001 From: The Magician Date: Fri, 30 Jul 2021 15:32:20 -0500 Subject: [PATCH] Removed testing of basic auth for clusters (#5020) (#9686) Signed-off-by: Modular Magician --- .changelog/5020.txt | 3 + ...ta_source_google_container_cluster_test.go | 5 - google/resource_container_cluster_test.go | 147 ------------------ 3 files changed, 3 insertions(+), 152 deletions(-) create mode 100644 .changelog/5020.txt diff --git a/.changelog/5020.txt b/.changelog/5020.txt new file mode 100644 index 00000000000..8ec013c0699 --- /dev/null +++ b/.changelog/5020.txt @@ -0,0 +1,3 @@ +```release-note:none + +``` diff --git a/google/data_source_google_container_cluster_test.go b/google/data_source_google_container_cluster_test.go index 24a4116b82d..8fb9ee63025 100644 --- a/google/data_source_google_container_cluster_test.go +++ b/google/data_source_google_container_cluster_test.go @@ -67,11 +67,6 @@ resource "google_container_cluster" "kubes" { name = "tf-test-cluster-%s" location = "us-central1-a" initial_node_count = 1 - - master_auth { - username = "mr.yoda" - password = "adoy.rm.123456789" - } } data "google_container_cluster" "kubes" { diff --git a/google/resource_container_cluster_test.go b/google/resource_container_cluster_test.go index 756f0a7c7a5..44ab1ec7d17 100644 --- a/google/resource_container_cluster_test.go +++ b/google/resource_container_cluster_test.go @@ -173,89 +173,6 @@ func TestAccContainerCluster_withAddons(t *testing.T) { }) } -func TestAccContainerCluster_withMasterAuthConfig(t *testing.T) { - t.Parallel() - - clusterName := fmt.Sprintf("tf-test-cluster-%s", randString(t, 10)) - - vcrTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckContainerClusterDestroyProducer(t), - Steps: []resource.TestStep{ - { - Config: testAccContainerCluster_withMasterAuth(clusterName), - }, - { - ResourceName: "google_container_cluster.with_master_auth", - ImportState: true, - ImportStateVerify: true, - }, - { - Config: testAccContainerCluster_updateMasterAuth(clusterName), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("google_container_cluster.with_master_auth", "master_auth.0.username", "mr.yoda.adoy.mr"), - resource.TestCheckResourceAttr("google_container_cluster.with_master_auth", "master_auth.0.password", "adoy.rm.123456789.mr.yoda"), - ), - }, - { - ResourceName: "google_container_cluster.with_master_auth", - ImportState: true, - ImportStateVerify: true, - }, - { - Config: testAccContainerCluster_disableMasterAuth(clusterName), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("google_container_cluster.with_master_auth", "master_auth.0.username", ""), - resource.TestCheckResourceAttr("google_container_cluster.with_master_auth", "master_auth.0.password", ""), - ), - }, - { - ResourceName: "google_container_cluster.with_master_auth", - ImportState: true, - ImportStateVerify: true, - }, - { - Config: testAccContainerCluster_updateMasterAuth(clusterName), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("google_container_cluster.with_master_auth", "master_auth.0.username", "mr.yoda.adoy.mr"), - resource.TestCheckResourceAttr("google_container_cluster.with_master_auth", "master_auth.0.password", "adoy.rm.123456789.mr.yoda"), - ), - }, - { - ResourceName: "google_container_cluster.with_master_auth", - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} - -func TestAccContainerCluster_withMasterAuthConfig_NoCert(t *testing.T) { - t.Parallel() - - clusterName := fmt.Sprintf("tf-test-cluster-%s", randString(t, 10)) - - vcrTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckContainerClusterDestroyProducer(t), - Steps: []resource.TestStep{ - { - Config: testAccContainerCluster_withMasterAuthNoCert(clusterName), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("google_container_cluster.with_master_auth_no_cert", "master_auth.0.client_certificate", ""), - ), - }, - { - ResourceName: "google_container_cluster.with_master_auth_no_cert", - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} - func TestAccContainerCluster_withAuthenticatorGroupsConfig(t *testing.T) { t.Parallel() clusterName := fmt.Sprintf("tf-test-cluster-%s", randString(t, 10)) @@ -2007,70 +1924,6 @@ resource "google_container_cluster" "primary" { `, projectID, clusterName) } -func testAccContainerCluster_withMasterAuth(clusterName string) string { - return fmt.Sprintf(` -resource "google_container_cluster" "with_master_auth" { - name = "%s" - location = "us-central1-a" - initial_node_count = 3 - enable_shielded_nodes = false - - master_auth { - username = "mr.yoda" - password = "adoy.rm.123456789" - } -} -`, clusterName) -} - -func testAccContainerCluster_updateMasterAuth(clusterName string) string { - return fmt.Sprintf(` -resource "google_container_cluster" "with_master_auth" { - name = "%s" - location = "us-central1-a" - initial_node_count = 3 - - master_auth { - username = "mr.yoda.adoy.mr" - password = "adoy.rm.123456789.mr.yoda" - } -} -`, clusterName) -} - -func testAccContainerCluster_disableMasterAuth(clusterName string) string { - return fmt.Sprintf(` -resource "google_container_cluster" "with_master_auth" { - name = "%s" - location = "us-central1-a" - initial_node_count = 3 - - master_auth { - username = "" - password = "" - } -} -`, clusterName) -} - -func testAccContainerCluster_withMasterAuthNoCert(clusterName string) string { - return fmt.Sprintf(` -resource "google_container_cluster" "with_master_auth_no_cert" { - name = "%s" - location = "us-central1-a" - initial_node_count = 3 - - master_auth { - username = "mr.yoda" - password = "adoy.rm.123456789" - client_certificate_config { - issue_client_certificate = false - } - } -} -`, clusterName) -} - func testAccContainerCluster_withNetworkPolicyEnabled(clusterName string) string { return fmt.Sprintf(` resource "google_container_cluster" "with_network_policy_enabled" {