Skip to content

Commit

Permalink
Remove helm hook annotation for initializer job (#526)
Browse files Browse the repository at this point in the history
* Remove helm hook annotation for initializer job

Signed-off-by: Aylei <rayingecho@gmail.com>

* Fix conditional

Signed-off-by: Aylei <rayingecho@gmail.com>

* Fix conditional structure

Signed-off-by: Aylei <rayingecho@gmail.com>

* Make tidb-configmap stable

Signed-off-by: Aylei <rayingecho@gmail.com>
  • Loading branch information
aylei authored and tennix committed May 30, 2019
1 parent fa324d0 commit 33e4142
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
14 changes: 14 additions & 0 deletions charts/tidb-cluster/templates/tidb-configmap-rollout.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- if .Values.enableConfigMapRollout }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "cluster.name" . }}-tidb-{{ template "tidb-configmap.data-digest" . }}
labels:
app.kubernetes.io/name: {{ template "chart.name" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: tidb
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
data:
{{ include "tidb-configmap.data" . | indent 2 }}
{{- end }}
7 changes: 3 additions & 4 deletions charts/tidb-cluster/templates/tidb-configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{{/*
tidb-initializer-job need a stable configmap name
*/}}
apiVersion: v1
kind: ConfigMap
metadata:
{{- if .Values.enableConfigMapRollout }}
name: {{ template "cluster.name" . }}-tidb-{{ template "tidb-configmap.data-digest" . }}
{{- else }}
name: {{ template "cluster.name" . }}-tidb
{{- end }}
labels:
app.kubernetes.io/name: {{ template "chart.name" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
Expand Down
8 changes: 1 addition & 7 deletions charts/tidb-cluster/templates/tidb-initializer-job.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{{- if (.Values.tidb.passwordSecretName) or (.Values.tidb.initSql) }}
{{- if or .Values.tidb.passwordSecretName .Values.tidb.initSql }}
apiVersion: batch/v1
kind: Job
metadata:
name: {{ template "cluster.name" . }}-tidb-initializer
annotations:
"helm.sh/hook": post-install
labels:
app.kubernetes.io/name: {{ template "chart.name" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
Expand Down Expand Up @@ -46,11 +44,7 @@ spec:
{{- if .Values.tidb.initSql }}
- name: init-sql
configMap:
{{- if .Values.enableConfigMapRollout }}
name: {{ template "cluster.name" . }}-tidb-{{ template "tidb-configmap.data-digest" . }}
{{- else }}
name: {{ template "cluster.name" . }}-tidb
{{- end }}
items:
- key: init-sql
path: init.sql
Expand Down

0 comments on commit 33e4142

Please sign in to comment.