Skip to content

Commit 0c906c9

Browse files
Merge pull request #126 from trakrf/miks2u/tra-850-prod-image-gke-preprod
feat(banner): runtime ENVIRONMENT_LABEL passthrough (TRA-853)
2 parents 8204ca2 + 7c1da1a commit 0c906c9

4 files changed

Lines changed: 28 additions & 1 deletion

File tree

argocd/root/templates/trakrf-backend.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
image-updater annotations — they would be inert.
1515
*/ -}}
1616
{{- range $env, $cfg := $.Values.envs }}
17-
{{- $base := printf "database:\n name: trakrf\n user: trakrf-app\n credentialsSecret: trakrf-app-credentials\n host: %s\nmigrate:\n database: trakrf\n user: trakrf-migrate\n credentialsSecret: trakrf-migrate-credentials\n host: %s\nconfig:\n appEnv: %s\n" $cfg.dbHost $cfg.dbHost $env }}
17+
{{- $base := printf "database:\n name: trakrf\n user: trakrf-app\n credentialsSecret: trakrf-app-credentials\n host: %s\nmigrate:\n database: trakrf\n user: trakrf-migrate\n credentialsSecret: trakrf-migrate-credentials\n host: %s\nconfig:\n appEnv: %s\n environmentLabel: %q\n" $cfg.dbHost $cfg.dbHost $env $cfg.environmentLabel }}
18+
{{- if $cfg.imageTag }}
19+
{{- $base = printf "%simage:\n tag: %q\n" $base $cfg.imageTag }}
20+
{{- end }}
1821
{{- $ingress := "ingress:\n enabled: false\n" }}
1922
{{- if $cfg.ingressEnabled }}
2023
{{- $ingressCtx := dict

argocd/root/values.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@ namespaces:
2929
# in its own namespace.
3030
# ingressEnabled — gates the preview-style ingress + IPAllowList.
3131
# mqttIp — MQTT broker LB IP (Tofu-injected on GKE).
32+
# imageTag — trakrf-backend image tag override. Empty falls
33+
# back to chart default (helm/trakrf-backend/values-<cluster>.yaml).
34+
# On GKE preview that's intercepted by image-updater
35+
# to track `:preview`; prod pins an explicit tag
36+
# (the TRA-853 ServeSPA sha / floating `:prod` tag)
37+
# so no image-updater is needed. Empty until the
38+
# TRA-853 image is published.
39+
# environmentLabel — frontend banner label (TRA-853). Backend reads
40+
# ENVIRONMENT_LABEL at serve time and stamps it into
41+
# index.html. Empty / "prod" / "production" → no
42+
# banner. Same main image everywhere; the banner is
43+
# purely this runtime value.
3244
# dbCluster.enabled — false skips emitting the CNPG Cluster
3345
# Application entirely.
3446
# dbCluster.fullnameOverride — drives CNPG Cluster name + Argo App name.
@@ -43,6 +55,8 @@ envs:
4355
dbHost: trakrf-db-preview-rw.trakrf-preview
4456
ingressEnabled: true
4557
mqttIp: ""
58+
imageTag: ""
59+
environmentLabel: preview
4660
dbCluster:
4761
enabled: true
4862
fullnameOverride: trakrf-db-preview
@@ -53,6 +67,11 @@ envs:
5367
dbHost: trakrf-db-prod-rw.trakrf-prod
5468
ingressEnabled: true
5569
mqttIp: ""
70+
# Pinned to the first main image carrying the TRA-853 ServeSPA runtime-config
71+
# injection (merge commit c372f81). Required for environmentLabel to render.
72+
# Saturday's cutover may swap this for a floating :prod tag (TRA-375 call).
73+
imageTag: sha-c372f81
74+
environmentLabel: GKE pre-prod
5675
dbCluster:
5776
enabled: true
5877
fullnameOverride: trakrf-db-prod

helm/trakrf-backend/templates/configmap.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ metadata:
66
{{- include "trakrf-backend.labels" . | nindent 4 }}
77
data:
88
APP_ENV: {{ .Values.config.appEnv | quote }}
9+
ENVIRONMENT_LABEL: {{ .Values.config.environmentLabel | quote }}
910
BACKEND_LOG_LEVEL: {{ .Values.config.logLevel | quote }}
1011
SERVICE_NAME: {{ .Values.config.serviceName | quote }}
1112
BACKEND_CORS_ORIGIN: {{ .Values.config.corsOrigin | quote }}

helm/trakrf-backend/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ config:
111111
serviceName: trakrf-backend
112112
corsOrigin: ""
113113
jwtExpirationSeconds: "3600"
114+
# Display label for the frontend environment banner. The Go backend reads
115+
# ENVIRONMENT_LABEL at serve time and stamps window.__APP_CONFIG__ into
116+
# index.html (TRA-853). Empty / unset / "prod" / "production" → no banner.
117+
environmentLabel: ""
114118

115119
# Secrets. Values here land in a K8s Secret created by this chart.
116120
# For real deployments, override via values.secret.yaml (gitignored):

0 commit comments

Comments
 (0)