Skip to content

Commit

Permalink
Leverages configurable fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
ridoo committed Aug 8, 2023
1 parent 41d6361 commit d97edba
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
22 changes: 22 additions & 0 deletions deployment/geonode/templates/geonode/geonode-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ spec:
mountPath: "/usr/src/geonode/geonode/geonode-k8s-settings.py"
subPath: geonode-k8s-settings.py
readOnly: true
{{ if .Values.geonodeFixtures }}
- name: geonode-fixtures
mountPath: "/usr/src/geonode/geonode/fixtures"
readOnly: true
{{ end }}

resources:
requests:
Expand Down Expand Up @@ -223,6 +228,12 @@ spec:
mountPath: "/usr/src/geonode/geonode/geonode-k8s-settings.py"
subPath: geonode-k8s-settings.py
readOnly: true
{{ if .Values.geonodeFixtures }}
- name: geonode-fixtures
mountPath: "/usr/src/geonode/geonode/fixtures"
readOnly: true
{{ end }}

resources:
requests:
memory: {{ .Values.geonode.celery.resources.requests.memory }}
Expand Down Expand Up @@ -262,6 +273,17 @@ spec:
items:
- key: geonode-k8s-settings.py
path: "geonode-k8s-settings.py"
{{- if .Values.geonodeFixtures }}
- name: geonode-fixtures
configMap:
name: {{ .Release.Name }}-geonode-fixtures
defaultMode: 0744
items:
{{- range $key, $value := .Values.geonodeFixtures }}
- key: {{ $key | quote }}
path: {{ $key | quote }}
{{- end }}
{{- end }}
# Using an emptyDir to cache compiled statics... it will survive container crashes, but not pod restarts
- name: cache-volume
emptyDir: {}
1 change: 1 addition & 0 deletions deployment/geonode/templates/geonode/geonode-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ data:

# General settings
FREETEXT_KEYWORDS_READONLY: {{ include "boolean2str" .Values.geonode.general.freetext_keywords_readonly | quote }}
FIXTURE_DIRS: "[ '/usr/src/geonode/fixtures' ]"
# PUBLISHING
RESOURCE_PUBLISHING: {{ include "boolean2str" .Values.geonode.general.publishing.resource_publishing_by_staff | quote }}
ADMIN_MODERATE_UPLOADS: {{ include "boolean2str" .Values.geonode.general.publishing.admin_moderate_uploads | quote }}
Expand Down
12 changes: 12 additions & 0 deletions deployment/geonode/templates/geonode/geonode-fixtures.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{ if .Values.geonodeFixtures }}
# fixture data for Django Geonode

apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-geonode-fixtures
namespace: {{ .Release.Namespace }}
data:
{{ toYaml .Values.geonodeFixtures | nindent 2 }}

{{ end }}
3 changes: 3 additions & 0 deletions deployment/geonode/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -444,3 +444,6 @@ postgres-operator-ui:
hosts:
- host: postgres-ui
paths: [""]

# fixture file content here
geonodeFixtures:

0 comments on commit d97edba

Please sign in to comment.