mirror of
https://github.com/lukaszraczylo/gohoarder.git
synced 2026-07-06 04:04:57 +00:00
fixup! fixup! fixup! fixup! fixup! chore: move directory setup from Helm initContainers to Dockerfiles
This commit is contained in:
@@ -172,3 +172,17 @@ Trivy cache volume configuration
|
|||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Validate SQLite configuration - SQLite cannot be used with SMB/NFS network storage
|
||||||
|
*/}}
|
||||||
|
{{- define "gohoarder.validateSQLiteConfig" -}}
|
||||||
|
{{- if eq .Values.metadata.backend "sqlite" }}
|
||||||
|
{{- if .Values.metadata.sqlite.persistence.enabled }}
|
||||||
|
{{- $storageClass := .Values.metadata.sqlite.persistence.storageClass | default .Values.storage.storageClass }}
|
||||||
|
{{- if or (contains "smb" ($storageClass | lower)) (contains "cifs" ($storageClass | lower)) (contains "nfs" ($storageClass | lower)) }}
|
||||||
|
{{- fail "\n\n❌ ERROR: SQLite cannot be used with SMB/CIFS/NFS network storage!\n\nSQLite requires POSIX file locking which is not reliably supported over network filesystems.\nThis will cause 'database is locked' errors and data corruption.\n\nPlease choose ONE of the following solutions:\n\n1. Use PostgreSQL for network storage (RECOMMENDED for production):\n metadata:\n backend: postgresql\n postgresql:\n host: your-postgres-host\n ...\n\n2. Use local storage for SQLite (OK for development):\n metadata:\n sqlite:\n persistence:\n enabled: true\n storageClass: local-path # or another local storage class\n\n3. Disable persistence (data will be lost on pod restart):\n metadata:\n sqlite:\n persistence:\n enabled: false\n\nFor more information, see: https://www.sqlite.org/lockingv3.html\n" }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{{- if .Values.security.enabled }}
|
{{- if .Values.security.enabled }}
|
||||||
|
{{- include "gohoarder.validateSQLiteConfig" . }}
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
{{- include "gohoarder.validateSQLiteConfig" . }}
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
|
|||||||
@@ -273,15 +273,30 @@ storage:
|
|||||||
# Metadata storage configuration
|
# Metadata storage configuration
|
||||||
metadata:
|
metadata:
|
||||||
# Backend: sqlite, postgresql
|
# Backend: sqlite, postgresql
|
||||||
# For multiple server replicas: postgresql is recommended (sqlite has concurrency limitations)
|
#
|
||||||
|
# IMPORTANT: SQLite CANNOT be used with SMB/CIFS/NFS network storage!
|
||||||
|
# SQLite requires POSIX file locking which causes "database is locked" errors on network filesystems.
|
||||||
|
#
|
||||||
|
# Choose your configuration:
|
||||||
|
# 1. SQLite with local storage (development/single-node only)
|
||||||
|
# - Set backend: sqlite
|
||||||
|
# - Set sqlite.persistence.storageClass to a LOCAL storage class (e.g., "local-path")
|
||||||
|
# - OR set sqlite.persistence.enabled: false to use emptyDir (data lost on pod restart)
|
||||||
|
#
|
||||||
|
# 2. PostgreSQL with any storage (RECOMMENDED for production)
|
||||||
|
# - Set backend: postgresql
|
||||||
|
# - Configure postgresql settings below
|
||||||
|
#
|
||||||
backend: "sqlite"
|
backend: "sqlite"
|
||||||
|
|
||||||
# SQLite configuration
|
# SQLite configuration
|
||||||
|
# WARNING: Do NOT use SMB/CIFS/NFS storage classes with SQLite!
|
||||||
sqlite:
|
sqlite:
|
||||||
# Use PVC for SQLite database
|
# Use PVC for SQLite database
|
||||||
|
# IMPORTANT: storageClass must be LOCAL storage, NOT network storage (smb/nfs)
|
||||||
persistence:
|
persistence:
|
||||||
enabled: true
|
enabled: false # Changed to false by default - use emptyDir unless you have local storage
|
||||||
storageClass: ""
|
storageClass: "" # Must be local-path or similar LOCAL storage class if enabled
|
||||||
size: "10Gi"
|
size: "10Gi"
|
||||||
accessMode: "ReadWriteOnce"
|
accessMode: "ReadWriteOnce"
|
||||||
existingClaim: ""
|
existingClaim: ""
|
||||||
|
|||||||
Reference in New Issue
Block a user