From be3f0d246602528618e7859ff9ebb2941d5ba732 Mon Sep 17 00:00:00 2001 From: Danny Bessems Date: Sat, 13 May 2023 17:28:45 +0200 Subject: [PATCH] Allow seed datainjection into configmap --- charts/json-server/Chart.yaml | 4 ++-- charts/json-server/templates/configmap.yaml | 11 +++-------- charts/json-server/values.yaml | 14 +++++++++----- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/charts/json-server/Chart.yaml b/charts/json-server/Chart.yaml index 77a8232..42eb0a3 100644 --- a/charts/json-server/Chart.yaml +++ b/charts/json-server/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: v0.2.2 +version: v0.3.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "v0.2.2" +appVersion: "v0.3.0" diff --git a/charts/json-server/templates/configmap.yaml b/charts/json-server/templates/configmap.yaml index 311bb01..8635b38 100644 --- a/charts/json-server/templates/configmap.yaml +++ b/charts/json-server/templates/configmap.yaml @@ -1,14 +1,9 @@ +{{- if not .Values.json-server.data.existingConfigMap }} apiVersion: v1 kind: ConfigMap metadata: name: {{ .Release.Name }}-configmap data: db.json: | - { - "metacluster": { - "version": "3.2.0", - "title": "json-server", - "author": "typicode" - }, - "foo": { "bar": "woot" } - } +{{ include "common.tplvalues.render" ( dict "value" .Values.json-server.data.configInline "context" $) | indent 4 }} +{{- end -}} diff --git a/charts/json-server/values.yaml b/charts/json-server/values.yaml index f94347f..5de3e1f 100644 --- a/charts/json-server/values.yaml +++ b/charts/json-server/values.yaml @@ -1,6 +1,10 @@ # Default values for json-server. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. + +json-server: + data: + # Not implemented yet + # existingConfigMap: "" + configInline: {} replicaCount: 1 @@ -47,14 +51,14 @@ ingress: # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" hosts: - - host: chart-example.local + - host: metadata.example.org paths: - path: / pathType: ImplementationSpecific tls: [] - # - secretName: chart-example-tls + # - secretName: json-server-tls # hosts: - # - chart-example.local + # - metadata.example.org resources: {} # We usually recommend not to specify default resources and to leave this as a conscious