feat(common): Release 3.2.0 (#318)

Signed-off-by: Gavin Mogan <git@gavinmogan.com>
Co-authored-by: Gavin Mogan <git@gavinmogan.com>
Co-authored-by: repo-duster[bot] <87358111+repo-duster[bot]@users.noreply.github.com>
This commit is contained in:
Bernd Schorgers 2024-05-23 11:54:12 +02:00 committed by GitHub
parent 6cbaa61a4f
commit 4a5f448abd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 248 additions and 53 deletions

View file

@ -20,10 +20,16 @@ kind: ConfigMap
metadata:
name: {{ $configMapObject.name }}
{{- with $labels }}
labels: {{- toYaml . | nindent 4 -}}
labels:
{{- range $key, $value := . }}
{{ $key }}: {{ tpl $value $rootContext }}
{{- end }}
{{- end }}
{{- with $annotations }}
annotations: {{- toYaml . | nindent 4 -}}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ tpl $value $rootContext }}
{{- end }}
{{- end }}
data:
{{- with $configMapObject.data }}

View file

@ -28,10 +28,16 @@ kind: CronJob
metadata:
name: {{ $cronjobObject.name }}
{{- with $labels }}
labels: {{- toYaml . | nindent 4 -}}
labels:
{{- range $key, $value := . }}
{{ $key }}: {{ tpl $value $rootContext }}
{{- end }}
{{- end }}
{{- with $annotations }}
annotations: {{- toYaml . | nindent 4 -}}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ tpl $value $rootContext }}
{{- end }}
{{- end }}
spec:
suspend: {{ default false $cronJobSettings.suspend }}
@ -45,6 +51,9 @@ spec:
failedJobsHistoryLimit: {{ include "bjw-s.common.lib.defaultKeepNonNullValue" (dict "value" $cronJobSettings.failedJobsHistory "default" 1) }}
jobTemplate:
spec:
{{- with $cronJobSettings.activeDeadlineSeconds }}
activeDeadlineSeconds: {{ . }}
{{- end }}
{{- with $cronJobSettings.ttlSecondsAfterFinished }}
ttlSecondsAfterFinished: {{ . }}
{{- end }}

View file

@ -21,10 +21,16 @@ kind: DaemonSet
metadata:
name: {{ $daemonsetObject.name }}
{{- with $labels }}
labels: {{- toYaml . | nindent 4 -}}
labels:
{{- range $key, $value := . }}
{{ $key }}: {{ tpl $value $rootContext }}
{{- end }}
{{- end }}
{{- with $annotations }}
annotations: {{- toYaml . | nindent 4 -}}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ tpl $value $rootContext }}
{{- end }}
{{- end }}
spec:
revisionHistoryLimit: {{ include "bjw-s.common.lib.defaultKeepNonNullValue" (dict "value" $daemonsetObject.revisionHistoryLimit "default" 3) }}

View file

@ -21,10 +21,16 @@ kind: Deployment
metadata:
name: {{ $deploymentObject.name }}
{{- with $labels }}
labels: {{- toYaml . | nindent 4 -}}
labels:
{{- range $key, $value := . }}
{{ $key }}: {{ tpl $value $rootContext }}
{{- end }}
{{- end }}
{{- with $annotations }}
annotations: {{- toYaml . | nindent 4 -}}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ tpl $value $rootContext }}
{{- end }}
{{- end }}
spec:
revisionHistoryLimit: {{ include "bjw-s.common.lib.defaultKeepNonNullValue" (dict "value" $deploymentObject.revisionHistoryLimit "default" 3) }}

View file

@ -21,10 +21,16 @@ kind: Ingress
metadata:
name: {{ $ingressObject.name }}
{{- with $labels }}
labels: {{- toYaml . | nindent 4 -}}
labels:
{{- range $key, $value := . }}
{{ $key }}: {{ tpl $value $rootContext }}
{{- end }}
{{- end }}
{{- with $annotations }}
annotations: {{- toYaml . | nindent 4 -}}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ tpl $value $rootContext }}
{{- end }}
{{- end }}
spec:
{{- if $ingressObject.className }}

View file

@ -23,13 +23,22 @@ kind: Job
metadata:
name: {{ $jobObject.name }}
{{- with $labels }}
labels: {{- toYaml . | nindent 4 -}}
labels:
{{- range $key, $value := . }}
{{ $key }}: {{ tpl $value $rootContext }}
{{- end }}
{{- end }}
{{- with $annotations }}
annotations: {{- toYaml . | nindent 4 -}}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ tpl $value $rootContext }}
{{- end }}
{{- end }}
spec:
suspend: {{ default false $jobSettings.suspend }}
{{- with $jobSettings.activeDeadlineSeconds }}
activeDeadlineSeconds: {{ . }}
{{- end }}
{{- with $jobSettings.ttlSecondsAfterFinished }}
ttlSecondsAfterFinished: {{ . }}
{{- end }}

View file

@ -30,10 +30,16 @@ kind: NetworkPolicy
metadata:
name: {{ $networkPolicyObject.name }}
{{- with $labels }}
labels: {{- toYaml . | nindent 4 -}}
labels:
{{- range $key, $value := . }}
{{ $key }}: {{ tpl $value $rootContext }}
{{- end }}
{{- end }}
{{- with $annotations }}
annotations: {{- toYaml . | nindent 4 -}}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ tpl $value $rootContext }}
{{- end }}
{{- end }}
spec:
podSelector: {{- toYaml $podSelector | nindent 4 }}

View file

@ -27,10 +27,16 @@ apiVersion: v1
metadata:
name: {{ $pvcObject.name }}
{{- with $labels }}
labels: {{- toYaml . | nindent 4 -}}
labels:
{{- range $key, $value := . }}
{{ $key }}: {{ tpl $value $rootContext }}
{{- end }}
{{- end }}
{{- with $annotations }}
annotations: {{- toYaml . | nindent 4 -}}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ tpl $value $rootContext }}
{{- end }}
{{- end }}
spec:
accessModes:

View file

@ -28,10 +28,16 @@ kind: {{ $routeKind }}
metadata:
name: {{ $routeObject.name }}
{{- with $labels }}
labels: {{- toYaml . | nindent 4 -}}
labels:
{{- range $key, $value := . }}
{{ $key }}: {{ tpl $value $rootContext }}
{{- end }}
{{- end }}
{{- with $annotations }}
annotations: {{- toYaml . | nindent 4 -}}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ tpl $value $rootContext }}
{{- end }}
{{- end }}
spec:
parentRefs:

View file

@ -28,10 +28,16 @@ type: {{ . }}
metadata:
name: {{ $secretObject.name }}
{{- with $labels }}
labels: {{- toYaml . | nindent 4 -}}
labels:
{{- range $key, $value := . }}
{{ $key }}: {{ tpl $value $rootContext }}
{{- end }}
{{- end }}
{{- with $annotations }}
annotations: {{- toYaml . | nindent 4 -}}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ tpl $value $rootContext }}
{{- end }}
{{- end }}
{{- with $stringData }}
stringData: {{- tpl $stringData $rootContext | nindent 2 }}

View file

@ -23,10 +23,16 @@ kind: Service
metadata:
name: {{ $serviceObject.name }}
{{- with $labels }}
labels: {{- toYaml . | nindent 4 -}}
labels:
{{- range $key, $value := . }}
{{ $key }}: {{ tpl $value $rootContext }}
{{- end }}
{{- end }}
{{- with $annotations }}
annotations: {{- toYaml . | nindent 4 -}}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ tpl $value $rootContext }}
{{- end }}
{{- end }}
spec:
{{- if (eq $svcType "ClusterIP") }}

View file

@ -20,10 +20,16 @@ kind: ServiceAccount
metadata:
name: {{ $serviceAccountObject.name }}
{{- with $labels }}
labels: {{- toYaml . | nindent 4 -}}
labels:
{{- range $key, $value := . }}
{{ $key }}: {{ tpl $value $rootContext }}
{{- end }}
{{- end }}
{{- with $annotations }}
annotations: {{- toYaml . | nindent 4 -}}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ tpl $value $rootContext }}
{{- end }}
{{- end }}
secrets:
- name: {{ include "bjw-s.common.lib.chart.names.fullname" $rootContext }}-sa-token

View file

@ -15,10 +15,16 @@ kind: ServiceMonitor
metadata:
name: {{ $serviceMonitorObject.name }}
{{- with $labels }}
labels: {{- toYaml . | nindent 4 -}}
labels:
{{- range $key, $value := . }}
{{ $key }}: {{ tpl $value $rootContext }}
{{- end }}
{{- end }}
{{- with $annotations }}
annotations: {{- toYaml . | nindent 4 -}}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ tpl $value $rootContext }}
{{- end }}
{{- end }}
spec:
jobLabel: "{{ $serviceMonitorObject.name }}"

View file

@ -21,10 +21,16 @@ kind: StatefulSet
metadata:
name: {{ $statefulsetObject.name }}
{{- with $labels }}
labels: {{- toYaml . | nindent 4 -}}
labels:
{{- range $key, $value := . }}
{{ $key }}: {{ tpl $value $rootContext }}
{{- end }}
{{- end }}
{{- with $annotations }}
annotations: {{- toYaml . | nindent 4 -}}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ tpl $value $rootContext }}
{{- end }}
{{- end }}
spec:
revisionHistoryLimit: {{ include "bjw-s.common.lib.defaultKeepNonNullValue" (dict "value" $statefulsetObject.revisionHistoryLimit "default" 3) }}

View file

@ -5,7 +5,7 @@ Return the enabled NetworkPolicies.
{{- $rootContext := .rootContext -}}
{{- $enabledNetworkPolicies := dict -}}
{{- range $name, $networkPolicy := $rootContext.Values.networkPolicy -}}
{{- range $name, $networkPolicy := $rootContext.Values.networkpolicies -}}
{{- if kindIs "map" $networkPolicy -}}
{{- /* Enable by default, but allow override */ -}}
{{- $networkPolicyEnabled := true -}}

View file

@ -29,7 +29,11 @@ Returns the value for annotations
{{- if hasKey $configmap "enabled" -}}
{{- $configMapEnabled = $configmap.enabled -}}
{{- end -}}
{{- if $configMapEnabled -}}
{{- $configMapIncludeInChecksum := true -}}
{{- if hasKey $configmap "includeInChecksum" -}}
{{- $configMapIncludeInChecksum = $configmap.includeInChecksum -}}
{{- end -}}
{{- if and $configMapEnabled $configMapIncludeInChecksum -}}
{{- $_ := set $configMapsFound $name (toYaml $configmap.data | sha256sum) -}}
{{- end -}}
{{- end -}}
@ -47,7 +51,11 @@ Returns the value for annotations
{{- if hasKey $secret "enabled" -}}
{{- $secretEnabled = $secret.enabled -}}
{{- end -}}
{{- if $secretEnabled -}}
{{- $secretIncludeInChecksum := true -}}
{{- if hasKey $secret "includeInChecksum" -}}
{{- $secretIncludeInChecksum = $secret.includeInChecksum -}}
{{- end -}}
{{- if and $secretEnabled $secretIncludeInChecksum -}}
{{- $_ := set $secretsFound $name (toYaml $secret.stringData | sha256sum) -}}
{{- end -}}
{{- end -}}