Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-21027

Grafana container GF_INSTALL_PLUGINS fails in OpenShift deployments

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Undefined Undefined
    • rhel-8.10
    • rhel-8.6.0.z
    • grafana-container
    • None
    • grafana-container-9-43
    • None
    • Moderate
    • 2
    • rhel-sst-pt-pcp
    • ssg_platform_tools
    • 25
    • 1
    • QE ack
    • False
    • Hide

      None

      Show
      None
    • None
    • PCP Sprint 1, PCP Sprint 2
    • x86_64
    • None

      What were you trying to do that didn't work?

      Deploying rhel8/grafana container image (https://catalog.redhat.com/software/containers/rhel8/grafana/5edf9c35dd19c7063a62aff6?architecture=amd64&image=6543c1717371c4bd30141cfc) within an OpenShift environment (via Grafana Operator, which populates the GF_INSTALL_PLUGINS environment variable) fails because the grafana-cli wrapper script expects the user running it to be grafana or root. In an OpenShift deployment, the UID doesn't match 1001.

      sh-4.4$ whoami
      1000700000
      
      sh-4.4$ /usr/sbin/grafana-cli
      /usr/sbin/grafana-cli: please run this script as user "grafana" or root.
      

      Please provide the package NVR for which bug is seen:

      grafana-9.2.10-7.el8_9.x86_64

      registry.redhat.io/rhel8/grafana:9 (also same issue with rhel8/grafana:7 and rhel9/grafana:9).

      How reproducible:

      Always

      Steps to reproduce

      1. Deploy Grafana image with a UID other than 1001 in OpenShift and populate the GF_INSTALL_PLUGINS environment variable via Deployment manifest, with a plugin parameter (e.g. grafana-polystat-plugin).

      Expected results

      Ability to override the grafana-cli wrapper script so it will ignore the user not being UID 1001, removal of the wrapper script, or container image using /usr/libexec/grafana/grafana-cli directly (like is done in the upstream docker.io/grafana/grafana image, which works with Grafana Operator and GF_INSTALL_PLUGINS).

      /usr/share/grafana $ whoami
      1000700000
      
      /usr/share/grafana $ grafana-cli
      NAME:
         Grafana CLI - A new cli application
      [...]
      

      Actual results

      sh-4.4$ whoami
      1000700000
      
      sh-4.4$ /usr/sbin/grafana-cli
      /usr/sbin/grafana-cli: please run this script as user "grafana" or root.
      

              pcp-maint pcp-maint
              lmadsen@redhat.com Leif Madsen
              pcp-maint pcp-maint
              Jan Kurik Jan Kurik
              Jacob Valdez Jacob Valdez (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

                Created:
                Updated:
                Resolved: