Skip to content

Commit 94c849d

Browse files
chore: apply RHDH-specific changes to vendored Backstage chart
1 parent c495e00 commit 94c849d

4 files changed

Lines changed: 119 additions & 3 deletions

File tree

charts/backstage/vendor/backstage/.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,9 @@
55
.idea
66

77
# helm chart dependencies
8-
charts/*/charts/
8+
charts/*/charts/*
99
**/charts/*.tgz
10+
11+
# RHDH: track vendored chart dependencies
12+
# Since this chart is vendored, we commit its dependencies rather than fetching them at install time
13+
!charts/*/charts/*.tgz
Binary file not shown.
Binary file not shown.

charts/backstage/vendor/backstage/charts/backstage/templates/backstage-deployment.yaml

Lines changed: 114 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
{{- $imageRepository := .Values.backstage.image.repository | required "The repository name of the image is required (e.g. my-backstage:tag | docker.io/my-backstage:tag) !" -}}
22
{{- $imageTag := .Values.backstage.image.tag | required "The image tag is required (e.g my-backstage:tag | docker.io/my-backstage:tag) !" -}}
33
{{- $installDir := .Values.backstage.installDir -}}
4+
{{- $lightspeed := include "rhdh.lightspeed" . | fromYaml -}}
5+
{{- $lightspeedRuntimeVolumeType := "" -}}
6+
{{- if $lightspeed.enabled -}}
7+
{{- $lightspeedRuntimeVolumeType = include "rhdh.lightspeed.runtimeVolumeType" (dict "volume" $lightspeed.runtimeVolume "path" "global.lightspeed.runtimeVolume") -}}
8+
{{- end -}}
9+
{{- $extraCatalogImages := include "rhdh.catalogIndex.extraImagesEnvValue" . | trim -}}
410
---
511
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
612
kind: Deployment
@@ -39,6 +45,11 @@ spec:
3945
{{- end }}
4046
annotations:
4147
checksum/app-config: {{ include "common.tplvalues.render" ( dict "value" .Values.backstage.appConfig "context" $) | sha256sum }}
48+
checksum/dynamic-plugins: {{ include "common.tplvalues.render" ( dict "value" (dict "dynamic" .Values.global.dynamic "lightspeed" (dict "enabled" $lightspeed.enabled "plugins" $lightspeed.plugins)) "context" $) | sha256sum }}
49+
{{- if $lightspeed.enabled }}
50+
checksum/lightspeed-configmaps: {{ include "rhdh.lightspeed.configMapsChecksum" (dict "context" $ "lightspeed" $lightspeed) | sha256sum }}
51+
checksum/lightspeed-secret: {{ include "rhdh.lightspeed.secretChecksum" (dict "context" $ "lightspeed" $lightspeed) | sha256sum }}
52+
{{- end }}
4253
{{- if .Values.backstage.podAnnotations }}
4354
{{- include "common.tplvalues.render" ( dict "value" .Values.backstage.podAnnotations "context" $ ) | nindent 8 }}
4455
{{- end }}
@@ -84,10 +95,69 @@ spec:
8495
configMap:
8596
name: {{ include "common.names.fullname" . }}-app-config
8697
{{- end }}
98+
{{- if $lightspeed.enabled }}
99+
- name: {{ $lightspeed.runtimeVolume.name }}
100+
{{- if eq $lightspeedRuntimeVolumeType "persistentVolumeClaim" }}
101+
persistentVolumeClaim:
102+
{{- include "common.tplvalues.render" ( dict "value" $lightspeed.runtimeVolume.persistentVolumeClaim "context" $ ) | nindent 12 }}
103+
{{- else }}
104+
emptyDir:
105+
{{- include "common.tplvalues.render" ( dict "value" $lightspeed.runtimeVolume.emptyDir "context" $ ) | nindent 12 }}
106+
{{- end }}
107+
- name: {{ $lightspeed.ragVolume.name }}
108+
emptyDir:
109+
{{- include "common.tplvalues.render" ( dict "value" $lightspeed.ragVolume.emptyDir "context" $ ) | nindent 12 }}
110+
{{- range $lightspeed.configMaps }}
111+
- name: {{ include "rhdh.lightspeed.configMapVolumeName" . }}
112+
configMap:
113+
name: {{ include "rhdh.lightspeed.configMapName" (dict "root" $ "configMap" .) }}
114+
optional: {{ default false .optional }}
115+
{{- end }}
116+
{{- end }}
87117
{{- include "backstage.renderImagePullSecrets" . | nindent 6 }}
88-
{{- if .Values.backstage.initContainers }}
118+
{{- if or .Values.backstage.initContainers $lightspeed.enabled }}
89119
initContainers:
90-
{{- include "common.tplvalues.render" ( dict "value" .Values.backstage.initContainers "context" $) | nindent 8 }}
120+
{{- if .Values.backstage.initContainers }}
121+
{{- range .Values.backstage.initContainers }}
122+
{{- $container := include "common.tplvalues.render" (dict "value" . "context" $) | fromYaml }}
123+
{{- if and $extraCatalogImages (eq (index $container "name") "install-dynamic-plugins") }}
124+
{{- $hasExisting := false }}
125+
{{- range (default list (index $container "env")) }}
126+
{{- if eq (default "" .name) "EXTRA_CATALOG_INDEX_IMAGES" }}{{ $hasExisting = true }}{{ end }}
127+
{{- end }}
128+
{{- if not $hasExisting }}
129+
{{- $_ := set $container "env" (append (default list (index $container "env")) (dict "name" "EXTRA_CATALOG_INDEX_IMAGES" "value" $extraCatalogImages)) }}
130+
{{- end }}
131+
{{- end }}
132+
- {{ $container | toYaml | nindent 10 | trim }}
133+
{{- end }}
134+
{{- end }}
135+
{{- if $lightspeed.enabled }}
136+
- name: {{ $lightspeed.initContainer.name }}
137+
image: {{ include "backstage.image.render" (dict "image" $lightspeed.initContainer.image "global" .Values.global) | quote }}
138+
imagePullPolicy: {{ $lightspeed.initContainer.imagePullPolicy | quote }}
139+
{{- if $lightspeed.initContainer.securityContext }}
140+
securityContext:
141+
{{- include "common.tplvalues.render" (dict "value" $lightspeed.initContainer.securityContext "context" $) | nindent 12 }}
142+
{{- end }}
143+
{{- if $lightspeed.initContainer.command }}
144+
command: {{- include "common.tplvalues.render" (dict "value" $lightspeed.initContainer.command "context" $) | nindent 12 }}
145+
{{- end }}
146+
{{- if $lightspeed.initContainer.args }}
147+
args: {{- include "common.tplvalues.render" (dict "value" $lightspeed.initContainer.args "context" $) | nindent 12 }}
148+
{{- end }}
149+
{{- if $lightspeed.initContainer.env }}
150+
env: {{- include "common.tplvalues.render" (dict "value" $lightspeed.initContainer.env "context" $) | nindent 12 }}
151+
{{- end }}
152+
{{- if $lightspeed.initContainer.resources }}
153+
resources: {{- include "common.tplvalues.render" (dict "value" $lightspeed.initContainer.resources "context" $) | nindent 12 }}
154+
{{- end }}
155+
volumeMounts:
156+
- name: {{ $lightspeed.runtimeVolume.name }}
157+
mountPath: {{ $lightspeed.runtimeVolume.mountPath | quote }}
158+
- name: {{ $lightspeed.ragVolume.name }}
159+
mountPath: {{ $lightspeed.ragVolume.initMountPath | quote }}
160+
{{- end }}
91161
{{- end }}
92162
containers:
93163
- name: backstage-backend
@@ -186,6 +256,48 @@ spec:
186256
{{- include "common.tplvalues.render" ( dict "value" .Values.backstage.extraVolumeMounts "context" $ ) | nindent 12 }}
187257
{{- end }}
188258
{{- end }}
259+
{{- if $lightspeed.enabled }}
260+
- name: {{ $lightspeed.sidecar.name }}
261+
image: {{ include "backstage.image.render" (dict "image" $lightspeed.sidecar.image "global" .Values.global) | quote }}
262+
imagePullPolicy: {{ $lightspeed.sidecar.imagePullPolicy | quote }}
263+
{{- if $lightspeed.sidecar.securityContext }}
264+
securityContext:
265+
{{- include "common.tplvalues.render" (dict "value" $lightspeed.sidecar.securityContext "context" $) | nindent 12 }}
266+
{{- end }}
267+
{{- if $lightspeed.sidecar.command }}
268+
command: {{- include "common.tplvalues.render" (dict "value" $lightspeed.sidecar.command "context" $) | nindent 12 }}
269+
{{- end }}
270+
{{- if $lightspeed.sidecar.args }}
271+
args: {{- include "common.tplvalues.render" (dict "value" $lightspeed.sidecar.args "context" $) | nindent 12 }}
272+
{{- end }}
273+
ports:
274+
- name: {{ $lightspeed.sidecar.portName }}
275+
containerPort: {{ $lightspeed.sidecar.containerPort }}
276+
protocol: TCP
277+
envFrom:
278+
- secretRef:
279+
name: {{ include "rhdh.lightspeed.secretName" (dict "context" $ "lightspeed" $lightspeed) }}
280+
optional: {{ default false $lightspeed.secret.optional }}
281+
{{- if $lightspeed.sidecar.env }}
282+
env: {{- include "common.tplvalues.render" (dict "value" $lightspeed.sidecar.env "context" $) | nindent 12 }}
283+
{{- end }}
284+
{{- if $lightspeed.sidecar.resources }}
285+
resources: {{- include "common.tplvalues.render" (dict "value" $lightspeed.sidecar.resources "context" $) | nindent 12 }}
286+
{{- end }}
287+
volumeMounts:
288+
- name: {{ $lightspeed.runtimeVolume.name }}
289+
mountPath: {{ $lightspeed.runtimeVolume.mountPath | quote }}
290+
- name: {{ $lightspeed.ragVolume.name }}
291+
mountPath: {{ $lightspeed.ragVolume.mountPath | quote }}
292+
{{- range $lightspeed.configMaps }}
293+
- name: {{ include "rhdh.lightspeed.configMapVolumeName" . }}
294+
mountPath: {{ .mountPath | quote }}
295+
{{- if .subPath }}
296+
subPath: {{ .subPath | quote }}
297+
{{- end }}
298+
readOnly: true
299+
{{- end }}
300+
{{- end }}
189301
{{- if .Values.backstage.extraContainers }}
190302
{{- include "common.tplvalues.render" ( dict "value" .Values.backstage.extraContainers "context" $) | nindent 8 }}
191303
{{- end }}

0 commit comments

Comments
 (0)