Uploaded image for project: 'Red Hat Developer Hub Bugs'
  1. Red Hat Developer Hub Bugs
  2. RHDHBUGS-887

Environment variables are not added into the initContainer

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.8.0
    • 1.5.0
    • Operator
    • None
    • 8
    • False
    • Hide

      None

      Show
      None
    • False
    • Release Note Not Required

      Description of problem:

      The Backstage CRD allows to declare environment variables for the pod of RHDH and they are only added into the backstage-backend container, but not into the init container. There is an example of usage to declare the registry authentication file (`REGISTRY_AUTH_FILE`) to pull images successfully from a private container image registry.

      Prerequisites (if any, like setup, operators/versions):

      Tested in a RDHD instance operated by the Operator (but it seems that it could happen into an instance managed by the Helm Chart.)

      Steps to Reproduce

      1. Declare some environment variables in a Backstage CR as:
      spec:
        application:
          appConfig:
            configMaps:
              - name: rhdh-app-config
            mountPath: /opt/app-root/src
          dynamicPluginsConfigMapName: rhdh-dynamic-plugins
          extraEnvs:
            envs:
              - name: NODE_TLS_REJECT_UNAUTHORIZED
                value: '0'
              - name: LOG_LEVEL
                value: debug
              - name: REGISTRY_AUTH_FILE
                value: /opt/app-root/src/.config/.dockerconfigjson 
      1. Apply the changes and confirm the variables defined
      2. The backstage-backend container includes them:
      3. The install-dynamic-plugins init container does not include them:

       

      Actual results:

      The environment variables are only declared into the backend container.

      Expected results:

      The environment variables are also declared into the init container.

      Reproducibility (Always/Intermittent/Only Once):

      Build Details:

      Additional info (Such as Logs, Screenshots, etc):

      Another alternative it could be to define which environment variables must be declared for the init container. Maybe with an definition such as:

       

      spec:
        application:
          appConfig:
            configMaps:
              - name: rhdh-app-config
            mountPath: /opt/app-root/src
          dynamicPluginsConfigMapName: rhdh-dynamic-plugins
          extraEnvs:
            envs:
              - name: NODE_TLS_REJECT_UNAUTHORIZED
                value: '0'
              - name: LOG_LEVEL
                value: debug
          initExtraEnvs:
            - name: REGISTRY_AUTH_FILE
              value: /opt/app-root/src/.config/.dockerconfigjson

       

       

              Unassigned Unassigned
              rmarting@redhat.com Roman Martin Gil
              RHIDP - Install
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: