Skip to content

Commit 84f6040

Browse files
modular-magicianslevenick
authored andcommitted
Correctly release visible_core_count (#6860) (#13108)
* Correctly release visible_core_count * Add test Signed-off-by: Modular Magician <[email protected]> Signed-off-by: Modular Magician <[email protected]>
1 parent ef0f97e commit 84f6040

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

.changelog/6860.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
compute: fixed a crash with `google_compute_instance_template` on a newly released field when `advanced_machine_features` was set
3+
```

google/resource_compute_instance_template.go

+6
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,12 @@ func resourceComputeInstanceTemplate() *schema.Resource {
642642
ForceNew: true,
643643
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.`,
644644
},
645+
"visible_core_count": {
646+
Type: schema.TypeInt,
647+
Optional: true,
648+
ForceNew: true,
649+
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.`,
650+
},
645651
},
646652
},
647653
},

google/resource_compute_instance_template_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -2507,6 +2507,7 @@ resource "google_compute_instance_template" "foobar" {
25072507
advanced_machine_features {
25082508
threads_per_core = 1
25092509
enable_nested_virtualization = true
2510+
visible_core_count = 1
25102511
}
25112512
25122513
scheduling {

0 commit comments

Comments
 (0)