From a092a069310cf151c73379a64606fa9ef6564545 Mon Sep 17 00:00:00 2001 From: Javan lacerda Date: Wed, 31 Jul 2024 16:47:20 +0000 Subject: [PATCH] create helper for fulcio config yaml Signed-off-by: Javan lacerda --- charts/fulcio/Chart.yaml | 2 +- charts/fulcio/README.md | 2 +- charts/fulcio/templates/_helpers.tpl | 19 +++++++++++++++++++ charts/fulcio/templates/fulcio-configmap.yaml | 8 +++----- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/charts/fulcio/Chart.yaml b/charts/fulcio/Chart.yaml index 8f83d4b6..97560d43 100644 --- a/charts/fulcio/Chart.yaml +++ b/charts/fulcio/Chart.yaml @@ -5,7 +5,7 @@ description: | type: application -version: 2.4.0 +version: 2.4.1 appVersion: 1.5.1 keywords: diff --git a/charts/fulcio/README.md b/charts/fulcio/README.md index 2e66b47d..bb23b51c 100644 --- a/charts/fulcio/README.md +++ b/charts/fulcio/README.md @@ -2,7 +2,7 @@ -![Version: 2.4.0](https://img.shields.io/badge/Version-2.4.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.5.1](https://img.shields.io/badge/AppVersion-1.5.1-informational?style=flat-square) +![Version: 2.4.1](https://img.shields.io/badge/Version-2.4.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.5.1](https://img.shields.io/badge/AppVersion-1.5.1-informational?style=flat-square) Fulcio is a free code signing Certificate Authority, built to make short-lived certificates available to anyone. diff --git a/charts/fulcio/templates/_helpers.tpl b/charts/fulcio/templates/_helpers.tpl index 5eb25f0b..7ed42094 100644 --- a/charts/fulcio/templates/_helpers.tpl +++ b/charts/fulcio/templates/_helpers.tpl @@ -173,3 +173,22 @@ Return the contents for fulcio config. } {{- end -}} {{- end -}} + +{{/* +Return the contents for fulcio config yaml format. +*/}} +{{- define "fulcio.configmap.yaml" -}} +{{- if .Values.config.contents -}} +{{- toYaml .Values.config.contents }} +{{- else -}} +oidc-issuers: + https://kubernetes.default.svc: + issuer-url: https://kubernetes.default.svc + client-id: sigstore + type: kubernetes +meta-issuers: + https://kubernetes.*.svc: + client-id: sigstore + type: kubernetes +{{- end -}} +{{- end -}} diff --git a/charts/fulcio/templates/fulcio-configmap.yaml b/charts/fulcio/templates/fulcio-configmap.yaml index 2bbcfe85..00c5d5fd 100644 --- a/charts/fulcio/templates/fulcio-configmap.yaml +++ b/charts/fulcio/templates/fulcio-configmap.yaml @@ -10,12 +10,10 @@ data: # config's content. # If the field format is empty, the default case is consider that is a # json or is empty and should use the defaults as defined on the file _helpers.tpl -{{- if and (eq .Values.config.format "yaml") (.Values.config.contents) -}} - {{- with .Values.config.contents }} +{{- if eq .Values.config.format "yaml"}} config.yaml: |- - {{ toYaml . | indent 2 }} - {{- end }} -{{- else -}} +{{ include "fulcio.configmap.yaml" . | indent 4 }} +{{- else }} config.json: |- {{ include "fulcio.configmap.contents" . | indent 4 }} {{- end }}