Skip to content

Commit

Permalink
check all fields nil and return []interface{}{} in flatten func
Browse files Browse the repository at this point in the history
  • Loading branch information
njuCZ committed Nov 20, 2020
1 parent d9edb8e commit f657fec
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ func resourceArmSpringCloudService() *schema.Resource {
"network": {
Type: schema.TypeList,
Optional: true,
Computed: true,
ForceNew: true,
MaxItems: 1,
Elem: &schema.Resource{
Expand Down Expand Up @@ -819,6 +818,10 @@ func flattenArmSpringCloudNetwork(input *appplatform.NetworkProfile) []interface
appNetworkResourceGroup = *input.AppNetworkResourceGroup
}

if serviceRuntimeSubnetID == "" && appSubnetID == "" && serviceRuntimeNetworkResourceGroup == "" && appNetworkResourceGroup == "" && len(cidrRanges) == 0 {
return []interface{}{}
}

return []interface{}{
map[string]interface{}{
"app_subnet_id": appSubnetID,
Expand Down

0 comments on commit f657fec

Please sign in to comment.