Compare commits

..

1 Commits

Author SHA1 Message Date
Bernd Schörgers
6b9650f348 [common] Fix classes logic (#112) 2020-11-06 15:54:25 -05:00
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