syncthing/test - migrate storage section (#2008)

* bump version

* update values

* update ui

* update templates

* add migration

* keep previous version
This commit is contained in:
Stavros Kois
2024-01-09 13:03:19 +02:00
committed by GitHub
parent 53b704b685
commit 95fb009bf6
11 changed files with 241 additions and 114 deletions

View File

@@ -2,9 +2,8 @@
persistence:
home:
enabled: true
type: {{ .Values.syncthingStorage.home.type }}
datasetName: {{ .Values.syncthingStorage.home.datasetName | default "" }}
hostPath: {{ .Values.syncthingStorage.home.hostPath | default "" }}
{{- include "syncthing.storage.ci.migration" (dict "storage" .Values.syncthingStorage.home) }}
{{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.syncthingStorage.home) | nindent 4 }}
targetSelector:
syncthing:
syncthing:
@@ -38,24 +37,9 @@ persistence:
{{- range $idx, $storage := .Values.syncthingStorage.additionalStorages }}
{{ printf "sync-%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 "syncthing.storage.ci.migration" (dict "storage" $storage) }}
{{- include "ix.v1.common.app.storageOptions" (dict "storage" $storage) | nindent 4 }}
targetSelector:
syncthing:
syncthing:
@@ -85,3 +69,13 @@ scaleCertificate:
id: {{ .Values.syncthingNetwork.certificateID }}
{{- end -}}
{{- end -}}
{{/* TODO: Remove on the next version bump, eg 1.2.0+ */}}
{{- define "syncthing.storage.ci.migration" -}}
{{- $storage := .storage -}}
{{- if $storage.hostPath -}}
{{- $_ := set $storage "hostPathConfig" dict -}}
{{- $_ := set $storage.hostPathConfig "hostPath" $storage.hostPath -}}
{{- end -}}
{{- end -}}