Make host and container devicePath the same. (#356)

* Make host and container devicePath the same.

* update Common and Common-test versions
This commit is contained in:
Kjeld Schouten-Lebbing
2021-04-15 14:38:34 +02:00
committed by GitHub
parent 4d21cc66e2
commit 70bac7a29e
8 changed files with 25 additions and 37 deletions
+5 -6
View File
@@ -251,21 +251,20 @@ class Test < ChartTest
describe 'deviceMounts' do describe 'deviceMounts' do
default_name_1 = 'devicemount-test1' default_name_1 = 'devicemount-test1'
default_name_2 = 'devicemount-test2' default_name_2 = 'devicemount-test2'
default_mountPath_1 = '/test1' default_devicePath_1 = '/test1'
default_mountPath_2 = '/test2' default_devicePath_2 = '/test2'
empty_dir = {} empty_dir = {}
path = '/tmp'
it 'deviceMounts creates VolumeMounts' do it 'deviceMounts creates VolumeMounts' do
jq('.spec.template.spec.containers[0].volumeMounts[0].name', resource('Deployment')).must_equal default_name_1 jq('.spec.template.spec.containers[0].volumeMounts[0].name', resource('Deployment')).must_equal default_name_1
jq('.spec.template.spec.containers[0].volumeMounts[1].name', resource('Deployment')).must_equal default_name_2 jq('.spec.template.spec.containers[0].volumeMounts[1].name', resource('Deployment')).must_equal default_name_2
jq('.spec.template.spec.containers[0].volumeMounts[0].mountPath', resource('Deployment')).must_equal default_mountPath_1 jq('.spec.template.spec.containers[0].volumeMounts[0].mountPath', resource('Deployment')).must_equal default_devicePath_1
jq('.spec.template.spec.containers[0].volumeMounts[1].mountPath', resource('Deployment')).must_equal default_mountPath_2 jq('.spec.template.spec.containers[0].volumeMounts[1].mountPath', resource('Deployment')).must_equal default_devicePath_2
end end
it 'deviceMounts creates Volumes' do it 'deviceMounts creates Volumes' do
jq('.spec.template.spec.volumes[0].emptyDir', resource('Deployment')).must_equal empty_dir jq('.spec.template.spec.volumes[0].emptyDir', resource('Deployment')).must_equal empty_dir
jq('.spec.template.spec.volumes[1].hostPath.path', resource('Deployment')).must_equal path jq('.spec.template.spec.volumes[1].hostPath.path', resource('Deployment')).must_equal default_devicePath_2
end end
end end
+1 -1
View File
@@ -1,7 +1,7 @@
apiVersion: v2 apiVersion: v2
kubeVersion: ">=1.16.0-0" kubeVersion: ">=1.16.0-0"
name: common-test name: common-test
version: 2.1.2 version: 2.1.3
# upstream_version: # upstream_version:
appVersion: none appVersion: none
description: Helper chart to test different use cases of the common library description: Helper chart to test different use cases of the common library
+11 -14
View File
@@ -65,20 +65,6 @@ persistence:
size: 1Gi size: 1Gi
storageClass: "" storageClass: ""
# these values and names are set specifically with the unittests in mind.
fixMountPermissions: false
deviceMounts:
test1:
enabled: true
emptyDir: true
mountPath: "/test1"
hostPath: "/tmp"
test2:
enabled: true
emptyDir: false
mountPath: "/test2"
hostPath: "/tmp"
# these values and names are set specifically with the unittests in mind. # these values and names are set specifically with the unittests in mind.
customStorage: customStorage:
- name: "test3" - name: "test3"
@@ -92,3 +78,14 @@ customStorage:
setPermissions: true setPermissions: true
mountPath: "/test4" mountPath: "/test4"
hostPath: "/tmp" hostPath: "/tmp"
deviceMounts:
test1:
enabled: true
emptyDir: true
devicePath: "/test1"
test2:
enabled: true
emptyDir: false
devicePath: "/test2"
+2 -4
View File
@@ -60,13 +60,11 @@ deviceMounts:
test1: test1:
enabled: true enabled: true
emptyDir: true emptyDir: true
mountPath: "/test1" devicePath: "/test1"
hostPath: "/tmp"
test2: test2:
enabled: true enabled: true
emptyDir: false emptyDir: false
mountPath: "/test2" devicePath: "/test2"
hostPath: "/tmp"
# these values and names are set specifically with the unittests in mind. # these values and names are set specifically with the unittests in mind.
customStorage: customStorage:
+1 -1
View File
@@ -1,7 +1,7 @@
apiVersion: v2 apiVersion: v2
kubeVersion: ">=1.16.0-0" kubeVersion: ">=1.16.0-0"
name: common name: common
version: 3.0.3 version: 3.0.4
# upstream_version: # upstream_version:
appVersion: none appVersion: none
description: Function library for TrueCharts description: Function library for TrueCharts
@@ -20,7 +20,7 @@ Volumes included by the controller.
{{ $name = $dmm.name }} {{ $name = $dmm.name }}
{{ end }} {{ end }}
- name: devicemount-{{ $name }} - name: devicemount-{{ $name }}
mountPath: {{ $dmm.mountPath }} mountPath: {{ $dmm.devicePath }}
{{ if $dmm.subPath }} {{ if $dmm.subPath }}
subPath: {{ $dmm.subPath }} subPath: {{ $dmm.subPath }}
{{ end }} {{ end }}
@@ -57,7 +57,7 @@ Volumes included by the controller.
emptyDir: {} emptyDir: {}
{{- else -}} {{- else -}}
hostPath: hostPath:
path: {{ required "hostPath not set" $dm.hostPath }} path: {{ required "hostPath not set" $dm.devicePath }}
{{ end }} {{ end }}
{{ end }} {{ end }}
{{- end -}} {{- end -}}
+3 -9
View File
@@ -296,24 +296,18 @@ PGID: 568
UMASK: "002" UMASK: "002"
fixMountPermissions: true fixMountPermissions: true
# appVolumeMounts: # deviceMounts:
# config: # config:
# enabled: false # enabled: false
# emptyDir: false # emptyDir: false
# datasetName: "config" # hostPath: "/config"
# mountPath: "/config"
# subPath: some-subpath
# hostPathEnabled: false
# hostPath: ""
# setPermissions: true # setPermissions: true
# additionalAppVolumeMounts: # customStorage:
# - name: "data" # - name: "data"
# enabled: false # enabled: false
# emptyDir: false # emptyDir: false
# datasetName: "data"
# mountPath: "/data" # mountPath: "/data"
# subPath: some-subpath # subPath: some-subpath
# hostPathEnabled: false
# hostPath: "" # hostPath: ""
# setPermissions: true # setPermissions: true