Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UseIpAliases should default to true when not set and the ip_allocation_policy_block exists #3732

Merged
merged 1 commit into from
Jul 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2560,14 +2560,14 @@ func expandClusterAddonsConfig(configured interface{}) *containerBeta.AddonsConf
}

<% unless version == 'ga' -%>
func expandIPAllocationPolicy(configured interface{}, networking_mode string) (*containerBeta.IPAllocationPolicy, error) {
func expandIPAllocationPolicy(configured interface{}, networkingMode string) (*containerBeta.IPAllocationPolicy, error) {
<% else -%>
func expandIPAllocationPolicy(configured interface{}) (*containerBeta.IPAllocationPolicy, error) {
<% end -%>
l := configured.([]interface{})
if len(l) == 0 || l[0] == nil {
<% unless version == 'ga' -%>
if networking_mode == "VPC_NATIVE" {
if networkingMode == "VPC_NATIVE" {
return nil, fmt.Errorf("`ip_allocation_policy` block is required for VPC_NATIVE clusters.")
}
<% end -%>
Expand All @@ -2580,7 +2580,7 @@ func expandIPAllocationPolicy(configured interface{}) (*containerBeta.IPAllocati
config := l[0].(map[string]interface{})
return &containerBeta.IPAllocationPolicy{
<% unless version == 'ga' -%>
UseIpAliases: networking_mode == "VPC_NATIVE",
UseIpAliases: networkingMode == "VPC_NATIVE" || networkingMode == "",
<% else -%>
UseIpAliases: true,
<% end -%>
Expand All @@ -2591,7 +2591,7 @@ func expandIPAllocationPolicy(configured interface{}) (*containerBeta.IPAllocati
ServicesSecondaryRangeName: config["services_secondary_range_name"].(string),
ForceSendFields: []string{"UseIpAliases"},
<% unless version == 'ga' -%>
UseRoutes: networking_mode == "ROUTES",
UseRoutes: networkingMode == "ROUTES",
<% end -%>
}, nil
}
Expand Down