Fix hostPathMounts and add install test (#527)

* Fix hostPathMounts and add install test

* whoops fix
This commit is contained in:
Kjeld Schouten-Lebbing
2021-05-28 23:06:40 +02:00
committed by GitHub
parent d782167fd3
commit 91c199f2ed
5 changed files with 70 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
apiVersion: v2
kubeVersion: ">=1.16.0-0"
name: common-test
version: 3.0.1
version: 3.0.2
# upstream_version:
appVersion: none
description: Helper chart to test different use cases of the common library

View File

@@ -0,0 +1,66 @@
image:
repository: b4bz/homer
tag: latest
pullPolicy: IfNotPresent
service:
main:
ports:
main:
port: 8080
ingress:
main:
enabled: true
persistence:
config:
enabled: true
mountPath: /config
emptyDir:
enabled: true
accessMode: ReadWriteOnce
size: 1Gi
skipuninstall: false
hostPathMounts:
- name: "hpmmountempty"
enabled: true
emptyDir:
enabled: true
mountPath: "/test1"
hostPath: ""
readOnly: false
- name: "hpmmountnonempty"
enabled: true
emptyDir:
enabled: false
mountPath: "/test2"
hostPath: "/tmp"
readOnly: false
- name: "hpmmountpermissions"
enabled: true
setPermissions: true
emptyDir:
enabled: false
mountPath: "/test3"
hostPath: "/tmp"
readOnly: false
- enabled: true
setPermissions: true
emptyDir:
enabled: false
mountPath: "/test4"
hostPath: "/tmp"
readOnly: false
probes:
liveness:
enabled: true
readiness:
enabled: true
startup:
enabled: true

View File

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

View File

@@ -18,7 +18,7 @@ before chart installation.
{{- $hostPathMounts := dict -}}
{{- range $name, $mount := .Values.hostPathMounts -}}
{{- if and $mount.enabled $mount.setPermissions -}}
{{- $name = default $name $mount.name -}}
{{- $name = default ( $name| toString ) $mount.name -}}
{{- $_ := set $hostPathMounts $name $mount -}}
{{- end -}}
{{- end }}

View File

@@ -72,7 +72,7 @@ Creates Volumes for hostPaths which can be directly mounted to a container
{{ if $hpm.name }}
{{ $name = $hpm.name }}
{{ end }}
- name: {{ printf "hostpathmounts-%s" $name }}
- name: hostpathmounts-{{ $name }}
{{- /* Always prefer an emptyDir next if that is set */}}
{{- $emptyDir := false -}}
{{- if $hpm.emptyDir -}}