mirror of
https://github.com/helm/charts.git
synced 2026-08-20 12:57:55 +00:00
[stable/consul] Fixes compatibility with 1.16 (#17527)
* Fixes compatibility with 1.16 Signed-off-by: Xiang Dai <764524258@qq.com> * fix white noise Signed-off-by: Xiang Dai <764524258@qq.com> * fix a typo Signed-off-by: Xiang Dai <764524258@qq.com> * update Signed-off-by: Xiang Dai <764524258@qq.com>
This commit is contained in:
committed by
Kubernetes Prow Robot
parent
2bd6e7b3c1
commit
403ec6a38d
@@ -1,7 +1,7 @@
|
||||
apiVersion: v1
|
||||
name: consul
|
||||
home: https://github.com/hashicorp/consul
|
||||
version: 3.9.1
|
||||
version: 3.9.2
|
||||
appVersion: 1.5.3
|
||||
description: Highly available and distributed service discovery and key-value store
|
||||
designed with support for the modern data center to make distributed systems and
|
||||
|
||||
@@ -30,3 +30,14 @@ Create chart name and version as used by the chart label.
|
||||
{{- define "consul.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the apiVersion of statefulset.
|
||||
*/}}
|
||||
{{- define "statefulset.apiVersion" -}}
|
||||
{{- if semverCompare "<1.9-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||
{{- print "apps/v1beta2" -}}
|
||||
{{- else if semverCompare ">=1.9-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||
{{- print "apps/v1" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
apiVersion: apps/v1
|
||||
apiVersion: {{ template "statefulset.apiVersion" . }}
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: "{{ template "consul.fullname" . }}"
|
||||
@@ -160,7 +160,7 @@ spec:
|
||||
JOIN_LAN=""
|
||||
for THIS_PEER in $JOIN_PEERS; do
|
||||
# Make sure we can resolve hostname and ping IP
|
||||
if PEER_IP="$(ping -c 1 $THIS_PEER | awk -F'[()]' '/PING/{print $2}')" && [ "$PEER_IP" != "" ]; then
|
||||
if PEER_IP="$(ping -c 1 $THIS_PEER | awk -F'[()]' '/PING/{print $2}')" && [ "$PEER_IP" != "" ]; then
|
||||
if [ "${PEER_IP}" != "${POD_IP}" ]; then
|
||||
JOIN_LAN="${JOIN_LAN}${JOIN_LAN:+ } -retry-join=$THIS_PEER"
|
||||
fi
|
||||
@@ -191,7 +191,7 @@ spec:
|
||||
JOIN_WAN=""
|
||||
for THIS_PEER in $WAN_PEERS; do
|
||||
# We don't care if we can ping the peer, but we do care that we can get its IP
|
||||
if PEER_IP="$( ( ping -c 1 $THIS_PEER || true ) | awk -F'[()]' '/PING/{print $2}')" && [ "$PEER_IP" != "" ]; then
|
||||
if PEER_IP="$( ( ping -c 1 $THIS_PEER || true ) | awk -F'[()]' '/PING/{print $2}')" && [ "$PEER_IP" != "" ]; then
|
||||
if [ "${PEER_IP}" != "${POD_IP}" ]; then
|
||||
JOIN_WAN="${JOIN_WAN}${JOIN_WAN:+ } -retry-join-wan=$THIS_PEER"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user