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

@ -3,7 +3,7 @@ apiVersion: v2
name: common
description: Function library for Helm charts
type: library
version: 3.1.0
version: 3.2.0
kubeVersion: ">=1.22.0-0"
keywords:
- common
@ -14,12 +14,18 @@ maintainers:
email: me@bjw-s.dev
annotations:
artifacthub.io/changes: |-
- kind: fixed
description: |-
Fixed `default` function overriding `0` values
- kind: fixed
description: |-
Fixed missing `volumeName` field in persistence schema
- kind: added
description: |-
Add jobLabel and namespaceSelector to serviceMonitor
Support templating in annotation and label values for all objects
- kind: added
description: |-
Support activeDeadlineSeconds field on CronJobs and Jobs
- kind: added
description: |-
Support excluding secrets and configMaps from pod checksum annotation
- kind: fixed
description: |-
Fixed failing ServiceMonitor test
- kind: fixed
description: |-
Fixed networkPolicies not rendering correctly

View file

@ -1,6 +1,6 @@
# common
![Version: 3.1.0](https://img.shields.io/badge/Version-3.1.0-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square)
![Version: 3.2.0](https://img.shields.io/badge/Version-3.2.0-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square)
Function library for Helm charts
@ -27,7 +27,7 @@ Include this chart as a dependency in your `Chart.yaml` e.g.
# Chart.yaml
dependencies:
- name: common
version: 3.1.0
version: 3.2.0
repository: https://bjw-s.github.io/helm-charts/
```

View file

@ -7,6 +7,10 @@
"type": "boolean",
"default": true
},
"includeInChecksum": {
"type": "boolean",
"default": true
},
"annotations": {
"$ref": "definitions.json#/annotations"
},

View file

@ -229,6 +229,9 @@
"timeZone": {
"type": "string"
},
"activeDeadlineSeconds": {
"type": "integer"
},
"ttlSecondsAfterFinished": {
"type": "integer"
}
@ -254,6 +257,9 @@
"type": "boolean",
"default": false
},
"activeDeadlineSeconds": {
"type": "integer"
},
"ttlSecondsAfterFinished": {
"type": "integer"
}

View file

@ -7,6 +7,10 @@
"type": "boolean",
"default": true
},
"includeInChecksum": {
"type": "boolean",
"default": true
},
"annotations": {
"$ref": "definitions.json#/annotations"
},

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 -}}

View file

@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "https://raw.githubusercontent.com/bjw-s/helm-charts/common-3.1.0/charts/library/common/values.schema.json",
"$id": "https://raw.githubusercontent.com/bjw-s/helm-charts/common-3.2.0/charts/library/common/values.schema.json",
"type": "object",
"properties": {

View file

@ -496,10 +496,10 @@ ingress:
# # -- Override the name suffix that is used for this ingress.
# nameOverride:
# # -- Provide additional annotations which may be required.
# # -- Provide additional annotations which may be required. Helm templates can be used.
# annotations: {}
# # -- Provide additional labels which may be required.
# # -- Provide additional labels which may be required. Helm templates can be used.
# labels: {}
# # -- Set the ingressClass that is used for this ingress.