forked from GoogleCloudPlatform/magic-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Remove force replacement from gcfs_config (GoogleCloudPlatform#…
- Loading branch information
1 parent
0718d4a
commit 2971b87
Showing
6 changed files
with
70 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1718,7 +1718,11 @@ func TestAccContainerNodePool_gcfsConfig(t *testing.T) { | |
CheckDestroy: testAccCheckContainerNodePoolDestroyProducer(t), | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: testAccContainerNodePool_gcfsConfig(cluster, np, networkName, subnetworkName), | ||
Config: testAccContainerNodePool_gcfsConfig(cluster, np, networkName, subnetworkName, true), | ||
Check: resource.ComposeTestCheckFunc( | ||
resource.TestCheckResourceAttr("google_container_node_pool.np", | ||
"node_config.0.gcfs_config.0.enabled", "true"), | ||
), | ||
}, | ||
{ | ||
ResourceName: "google_container_node_pool.np", | ||
|
@@ -1729,7 +1733,7 @@ func TestAccContainerNodePool_gcfsConfig(t *testing.T) { | |
}) | ||
} | ||
|
||
func testAccContainerNodePool_gcfsConfig(cluster, np, networkName, subnetworkName string) string { | ||
func testAccContainerNodePool_gcfsConfig(cluster, np, networkName, subnetworkName string, enabled bool) string { | ||
return fmt.Sprintf(` | ||
resource "google_container_cluster" "cluster" { | ||
name = "%s" | ||
|
@@ -1750,11 +1754,11 @@ resource "google_container_node_pool" "np" { | |
machine_type = "n1-standard-8" | ||
image_type = "COS_CONTAINERD" | ||
gcfs_config { | ||
enabled = true | ||
enabled = %t | ||
} | ||
} | ||
} | ||
`, cluster, networkName, subnetworkName, np) | ||
`, cluster, networkName, subnetworkName, np, enabled) | ||
} | ||
|
||
func TestAccContainerNodePool_gvnic(t *testing.T) { | ||
|
@@ -4734,30 +4738,30 @@ func TestAccContainerNodePool_privateRegistry(t *testing.T) { | |
|
||
func testAccContainerNodePool_privateRegistryEnabled(secretID, cluster, nodepool, network, subnetwork string) string { | ||
return fmt.Sprintf(` | ||
data "google_project" "test_project" { | ||
data "google_project" "test_project" { | ||
} | ||
|
||
resource "google_secret_manager_secret" "secret-basic" { | ||
secret_id = "%s" | ||
replication { | ||
user_managed { | ||
replicas { | ||
location = "us-central1" | ||
} | ||
} | ||
} | ||
} | ||
|
||
resource "google_secret_manager_secret" "secret-basic" { | ||
secret_id = "%s" | ||
replication { | ||
user_managed { | ||
replicas { | ||
location = "us-central1" | ||
} | ||
} | ||
} | ||
} | ||
|
||
resource "google_secret_manager_secret_version" "secret-version-basic" { | ||
secret = google_secret_manager_secret.secret-basic.id | ||
secret_data = "dummypassword" | ||
} | ||
|
||
resource "google_secret_manager_secret_iam_member" "secret_iam" { | ||
secret_id = google_secret_manager_secret.secret-basic.id | ||
role = "roles/secretmanager.admin" | ||
member = "serviceAccount:${data.google_project.test_project.number}[email protected]" | ||
depends_on = [google_secret_manager_secret_version.secret-version-basic] | ||
resource "google_secret_manager_secret_version" "secret-version-basic" { | ||
secret = google_secret_manager_secret.secret-basic.id | ||
secret_data = "dummypassword" | ||
} | ||
|
||
resource "google_secret_manager_secret_iam_member" "secret_iam" { | ||
secret_id = google_secret_manager_secret.secret-basic.id | ||
role = "roles/secretmanager.admin" | ||
member = "serviceAccount:${data.google_project.test_project.number}[email protected]" | ||
depends_on = [google_secret_manager_secret_version.secret-version-basic] | ||
} | ||
|
||
resource "google_container_cluster" "cluster" { | ||
|
@@ -4768,13 +4772,13 @@ resource "google_container_cluster" "cluster" { | |
network = "%s" | ||
subnetwork = "%s" | ||
} | ||
|
||
resource "google_container_node_pool" "np" { | ||
name = "%s" | ||
location = "us-central1-a" | ||
cluster = google_container_cluster.cluster.name | ||
initial_node_count = 1 | ||
|
||
node_config { | ||
oauth_scopes = [ | ||
"https://www.googleapis.com/auth/cloud-platform", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1719,7 +1719,11 @@ func TestAccContainerNodePool_gcfsConfig(t *testing.T) { | |
CheckDestroy: testAccCheckContainerNodePoolDestroyProducer(t), | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: testAccContainerNodePool_gcfsConfig(cluster, np, networkName, subnetworkName), | ||
Config: testAccContainerNodePool_gcfsConfig(cluster, np, networkName, subnetworkName, true), | ||
Check: resource.ComposeTestCheckFunc( | ||
resource.TestCheckResourceAttr("google_container_node_pool.np", | ||
"node_config.0.gcfs_config.0.enabled", "true"), | ||
), | ||
}, | ||
{ | ||
ResourceName: "google_container_node_pool.np", | ||
|
@@ -1730,7 +1734,7 @@ func TestAccContainerNodePool_gcfsConfig(t *testing.T) { | |
}) | ||
} | ||
|
||
func testAccContainerNodePool_gcfsConfig(cluster, np, networkName, subnetworkName string) string { | ||
func testAccContainerNodePool_gcfsConfig(cluster, np, networkName, subnetworkName string, enabled bool) string { | ||
return fmt.Sprintf(` | ||
resource "google_container_cluster" "cluster" { | ||
name = "%s" | ||
|
@@ -1751,11 +1755,11 @@ resource "google_container_node_pool" "np" { | |
machine_type = "n1-standard-8" | ||
image_type = "COS_CONTAINERD" | ||
gcfs_config { | ||
enabled = true | ||
enabled = %t | ||
} | ||
} | ||
} | ||
`, cluster, networkName, subnetworkName, np) | ||
`, cluster, networkName, subnetworkName, np, enabled) | ||
} | ||
|
||
func TestAccContainerNodePool_gvnic(t *testing.T) { | ||
|
@@ -4735,30 +4739,30 @@ func TestAccContainerNodePool_privateRegistry(t *testing.T) { | |
|
||
func testAccContainerNodePool_privateRegistryEnabled(secretID, cluster, nodepool, network, subnetwork string) string { | ||
return fmt.Sprintf(` | ||
data "google_project" "test_project" { | ||
data "google_project" "test_project" { | ||
} | ||
|
||
resource "google_secret_manager_secret" "secret-basic" { | ||
secret_id = "%s" | ||
replication { | ||
user_managed { | ||
replicas { | ||
location = "us-central1" | ||
} | ||
} | ||
} | ||
} | ||
|
||
resource "google_secret_manager_secret" "secret-basic" { | ||
secret_id = "%s" | ||
replication { | ||
user_managed { | ||
replicas { | ||
location = "us-central1" | ||
} | ||
} | ||
} | ||
} | ||
|
||
resource "google_secret_manager_secret_version" "secret-version-basic" { | ||
secret = google_secret_manager_secret.secret-basic.id | ||
secret_data = "dummypassword" | ||
} | ||
|
||
resource "google_secret_manager_secret_iam_member" "secret_iam" { | ||
secret_id = google_secret_manager_secret.secret-basic.id | ||
role = "roles/secretmanager.admin" | ||
member = "serviceAccount:${data.google_project.test_project.number}[email protected]" | ||
depends_on = [google_secret_manager_secret_version.secret-version-basic] | ||
resource "google_secret_manager_secret_version" "secret-version-basic" { | ||
secret = google_secret_manager_secret.secret-basic.id | ||
secret_data = "dummypassword" | ||
} | ||
|
||
resource "google_secret_manager_secret_iam_member" "secret_iam" { | ||
secret_id = google_secret_manager_secret.secret-basic.id | ||
role = "roles/secretmanager.admin" | ||
member = "serviceAccount:${data.google_project.test_project.number}[email protected]" | ||
depends_on = [google_secret_manager_secret_version.secret-version-basic] | ||
} | ||
|
||
resource "google_container_cluster" "cluster" { | ||
|
@@ -4769,13 +4773,13 @@ resource "google_container_cluster" "cluster" { | |
network = "%s" | ||
subnetwork = "%s" | ||
} | ||
|
||
resource "google_container_node_pool" "np" { | ||
name = "%s" | ||
location = "us-central1-a" | ||
cluster = google_container_cluster.cluster.name | ||
initial_node_count = 1 | ||
|
||
node_config { | ||
oauth_scopes = [ | ||
"https://www.googleapis.com/auth/cloud-platform", | ||
|