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

Remove incomplete ValidateFunc for disk type. #5993

Merged
merged 1 commit into from
May 3, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,7 @@ func resourceComputeInstance() *schema.Resource {
AtLeastOneOf: initializeParamsKeys,
Computed: true,
ForceNew: true,
ValidateFunc: validation.StringInSlice([]string{"pd-standard", "pd-ssd", "pd-balanced"}, false),
Description: `The Google Compute Engine disk type. One of pd-standard, pd-ssd or pd-balanced.`,
Description: `The Google Compute Engine disk type. Such as pd-standard, pd-ssd or pd-balanced.`,
},

"image": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func resourceComputeInstanceTemplate() *schema.Resource {
Optional: true,
ForceNew: true,
Computed: true,
Description: `The Google Compute Engine disk type. Can be either "pd-ssd", "local-ssd", "pd-balanced" or "pd-standard".`,
Description: `The Google Compute Engine disk type. Such as "pd-ssd", "local-ssd", "pd-balanced" or "pd-standard".`,
},

"labels": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,9 +411,8 @@ func resourceDataprocCluster() *schema.Resource {
Optional: true,
AtLeastOneOf: preemptibleWorkerDiskConfigKeys,
ForceNew: true,
ValidateFunc: validation.StringInSlice([]string{"pd-standard", "pd-ssd", ""}, false),
Default: "pd-standard",
Description: `The disk type of the primary disk attached to each preemptible worker node. One of "pd-ssd" or "pd-standard". Defaults to "pd-standard".`,
Description: `The disk type of the primary disk attached to each preemptible worker node. Such as "pd-ssd" or "pd-standard". Defaults to "pd-standard".`,
},
},
},
Expand Down Expand Up @@ -825,14 +824,13 @@ func instanceConfigSchema(parent string) *schema.Schema {
"boot_disk_type": {
Type: schema.TypeString,
Optional: true,
Description: `The disk type of the primary disk attached to each node. One of "pd-ssd" or "pd-standard". Defaults to "pd-standard".`,
Description: `The disk type of the primary disk attached to each node. Such as "pd-ssd" or "pd-standard". Defaults to "pd-standard".`,
AtLeastOneOf: []string{
"cluster_config.0." + parent + ".0.disk_config.0.num_local_ssds",
"cluster_config.0." + parent + ".0.disk_config.0.boot_disk_size_gb",
"cluster_config.0." + parent + ".0.disk_config.0.boot_disk_type",
},
ForceNew: true,
ValidateFunc: validation.StringInSlice([]string{"pd-standard", "pd-ssd", ""}, false),
Default: "pd-standard",
},
},
Expand Down
3 changes: 1 addition & 2 deletions mmv1/third_party/terraform/utils/node_config.go.erb
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ func schemaNodeConfig() *schema.Schema {
Optional: true,
Computed: true,
ForceNew: true,
ValidateFunc: validation.StringInSlice([]string{"pd-standard", "pd-balanced", "pd-ssd"}, false),
Description: `Type of the disk attached to each node.`,
Description: `Type of the disk attached to each node. Such as pd-standard, pd-balanced or pd-ssd`,
},

"guest_accelerator": &schema.Schema{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ The following arguments are supported:
of the disk (such as those managed by `google_compute_disk`) to attach.
~> **Note:** Either `source` or `source_image` is **required** in a disk block unless the disk type is `local-ssd`. Check the API [docs](https://cloud.google.com/compute/docs/reference/rest/v1/instanceTemplates/insert) for details.

* `disk_type` - The GCE disk type. Can be either `"pd-ssd"`,
`"local-ssd"`, `"pd-balanced"` or `"pd-standard"`.
* `disk_type` - The GCE disk type. Such as `"pd-ssd"`, `"local-ssd"`,
`"pd-balanced"` or `"pd-standard"`.

* `disk_size_gb` - The size of the image in gigabytes. If not
specified, it will inherit the size of its base image. For SCRATCH disks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ is desired, you will need to modify your state file manually using
* `size` - (Optional) The size of the image in gigabytes. If not specified, it
will inherit the size of its base image.

* `type` - (Optional) The GCE disk type. May be set to pd-standard, pd-balanced or pd-ssd.
* `type` - (Optional) The GCE disk type. Such as pd-standard, pd-balanced or pd-ssd.

* `image` - (Optional) The image from which to initialize this disk. This can be
one of: the image's `self_link`, `projects/{project}/global/images/{image}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,8 @@ The following arguments are supported:
of the disk (such as those managed by `google_compute_disk`) to attach.
~> **Note:** Either `source` or `source_image` is **required** in a disk block unless the disk type is `local-ssd`. Check the API [docs](https://cloud.google.com/compute/docs/reference/rest/v1/instanceTemplates/insert) for details.

* `disk_type` - (Optional) The GCE disk type. Can be either `"pd-ssd"`,
`"local-ssd"`, `"pd-balanced"` or `"pd-standard"`.
* `disk_type` - (Optional) The GCE disk type. Such as `"pd-ssd"`, `"local-ssd"`,
`"pd-balanced"` or `"pd-standard"`.

* `disk_size_gb` - (Optional) The size of the image in gigabytes. If not
specified, it will inherit the size of its base image. For SCRATCH disks,
Expand Down