Skip to content

Commit

Permalink
fix(#3): still start frontend disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Jumpy-Squirrel committed Dec 23, 2023
1 parent 5c6623b commit fd23cdf
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 9 deletions.
2 changes: 1 addition & 1 deletion charts/eurofurence-registration-system/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: eurofurence-registration-system
version: 0.0.15
version: 0.0.16
description: A helm chart that can deploy the Eurofurence Registration System.
type: application
home: https://github.com/eurofurence/reg-helm-chart
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
{{- template "helpers.deployment" $classicInput }}
---
{{- end }}
{{- if .Values.system.components.frontend.enable }}
{{ $frontendInput := dict "name" "frontend"
"all" .Values
"component" .Values.system.components.frontend
Expand All @@ -67,4 +66,3 @@
"args" (list "-f" "/etc/apache2/regsys.conf" "-DNO_DETACH" "-DFOREGROUND")
"volume" "no" -}}
{{- template "helpers.deployment" $frontendInput }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@
{{- template "helpers.service" $classicInput }}
---
{{- end }}
{{- if .Values.system.components.frontend.enable }}
{{ $frontendInput := dict "name" "frontend"
"all" .Values
"component" .Values.system.components.frontend -}}
{{- template "helpers.service" $frontendInput }}
{{- end }}
74 changes: 72 additions & 2 deletions charts/eurofurence-registration-system/tests/deployments_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ suite: test deployments
templates:
- deployments.yaml
tests:
- it: should create no deployments if all disabled
- it: should create frontend deployment if all disabled
set:
system:
components:
Expand All @@ -21,8 +21,78 @@ tests:
frontend:
enable: false
asserts:
- isKind:
of: Deployment
- hasDocuments:
count: 0
count: 1
- equal:
path: metadata
value:
name: frontend
labels:
app: regsys
service: frontend
documentIndex: 0
- equal:
path: spec
value:
replicas: 1
revisionHistoryLimit: 3
selector:
matchLabels:
app: regsys
service: frontend
template:
metadata:
labels:
app: regsys
service: frontend
spec:
containers:
- name: application
image: 'ghcr.io/eurofurence/reg-frontend:latest'
ports:
- containerPort: 8080
name: primary
readinessProbe:
httpGet:
port: primary
path: /
initialDelaySeconds: 2
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
resources:
limits:
memory: 256Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
command: [/usr/sbin/httpd]
args:
- -f
- /etc/apache2/regsys.conf
- -DNO_DETACH
- -DFOREGROUND
env:
- name: HTTPD_CONF_PATH_PREFIX_NO_SLASHES
valueFrom:
configMapKeyRef:
name: regsys-cm
key: HTTPD_CONF_PATH_PREFIX_NO_SLASHES
- name: HTTPD_CONF_SERVER_NAME
valueFrom:
configMapKeyRef:
name: regsys-cm
key: HTTPD_CONF_SERVER_NAME
- name: HTTPD_CONF_STATIC_DIR
valueFrom:
configMapKeyRef:
name: regsys-cm
key: HTTPD_CONF_STATIC_DIR
documentIndex: 0
- it: should create all deployments minimal
set:
system:
Expand Down
25 changes: 23 additions & 2 deletions charts/eurofurence-registration-system/tests/services_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ suite: test services
templates:
- services.yaml
tests:
- it: should create no services if all disabled
- it: should create only frontend service if all disabled
set:
system:
components:
Expand All @@ -22,7 +22,28 @@ tests:
enable: false
asserts:
- hasDocuments:
count: 0
count: 1
- equal:
path: metadata
value:
name: frontend
labels:
app: regsys
service: frontend
documentIndex: 0
- equal:
path: spec
value:
ports:
- port: 8080
appProtocol: http
name: application
targetPort: primary
selector:
app: regsys
service: frontend
type: ClusterIP
documentIndex: 0
- it: should create expected services all enabled
set:
system:
Expand Down

0 comments on commit fd23cdf

Please sign in to comment.