diff --git a/.github/ct.yaml b/.github/ct.yaml index 75295ae..9c2b57c 100644 --- a/.github/ct.yaml +++ b/.github/ct.yaml @@ -5,4 +5,3 @@ check-version-increment: true debug: true helm-extra-args: --timeout 600s target-branch: main -upgrade: true diff --git a/charts/visual-regression-tracker/Chart.yaml b/charts/visual-regression-tracker/Chart.yaml index feec464..14775a4 100644 --- a/charts/visual-regression-tracker/Chart.yaml +++ b/charts/visual-regression-tracker/Chart.yaml @@ -6,13 +6,13 @@ sources: - https://github.com/Visual-Regression-Tracker/Visual-Regression-Tracker - https://github.com/kokuwaio/helm-charts/tree/main/charts/visual-regression-tracker type: application -version: 3.1.0 -appVersion: "5.0.3" +version: 3.2.0 +appVersion: "5.0.4" maintainers: - name: monotek email: monotek23@gmail.com dependencies: - name: postgresql - version: 13.3.0 + version: 15.5.10 repository: https://charts.bitnami.com/bitnami condition: vrtConfig.postgresql.enabled diff --git a/charts/visual-regression-tracker/templates/_helpers.tpl b/charts/visual-regression-tracker/templates/_helpers.tpl index f7a32ca..f64b5c2 100644 --- a/charts/visual-regression-tracker/templates/_helpers.tpl +++ b/charts/visual-regression-tracker/templates/_helpers.tpl @@ -104,3 +104,14 @@ vrt secret name {{ template "visual-regression-tracker.fullname" . }}-{{ .Values.secrets.defaults.secretName }} {{- end -}} {{- end -}} + +{{/* +vrt api url secret name +*/}} +{{- define "visual-regression-tracker.vrtApiUrlSecretName" -}} +{{- if .Values.secrets.apiUrl.useExisting -}} +{{ .Values.secrets.apiUrl.secretName }} +{{- else -}} +{{ template "visual-regression-tracker.fullname" . }}-{{ .Values.secrets.apiUrl.secretName }} +{{- end -}} +{{- end -}} diff --git a/charts/visual-regression-tracker/templates/secrets.yaml b/charts/visual-regression-tracker/templates/secrets.yaml index d5c0c3d..a1fa2cb 100644 --- a/charts/visual-regression-tracker/templates/secrets.yaml +++ b/charts/visual-regression-tracker/templates/secrets.yaml @@ -46,3 +46,15 @@ type: Opaque data: {{ .Values.secrets.defaults.secretKey }}: {{ tpl (.Files.Get "files/seed.ts") $ | b64enc }} {{ end }} +{{ if and .Values.vrtConfig.reactAppApiUrl (not .Values.secrets.apiUrl.useExisting) }} +--- +apiVersion: v1 +kind: Secret +metadata: + name: {{ template "visual-regression-tracker.vrtApiUrlSecretName" . }} + labels: + {{- include "visual-regression-tracker.labels" . | nindent 4 }} +type: Opaque +data: + {{ .Values.secrets.apiUrl.secretKey }}: {{ .Values.vrtConfig.reactAppApiUrl | b64enc | quote }} +{{ end }} diff --git a/charts/visual-regression-tracker/templates/statefulset.yaml b/charts/visual-regression-tracker/templates/statefulset.yaml index 74a02dd..073116f 100644 --- a/charts/visual-regression-tracker/templates/statefulset.yaml +++ b/charts/visual-regression-tracker/templates/statefulset.yaml @@ -122,7 +122,10 @@ spec: - name: {{ .Chart.Name }}-ui env: - name: REACT_APP_API_URL - value: "{{ .Values.vrtConfig.reactAppApiUrl }}" + valueFrom: + secretKeyRef: + name: {{ template "visual-regression-tracker.vrtApiUrlSecretName" . }} + key: {{ .Values.secrets.apiUrl.secretKey }} - name: VRT_VERSION value: "{{ .Chart.AppVersion }}" image: "{{ .Values.vrtComponents.ui.image.repository }}:{{ .Values.vrtComponents.ui.image.tag }}" diff --git a/charts/visual-regression-tracker/values.yaml b/charts/visual-regression-tracker/values.yaml index 1fbb384..008b2da 100644 --- a/charts/visual-regression-tracker/values.yaml +++ b/charts/visual-regression-tracker/values.yaml @@ -39,7 +39,7 @@ vrtComponents: image: repository: visualregressiontracker/api pullPolicy: IfNotPresent - tag: "5.0.4" + tag: "5.0.5" ingress: enabled: false @@ -171,6 +171,10 @@ persistence: annotations: {} secrets: + apiUrl: + useExisting: false + secretKey: api-url + secretName: vrt-api-url defaults: useExisting: false secretName: vrt