From 4d8f07c4f83437fc0a4b51104cf3e3c389f308d1 Mon Sep 17 00:00:00 2001 From: Peter Rifel Date: Tue, 25 Aug 2020 20:03:06 -0500 Subject: [PATCH] Fix GCE cluster creation with private topology This was later failing api validation with: `spec.subnets[1].region: Required value: region must be specified for GCE subnets` So now we copy the region value from the equivalent non-utility subnet when creating utility subnets. --- upup/pkg/fi/cloudup/new_cluster.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/upup/pkg/fi/cloudup/new_cluster.go b/upup/pkg/fi/cloudup/new_cluster.go index 125b45e71d..098d28ac00 100644 --- a/upup/pkg/fi/cloudup/new_cluster.go +++ b/upup/pkg/fi/cloudup/new_cluster.go @@ -856,9 +856,10 @@ func setupTopology(opt *NewClusterOptions, cluster *api.Cluster, allZones sets.S continue } subnet := api.ClusterSubnetSpec{ - Name: "utility-" + s.Name, - Zone: s.Zone, - Type: api.SubnetTypeUtility, + Name: "utility-" + s.Name, + Zone: s.Zone, + Type: api.SubnetTypeUtility, + Region: s.Region, } if subnetID, ok := zoneToSubnetProviderID[s.Zone]; ok { subnet.ProviderID = subnetID