Commit f27e0b2a authored by Dawn Chen's avatar Dawn Chen

Merge pull request #15290 from ZJU-SEL/enhance-lsb_release

enhance lsb_release detection for multi-docker
parents 2dd5b2b1 31f7d33d
...@@ -75,6 +75,15 @@ detect_lsb() { ...@@ -75,6 +75,15 @@ detect_lsb() {
fi fi
lsb_dist="$(echo ${lsb_dist} | tr '[:upper:]' '[:lower:]')" lsb_dist="$(echo ${lsb_dist} | tr '[:upper:]' '[:lower:]')"
case "${lsb_dist}" in
amzn|centos|debian|ubuntu)
;;
*)
echo "Error: We currently only support ubuntu|debian|amzn|centos."
exit 1
;;
esac
} }
...@@ -106,7 +115,7 @@ start_k8s(){ ...@@ -106,7 +115,7 @@ start_k8s(){
source subnet.env source subnet.env
# Configure docker net settings, then restart it # Configure docker net settings, then restart it
case "$lsb_dist" in case "${lsb_dist}" in
amzn) amzn)
DOCKER_CONF="/etc/sysconfig/docker" DOCKER_CONF="/etc/sysconfig/docker"
echo "OPTIONS=\"\$OPTIONS --mtu=${FLANNEL_MTU} --bip=${FLANNEL_SUBNET}\"" | sudo tee -a ${DOCKER_CONF} echo "OPTIONS=\"\$OPTIONS --mtu=${FLANNEL_MTU} --bip=${FLANNEL_SUBNET}\"" | sudo tee -a ${DOCKER_CONF}
...@@ -129,7 +138,7 @@ start_k8s(){ ...@@ -129,7 +138,7 @@ start_k8s(){
apt-get install bridge-utils && brctl delbr docker0 && service docker restart apt-get install bridge-utils && brctl delbr docker0 && service docker restart
;; ;;
*) *)
echo "Unsupported operations system $lsb_dist" echo "Unsupported operations system ${lsb_dist}"
exit 1 exit 1
;; ;;
esac esac
......
...@@ -84,6 +84,15 @@ detect_lsb() { ...@@ -84,6 +84,15 @@ detect_lsb() {
fi fi
lsb_dist="$(echo ${lsb_dist} | tr '[:upper:]' '[:lower:]')" lsb_dist="$(echo ${lsb_dist} | tr '[:upper:]' '[:lower:]')"
case "${lsb_dist}" in
amzn|centos|debian|ubuntu)
;;
*)
echo "Error: We currently only support ubuntu|debian|amzn|centos."
exit 1
;;
esac
} }
...@@ -108,7 +117,7 @@ start_k8s() { ...@@ -108,7 +117,7 @@ start_k8s() {
source subnet.env source subnet.env
# Configure docker net settings, then restart it # Configure docker net settings, then restart it
case "$lsb_dist" in case "${lsb_dist}" in
centos) centos)
DOCKER_CONF="/etc/sysconfig/docker" DOCKER_CONF="/etc/sysconfig/docker"
echo "OPTIONS=\"\$OPTIONS --mtu=${FLANNEL_MTU} --bip=${FLANNEL_SUBNET}\"" | sudo tee -a ${DOCKER_CONF} echo "OPTIONS=\"\$OPTIONS --mtu=${FLANNEL_MTU} --bip=${FLANNEL_SUBNET}\"" | sudo tee -a ${DOCKER_CONF}
...@@ -131,7 +140,7 @@ start_k8s() { ...@@ -131,7 +140,7 @@ start_k8s() {
apt-get install bridge-utils && brctl delbr docker0 && service docker restart apt-get install bridge-utils && brctl delbr docker0 && service docker restart
;; ;;
*) *)
echo "Unsupported operations system $lsb_dist" echo "Unsupported operations system ${lsb_dist}"
exit 1 exit 1
;; ;;
esac esac
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment