Skip to content

Commit

Permalink
add forcenew on shielded instance config
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
megan07 authored and modular-magician committed Oct 22, 2019
1 parent 4a4b192 commit db710de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 30 deletions.
3 changes: 3 additions & 0 deletions google/node_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,17 +151,20 @@ var schemaNodeConfig = &schema.Schema{
Type: schema.TypeList,
Optional: true,
Computed: true,
ForceNew: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"enable_secure_boot": {
Type: schema.TypeBool,
Optional: true,
ForceNew: true,
Default: false,
},
"enable_integrity_monitoring": {
Type: schema.TypeBool,
Optional: true,
ForceNew: true,
Default: true,
},
},
Expand Down
30 changes: 0 additions & 30 deletions google/resource_container_node_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,15 +533,6 @@ func TestAccContainerNodePool_shieldedInstanceConfig(t *testing.T) {
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"max_pods_per_node"},
},
{
Config: testAccContainerNodePool_updateShieldedInstanceConfig(cluster, np),
},
{
ResourceName: "google_container_node_pool.np",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"max_pods_per_node"},
},
},
})
}
Expand Down Expand Up @@ -1140,28 +1131,7 @@ resource "google_container_node_pool" "np" {
node_config {
shielded_instance_config {
enable_integrity_monitoring = true
}
}
}`, cluster, np)
}

func testAccContainerNodePool_updateShieldedInstanceConfig(cluster, np string) string {
return fmt.Sprintf(`
resource "google_container_cluster" "cluster" {
name = "%s"
location = "us-central1-a"
initial_node_count = 1
}
resource "google_container_node_pool" "np" {
name = "%s"
location = "us-central1-a"
cluster = "${google_container_cluster.cluster.name}"
initial_node_count = 2
node_config {
shielded_instance_config {
enable_secure_boot = true
enable_integrity_monitoring = true
}
}
}`, cluster, np)
Expand Down

0 comments on commit db710de

Please sign in to comment.