adjust the naming style for resources to make them not pass the length limit (#12955)

Signed-off-by: Gang Liu <gang.liu@daocloud.io>

Signed-off-by: Gang Liu <gang.liu@daocloud.io>
This commit is contained in:
izturn
2022-10-14 18:45:56 +08:00
committed by GitHub
parent 4b447271e7
commit 523d82d90e
8 changed files with 20 additions and 20 deletions

View File

@@ -24,4 +24,4 @@ name: etcd
sources: sources:
- https://github.com/bitnami/containers/tree/main/bitnami/etcd - https://github.com/bitnami/containers/tree/main/bitnami/etcd
- https://coreos.com/etcd/ - https://coreos.com/etcd/
version: 8.5.5 version: 8.5.6

View File

@@ -69,9 +69,9 @@ Return the etcd configuration configmap
*/}} */}}
{{- define "etcd.configmapName" -}} {{- define "etcd.configmapName" -}}
{{- if .Values.existingConfigmap -}} {{- if .Values.existingConfigmap -}}
{{- printf "%s" (tpl .Values.existingConfigmap $) -}} {{- printf "%s" (tpl .Values.existingConfigmap $) | trunc 63 | trimSuffix "-" -}}
{{- else -}} {{- else -}}
{{- printf "%s-configuration" (include "common.names.fullname" .) -}} {{- printf "%s-configuration" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
@@ -89,7 +89,7 @@ Return the secret with etcd credentials
*/}} */}}
{{- define "etcd.secretName" -}} {{- define "etcd.secretName" -}}
{{- if .Values.auth.rbac.existingSecret -}} {{- if .Values.auth.rbac.existingSecret -}}
{{- printf "%s" .Values.auth.rbac.existingSecret -}} {{- printf "%s" .Values.auth.rbac.existingSecret | trunc 63 | trimSuffix "-" -}}
{{- else -}} {{- else -}}
{{- printf "%s" (include "common.names.fullname" .) -}} {{- printf "%s" (include "common.names.fullname" .) -}}
{{- end -}} {{- end -}}
@@ -120,9 +120,9 @@ Return the secret with etcd token private key
*/}} */}}
{{- define "etcd.token.secretName" -}} {{- define "etcd.token.secretName" -}}
{{- if .Values.auth.token.privateKey.existingSecret -}} {{- if .Values.auth.token.privateKey.existingSecret -}}
{{- printf "%s" .Values.auth.token.privateKey.existingSecret -}} {{- printf "%s" .Values.auth.token.privateKey.existingSecret | trunc 63 | trimSuffix "-" -}}
{{- else -}} {{- else -}}
{{- printf "%s-jwt-token" (include "common.names.fullname" .) -}} {{- printf "%s-jwt-token" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
@@ -131,11 +131,11 @@ Return the proper Disaster Recovery PVC name
*/}} */}}
{{- define "etcd.disasterRecovery.pvc.name" -}} {{- define "etcd.disasterRecovery.pvc.name" -}}
{{- if .Values.disasterRecovery.pvc.existingClaim -}} {{- if .Values.disasterRecovery.pvc.existingClaim -}}
{{- printf "%s" (tpl .Values.disasterRecovery.pvc.existingClaim $) -}} {{- printf "%s" (tpl .Values.disasterRecovery.pvc.existingClaim $) | trunc 63 | trimSuffix "-" -}}
{{- else if .Values.startFromSnapshot.existingClaim -}} {{- else if .Values.startFromSnapshot.existingClaim -}}
{{- printf "%s" (tpl .Values.startFromSnapshot.existingClaim $) -}} {{- printf "%s" (tpl .Values.startFromSnapshot.existingClaim $) | trunc 63 | trimSuffix "-" -}}
{{- else -}} {{- else -}}
{{- printf "%s-snapshotter" (include "common.names.fullname" .) }} {{- printf "%s-snapshotter" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
@@ -144,9 +144,9 @@ Return the proper Disaster Recovery PVC name
*/}} */}}
{{- define "etcd.serviceAccountName" -}} {{- define "etcd.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}} {{- if .Values.serviceAccount.create -}}
{{ default (include "common.names.fullname" .) .Values.serviceAccount.name }} {{ default (include "common.names.fullname" .) .Values.serviceAccount.name | trunc 63 | trimSuffix "-" }}
{{- else -}} {{- else -}}
{{ default "default" .Values.serviceAccount.name }} {{ default "default" .Values.serviceAccount.name | trunc 63 | trimSuffix "-" }}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
@@ -195,7 +195,7 @@ etcd: disasterRecovery
{{- define "etcd.token.jwtToken" -}} {{- define "etcd.token.jwtToken" -}}
{{- if (include "etcd.token.createSecret" .) -}} {{- if (include "etcd.token.createSecret" .) -}}
{{- $jwtToken := lookup "v1" "Secret" .Release.Namespace (printf "%s-jwt-token" (include "common.names.fullname" .)) -}} {{- $jwtToken := lookup "v1" "Secret" .Release.Namespace (printf "%s-jwt-token" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" ) -}}
{{- if $jwtToken -}} {{- if $jwtToken -}}
{{ index $jwtToken "data" "jwt-token.pem" | b64dec }} {{ index $jwtToken "data" "jwt-token.pem" | b64dec }}
{{- else -}} {{- else -}}

View File

@@ -2,7 +2,7 @@
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: {{ printf "%s-configuration" (include "common.names.fullname" .) }} name: {{ printf "%s-configuration" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
namespace: {{ .Release.Namespace | quote }} namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }} labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }} {{- if .Values.commonLabels }}

View File

@@ -2,7 +2,7 @@
apiVersion: {{ include "common.capabilities.cronjob.apiVersion" . }} apiVersion: {{ include "common.capabilities.cronjob.apiVersion" . }}
kind: CronJob kind: CronJob
metadata: metadata:
name: {{ printf "%s-snapshotter" (include "common.names.fullname" .) }} name: {{ printf "%s-snapshotter" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
namespace: {{ .Release.Namespace | quote }} namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }} labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }} {{- if .Values.commonLabels }}
@@ -80,7 +80,7 @@ spec:
value: {{ include "common.names.fullname" . | quote }} value: {{ include "common.names.fullname" . | quote }}
{{- $releaseNamespace := .Release.Namespace }} {{- $releaseNamespace := .Release.Namespace }}
{{- $etcdFullname := include "common.names.fullname" . }} {{- $etcdFullname := include "common.names.fullname" . }}
{{- $etcdHeadlessServiceName := printf "%s-%s" $etcdFullname "headless" }} {{- $etcdHeadlessServiceName := (printf "%s-%s" $etcdFullname "headless" | trunc 63 | trimSuffix "-") }}
{{- $clusterDomain := .Values.clusterDomain }} {{- $clusterDomain := .Values.clusterDomain }}
- name: ETCD_CLUSTER_DOMAIN - name: ETCD_CLUSTER_DOMAIN
value: {{ printf "%s.%s.svc.%s" $etcdHeadlessServiceName $releaseNamespace $clusterDomain | quote }} value: {{ printf "%s.%s.svc.%s" $etcdHeadlessServiceName $releaseNamespace $clusterDomain | quote }}

View File

@@ -2,7 +2,7 @@
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
apiVersion: v1 apiVersion: v1
metadata: metadata:
name: {{ printf "%s-snapshotter" (include "common.names.fullname" .) }} name: {{ printf "%s-snapshotter" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
namespace: {{ .Release.Namespace | quote }} namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }} labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }} {{- if .Values.commonLabels }}

View File

@@ -14,7 +14,7 @@ spec:
replicas: {{ .Values.replicaCount }} replicas: {{ .Values.replicaCount }}
selector: selector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
serviceName: {{ printf "%s-headless" (include "common.names.fullname" .) }} serviceName: {{ printf "%s-headless" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
podManagementPolicy: {{ .Values.podManagementPolicy }} podManagementPolicy: {{ .Values.podManagementPolicy }}
updateStrategy: {{- include "common.tplvalues.render" (dict "value" .Values.updateStrategy "context" $ ) | nindent 4 }} updateStrategy: {{- include "common.tplvalues.render" (dict "value" .Values.updateStrategy "context" $ ) | nindent 4 }}
template: template:
@@ -103,7 +103,7 @@ spec:
{{- $peerPort := int .Values.containerPorts.peer }} {{- $peerPort := int .Values.containerPorts.peer }}
{{- $etcdFullname := include "common.names.fullname" . }} {{- $etcdFullname := include "common.names.fullname" . }}
{{- $releaseNamespace := .Release.Namespace }} {{- $releaseNamespace := .Release.Namespace }}
{{- $etcdHeadlessServiceName := printf "%s-%s" $etcdFullname "headless" }} {{- $etcdHeadlessServiceName := (printf "%s-%s" $etcdFullname "headless" | trunc 63 | trimSuffix "-") }}
{{- $clusterDomain := .Values.clusterDomain }} {{- $clusterDomain := .Values.clusterDomain }}
{{- $etcdPeerProtocol := include "etcd.peerProtocol" . }} {{- $etcdPeerProtocol := include "etcd.peerProtocol" . }}
{{- $etcdClientProtocol := include "etcd.clientProtocol" . }} {{- $etcdClientProtocol := include "etcd.clientProtocol" . }}

View File

@@ -1,7 +1,7 @@
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: {{ printf "%s-headless" (include "common.names.fullname" .) }} name: {{ printf "%s-headless" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
namespace: {{ .Release.Namespace | quote }} namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }} labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }} {{- if .Values.commonLabels }}

View File

@@ -2,7 +2,7 @@
apiVersion: v1 apiVersion: v1
kind: Secret kind: Secret
metadata: metadata:
name: {{ printf "%s-jwt-token" (include "common.names.fullname" .) }} name: {{ printf "%s-jwt-token" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
namespace: {{ .Release.Namespace | quote }} namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }} labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonAnnotations }} {{- if .Values.commonAnnotations }}