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

fix crash when create compute cluster without specifying subtnetId #12658

Merged
Merged
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 @@ -240,10 +240,14 @@ func resourceComputeClusterRead(d *pluginsdk.ResourceData, meta interface{}) err
return fmt.Errorf("compute resource %s is not an Aml Compute cluster", id.ComputeName)
}

d.Set("vm_size", computeCluster.Properties.VMSize)
d.Set("vm_priority", computeCluster.Properties.VMPriority)
d.Set("scale_settings", flattenScaleSettings(computeCluster.Properties.ScaleSettings))
d.Set("subnet_resource_id", computeCluster.Properties.Subnet.ID)
if props := computeCluster.Properties; props != nil {
d.Set("vm_size", props.VMSize)
d.Set("vm_priority", props.VMPriority)
d.Set("scale_settings", flattenScaleSettings(props.ScaleSettings))
if props.Subnet != nil {
d.Set("subnet_resource_id", props.Subnet.ID)
}
}

if location := computeResource.Location; location != nil {
d.Set("location", azure.NormalizeLocation(*location))
Expand Down