Skip to content

Commit

Permalink
GA ILB multi-nic (#3289) (#398)
Browse files Browse the repository at this point in the history
* GA ILB multi-nic

* Failover is not GA, needs if/else

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Mar 23, 2020
1 parent 2d79acc commit dd5ee86
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions google/compute_region_backend_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,12 @@ func GetComputeRegionBackendServiceApiObject(d TerraformResourceData, config *Co
} else if v, ok := d.GetOkExists("timeout_sec"); !isEmptyValue(reflect.ValueOf(timeoutSecProp)) && (ok || !reflect.DeepEqual(v, timeoutSecProp)) {
obj["timeoutSec"] = timeoutSecProp
}
networkProp, err := expandComputeRegionBackendServiceNetwork(d.Get("network"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("network"); !isEmptyValue(reflect.ValueOf(networkProp)) && (ok || !reflect.DeepEqual(v, networkProp)) {
obj["network"] = networkProp
}
regionProp, err := expandComputeRegionBackendServiceRegion(d.Get("region"), d, config)
if err != nil {
return nil, err
Expand Down Expand Up @@ -426,6 +432,14 @@ func expandComputeRegionBackendServiceTimeoutSec(v interface{}, d TerraformResou
return v, nil
}

func expandComputeRegionBackendServiceNetwork(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
f, err := parseGlobalFieldValue("networks", v.(string), "project", d, config, true)
if err != nil {
return nil, fmt.Errorf("Invalid value for network: %s", err)
}
return f.RelativeLink(), nil
}

func expandComputeRegionBackendServiceRegion(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
f, err := parseGlobalFieldValue("regions", v.(string), "project", d, config, true)
if err != nil {
Expand Down

0 comments on commit dd5ee86

Please sign in to comment.