diff --git a/templates/gitea/config.yaml b/templates/gitea/config.yaml index ab4832d..983014d 100644 --- a/templates/gitea/config.yaml +++ b/templates/gitea/config.yaml @@ -17,6 +17,12 @@ metadata: type: Opaque stringData: assertions: | + +{{- /*assert that only one PG dep is enabled */ -}} +{{- if and (.Values.gitea.postgresql.enabled) (index (.Values.gitea "postgresql-ha" "enabled")) -}} + {{- fail "Only one of postgresql or postgresql-ha can be enabled at the same time." -}} +{{- end }} + {{- /* multiple replicas assertions */ -}} {{- if gt .Values.replicaCount 1.0 -}} {{- if .Values.gitea.config.cron.GIT_GC_REPOS -}} @@ -24,10 +30,11 @@ stringData: {{- fail "Invoking the garbage collector via CRON is not yet supported when running with multiple replicas. Please set 'GIT_GC_REPOS.enabled = false'." -}} {{- end }} {{- end }} + {{- if eq (first .Values.persistence.accessModes) "ReadWriteOnce" -}} {{- fail "When using multiple replicas, a RWX file system is required and gitea.persistence.accessModes[0] must be set to ReadWriteMany." -}} {{- end }} - + {{- if eq (get .Values.gitea.config.indexer "ISSUE_INDEXER_TYPE") "bleve" -}} {{- fail "When using multiple replicas, the issue indexer (gitea.config.indexer.ISSUE_INDEXER_TYPE) must be set to a HA-ready provider such as 'meilisearch', 'elasticsearch' or 'db' (if the DB is HA-ready)." -}} {{- end }}