Uploaded image for project: 'Red Hat OpenShift Control Planes'
  1. Red Hat OpenShift Control Planes
  2. CNTRLPLANE-1325

Segregate HostedControlPlane validation reasons and fix misleading InsufficientClusterCapabilities reason

XMLWordPrintable

    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • None
    • None
    • None
    • None

      As a platform engineer operating ARO HyperShift clusters, I want HostedControlPlane validation errors to report accurate reasons and clear messages instead of the generic InsufficientClusterCapabilities, so that triage is faster and more actionable.

      Context

      Problem

      • Configuration errors (e.g., credential path issues) are being surfaced with reason InsufficientClusterCapabilities, which is misleading and hampers debugging.

      Proposed Direction

      • Segregate reasons returned by validateConfigAndClusterCapabilities:
      • Either return a reason value from the validator, or split into distinct validator functions that convey specific reasons.
      • Default to InvalidConfigurationReason for configuration errors instead of InsufficientClusterCapabilities.
      • Improve error messages for credential and path issues to be explicit and actionable.
      • Update condition setting logic accordingly and add unit tests for each path.

      Acceptance Criteria

      • Given an Azure HCP with a missing or invalid credential mount/path, when the ValidHostedControlPlaneConfiguration condition is set, it should use InvalidConfigurationReason (or a more precise configuration-related reason) instead of InsufficientClusterCapabilities.
      • Given each of the three failure paths currently returned by validateConfigAndClusterCapabilities, when a failure occurs, it should set a specific, accurate reason that distinguishes configuration errors from cluster capability issues.
      • When the credential path /mnt/certs/ is a directory or otherwise unreadable, it should emit a condition message that clearly indicates misconfiguration and recommended next steps (e.g., check file vs directory, path correctness, mount contents).
      • Unit tests cover the updated reason mapping for each failure path and validate messages using the "When ... it should ..." description style.
      • No change to success path behavior; all existing e2e/integration tests continue to pass.

      Notes

      • Aligns with feedback from @Bryan and @alberto.lamela: segregate reasons; possibly let the function return the reason or split into separate functions.
      • This issue is motivated by ARO/Azure but the fix should be platform-agnostic within the controller.

              Unassigned Unassigned
              rh-ee-brcox Bryan Cox
              None
              None
              None
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: