Skip to content

Commit

Permalink
put genesis config into value file
Browse files Browse the repository at this point in the history
  • Loading branch information
sbaizet-ledger committed Sep 20, 2024
1 parent ed23f3e commit a569954
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 7 deletions.
8 changes: 4 additions & 4 deletions charts/balance-checker/templates/config-file.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{{- if .Values.global.isStandalone }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: balance-checker-config
labels:
{{- include "scroll-sdk.labels" $ | nindent 4 }}
data:
{{ (.Files.Glob "configs/balance-checker-config.json").AsConfig | indent 2 }}
---
{{- end }}
balance-checker-config.json : |
{{ .Values.scrollConfig | indent 4 }}
47 changes: 47 additions & 0 deletions charts/balance-checker/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: 1 addition & 1 deletion charts/scroll-common/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v2
description: scroll helm charts to deploy common scripts and configuration
name: scroll-common
version: 0.0.2
version: 0.0.3
appVersion: v0.1.0
kubeVersion: ">=1.22.0-0"
maintainers:
Expand Down
8 changes: 7 additions & 1 deletion charts/scroll-common/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# scroll-common

![Version: 0.0.2](https://img.shields.io/badge/Version-0.0.2-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square)
![Version: 0.0.3](https://img.shields.io/badge/Version-0.0.3-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square)

scroll helm charts to deploy common scripts and configuration

Expand All @@ -20,5 +20,11 @@ Kubernetes: `>=1.22.0-0`
|------------|------|---------|
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | external-secrets-lib | 0.0.3 |

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| genesisConfig | string | `"{}\n"` | |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
3 changes: 2 additions & 1 deletion charts/scroll-common/templates/genesis.conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ metadata:
{{- include "scroll-common.labels" $ | nindent 4 }}
name: genesis-config
data:
{{ (.Files.Glob "configs/genesis.json").AsConfig | indent 2 }}
genesis.json:
{{ .Values.genesisConfig indent 4 }}
2 changes: 2 additions & 0 deletions charts/scroll-common/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
genesisConfig: |
{}

0 comments on commit a569954

Please sign in to comment.