Skip to content

Commit

Permalink
Set the enable-v2 etcd flag if missing
Browse files Browse the repository at this point in the history
  • Loading branch information
ktsakalozos committed Feb 10, 2020
1 parent 616336b commit b363aa6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions snap/hooks/configure
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,8 @@ fi

if grep -e "etcd.socket:2379" ${SNAP_DATA}/args/etcd
then
# TODO: Do something smart in selecting a port
installed=`${SNAP}/bin/grep '\-\-enable\-v2=true' ${SNAP}/args/etcd | wc -l`
if [ ${installed} -eq 0 ]; then
refresh_opt_in_config enable-v2 true etcd
fi
echo "Using a port for etcd"
# TODO: Do something smart in selecting a port
refresh_opt_in_config advertise-client-urls https://\${DEFAULT_INTERFACE_IP_ADDR}:12379 etcd
refresh_opt_in_config listen-client-urls https://0.0.0.0:12379 etcd
refresh_opt_in_config client-cert-auth true etcd
Expand All @@ -331,6 +327,12 @@ then
need_api_restart=true
fi

if ! grep '\-\-enable\-v2' ${SNAP_DATA}/args/etcd
then
refresh_opt_in_config enable-v2 true etcd
snapctl restart ${SNAP_NAME}.daemon-etcd
fi

if ${need_api_restart}
then
snapctl restart ${SNAP_NAME}.daemon-apiserver
Expand Down

0 comments on commit b363aa6

Please sign in to comment.