Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-57316

hypershift version in CLI returns "<unknown>" for Server Version when HyperShift operator is deployed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • 4.20.0
    • 4.20.0
    • HyperShift
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • Low
    • None
    • None
    • None
    • None
    • In Progress
    • Bug Fix
    • Hide
      Cause – A variable shadowing bug in the `GetSupportedOCPVersions()` function caused the `supportedVersions` variable to be incorrectly assigned using `:=` instead of `=`, creating a local variable that was immediately discarded rather than updating the intended outer scope variable.

      Consequence – When users ran the `hypershift version` command with the HyperShift operator deployed, the CLI would either display `<unknown>` for the Server Version or panic with a "nil pointer dereference" error, preventing users from verifying the deployed HyperShift operator version.

      Fix – Corrected the variable assignment from `supportedVersions :=` to `supportedVersions =` in the `GetSupportedOCPVersions()` function to properly assign the ConfigMap to the outer scope variable, ensuring the supported versions data is correctly populated.

      Result – The `hypershift version` command now correctly displays the Server Version (e.g., "Server Version: f001510b35842df352d1ab55d961be3fdc2dae32") when the HyperShift operator is deployed, allowing users to verify the running operator version and supported OCP versions.
      Show
      Cause – A variable shadowing bug in the `GetSupportedOCPVersions()` function caused the `supportedVersions` variable to be incorrectly assigned using `:=` instead of `=`, creating a local variable that was immediately discarded rather than updating the intended outer scope variable. Consequence – When users ran the `hypershift version` command with the HyperShift operator deployed, the CLI would either display `<unknown>` for the Server Version or panic with a "nil pointer dereference" error, preventing users from verifying the deployed HyperShift operator version. Fix – Corrected the variable assignment from `supportedVersions :=` to `supportedVersions =` in the `GetSupportedOCPVersions()` function to properly assign the ConfigMap to the outer scope variable, ensuring the supported versions data is correctly populated. Result – The `hypershift version` command now correctly displays the Server Version (e.g., "Server Version: f001510b35842df352d1ab55d961be3fdc2dae32") when the HyperShift operator is deployed, allowing users to verify the running operator version and supported OCP versions.
    • None
    • None
    • None
    • None

      Description of problem:

          In CLI, using "hypershift version" will return "<unknown>" even when the HyperShift operator is deployed and running.

      Version-Release number of selected component (if applicable):

          

      How reproducible:

          100%

      Steps to Reproduce:

          1. Create Hypershift cluster
          2. Use "hypershift version" to retrieve versions

      Actual results:

      $ ./bin/hypershift version
      Client Version: openshift/hypershift: 180e1173f92f392c275d6492df7aca7d8697c323. Latest supported OCP: 4.20.0
      Server Version: <unknown>
      Server Supports OCP Versions: 4.20, 4.19, 4.18, 4.17, 4.16, 4.15, 4.14
      

      Expected results:

      $ ./bin/hypershift version
      Client Version: openshift/hypershift: 180e1173f92f392c275d6492df7aca7d8697c323. Latest supported OCP: 4.20.0
      Server Version: 180e1173f92f392c275d6492df7aca7d8697c323. Latest supported OCP: 4.20.0
      Server Supports OCP Versions: 4.20, 4.19, 4.18, 4.17, 4.16, 4.15, 4.14
          

      Additional info:

          

              rh-ee-glipcean George Lipceanu (Inactive)
              rh-ee-glipcean George Lipceanu (Inactive)
              None
              None
              Wen Wang Wen Wang
              None
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated: