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

OCPBUGS-49662: Prevent resetting masquerade subnet #2641

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
11 changes: 11 additions & 0 deletions bindata/network/ovn-kubernetes/managed/ovnkube-control-plane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,15 @@ spec:
ovn_v6_transit_switch_subnet_opt="--cluster-manager-v6-transit-switch-subnet {{.V6TransitSwitchSubnet}}"
fi

ovn_v4_masquerade_subnet_opt=
if [[ "{{.V4MasqueradeSubnet}}" != "" ]]; then
ovn_v4_masquerade_subnet_opt="--gateway-v4-masquerade-subnet {{.V4MasqueradeSubnet}}"
fi
ovn_v6_masquerade_subnet_opt=
if [[ "{{.V6MasqueradeSubnet}}" != "" ]]; then
ovn_v6_masquerade_subnet_opt="--gateway-v6-masquerade-subnet {{.V6MasqueradeSubnet}}"
fi

dns_name_resolver_enabled_flag=
if [[ "{{.DNS_NAME_RESOLVER_ENABLE}}" == "true" ]]; then
dns_name_resolver_enabled_flag="--enable-dns-name-resolver"
Expand Down Expand Up @@ -211,6 +220,8 @@ spec:
${ovn_v6_join_subnet_opt} \
${ovn_v4_transit_switch_subnet_opt} \
${ovn_v6_transit_switch_subnet_opt} \
${ovn_v4_masquerade_subnet_opt} \
${ovn_v6_masquerade_subnet_opt} \
${dns_name_resolver_enabled_flag} \
${persistent_ips_enabled_flag} \
${multi_network_enabled_flag} \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,15 @@ spec:
ovn_v6_transit_switch_subnet_opt="--cluster-manager-v6-transit-switch-subnet {{.V6TransitSwitchSubnet}}"
fi

ovn_v4_masquerade_subnet_opt=
if [[ "{{.V4MasqueradeSubnet}}" != "" ]]; then
ovn_v4_masquerade_subnet_opt="--gateway-v4-masquerade-subnet {{.V4MasqueradeSubnet}}"
fi
ovn_v6_masquerade_subnet_opt=
if [[ "{{.V6MasqueradeSubnet}}" != "" ]]; then
ovn_v6_masquerade_subnet_opt="--gateway-v6-masquerade-subnet {{.V6MasqueradeSubnet}}"
fi

dns_name_resolver_enabled_flag=
if [[ "{{.DNS_NAME_RESOLVER_ENABLE}}" == "true" ]]; then
dns_name_resolver_enabled_flag="--enable-dns-name-resolver"
Expand Down Expand Up @@ -161,6 +170,8 @@ spec:
${ovn_v6_join_subnet_opt} \
${ovn_v4_transit_switch_subnet_opt} \
${ovn_v6_transit_switch_subnet_opt} \
${ovn_v4_masquerade_subnet_opt} \
${ovn_v6_masquerade_subnet_opt} \
${dns_name_resolver_enabled_flag} \
${persistent_ips_enabled_flag} \
${multi_network_enabled_flag} \
Expand Down
2 changes: 1 addition & 1 deletion pkg/network/ovn_kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -1306,7 +1306,7 @@ func bootstrapOVN(conf *operv1.Network, kubeClient cnoclient.Client, infraStatus
}

// set the default masquerade CIDR for new clusters while ignoring upgrades
if res.ControlPlaneUpdateStatus == nil && res.NodeUpdateStatus == nil {
if res.ControlPlaneUpdateStatus == nil || res.NodeUpdateStatus == nil {
klog.Infof("Configuring the default masquerade subnets to %q and %q", defaultV4MasqueradeSubnet, defaultV6MasqueradeSubnet)
res.DefaultV4MasqueradeSubnet = defaultV4MasqueradeSubnet
res.DefaultV6MasqueradeSubnet = defaultV6MasqueradeSubnet
Expand Down