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

MarkPersistentFlagRequired does not work since CLI refactoring

XMLWordPrintable

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

      None

      Show
      None
    • None
    • Low
    • None
    • None
    • None
    • Hypershift Sprint 258, Hypershift Sprint 259, Hypershift Sprint 260, Hypershift Sprint 261, Hypershift Sprint 262, Hypershift Sprint 263
    • 6
    • In Progress
    • Bug Fix
    • Hide
      Cause – Following a CLI refactoring, the `MarkPersistentFlagRequired` function stopped working correctly. The `--name` and `--pull-secret` flags, which are critical for cluster creation, were marked as required but the validation was not being enforced.

      Consequence – Users could execute the `hypershift create cluster` command without providing the required `--name` or `--pull-secret` flags, and the CLI would not immediately alert them that these required flags were missing. This could lead to misconfigured deployments and confusing error messages later in the process.

      Fix – Added explicit validation in the `RawCreateOptions.Validate()` function to check for the presence of `--name` and `--pull-secret` flags, returning clear error messages when either flag is missing. Additionally, removed the default "example" value for the name field to ensure proper validation.

      Result – When users attempt to create a cluster without the required `--name` or `--pull-secret` flags, they now receive immediate, clear error messages indicating which required flag is missing (e.g., "Error: --name is required" or "Error: --pull-secret is required"), preventing misconfigured deployments and improving the user experience.
      Show
      Cause – Following a CLI refactoring, the `MarkPersistentFlagRequired` function stopped working correctly. The `--name` and `--pull-secret` flags, which are critical for cluster creation, were marked as required but the validation was not being enforced. Consequence – Users could execute the `hypershift create cluster` command without providing the required `--name` or `--pull-secret` flags, and the CLI would not immediately alert them that these required flags were missing. This could lead to misconfigured deployments and confusing error messages later in the process. Fix – Added explicit validation in the `RawCreateOptions.Validate()` function to check for the presence of `--name` and `--pull-secret` flags, returning clear error messages when either flag is missing. Additionally, removed the default "example" value for the name field to ensure proper validation. Result – When users attempt to create a cluster without the required `--name` or `--pull-secret` flags, they now receive immediate, clear error messages indicating which required flag is missing (e.g., "Error: --name is required" or "Error: --pull-secret is required"), preventing misconfigured deployments and improving the user experience.
    • None
    • None
    • None
    • None

      Description of problem:

          The flags pull-secret and name are often marked as required however since the CLI refactoring, MarkPersistentFlagRequired does not seem to be working.

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

          

      How reproducible:

          Everytime

      Steps to Reproduce:

          1. Try to create a cluster without a name or pull-secret
          2. CLI will not flag the name or pull-secret flag was missing
          

      Actual results:

          CLI will not show the name or pull-secret flag was missing

      Expected results:

          CLI show the name or pull-secret flag was missing

      Additional info:

          

              rh-ee-glipcean George Lipceanu (Inactive)
              rh-ee-brcox Bryan Cox
              None
              None
              XiuJuan Wang XiuJuan Wang
              None
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated: