Small common touchup

This commit is contained in:
kjeld Schouten-Lebbing
2021-05-19 22:08:21 +02:00
parent dd51466087
commit 36fcfa18c4
4 changed files with 11 additions and 10 deletions

View File

@@ -19,4 +19,4 @@ name: common
sources:
- https://github.com/truecharts/apps/tree/master/library/common
type: library
version: 4.1.0
version: 4.1.1

View File

@@ -31,7 +31,7 @@ Main entrypoint for the common library chart. It will render all underlying temp
{{- if .Values.secret -}}
{{ include "common.secret" . | nindent 0 }}
{{- end -}}
{{ include "common.classes.portal" . | nindent 0 }}
{{ include "common.class.portal" . | nindent 0 }}
{{ include "common.class.mountPermissions" . | nindent 0 }}
{{- end -}}

View File

@@ -1,8 +1,9 @@
{{- define "common.classes.portal" -}}
{{- define "common.class.portal" -}}
{{- if .Values.portal }}
{{- if .Values.portal.enabled }}
{{- $svc := index .Values.services (keys .Values.services | first) -}}
{{- $primaryService := get .Values.service (include "common.service.primary" .) }}
{{- $primaryPort := get $primaryService.ports (include "common.classes.service.ports.primary" (dict "values" $primaryService)) -}}
{{- $ingr := index .Values.ingress (keys .Values.ingress | first) -}}
{{- $host := "$node_ip" }}
{{- $port := 443 }}
@@ -30,10 +31,10 @@
{{- if and ( .Values.portal.ingressPort ) ( ne $host "$node_ip" ) }}
{{- $port = .Values.portal.ingressPort }}
{{- else if eq $host "$node_ip" }}
{{- if eq $svc.type "NodePort" }}
{{- $port = $svc.port.nodePort }}
{{- if or ( eq $svc.port.protocol "HTTP" ) ( eq $svc.port.protocol "HTTPS" ) }}
{{- $portProtocol = $svc.port.protocol }}
{{- if eq $primaryService.type "NodePort" }}
{{- $port = $primaryPort.nodePort }}
{{- if or ( eq $primaryPort.protocol "HTTP" ) ( eq $primaryPort.protocol "HTTPS" ) }}
{{- $portProtocol = $primaryPort.protocol }}
{{- end }}
{{- end }}
{{- end }}
@@ -54,7 +55,7 @@
{{- $path = .Values.portal.path }}
{{- end }}
{{- print "---" | nindent 0 -}}
---
apiVersion: v1
kind: ConfigMap

View File

@@ -222,7 +222,7 @@ service:
# Additional ports can be added by adding a dictionary key similar to the 'http' service.
# @default -- See below
ports:
http:
main:
# -- Enables or disables the port
enabled: true