Skip to content

Commit

Permalink
create helper for fulcio config yaml
Browse files Browse the repository at this point in the history
Signed-off-by: Javan lacerda <[email protected]>
  • Loading branch information
javanlacerda committed Aug 1, 2024
1 parent b0a2dc9 commit a092a06
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
2 changes: 1 addition & 1 deletion charts/fulcio/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: |
type: application

version: 2.4.0
version: 2.4.1
appVersion: 1.5.1

keywords:
Expand Down
2 changes: 1 addition & 1 deletion charts/fulcio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!-- This README.md is generated. Please edit README.md.gotmpl -->

![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.

Expand Down
19 changes: 19 additions & 0 deletions charts/fulcio/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
8 changes: 3 additions & 5 deletions charts/fulcio/templates/fulcio-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit a092a06

Please sign in to comment.