feat(common)!: Release v3.0.0-beta4 (#282)

This commit is contained in:
Bernd Schorgers 2024-03-10 17:08:43 +01:00 committed by GitHub
parent ea9484a7fd
commit a27c4f6124
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 283 additions and 157 deletions

View file

@ -3,7 +3,7 @@ apiVersion: v2
name: common
description: Function library for Helm charts
type: library
version: 3.0.0-beta3
version: 3.0.0-beta4
kubeVersion: ">=1.22.0-0"
keywords:
- common
@ -19,10 +19,13 @@ annotations:
Default objects (they used to be called main) have been commented out and will therefore no longer provide any (both expected and unexpected) default values.
- kind: changed
description: |-
enableServiceLinks is disabled by default
enableServiceLinks is now disabled by default
- kind: added
description: |-
Added support for restartPolicy field on container level
- kind: added
description: |-
Added json-schema to the chart
- kind: added
description: |-
Allow referencing secrets and configMaps by identifier in persistence section

View file

@ -93,10 +93,21 @@
"name": {
"type": "string"
},
"identifier": {
"type": "string"
},
"advancedMounts": {"$ref": "#/advancedMounts"},
"globalMounts": {"$ref": "#/globalMounts"}
},
"required": ["name"]
"oneOf": [{"required": ["name"]}, {"required": ["identifier"]}],
"dependencies": {
"name": {
"not": {"required": ["identifier"]}
},
"identifier": {
"not": {"required": ["name"]}
}
}
},
"secretItem": {
@ -114,10 +125,21 @@
"name": {
"type": "string"
},
"identifier": {
"type": "string"
},
"advancedMounts": {"$ref": "#/advancedMounts"},
"globalMounts": {"$ref": "#/globalMounts"}
},
"required": ["name"]
"oneOf": [{"required": ["name"]}, {"required": ["identifier"]}],
"dependencies": {
"name": {
"not": {"required": ["identifier"]}
},
"identifier": {
"not": {"required": ["name"]}
}
}
},
"nfsItem": {

View file

@ -58,8 +58,16 @@ Returns the value for volumes
{{- /* configMap persistence type */ -}}
{{- else if eq $persistenceValues.type "configMap" -}}
{{- $objectName := (required (printf "name not set for persistence item %s" $identifier) $persistenceValues.name) -}}
{{- $objectName = tpl $objectName $rootContext -}}
{{- $objectName := "" -}}
{{- if $persistenceValues.name -}}
{{- $objectName = tpl $persistenceValues.name $rootContext -}}
{{- else if $persistenceValues.identifier -}}
{{- $object := (include "bjw-s.common.lib.configMap.getByIdentifier" (dict "rootContext" $rootContext "id" $persistenceValues.identifier) | fromYaml ) -}}
{{- if not $object -}}
{{fail (printf "No configmap found with this identifier. (persistence item '%s', identifier '%s')" $identifier $persistenceValues.identifier)}}
{{- end -}}
{{- $objectName = $object.name -}}
{{- end -}}
{{- $_ := set $volume "configMap" dict -}}
{{- $_ := set $volume.configMap "name" $objectName -}}
{{- with $persistenceValues.defaultMode -}}
@ -71,8 +79,16 @@ Returns the value for volumes
{{- /* Secret persistence type */ -}}
{{- else if eq $persistenceValues.type "secret" -}}
{{- $objectName := (required (printf "name not set for persistence item %s" $identifier) $persistenceValues.name) -}}
{{- $objectName = tpl $objectName $rootContext -}}
{{- $objectName := "" -}}
{{- if $persistenceValues.name -}}
{{- $objectName = tpl $persistenceValues.name $rootContext -}}
{{- else if $persistenceValues.identifier -}}
{{- $object := (include "bjw-s.common.lib.secret.getByIdentifier" (dict "rootContext" $rootContext "id" $persistenceValues.identifier) | fromYaml ) -}}
{{- if not $object -}}
{{fail (printf "No secret found with this identifier. (persistence item '%s', identifier '%s')" $identifier $persistenceValues.identifier)}}
{{- end -}}
{{- $objectName = $object.name -}}
{{- end -}}
{{- $_ := set $volume "secret" dict -}}
{{- $_ := set $volume.secret "secretName" $objectName -}}
{{- with $persistenceValues.defaultMode -}}

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.0.0-beta3/charts/library/common/values.schema.json",
"$id": "https://raw.githubusercontent.com/bjw-s/helm-charts/common-3.0.0-beta4/charts/library/common/values.schema.json",
"type": "object",
"properties": {