fix(nova): backport live migration patch
diff --git a/charts/nova/templates/bin/_nova-compute-init.sh.tpl b/charts/nova/templates/bin/_nova-compute-init.sh.tpl
index 0636b69..442e7d6 100644
--- a/charts/nova/templates/bin/_nova-compute-init.sh.tpl
+++ b/charts/nova/templates/bin/_nova-compute-init.sh.tpl
@@ -23,18 +23,23 @@
chown ${NOVA_USER_UID} /var/lib/nova /var/lib/nova/instances
migration_interface="{{- .Values.conf.libvirt.live_migration_interface -}}"
-if [[ -n $migration_interface ]]; then
- # determine ip dynamically based on interface provided
- migration_address=$(ip a s $migration_interface | grep 'inet ' | awk '{print $2}' | awk -F "/" '{print $1}' | head -1)
+if [[ -z $migration_interface ]]; then
+ # search for interface with default routing
+ # If there is not default gateway, exit
+ migration_interface=$(ip -4 route list 0/0 | awk -F 'dev' '{ print $2; exit }' | awk '{ print $1 }') || exit 1
fi
-touch /tmp/pod-shared/nova-libvirt.conf
-if [[ -n $migration_address ]]; then
-cat <<EOF>/tmp/pod-shared/nova-libvirt.conf
+migration_address=$(ip a s $migration_interface | grep 'inet ' | awk '{print $2}' | awk -F "/" '{print $1}' | head -1)
+
+if [ -z "${migration_address}" ] ; then
+ echo "Var live_migration_interface is empty"
+ exit 1
+fi
+
+tee > /tmp/pod-shared/nova-libvirt.conf << EOF
[libvirt]
live_migration_inbound_addr = $migration_address
EOF
-fi
hypervisor_interface="{{- .Values.conf.hypervisor.host_interface -}}"
if [[ -z $hypervisor_interface ]]; then
diff --git a/hack/sync-charts.sh b/hack/sync-charts.sh
index 87400e1..09a6a04 100755
--- a/hack/sync-charts.sh
+++ b/hack/sync-charts.sh
@@ -142,6 +142,11 @@
| filterdiff -p1 -x 'releasenotes/*' \
| filterdiff -p2 -x 'Chart.yaml' \
| patch -p2 -d ${ATMOSPHERE}/charts/nova
+curl 'https://review.opendev.org/changes/openstack%2Fopenstack-helm~879066/revisions/2/patch?download' \
+ | base64 --decode \
+ | filterdiff -p1 -x 'releasenotes/*' \
+ | filterdiff -p2 -x 'Chart.yaml' \
+ | patch -p2 -d ${ATMOSPHERE}/charts/nova
SENLIN_VERSION=0.2.8
curl -sL https://tarballs.opendev.org/openstack/openstack-helm/senlin-${SENLIN_VERSION}.tgz \