Merge pull request #11457 from nicktrav/nickt.force-send

upup: gcetasks: force send AutoCreateSubnetworks field when set to false
This commit is contained in:
Kubernetes Prow Robot 2021-05-13 08:16:26 -07:00 committed by GitHub
commit 3d5a4127b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -133,6 +133,11 @@ func (_ *Network) RenderGCE(t *gce.GCEAPITarget, a, e, changes *Network) error {
case "custom":
network.AutoCreateSubnetworks = false
// The boolean default value of "false" is omitted when the struct
// is serialized, which results in the network being created with
// the auto-create subnetworks default of "true". Explicitly send
// the default value.
network.ForceSendFields = []string{"AutoCreateSubnetworks"}
}
_, err := t.Cloud.Compute().Networks().Insert(t.Cloud.Project(), network)
if err != nil {