Skip to content

Commit

Permalink
Correctly release visible_core_count (#6860) (#13108)
Browse files Browse the repository at this point in the history
* Correctly release visible_core_count

* Add test

Signed-off-by: Modular Magician <magic-modules@google.com>

Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored and slevenick committed Nov 22, 2022
1 parent ef0f97e commit 84f6040
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/6860.txt
@@ -0,0 +1,3 @@
```release-note:bug
compute: fixed a crash with `google_compute_instance_template` on a newly released field when `advanced_machine_features` was set
```
6 changes: 6 additions & 0 deletions google/resource_compute_instance_template.go
Expand Up @@ -642,6 +642,12 @@ func resourceComputeInstanceTemplate() *schema.Resource {
ForceNew: true,
Description: `The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. If unset, the maximum number of threads supported per core by the underlying processor is assumed.`,
},
"visible_core_count": {
Type: schema.TypeInt,
Optional: true,
ForceNew: true,
Description: `The number of physical cores to expose to an instance. Multiply by the number of threads per core to compute the total number of virtual CPUs to expose to the instance. If unset, the number of cores is inferred from the instance\'s nominal CPU count and the underlying platform\'s SMT width.`,
},
},
},
},
Expand Down
1 change: 1 addition & 0 deletions google/resource_compute_instance_template_test.go
Expand Up @@ -2507,6 +2507,7 @@ resource "google_compute_instance_template" "foobar" {
advanced_machine_features {
threads_per_core = 1
enable_nested_virtualization = true
visible_core_count = 1
}
scheduling {
Expand Down

0 comments on commit 84f6040

Please sign in to comment.