Skip to content

Commit 78dc7f6

Browse files
committed
feat: Support configuring multiple catalog index images [RHIDP-12934]
Add global.catalogIndex.extraImages to allow listing additional catalog index OCI images whose catalog entities are extracted for the Extensions UI. A new helper (rhdh.catalogIndex.extraImagesEnvValue) builds the comma-separated EXTRA_CATALOG_INDEX_IMAGES value, and the vendored deployment template conditionally injects it into the install-dynamic-plugins init container only when the list is non-empty. Assisted-by: Claude
1 parent d92e72a commit 78dc7f6

9 files changed

Lines changed: 137 additions & 7 deletions

File tree

charts/backstage/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ sources: []
4747
# Versions are expected to follow Semantic Versioning (https://semver.org/)
4848
# Note that when this chart is published to https://github.com/openshift-helm-charts/charts
4949
# it will follow the RHDH versioning 1.y.z
50-
version: 5.8.0
50+
version: 5.9.0

charts/backstage/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# RHDH Backstage Helm Chart for OpenShift
33

4-
![Version: 5.8.0](https://img.shields.io/badge/Version-5.8.0-informational?style=flat-square)
4+
![Version: 5.9.0](https://img.shields.io/badge/Version-5.9.0-informational?style=flat-square)
55
![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
66

77
A Helm chart for deploying Red Hat Developer Hub, which is a Red Hat supported version of Backstage.
@@ -29,7 +29,7 @@ For the **Generally Available** version of this chart, see:
2929
helm repo add bitnami https://charts.bitnami.com/bitnami
3030
helm repo add redhat-developer https://redhat-developer.github.io/rhdh-chart
3131

32-
helm install my-backstage redhat-developer/backstage --version 5.8.0
32+
helm install my-backstage redhat-developer/backstage --version 5.9.0
3333
```
3434

3535
## Introduction
@@ -168,7 +168,8 @@ Kubernetes: `>= 1.27.0-0`
168168
| global.auth.backend.enabled | Enable backend service to service authentication, unless configured otherwise it generates a secret value | bool | `true` |
169169
| global.auth.backend.existingSecret | Instead of generating a secret value, refer to existing secret | string | `""` |
170170
| global.auth.backend.value | Instead of generating a secret value, use the following value | string | `""` |
171-
| global.catalogIndex | Catalog index configuration for automatic plugin discovery. The `install-dynamic-plugins.py` script pulls this image if the `CATALOG_INDEX_IMAGE` environment variable is set. The `dynamic-plugins.default.yaml` file will be extracted and written to `dynamic-plugins-root` volume mount. | object | `{"image":{"registry":"quay.io","repository":"rhdh/plugin-catalog-index","tag":"1.10"}}` |
171+
| global.catalogIndex | Catalog index configuration for automatic plugin discovery. The `install-dynamic-plugins.py` script pulls this image if the `CATALOG_INDEX_IMAGE` environment variable is set. The `dynamic-plugins.default.yaml` file will be extracted and written to `dynamic-plugins-root` volume mount. | object | `{"extraImages":[],"image":{"registry":"quay.io","repository":"rhdh/plugin-catalog-index","tag":"1.10"}}` |
172+
| global.catalogIndex.extraImages | Extra catalog index images for additional plugin discovery in the Extensions UI. Each item must include `registry`, `repository`, and `tag` fields; `name` is optional. Only catalog entities are extracted from extra images (no `dynamic-plugins.default.yaml` handling). | list | `[]` |
172173
| global.clusterRouterBase | Shorthand for users who do not want to specify a custom HOSTNAME. Used ONLY with the DEFAULT upstream.backstage.appConfig value and with OCP Route enabled. | string | `"apps.example.com"` |
173174
| global.dynamic.includes | Array of YAML files listing dynamic plugins to include with those listed in the `plugins` field. Relative paths are resolved from the working directory of the initContainer that will install the plugins (`/opt/app-root/src`). | list | `["dynamic-plugins.default.yaml"]` |
174175
| global.dynamic.includes[0] | List of dynamic plugins included inside the `rhdh` container image, some of which are disabled by default. This file ONLY works with the `rhdh` container image. | string | `"dynamic-plugins.default.yaml"` |
@@ -331,7 +332,9 @@ upstream:
331332

332333
The chart supports automatic plugin discovery through a catalog index OCI image. This is configured via `global.catalogIndex.image` (with `registry`, `repository`, and `tag` fields) and lets you use a pre-defined set of dynamic plugins.
333334

334-
For detailed information on configuring the catalog index, including how to override the default image or use a private registry, see the [Catalog Index Configuration documentation](../../docs/catalog-index-configuration.md).
335+
You can also configure additional catalog index images via `global.catalogIndex.extraImages` to make plugins from other sources discoverable in the Extensions UI. Each extra image contributes catalog entities only (no `dynamic-plugins.default.yaml` handling).
336+
337+
For detailed information on configuring the catalog index, including how to override the default image, use a private registry, or add extra catalog index images, see the [Catalog Index Configuration documentation](../../docs/catalog-index-configuration.md).
335338

336339
### Lightspeed
337340

charts/backstage/README.md.gotmpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,9 @@ upstream:
234234

235235
The chart supports automatic plugin discovery through a catalog index OCI image. This is configured via `global.catalogIndex.image` (with `registry`, `repository`, and `tag` fields) and lets you use a pre-defined set of dynamic plugins.
236236

237-
For detailed information on configuring the catalog index, including how to override the default image or use a private registry, see the [Catalog Index Configuration documentation](../../docs/catalog-index-configuration.md).
237+
You can also configure additional catalog index images via `global.catalogIndex.extraImages` to make plugins from other sources discoverable in the Extensions UI. Each extra image contributes catalog entities only (no `dynamic-plugins.default.yaml` handling).
238+
239+
For detailed information on configuring the catalog index, including how to override the default image, use a private registry, or add extra catalog index images, see the [Catalog Index Configuration documentation](../../docs/catalog-index-configuration.md).
238240

239241
### Lightspeed
240242

charts/backstage/templates/_helpers.tpl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,23 @@ Return the Lightspeed ConfigMap volume name.
283283
{{- printf "lightspeed-config-%s" .name | trunc 63 | trimSuffix "-" -}}
284284
{{- end -}}
285285

286+
{{/*
287+
Return the computed EXTRA_CATALOG_INDEX_IMAGES env var value from
288+
global.catalogIndex.extraImages. Returns an empty string when no extra
289+
images are configured.
290+
*/}}
291+
{{- define "rhdh.catalogIndex.extraImagesEnvValue" -}}
292+
{{- $imgs := list -}}
293+
{{- range (.Values.global.catalogIndex.extraImages | default list) -}}
294+
{{- $ref := printf "%s/%s:%s" .registry .repository .tag -}}
295+
{{- if .name -}}
296+
{{- $ref = printf "%s=%s" .name $ref -}}
297+
{{- end -}}
298+
{{- $imgs = append $imgs $ref -}}
299+
{{- end -}}
300+
{{- join "," $imgs -}}
301+
{{- end -}}
302+
286303
{{/*
287304
DEPRECATED: The following templates are deprecated. Please use the corresponding "rhdh.*" templates instead.
288305
*/}}

charts/backstage/values.schema.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,38 @@
3535
"catalogIndex": {
3636
"additionalProperties": false,
3737
"properties": {
38+
"extraImages": {
39+
"default": [],
40+
"items": {
41+
"additionalProperties": false,
42+
"properties": {
43+
"name": {
44+
"title": "Optional name for the extra catalog index image. Produces cleaner extraction directory names (e.g., /extra/community/).",
45+
"type": "string"
46+
},
47+
"registry": {
48+
"title": "Extra catalog index image registry",
49+
"type": "string"
50+
},
51+
"repository": {
52+
"title": "Extra catalog index image repository",
53+
"type": "string"
54+
},
55+
"tag": {
56+
"title": "Extra catalog index image tag",
57+
"type": "string"
58+
}
59+
},
60+
"required": [
61+
"registry",
62+
"repository",
63+
"tag"
64+
],
65+
"type": "object"
66+
},
67+
"title": "Extra catalog index images for additional plugin discovery in the Extensions UI. Only catalog entities are extracted from extra images (no dynamic-plugins.default.yaml handling).",
68+
"type": "array"
69+
},
3870
"image": {
3971
"additionalProperties": false,
4072
"properties": {

charts/backstage/values.schema.tmpl.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,38 @@
130130
"default": "1.9"
131131
}
132132
}
133+
},
134+
"extraImages": {
135+
"title": "Extra catalog index images for additional plugin discovery in the Extensions UI. Only catalog entities are extracted from extra images (no dynamic-plugins.default.yaml handling).",
136+
"type": "array",
137+
"default": [],
138+
"items": {
139+
"type": "object",
140+
"additionalProperties": false,
141+
"required": [
142+
"registry",
143+
"repository",
144+
"tag"
145+
],
146+
"properties": {
147+
"name": {
148+
"title": "Optional name for the extra catalog index image. Produces cleaner extraction directory names (e.g., /extra/community/).",
149+
"type": "string"
150+
},
151+
"registry": {
152+
"title": "Extra catalog index image registry",
153+
"type": "string"
154+
},
155+
"repository": {
156+
"title": "Extra catalog index image repository",
157+
"type": "string"
158+
},
159+
"tag": {
160+
"title": "Extra catalog index image tag",
161+
"type": "string"
162+
}
163+
}
164+
}
133165
}
134166
}
135167
},

charts/backstage/values.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@ global:
3535
registry: quay.io
3636
repository: rhdh/plugin-catalog-index
3737
tag: "1.10"
38+
# -- Extra catalog index images for additional plugin discovery in the Extensions UI.
39+
# Each item must include `registry`, `repository`, and `tag` fields; `name` is optional.
40+
# Only catalog entities are extracted from extra images (no `dynamic-plugins.default.yaml` handling).
41+
# @default -- `[]`
42+
extraImages: []
43+
# - name: community
44+
# registry: ghcr.io
45+
# repository: redhat-developer/rhdh-plugin-community-index
46+
# tag: "1.10"
47+
# - registry: my-registry.example.com
48+
# repository: my-org/my-rhdh-internal-plugin-catalog
49+
# tag: "1.2.3"
3850
# -- Built-in Lightspeed feature configuration.
3951
# @default -- Use Lightspeed compatible settings / configurations.
4052
lightspeed:

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
{{- if $lightspeed.enabled -}}
77
{{- $lightspeedRuntimeVolumeType = include "rhdh.lightspeed.runtimeVolumeType" (dict "volume" $lightspeed.runtimeVolume "path" "global.lightspeed.runtimeVolume") -}}
88
{{- end -}}
9+
{{- $extraCatalogImages := include "rhdh.catalogIndex.extraImagesEnvValue" . | trim -}}
910
---
1011
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
1112
kind: Deployment
@@ -114,7 +115,13 @@ spec:
114115
{{- if or .Values.backstage.initContainers $lightspeed.enabled }}
115116
initContainers:
116117
{{- if .Values.backstage.initContainers }}
117-
{{- include "common.tplvalues.render" ( dict "value" .Values.backstage.initContainers "context" $) | nindent 8 }}
118+
{{- range .Values.backstage.initContainers }}
119+
{{- $container := include "common.tplvalues.render" (dict "value" . "context" $) | fromYaml }}
120+
{{- if and $extraCatalogImages (eq (index $container "name") "install-dynamic-plugins") }}
121+
{{- $_ := set $container "env" (append (default list (index $container "env")) (dict "name" "EXTRA_CATALOG_INDEX_IMAGES" "value" $extraCatalogImages)) }}
122+
{{- end }}
123+
- {{ $container | toYaml | nindent 10 | trim }}
124+
{{- end }}
118125
{{- end }}
119126
{{- if $lightspeed.enabled }}
120127
- name: {{ $lightspeed.initContainer.name }}

docs/catalog-index-configuration.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,31 @@ global:
1313
tag: "1.9"
1414
```
1515
16+
## Extra Catalog Index Images
17+
18+
You can configure additional catalog index images alongside the primary one using `global.catalogIndex.extraImages`. Each extra image contributes catalog entities only to the Extensions UI — only the primary `CATALOG_INDEX_IMAGE` is used for extracting and handling the `dynamic-plugins.default.yaml`.
19+
20+
```yaml
21+
global:
22+
catalogIndex:
23+
image:
24+
registry: quay.io
25+
repository: rhdh/plugin-catalog-index
26+
tag: "1.10"
27+
extraImages:
28+
- name: community
29+
registry: ghcr.io
30+
repository: redhat-developer/rhdh-plugin-community-index
31+
tag: "1.10"
32+
- registry: my-registry.example.com
33+
repository: my-org/my-rhdh-internal-plugin-catalog
34+
tag: "1.2.3"
35+
```
36+
37+
Each entry requires `registry`, `repository`, and `tag` fields. The optional `name` field produces cleaner extraction directory names (e.g., `/extensions/extra/community/`); when omitted, the name is auto-derived from the image reference.
38+
39+
The chart constructs the `EXTRA_CATALOG_INDEX_IMAGES` environment variable for the `install-dynamic-plugins` init container as a comma-separated list. Named entries use the format `name=registry/repository:tag`, while unnamed entries use `registry/repository:tag`.
40+
1641
## Using a Private Registry
1742

1843
If your catalog index image is stored in a private registry that requires authentication, create a secret named `<release_name>-dynamic-plugins-registry-auth` containing an `auth.json` file with your registry credentials.

0 commit comments

Comments
 (0)