Skip to content

Commit 272115d

Browse files
committed
exempt /status from maintenance redirect
1 parent 6ffaf15 commit 272115d

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

app/main/routes.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ def index():
2020
return render_template("index.html")
2121

2222

23+
@bp.route("/status", methods=["GET"])
24+
def status():
25+
return "OK"
26+
27+
2328
@bp.route("/maintenance-mode", methods=["GET"])
2429
def maintenance_mode_page():
2530
if not current_app.config["MAINTENANCE_MODE"]:
@@ -86,5 +91,9 @@ def csrf_error(error):
8691
@bp.before_request
8792
def maintenance_mode_middleware():
8893
maintenance_url = url_for("main.maintenance_mode_page")
89-
if current_app.config["MAINTENANCE_MODE"] and request.path != maintenance_url:
94+
exempt_urls = [
95+
maintenance_url,
96+
url_for("main.status"),
97+
]
98+
if current_app.config["MAINTENANCE_MODE"] and request.path not in exempt_urls:
9099
return redirect(maintenance_url)

helm_deploy/laa-access-civil-legal-aid/templates/deployment.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ spec:
4444
protocol: TCP
4545
livenessProbe:
4646
httpGet:
47-
path: /
47+
path: /status
4848
port: http
4949
readinessProbe:
5050
httpGet:
51-
path: /
51+
path: /status
5252
port: http

helm_deploy/laa-access-civil-legal-aid/templates/ingress.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ metadata:
1313
labels:
1414
{{- include "laa-access-civil-legal-aid.labels" . | nindent 4 }}
1515
annotations:
16+
nginx.ingress.kubernetes.io/custom-http-errors: "413,502,504"
1617
{{- if .Values.ingress.cluster.name }}
1718
external-dns.alpha.kubernetes.io/set-identifier: "{{ $fullName }}-{{ .Release.Namespace }}-{{- .Values.ingress.cluster.name -}}"
1819
external-dns.alpha.kubernetes.io/aws-weight: "{{- .Values.ingress.cluster.weight -}}"

0 commit comments

Comments
 (0)