|
4 | 4 |
|
5 | 5 | This section lists breaking changes in {product} {product-version}. |
6 | 6 |
|
7 | | -None |
| 7 | + |
| 8 | +[id="removed-functionality-rhdhbugs-2000"] |
| 9 | +== Using an optional Secret named `dynamic-plugins-npmrc` to configure a custom NPM registry in the Operator is removed |
| 10 | + |
| 11 | +Previously, the Operator could automatically detect and mount an optional Secret named `dynamic-plugins-npmrc` to configure a custom npm registry. |
| 12 | + |
| 13 | +With this update, you can do any of the following workarounds: |
| 14 | + |
| 15 | +* Modify the `default-config/secret-files.yaml` key in the default configuration of the Operator (`rhdh-default-config` ConfigMap in the `rhdh-operator` namespace) to include custom `.npmrc` content. |
| 16 | +* In your {product-custom-resource-type} custom resource (CR), complete the following steps: |
| 17 | +.. Create a new Secret containing the custom `.npmrc` content. |
| 18 | +.. Mount the Secret to the `install-dynamic-plugins` initContainer. |
| 19 | +.. Set the `NPM_CONFIG_USERCONFIG` environment variable to reference to the mounted `.npmrc` file in the `spec.deployment.patch` section. |
| 20 | + |
| 21 | +.Example of a Secret containing the .npmrc file |
| 22 | +[source,yaml,subs="+attributes,+quotes"] |
| 23 | +---- |
| 24 | +apiVersion: v1 |
| 25 | +kind: Secret |
| 26 | +metadata: |
| 27 | + name: dynamic-plugins-npmrc |
| 28 | +type: Opaque |
| 29 | +stringData: |
| 30 | + .npmrc: | |
| 31 | + @my-company:registry=https://my-company.example.com |
| 32 | + //<registry-url>:_authToken=<auth-token> |
| 33 | +--- |
| 34 | +apiVersion: rhdh.redhat.com/v1alpha3 |
| 35 | +kind: Backstage |
| 36 | +metadata: |
| 37 | + name: my-rhdh |
| 38 | +spec: |
| 39 | + application: |
| 40 | + dynamicPluginsConfigMapName: my-dynamic-plugins-rhdh |
| 41 | + # --- BEGIN WORKAROUND: Ensure you have the volumes, volume mounts and NPM_CONFIG_USERCONFIG env var listed below |
| 42 | + deployment: |
| 43 | + patch: |
| 44 | + spec: |
| 45 | + template: |
| 46 | + spec: |
| 47 | + initContainers: |
| 48 | + - name: install-dynamic-plugins |
| 49 | + volumeMounts: |
| 50 | + - mountPath: /opt/app-root/src/.my-dynamic-plugins-npmrc.dynamic-plugins |
| 51 | + name: my-dynamic-plugins-npmrc |
| 52 | + env: |
| 53 | + - name: |
| 54 | + - name: NPM_CONFIG_USERCONFIG |
| 55 | + # path before .npmrc should be the same as in the mountPath above |
| 56 | + # file name .npmrc should be the same as key in the dynamic-plugins-npmrc secret above |
| 57 | + value: /opt/app-root/src/.my-dynamic-plugins-npmrc.dynamic-plugins/.npmrc |
| 58 | + volumes: |
| 59 | + - name: my-dynamic-plugins-npmrc |
| 60 | + secret: |
| 61 | + secretName: dynamic-plugins-npmrc |
| 62 | + # --- END WORKAROUND |
| 63 | +---- |
0 commit comments