Skip to content

Commit

Permalink
[ATMOSPHERE-497] [stable/2024.1] chart: sync ovn with upstream (#2028)
Browse files Browse the repository at this point in the history
Co-authored-by: okozachenko1203 <[email protected]>
Co-authored-by: Mohammed Naser <[email protected]>
  • Loading branch information
3 people authored Oct 25, 2024
1 parent f6820b3 commit a9dd1a4
Show file tree
Hide file tree
Showing 15 changed files with 323 additions and 587 deletions.
5 changes: 2 additions & 3 deletions .charts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,13 @@ charts:
repository: *openstack_helm_infra_repository
dependencies: *openstack_helm_dependencies
- name: ovn
version: 0.1.4
version: 0.1.13
repository: *openstack_helm_infra_repository
dependencies: *openstack_helm_dependencies
patches:
gerrit:
review.opendev.org:
- 893739
- 914807
- 933333
- name: placement
version: 0.3.9
repository: *openstack_helm_repository
Expand Down
2 changes: 1 addition & 1 deletion charts/ovn/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ name: ovn
sources:
- https://github.com/ovn-org/ovn
- https://opendev.org/openstack/openstack-helm
version: 0.1.4
version: 0.1.13
19 changes: 13 additions & 6 deletions charts/ovn/templates/bin/_ovn-controller-init.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ANNOTATION_KEY="atmosphere.cloud/ovn-system-id"

function get_ip_address_from_interface {
local interface=$1
local ip=$(ip -4 -o addr s "${interface}" | awk '{ print $4; exit }' | awk -F '/' '{print $1}')
local ip=$(ip -4 -o addr s "${interface}" | awk '{ print $4; exit }' | awk -F '/' 'NR==1 {print $1}')
if [ -z "${ip}" ] ; then
exit 1
fi
Expand All @@ -27,7 +27,7 @@ function get_ip_address_from_interface {

function get_ip_prefix_from_interface {
local interface=$1
local prefix=$(ip -4 -o addr s "${interface}" | awk '{ print $4; exit }' | awk -F '/' '{print $2}')
local prefix=$(ip -4 -o addr s "${interface}" | awk '{ print $4; exit }' | awk -F '/' 'NR==1 {print $2}')
if [ -z "${prefix}" ] ; then
exit 1
fi
Expand Down Expand Up @@ -70,7 +70,7 @@ function migrate_ip_from_nic {
elif [[ -z "${bridge_ip}" && -z "${ip}" ]]; then
echo "Interface and bridge have no ips configured. Leaving as is."
else
echo "Interface ${name} has invalid IP address. IP:[${ip}]; Prefix:[${prefix}]..."
echo "Interface ${src_nic} has invalid IP address. IP:[${ip}]; Prefix:[${prefix}]..."
exit 1
fi

Expand Down Expand Up @@ -144,13 +144,20 @@ ovs-vsctl set open . external-ids:rundir="/var/run/openvswitch"
ovs-vsctl set open . external-ids:ovn-encap-type="{{ .Values.conf.ovn_encap_type }}"
ovs-vsctl set open . external-ids:ovn-bridge="{{ .Values.conf.ovn_bridge }}"
ovs-vsctl set open . external-ids:ovn-bridge-mappings="{{ .Values.conf.ovn_bridge_mappings }}"
ovs-vsctl set open . external-ids:ovn-cms-options="${OVN_CMS_OPTIONS}"

GW_ENABLED=$(cat /tmp/gw-enabled/gw-enabled)
if [[ ${GW_ENABLED} == {{ .Values.labels.ovn_controller_gw.node_selector_value }} ]]; then
ovs-vsctl set open . external-ids:ovn-cms-options={{ .Values.conf.ovn_cms_options_gw_enabled }}
else
ovs-vsctl set open . external-ids:ovn-cms-options={{ .Values.conf.ovn_cms_options }}
fi

{{ if .Values.conf.ovn_bridge_datapath_type -}}
ovs-vsctl set open . external-ids:ovn-bridge-datapath-type="{{ .Values.conf.ovn_bridge_datapath_type }}"
{{- end }}

# Configure hostname
{{- if .Values.conf.use_fqdn.compute }}
{{- if .Values.pod.use_fqdn.compute }}
ovs-vsctl set open . external-ids:hostname="$(hostname -f)"
{{- else }}
ovs-vsctl set open . external-ids:hostname="$(hostname)"
Expand All @@ -164,7 +171,7 @@ do
bridge=${bmap%:*}
iface=${bmap#*:}
ovs-vsctl --may-exist add-br $bridge -- set bridge $bridge protocols=OpenFlow13
if [ -n "$iface" ] && [ "$iface" != "null" ]
if [ -n "$iface" ] && [ "$iface" != "null" ] && ( ip link show $iface 1>/dev/null 2>&1 );
then
ovs-vsctl --may-exist add-port $bridge $iface
migrate_ip_from_nic $iface $bridge
Expand Down
191 changes: 0 additions & 191 deletions charts/ovn/templates/daemonset-controller-gw.yaml

This file was deleted.

Loading

0 comments on commit a9dd1a4

Please sign in to comment.