第 2 章 可能会造成问题的更改
本节列出了 Red Hat Developer Hub 1.7 中的破坏更改。
在以前的版本中,Operator 可以自动检测并挂载名为 dynamic-plugins-npmrc 的可选 Secret,以配置自定义的 npm registry。
在这个版本中,您可以进行以下任一临时解决方案:
-
修改 Operator 默认配置中的
default-config/secret-files.yaml键(rhdh-default-configConfigMap 在rhdh-operator命名空间中),使其包含自定义.npmrc内容。 在 Backstage 自定义资源(CR)中,完成以下步骤:
-
创建包含自定义
.npmrc内容的新 Secret。 -
将 Secret 挂载到
install-dynamic-pluginsinitContainer。 设置
NPM_CONFIG_USERCONFIG环境变量,以引用spec.deployment.patch部分中挂载的.npmrc文件。包含 .npmrc 文件的 Secret 示例
apiVersion: v1 kind: Secret metadata: name: dynamic-plugins-npmrc type: Opaque stringData: .npmrc: | @my-company:registry=https://my-company.example.com //<registry-url>:_authToken=<auth-token> --- apiVersion: rhdh.redhat.com/v1alpha3 kind: Backstage metadata: name: my-rhdh spec: application: dynamicPluginsConfigMapName: my-dynamic-plugins-rhdh # --- BEGIN WORKAROUND: Ensure you have the volumes, volume mounts and NPM_CONFIG_USERCONFIG env var listed below deployment: patch: spec: template: spec: initContainers: - name: install-dynamic-plugins volumeMounts: - mountPath: /opt/app-root/src/.my-dynamic-plugins-npmrc.dynamic-plugins name: my-dynamic-plugins-npmrc env: - name: - name: NPM_CONFIG_USERCONFIG # path before .npmrc should be the same as in the mountPath above # file name .npmrc should be the same as key in the dynamic-plugins-npmrc secret above value: /opt/app-root/src/.my-dynamic-plugins-npmrc.dynamic-plugins/.npmrc volumes: - name: my-dynamic-plugins-npmrc secret: secretName: dynamic-plugins-npmrc # --- END WORKAROUND
-
创建包含自定义
其他资源