Skip to content

Commit

Permalink
Stop reading data_disk_type value from API response into state of goo…
Browse files Browse the repository at this point in the history
…gle_notebooks_instance resource (#6512) (#4664)

Signed-off-by: Modular Magician <[email protected]>

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Sep 7, 2022
1 parent 66d2d76 commit 06a51d8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
3 changes: 3 additions & 0 deletions .changelog/6512.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
notebooks: fixed perma-diff in `google_notebooks_instance`
```
18 changes: 5 additions & 13 deletions google-beta/resource_notebooks_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,11 @@ You can choose the size of the data disk based on how big your notebooks and dat
If not specified, this defaults to 100.`,
},
"data_disk_type": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
ValidateFunc: validateEnum([]string{"DISK_TYPE_UNSPECIFIED", "PD_STANDARD", "PD_SSD", "PD_BALANCED", "PD_EXTREME", ""}),
DiffSuppressFunc: emptyOrDefaultStringSuppress("DISK_TYPE_UNSPECIFIED"),
Description: `Possible disk types for notebook instances. Possible values: ["DISK_TYPE_UNSPECIFIED", "PD_STANDARD", "PD_SSD", "PD_BALANCED", "PD_EXTREME"]`,
Type: schema.TypeString,
Optional: true,
ForceNew: true,
ValidateFunc: validateEnum([]string{"DISK_TYPE_UNSPECIFIED", "PD_STANDARD", "PD_SSD", "PD_BALANCED", "PD_EXTREME", ""}),
Description: `Possible disk types for notebook instances. Possible values: ["DISK_TYPE_UNSPECIFIED", "PD_STANDARD", "PD_SSD", "PD_BALANCED", "PD_EXTREME"]`,
},
"disk_encryption": {
Type: schema.TypeString,
Expand Down Expand Up @@ -738,9 +737,6 @@ func resourceNotebooksInstanceRead(d *schema.ResourceData, meta interface{}) err
if err := d.Set("custom_gpu_driver_path", flattenNotebooksInstanceCustomGpuDriverPath(res["customGpuDriverPath"], d, config)); err != nil {
return fmt.Errorf("Error reading Instance: %s", err)
}
if err := d.Set("data_disk_type", flattenNotebooksInstanceDataDiskType(res["dataDiskType"], d, config)); err != nil {
return fmt.Errorf("Error reading Instance: %s", err)
}
if err := d.Set("disk_encryption", flattenNotebooksInstanceDiskEncryption(res["diskEncryption"], d, config)); err != nil {
return fmt.Errorf("Error reading Instance: %s", err)
}
Expand Down Expand Up @@ -1030,10 +1026,6 @@ func flattenNotebooksInstanceCustomGpuDriverPath(v interface{}, d *schema.Resour
return v
}

func flattenNotebooksInstanceDataDiskType(v interface{}, d *schema.ResourceData, config *Config) interface{} {
return v
}

func flattenNotebooksInstanceDiskEncryption(v interface{}, d *schema.ResourceData, config *Config) interface{} {
return v
}
Expand Down
8 changes: 4 additions & 4 deletions google-beta/resource_notebooks_instance_generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestAccNotebooksInstance_notebookInstanceBasicExample(t *testing.T) {
ResourceName: "google_notebooks_instance.instance",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"name", "instance_owners", "boot_disk_type", "boot_disk_size_gb", "data_disk_size_gb", "no_remove_data_disk", "metadata", "vm_image", "container_image", "location"},
ImportStateVerifyIgnore: []string{"name", "instance_owners", "boot_disk_type", "boot_disk_size_gb", "data_disk_type", "data_disk_size_gb", "no_remove_data_disk", "metadata", "vm_image", "container_image", "location"},
},
},
})
Expand Down Expand Up @@ -81,7 +81,7 @@ func TestAccNotebooksInstance_notebookInstanceBasicContainerExample(t *testing.T
ResourceName: "google_notebooks_instance.instance",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"name", "instance_owners", "boot_disk_type", "boot_disk_size_gb", "data_disk_size_gb", "no_remove_data_disk", "metadata", "vm_image", "container_image", "location"},
ImportStateVerifyIgnore: []string{"name", "instance_owners", "boot_disk_type", "boot_disk_size_gb", "data_disk_type", "data_disk_size_gb", "no_remove_data_disk", "metadata", "vm_image", "container_image", "location"},
},
},
})
Expand Down Expand Up @@ -124,7 +124,7 @@ func TestAccNotebooksInstance_notebookInstanceBasicGpuExample(t *testing.T) {
ResourceName: "google_notebooks_instance.instance",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"name", "instance_owners", "boot_disk_type", "boot_disk_size_gb", "data_disk_size_gb", "no_remove_data_disk", "metadata", "vm_image", "container_image", "location"},
ImportStateVerifyIgnore: []string{"name", "instance_owners", "boot_disk_type", "boot_disk_size_gb", "data_disk_type", "data_disk_size_gb", "no_remove_data_disk", "metadata", "vm_image", "container_image", "location"},
},
},
})
Expand Down Expand Up @@ -170,7 +170,7 @@ func TestAccNotebooksInstance_notebookInstanceFullExample(t *testing.T) {
ResourceName: "google_notebooks_instance.instance",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"name", "instance_owners", "boot_disk_type", "boot_disk_size_gb", "data_disk_size_gb", "no_remove_data_disk", "metadata", "vm_image", "container_image", "location"},
ImportStateVerifyIgnore: []string{"name", "instance_owners", "boot_disk_type", "boot_disk_size_gb", "data_disk_type", "data_disk_size_gb", "no_remove_data_disk", "metadata", "vm_image", "container_image", "location"},
},
},
})
Expand Down

0 comments on commit 06a51d8

Please sign in to comment.