Skip to content

Commit

Permalink
fix missing labels on config files
Browse files Browse the repository at this point in the history
  • Loading branch information
sbaizet-ledger committed Sep 25, 2024
1 parent b511748 commit 96ca830
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
2 changes: 2 additions & 0 deletions charts/admin-system-cron/templates/config-file.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: admin-system-cron-config
labels:
{{- include "scroll-sdk.labels" $ | nindent 4 }}
data:
admin-system-backend-config.json: |
{{ .Values.scrollConfig | indent 4 }}
Expand Down
47 changes: 47 additions & 0 deletions charts/admin-system-cron/templates/helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "scroll-sdk.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "scroll-sdk.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Create chart name and build as used by the chart label.
*/}}
{{- define "scroll-sdk.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "scroll-sdk.labels" -}}
helm.sh/chart: {{ include "scroll-sdk.chart" . }}
{{ include "scroll-sdk.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/build: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "scroll-sdk.selectorLabels" -}}
app.kubernetes.io/name: {{ include "scroll-sdk.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/frontends/templates/config-file.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: frontends-config
labels:
{{- include "scroll-sdk.labels" $ | nindent 4 }}
data:
frontend-config: |
{{ .Values.scrollConfig | indent 4 }}
2 changes: 2 additions & 0 deletions charts/rollup-explorer-backend/templates/config-file.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: rollup-explorer-backend-config
labels:
{{- include "scroll-sdk.labels" $ | nindent 4 }}
data:
config.json: |
{{ .Values.scrollConfig | indent 4 }}

0 comments on commit 96ca830

Please sign in to comment.