diff --git a/incubator/etcd/Chart.yaml b/incubator/etcd/Chart.yaml index 4e6742de1e..e43f697fbb 100755 --- a/incubator/etcd/Chart.yaml +++ b/incubator/etcd/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 name: etcd home: https://github.com/coreos/etcd -version: 0.7.3 +version: 0.7.4 appVersion: 3.2.26 description: Distributed reliable key-value store for the most critical data of a distributed system. diff --git a/incubator/etcd/templates/statefulset.yaml b/incubator/etcd/templates/statefulset.yaml index 71ef7e34df..b4b0176add 100644 --- a/incubator/etcd/templates/statefulset.yaml +++ b/incubator/etcd/templates/statefulset.yaml @@ -101,7 +101,7 @@ spec: AUTH_OPTIONS="{{ $etcdAuthOptions }}" member_hash() { - etcdctl $AUTH_OPTIONS member list | grep {{ $etcdPeerProtocol }}://${HOSTNAME}.${SET_NAME}:2380 | cut -d':' -f1 | cut -d'[' -f1 + etcdctl $AUTH_OPTIONS member list | grep {{ $etcdPeerProtocol }}://${HOSTNAME}.${SET_NAME}:2380 | cut -d ',' -f1 } SET_ID=${HOSTNAME##*[^0-9]} @@ -122,8 +122,8 @@ spec: AUTH_OPTIONS="{{ $etcdAuthOptions }}" # store member id into PVC for later member replacement collect_member() { - while ! etcdctl $AUTH_OPTIONS member list &>/dev/null; do sleep 1; done - etcdctl $AUTH_OPTIONS member list | grep {{ $etcdPeerProtocol }}://${HOSTNAME}.${SET_NAME}:2380 | cut -d':' -f1 | cut -d'[' -f1 > /var/run/etcd/member_id + while ! etcdctl $AUTH_OPTIONS member list > /dev/null 2>&1; do sleep 1; done + etcdctl $AUTH_OPTIONS member list | grep {{ $etcdPeerProtocol }}://${HOSTNAME}.${SET_NAME}:2380 | cut -d ',' -f1 > /var/run/etcd/member_id exit 0 } @@ -136,7 +136,7 @@ spec: } member_hash() { - etcdctl $AUTH_OPTIONS member list | grep {{ $etcdPeerProtocol }}://${HOSTNAME}.${SET_NAME}:2380 | cut -d':' -f1 | cut -d'[' -f1 + etcdctl $AUTH_OPTIONS member list | grep {{ $etcdPeerProtocol }}://${HOSTNAME}.${SET_NAME}:2380 | cut -d ',' -f1 } # we should wait for other pods to be up before trying to join @@ -150,7 +150,7 @@ spec: done # re-joining after failure? - if [ -e /var/run/etcd/default.etcd ]; then + if [ -e /var/run/etcd/default.etcd && -e /var/run/etcd/member_id ]; then echo "Re-joining etcd member" member_id=$(cat /var/run/etcd/member_id) @@ -255,4 +255,4 @@ spec: {{- else }} emptyDir: {} {{- end }} - {{- end }} \ No newline at end of file + {{- end }}