change the way to get tunnel device
to set local_ip in osh, you have to use nic name.
but some devices can have different nic name.
so I add new option for getting tunnel device by cidr.
Added value:
network:
interface:
tunnel: null
tunnel_network_cidr: "0/0"
Change-Id: I8bffae640dfe0086de0b5274bb8c3cdce9754160
Signed-off-by: Hyunkook Cho <hk0713.cho@samsung.com>
This commit is contained in:
@@ -37,9 +37,14 @@ done
|
||||
|
||||
tunnel_interface="{{- .Values.network.interface.tunnel -}}"
|
||||
if [ -z "${tunnel_interface}" ] ; then
|
||||
# search for interface with default routing
|
||||
# If there is not default gateway, exit
|
||||
tunnel_interface=$(ip -4 route list 0/0 | awk -F 'dev' '{ print $2; exit }' | awk '{ print $1 }') || exit 1
|
||||
# search for interface with tunnel network routing
|
||||
tunnel_network_cidr="{{- .Values.network.interface.tunnel_network_cidr -}}"
|
||||
if [ -z "${tunnel_network_cidr}" ] ; then
|
||||
tunnel_network_cidr="0/0"
|
||||
fi
|
||||
# If there is not tunnel network gateway, exit
|
||||
tunnel_interface=$(ip -4 route list ${tunnel_network_cidr} | awk -F 'dev' '{ print $2; exit }' \
|
||||
| awk '{ print $1 }') || exit 1
|
||||
fi
|
||||
|
||||
# determine local-ip dynamically based on interface provided but only if tunnel_types is not null
|
||||
|
||||
@@ -51,9 +51,14 @@ done
|
||||
|
||||
tunnel_interface="{{- .Values.network.interface.tunnel -}}"
|
||||
if [ -z "${tunnel_interface}" ] ; then
|
||||
# search for interface with default routing
|
||||
# If there is not default gateway, exit
|
||||
tunnel_interface=$(ip -4 route list 0/0 | awk -F 'dev' '{ print $2; exit }' | awk '{ print $1 }') || exit 1
|
||||
# search for interface with tunnel network routing
|
||||
tunnel_network_cidr="{{- .Values.network.interface.tunnel_network_cidr -}}"
|
||||
if [ -z "${tunnel_network_cidr}" ] ; then
|
||||
tunnel_network_cidr="0/0"
|
||||
fi
|
||||
# If there is not tunnel network gateway, exit
|
||||
tunnel_interface=$(ip -4 route list ${tunnel_network_cidr} | awk -F 'dev' '{ print $2; exit }' \
|
||||
| awk '{ print $1 }') || exit 1
|
||||
fi
|
||||
|
||||
# determine local-ip dynamically based on interface provided but only if tunnel_types is not null
|
||||
|
||||
@@ -91,10 +91,11 @@ network:
|
||||
# debugging. This feature requires mount propagation support.
|
||||
share_namespaces: true
|
||||
interface:
|
||||
# Tunnel interface will be used for VXLAN tunneling. If null
|
||||
# (default) there is a fallback mechanism to search for interface
|
||||
# with default routing.
|
||||
# Tunnel interface will be used for VXLAN tunneling.
|
||||
tunnel: null
|
||||
# If tunnel is null there is a fallback mechanism to search
|
||||
# for interface with routing using tunnel network cidr.
|
||||
tunnel_network_cidr: "0/0"
|
||||
sriov:
|
||||
# To perform setup of network interfaces using the SR-IOV init
|
||||
# container you can use a section similar to:
|
||||
|
||||
Reference in New Issue
Block a user