Logseq - migrate storage section (adds acl) (#1955)

* update values

* update templates

* update ui

* bump version

* add miration
This commit is contained in:
Stavros Kois
2023-12-29 14:34:33 +02:00
committed by GitHub
parent 992a521584
commit bc86200511
6 changed files with 189 additions and 76 deletions

View File

@@ -42,4 +42,10 @@ workload:
type: {{ $protocol }}
port: {{ .Values.logseqNetwork.webPort }}
path: /health
initContainers:
{{- include "ix.v1.common.app.permissions" (dict "containerName" "01-permissions"
"UID" .Values.logseqRunAs.user
"GID" .Values.logseqRunAs.group
"mode" "check"
"type" "install") | nindent 8 }}
{{- end -}}

View File

@@ -34,28 +34,17 @@ persistence:
mountPath: /var/run
{{- range $idx, $storage := .Values.logseqStorage.additionalStorages }}
{{ printf "logseq-%v" (int $idx) }}:
{{- $size := "" -}}
{{- if $storage.size -}}
{{- $size = (printf "%vGi" $storage.size) -}}
{{- end }}
enabled: true
type: {{ $storage.type }}
datasetName: {{ $storage.datasetName | default "" }}
hostPath: {{ $storage.hostPath | default "" }}
server: {{ $storage.server | default "" }}
share: {{ $storage.share | default "" }}
domain: {{ $storage.domain | default "" }}
username: {{ $storage.username | default "" }}
password: {{ $storage.password | default "" }}
size: {{ $size }}
{{- if eq $storage.type "smb-pv-pvc" }}
mountOptions:
- key: noperm
{{- end }}
{{- include "logseq.storage.ci.migration" (dict "storage" $storage) }}
{{- include "ix.v1.common.app.storageOptions" (dict "storage" $storage) | nindent 4 }}
targetSelector:
logseq:
logseq:
mountPath: {{ $storage.mountPath }}
{{- if and (eq $storage.type "ixVolume") (not ($storage.ixVolumeConfig | default dict).aclEnable) }}
01-permissions:
mountPath: /mnt/directories{{ $storage.mountPath }}
{{- end }}
{{- end -}}
{{- if .Values.logseqNetwork.certificateID }}
@@ -81,3 +70,13 @@ scaleCertificate:
id: {{ .Values.logseqNetwork.certificateID }}
{{- end -}}
{{- end -}}
{{/* TODO: Remove on the next version bump, eg 1.2.0+ */}}
{{- define "logseq.storage.ci.migration" -}}
{{- $storage := .storage -}}
{{- if $storage.hostPath -}}
{{- $_ := set $storage "hostPathConfig" dict -}}
{{- $_ := set $storage.hostPathConfig "hostPath" $storage.hostPath -}}
{{- end -}}
{{- end -}}