Skip to content

Commit

Permalink
Fix for hashicorp#13097 panic.
Browse files Browse the repository at this point in the history
  • Loading branch information
aebrahim committed Nov 21, 2022
1 parent 9dfb774 commit 2a6d384
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions google/compute_instance_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,17 @@ func expandAdvancedMachineFeatures(d TerraformResourceData) *compute.AdvancedMac
}

prefix := "advanced_machine_features.0"
return &compute.AdvancedMachineFeatures{
EnableNestedVirtualization: d.Get(prefix + ".enable_nested_virtualization").(bool),
ThreadsPerCore: int64(d.Get(prefix + ".threads_per_core").(int)),
VisibleCoreCount: int64(d.Get(prefix + ".visible_core_count").(int)),
result := &compute.AdvancedMachineFeatures{}
if got, ok := d.GetOk(prefix + ".enable_nested_virtualization"); ok {
result.EnableNestedVirtualization = result.(bool)
}
if got, ok := d.GetOk(prefix + ".threads_per_core"); ok {
result.ThreadsPerCore = int64(got.(int))
}
if got, ok := d.GetOk(prefix + ".visible_core_count"); ok {
results.VisibleCoreCount = int64(got.(int))
}
return result
}

func flattenAdvancedMachineFeatures(AdvancedMachineFeatures *compute.AdvancedMachineFeatures) []map[string]interface{} {
Expand Down

0 comments on commit 2a6d384

Please sign in to comment.