Skip to content

Commit

Permalink
Always send internal_ip_only, if it is set by the user.
Browse files Browse the repository at this point in the history
This is required because the autogenerated Dataproc API client has `omitempty` on the field. So if the user specifies `internal_ip_only: false`, then it would not get sent to Dataproc. Thus Dataproc uses server-side defaulting. We don't want that. If the user specifies the value, we want to ensure that value is used.
  • Loading branch information
Harwayne committed Oct 2, 2024
1 parent 183b0d5 commit 3b40590
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2177,7 +2177,13 @@ func expandGceClusterConfig(d *schema.ResourceData, config *transport_tpg.Config
}
if v, ok := cfg["internal_ip_only"]; ok {
conf.InternalIpOnly = v.(bool)
// Normally default values are omitted. Concretely this means that if v is
// false, then it would not get sent on the request to Dataproc. However,
// the user has explicitly set internal_ip_only, therefore we need to send
// it on the wire to ensure Dataproc does not use server-side defaulting.
conf.ForceSendFields = append(conf.ForceSendFields, "InternalIpOnly")
}

if v, ok := cfg["metadata"]; ok {
conf.Metadata = tpgresource.ConvertStringMap(v.(map[string]interface{}))
}
Expand Down

0 comments on commit 3b40590

Please sign in to comment.