[common] Fix classes logic (#112)

This commit is contained in:
Bernd Schörgers 2020-11-06 21:54:25 +01:00 committed by GitHub
parent f36de85c15
commit 6b9650f348
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 7 deletions

View File

@ -2,7 +2,7 @@ apiVersion: v2
name: common
description: Function library for k8s-at-home charts
type: library
version: 1.0.1
version: 1.0.2
keywords:
- k8s-at-home
- common

View File

@ -3,8 +3,10 @@
{{- $apiv1beta1 := .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" -}}
{{- $ingressName := include "common.names.fullname" . -}}
{{- $values := .Values.ingress -}}
{{- if and (hasKey . "ObjectValues") (hasKey .ObjectValues "ingress") -}}
{{- $values = .ObjectValues.ingress -}}
{{- if hasKey . "ObjectValues" -}}
{{- with .ObjectValues.ingress -}}
{{- $values = . -}}
{{- end -}}
{{ end -}}
{{- if hasKey $values "nameSuffix" -}}
{{- $ingressName = printf "%v-%v" $ingressName $values.nameSuffix -}}

View File

@ -1,7 +1,9 @@
{{- define "common.classes.pvc" -}}
{{- $values := .Values.persistence -}}
{{- if and (hasKey . "ObjectValues") (hasKey .ObjectValues "persistence") -}}
{{- $values = .ObjectValues.persistence -}}
{{- if hasKey . "ObjectValues" -}}
{{- with .ObjectValues.persistence -}}
{{- $values = . -}}
{{- end -}}
{{ end -}}
{{- $pvcName := include "common.names.fullname" . -}}
{{- if hasKey $values "nameSuffix" -}}

View File

@ -1,7 +1,9 @@
{{- define "common.classes.service" -}}
{{- $values := .Values.service -}}
{{- if and (hasKey . "ObjectValues") (hasKey .ObjectValues "service") -}}
{{- $values = .ObjectValues.service -}}
{{- if hasKey . "ObjectValues" -}}
{{- with .ObjectValues.service -}}
{{- $values = . -}}
{{- end -}}
{{ end -}}
{{- $svcType := $values.type -}}
apiVersion: v1