Skip to content
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
22 changes: 6 additions & 16 deletions packaging/systemd/configure-ovs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -666,12 +666,6 @@ if [ "$1" == "OVNKubernetes" ]; then
else
rm -f "${iface_default_hint_file}"
fi
externalGatewayInterface=$(get_cni_config "externalGatewayInterface")
if [ "$externalGatewayInterface" != "" ]; then
write_iface_external_hint "${extra_bridge_file}" "${externalGatewayInterface}"
else
rm -f "${extra_bridge_file}"
fi
fi
# Configures NICs onto OVS bridge "br-ex"
# Configuration is either auto-detected or provided through a config file written already in Network Manager
Expand Down Expand Up @@ -737,16 +731,15 @@ if [ "$1" == "OVNKubernetes" ]; then
fi
fi
convert_to_bridge "$iface" "br-ex" "phys0" "${BRIDGE_METRIC}"
# Check if we need to configure the second bridge
if [ -f "$extra_bridge_file" ] && (! nmcli connection show br-ex1 &> /dev/null || ! nmcli connection show ovs-if-phys1 &> /dev/null); then
interface=$(head -n 1 $extra_bridge_file)
convert_to_bridge "$interface" "br-ex1" "phys1" "${BRIDGE1_METRIC}"
fi
# Check if we need to remove the second bridge
if [ ! -f "$extra_bridge_file" ] && (nmcli connection show br-ex1 &> /dev/null || nmcli connection show ovs-if-phys1 &> /dev/null); then
# Remove the second bridge
if nmcli connection show br-ex1 &> /dev/null || nmcli connection show ovs-if-phys1 &> /dev/null; then
update_nm_conn_files br-ex1 phys1
rm_nm_conn_files
fi
# Remove the second bridge hint file
if [ -f "$extra_bridge_file" ]; then
rm -f "$extra_bridge_file"
fi
# Remove bridges created by openshift-sdn
ovs-vsctl --timeout=30 --if-exists del-br br0
# Make sure everything is activated
Expand All @@ -757,9 +750,6 @@ if [ "$1" == "OVNKubernetes" ]; then
fi
done < <(nmcli -g NAME c)
connections+=(ovs-if-phys0 ovs-if-br-ex)
if [ -f "$extra_bridge_file" ]; then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the $extra_bridge_file is used in other places in the script, do we want to remove them all at once in this PR or leave it until the detach ovnk gateway change lands in microshift?

Copy link
Copy Markdown
Contributor Author

@pliurh pliurh Jun 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will remove most of the content from configure-ovs.sh in 4.14 when the detach ovnk gateway change lands. All the NM configurations will be removed when users upgrade to 4.14.

When we backport this PR to 4.13, for clusters that have br-ex1 configured, we need to keep extra_bridge_file in the script to ensure the behavior of get_default_interface is unchanged during upgrade.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack+.

connections+=(ovs-if-phys1 ovs-if-br-ex1)
fi
activate_nm_connections "${connections[@]}"
elif [ "$1" == "OpenShiftSDN" ]; then
# Revert changes made by /usr/local/bin/configure-ovs.sh during SDN migration.
Expand Down