mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 08:57:04 +02:00
feat(common): Release common 4.0.0 (#398)
Co-authored-by: lab-assistant[bot] <180935599+lab-assistant[bot]@users.noreply.github.com>
This commit is contained in:
parent
1e210f43e3
commit
a01a89cb13
327 changed files with 11181 additions and 7330 deletions
23
charts/library/common/templates/lib/pvc/_enabled_pvcs.tpl
Normal file
23
charts/library/common/templates/lib/pvc/_enabled_pvcs.tpl
Normal file
|
@ -0,0 +1,23 @@
|
|||
{{/*
|
||||
Return the enabled PVCs.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.pvc.enabledPVCs" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $enabledPVCs := dict -}}
|
||||
|
||||
{{- range $identifier, $persistenceItem := $rootContext.Values.persistence -}}
|
||||
{{- if kindIs "map" $persistenceItem -}}
|
||||
{{- /* Enable PVC by default, but allow override */ -}}
|
||||
{{- $pvcEnabled := true -}}
|
||||
{{- if hasKey $persistenceItem "enabled" -}}
|
||||
{{- $pvcEnabled = $persistenceItem.enabled -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if and $pvcEnabled (eq (default "persistentVolumeClaim" $persistenceItem.type) "persistentVolumeClaim") (not $persistenceItem.existingClaim) -}}
|
||||
{{- $_ := set $enabledPVCs $identifier . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $enabledPVCs | toYaml -}}
|
||||
{{- end -}}
|
23
charts/library/common/templates/lib/pvc/_enabled_roles.tpl
Normal file
23
charts/library/common/templates/lib/pvc/_enabled_roles.tpl
Normal file
|
@ -0,0 +1,23 @@
|
|||
{{/*
|
||||
Return the enabled roles.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.rbac.role.enabledRoles" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $enabledRoles := dict -}}
|
||||
|
||||
{{- range $name, $role := $rootContext.Values.rbac.roles -}}
|
||||
{{- if kindIs "map" $role -}}
|
||||
{{- /* Enable Role by default, but allow override */ -}}
|
||||
{{- $roleEnabled := true -}}
|
||||
{{- if hasKey $role "enabled" -}}
|
||||
{{- $roleEnabled = $role.enabled -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $roleEnabled -}}
|
||||
{{- $_ := set $enabledRoles $name . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $enabledRoles | toYaml -}}
|
||||
{{- end -}}
|
13
charts/library/common/templates/lib/pvc/_getByIdentifier.tpl
Normal file
13
charts/library/common/templates/lib/pvc/_getByIdentifier.tpl
Normal file
|
@ -0,0 +1,13 @@
|
|||
{{/*
|
||||
Return a PVC object by its Identifier.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.pvc.getByIdentifier" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $identifier := .id -}}
|
||||
{{- $enabledPVCs := (include "bjw-s.common.lib.pvc.enabledPVCs" (dict "rootContext" $rootContext) | fromYaml ) }}
|
||||
|
||||
{{- if (hasKey $enabledPVCs $identifier) -}}
|
||||
{{- $objectValues := get $enabledPVCs $identifier -}}
|
||||
{{- include "bjw-s.common.lib.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $objectValues "itemCount" (len $enabledPVCs)) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
|
@ -1,7 +0,0 @@
|
|||
{{/*
|
||||
Validate PVC values
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.pvc.validate" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $pvcObject := .object -}}
|
||||
{{- end -}}
|
|
@ -1,26 +0,0 @@
|
|||
{{/*
|
||||
Convert PVC values to an object
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.pvc.valuesToObject" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $identifier := .id -}}
|
||||
{{- $objectValues := .values -}}
|
||||
|
||||
{{- /* Determine and inject the PVC name */ -}}
|
||||
{{- $objectName := (include "bjw-s.common.lib.chart.names.fullname" $rootContext) -}}
|
||||
|
||||
{{- if $objectValues.nameOverride -}}
|
||||
{{- if ne $objectValues.nameOverride "-" -}}
|
||||
{{- $objectName = printf "%s-%s" $objectName $objectValues.nameOverride -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if not (eq $objectName $identifier) -}}
|
||||
{{- $objectName = printf "%s-%s" $objectName $identifier -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $_ := set $objectValues "name" $objectName -}}
|
||||
{{- $_ := set $objectValues "identifier" $identifier -}}
|
||||
|
||||
{{- /* Return the PVC object */ -}}
|
||||
{{- $objectValues | toYaml -}}
|
||||
{{- end -}}
|
Loading…
Add table
Add a link
Reference in a new issue