Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop reading data_disk_type value from API response into state of google_notebooks_instance resource #4664

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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