Skip to content

Commit

Permalink
ensure kubeletDir slash
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonoughe committed Apr 23, 2024
1 parent cd7e9b7 commit a68c9d2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
7 changes: 7 additions & 0 deletions deploy/helm/charts/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,10 @@ Create the name of the priority class for csi controller plugin
{{- printf "%s" .Values.lvmController.priorityClass.name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}

{{/*
Ensure that the path to kubelet ends with a slash
*/}}
{{- define "lvmlocalpv.lvmNode.kubeletDir" -}}
{{- printf "%s/" (.Values.lvmNode.kubeletDir | trimSuffix "/") -}}
{{- end }}
10 changes: 5 additions & 5 deletions deploy/helm/charts/templates/lvm-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ spec:
- name: ADDRESS
value: /plugin/csi.sock
- name: DRIVER_REG_SOCK_PATH
value: {{ .Values.lvmNode.kubeletDir }}plugins/lvm-localpv/csi.sock
value: {{ printf "%s%s" (include "lvmlocalpv.lvmNode.kubeletDir" .) "plugins/lvm-localpv/csi.sock" | quote }}
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
Expand Down Expand Up @@ -117,7 +117,7 @@ spec:
- name: device-dir
mountPath: /dev
- name: pods-mount-dir
mountPath: {{ .Values.lvmNode.kubeletDir }}
mountPath: {{ include "lvmlocalpv.lvmNode.kubeletDir" . | quote }}
# needed so that any mounts setup inside this container are
# propagated back to the host machine.
mountPropagation: "Bidirectional"
Expand All @@ -130,15 +130,15 @@ spec:
type: Directory
- name: registration-dir
hostPath:
path: {{ .Values.lvmNode.kubeletDir }}plugins_registry/
path: {{ printf "%s%s" (include "lvmlocalpv.lvmNode.kubeletDir" .) "plugins_registry/" | quote }}
type: DirectoryOrCreate
- name: plugin-dir
hostPath:
path: {{ .Values.lvmNode.kubeletDir }}plugins/lvm-localpv/
path: {{ printf "%s%s" (include "lvmlocalpv.lvmNode.kubeletDir" .) "plugins/lvm-localpv/" | quote }}
type: DirectoryOrCreate
- name: pods-mount-dir
hostPath:
path: {{ .Values.lvmNode.kubeletDir }}
path: {{ include "lvmlocalpv.lvmNode.kubeletDir" . | quote }}
type: Directory
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
Expand Down

0 comments on commit a68c9d2

Please sign in to comment.