Use first IP address for interface

It is possible than an interface has multiple IP addresses, for
simplicity of this change, use the first one so that the service
can start.

We can look later into improving it to accept some sort of index
for the IP address.

Change-Id: Ie856f54331d689a51bfd6de45db5820b765797ef
This commit is contained in:
Mohammed Naser 2021-03-08 11:48:03 -05:00
parent 80c8f6d6d3
commit fdd6b4507d
3 changed files with 4 additions and 3 deletions

View File

@ -14,7 +14,7 @@ apiVersion: v1
appVersion: v1.0.0
description: OpenStack-Helm Nova
name: nova
version: 0.1.15
version: 0.1.16
home: https://docs.openstack.org/nova/latest/
icon: https://www.openstack.org/themes/openstack/images/project-mascots/Nova/OpenStack_Project_Nova_vertical.png
sources:

View File

@ -25,7 +25,7 @@ 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}')
migration_address=$(ip a s $migration_interface | grep 'inet ' | awk '{print $2}' | awk -F "/" '{print $1}' | head -1)
fi
touch /tmp/pod-shared/nova-libvirt.conf
@ -43,7 +43,7 @@ if [[ -z $hypervisor_interface ]]; then
hypervisor_interface=$(ip -4 route list 0/0 | awk -F 'dev' '{ print $2; exit }' | awk '{ print $1 }') || exit 1
fi
hypervisor_address=$(ip a s $hypervisor_interface | grep 'inet ' | awk '{print $2}' | awk -F "/" '{print $1}')
hypervisor_address=$(ip a s $hypervisor_interface | grep 'inet ' | awk '{print $2}' | awk -F "/" '{print $1}' | head -1)
if [ -z "${hypervisor_address}" ] ; then
echo "Var my_ip is empty"

View File

@ -16,3 +16,4 @@ nova:
- 0.1.13 Change Issuer to ClusterIssuer
- 0.1.14 BUG for deploying multiple compute nodes
- 0.1.15 Mount /dev/pts in Nova compute container
- 0.1.16 Use first IP address for migration