Skip to content

OCPBUGS-66251: OADP restore results in htpasswd no longer being applied as volume#7628

Open
mehabhalodiya wants to merge 1 commit into
openshift:mainfrom
mehabhalodiya:oadp-oauth
Open

OCPBUGS-66251: OADP restore results in htpasswd no longer being applied as volume#7628
mehabhalodiya wants to merge 1 commit into
openshift:mainfrom
mehabhalodiya:oadp-oauth

Conversation

@mehabhalodiya
Copy link
Copy Markdown
Contributor

@mehabhalodiya mehabhalodiya commented Feb 3, 2026

Which issue(s) this PR fixes:

Fixes https://issues.redhat.com/browse/OCPBUGS-66251

Description

This PR fixes an issue where OAuth identity provider (IDP) secrets are not mounted as volumes in the oauth-openshift deployment after OADP restore operations.

✅ Changes Made & Tests Created

1. Fixed Error Handling (deployment.go & config.go)

The Root Cause:

The previous code was silently ignoring errors from ConvertIdentityProviders() using _, volumeMountInfo, _ := ...
When IDP conversion failed (e.g., during transient OADP restore conditions), no volumes were added
Result: HTPasswd secret was never mounted to the oauth-openshift deployment

The Fix:

_, volumeMountInfo, err := ConvertIdentityProviders(...)
if err != nil {
    // Return error to trigger reconciliation retry
    return fmt.Errorf("failed to convert identity providers: %w", err)
}

This ensures:
✅ Errors are not silently ignored
✅ Reconciliation retries automatically on failure
✅ When OADP-restored secrets become available, conversion succeeds
✅ IDP volumes are properly added to the deployment

2. Comprehensive Testing

Created deployment_test.go with tests verifying:

✅ HTPasswd IDP volumes are added to deployment
Test: When HTPasswd IDP is configured, it should add IDP volumes to deployment

  • Verifies IDP secret volume is added
  • Verifies volume mount is added to oauth-openshift container

✅ Handles missing secrets correctly (OADP restore scenario)
Test: When HTPasswd IDP secret is missing, it should still add volume reference

  • Volume reference is created even if secret doesn't exist yet
  • Pod will wait for secret (important for OADP restore timing)

✅ Supports multiple IDPs
Test: When multiple IDPs are configured, it should add all IDP volumes

  • Tests HTPasswd + GitHub IDPs
  • Verifies all volumes are properly added

✅ OADP Restore Scenario Test
Test: TestAdaptDeploymentOADPRestoreScenario

  • Simulates post-OADP-restore environment
  • Verifies deployment gets IDP volumes when secret exists
  • Validates volume mounts are under /etc/oauth/idp path

Created config_test.go verifying:

✅ OAuth config includes IDPs

  • HTPasswd IDP is added to OAuth server config
  • Multiple IDPs are all included
  • Empty IDP list results in no IDPs in config

3. Test Results
All tests pass successfully:

  • TestAdaptDeploymentWithHTPasswdIDP - PASS
    • When HTPasswd IDP is configured - PASS
    • When HTPasswd IDP secret is missing - PASS
    • When multiple IDPs are configured - PASS
    • When no IDPs are configured - PASS
  • TestAdaptDeploymentOADPRestoreScenario - PASS
  • TestAdaptOAuthConfigWithHTPasswd - PASS
  • All existing tests continue to pass
  • Linting: 0 issues

Special notes for your reviewer:

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

Summary by CodeRabbit

  • New Features

    • Added etcd backup capability for hosted clusters with S3 and Azure Blob storage support.
    • Introduced Azure Private Link topology for private cluster networking.
    • Added control plane version tracking and status visibility.
    • Enabled AutoNode provisioner support with observed node/claim counts.
    • Added AWS spot instance and Elastic IP allocation configuration for load balancers.
    • Introduced node CIDR allocation controls via allocateNodeCIDRs field.
    • Enhanced GCP platform with workload identity federation and resource labeling.
  • API Changes

    • New CRDs: AzurePrivateLinkService and HCPEtcdBackup.
    • Extended AWS platform with spot market type and termination handler queue options.
    • Azure topology and private endpoint configuration options.
  • Infrastructure

    • Updated base container images for Go toolchain and UBI minimal.
    • Added new CI/CD workflows for API validation, envtest, and documentation.
    • Enhanced Makefile with additional build targets and artifact management.

@openshift-ci-robot openshift-ci-robot added jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Feb 3, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@mehabhalodiya: This pull request references Jira Issue OCPBUGS-66251, which is invalid:

  • expected the bug to target the "4.22.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

This PR fixes an issue where OAuth identity provider (IDP) secrets are not mounted as volumes in the oauth-openshift deployment after OADP restore operations.

What this PR does / why we need it:

Problem

After restoring a HostedCluster using the OADP plugin, htpasswd IDP secrets exist in the HCP namespace but are not mounted as volumes in the oauth-openshift deployment. This prevents OAuth authentication from working with the IDP.

Root Cause

The oauth-openshift deployment reconciliation logic appends IDP volumes to the existing volumes list without first removing stale volumes. When OADP restores the deployment, it may restore with:

  • Stale volumes from previous configurations
  • Missing volumes entirely
  • Incorrect volume mount configurations

The reconciliation doesn't clean up these stale volumes, leading to inconsistent state.

Solution

HyperShift Codebase Fix

File: control-plane-operator/controllers/hostedcontrolplane/v2/oauth/deployment.go

Changes:

  1. Added removeIDPVolumes() function to clean up stale IDP volumes
  2. Added removeIDPVolumeMounts() function to clean up stale IDP volume mounts
  3. Updated adaptDeployment() to remove stale volumes/mounts before adding new ones

Key Benefits:

  • Ensures clean state after restore
  • Makes reconciliation idempotent
  • Works correctly even if deployment is restored with incorrect state
  • Backward compatible

Which issue(s) this PR fixes:

Fixes https://issues.redhat.com/browse/OCPBUGS-66251

Special notes for your reviewer:

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 3, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Review skipped — only excluded labels are configured. (1)
  • do-not-merge/work-in-progress

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 902530cd-dda8-435c-a6a5-7377b4d5b4b3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This pull request introduces significant infrastructure and API enhancements to the HyperShift project. Major changes include: new etcd backup and Azure Private Link Service CRD types; expanded platform support for Azure topology/private configurations, GCP workload identity, and AWS spot instances; enhanced validation rules across multiple CRD manifests; updated Tekton pipeline definitions with improved task bundling; extended Makefile with new test targets (envtest, backup-restore); new GitHub Actions workflows for CI/CD (lint, verify, test, docs, envtest); base container image updates; and comprehensive documentation additions including Claude skills and command guides. API schemas are tightened with stricter immutability constraints, cross-field validations, and required field changes.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

@openshift-ci openshift-ci Bot requested review from bryan-cox and sjenning February 3, 2026 17:48
@openshift-ci openshift-ci Bot added area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release and removed do-not-merge/needs-area labels Feb 3, 2026
@mehabhalodiya mehabhalodiya changed the title OCPBUGS-66251: OADP Restore Results in htpasswd No Longer Being Applied as Volume OCPBUGS-66251: OADP restore results in htpasswd no longer being applied as volume Feb 3, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
`@control-plane-operator/controllers/hostedcontrolplane/v2/oauth/deployment.go`:
- Around line 95-118: When identityProviders > 0, removeIDPVolumeMounts must run
regardless of whether ConvertIdentityProviders returned volumes to avoid leaving
stale mounts; change the block handling ConvertIdentityProviders so that after
calling removeIDPVolumes(deployment) and calling ConvertIdentityProviders(...)
you always call removeIDPVolumeMounts(deployment) before inspecting
volumeMountInfo.Volumes, then only append volumeMountInfo.Volumes and update
container mounts via util.UpdateContainer(ComponentName, ...) if
len(volumeMountInfo.Volumes) > 0. Ensure the same functions (removeIDPVolumes,
removeIDPVolumeMounts, ConvertIdentityProviders, util.UpdateContainer,
ComponentName, deployment) are used and no other behavior changes.

Comment on lines 95 to 118
identityProviders := configuration.OAuth.IdentityProviders
if len(identityProviders) > 0 {
// Remove any existing IDP volumes to ensure clean state after restore
// This is important for OADP restore scenarios where the deployment
// might be restored with stale volume configurations
removeIDPVolumes(deployment)

_, volumeMountInfo, _ := ConvertIdentityProviders(cpContext, identityProviders, providerOverrides(cpContext.HCP), cpContext.Client, deployment.Namespace)
// Ignore the error here, since we don't want to fail the deployment if the identity providers are invalid
// A condition will be set on the HC to indicate the error
if len(volumeMountInfo.Volumes) > 0 {
// Remove any existing IDP volume mounts before adding new ones
removeIDPVolumeMounts(deployment)

deployment.Spec.Template.Spec.Volumes = append(deployment.Spec.Template.Spec.Volumes, volumeMountInfo.Volumes...)
util.UpdateContainer(ComponentName, deployment.Spec.Template.Spec.Containers, func(c *corev1.Container) {
c.VolumeMounts = append(c.VolumeMounts, volumeMountInfo.VolumeMounts.ContainerMounts(ComponentName)...)
})
}
} else {
// If no identity providers are configured, ensure any stale IDP volumes are removed
removeIDPVolumes(deployment)
removeIDPVolumeMounts(deployment)
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find the ConvertIdentityProviders function
fd -t f -e go -path "*oauth*" control-plane-operator/controllers/hostedcontrolplane/v2 | head -20

Repository: openshift/hypershift

Length of output: 232


🏁 Script executed:

#!/bin/bash
# Search for ConvertIdentityProviders implementation
rg "func ConvertIdentityProviders" -A 50 --type go

Repository: openshift/hypershift

Length of output: 11465


🏁 Script executed:

#!/bin/bash
# Also search for the removeIDPVolumes and removeIDPVolumeMounts functions
rg "func (.*)?removeIDPVolumes|func (.*)?removeIDPVolumeMounts" -A 15 --type go

Repository: openshift/hypershift

Length of output: 3071


Fix dangling IDP mounts when volume conversion fails.

When ConvertIdentityProviders produces zero volumes (e.g., all providers fail conversion), removeIDPVolumes runs unconditionally, but removeIDPVolumeMounts is skipped because volumeMountInfo.Volumes is empty. This leaves stale mounts referencing volumes that no longer exist, creating an inconsistent pod spec. Move removeIDPVolumeMounts outside the conditional to always clean up mounts alongside volumes.

✅ Suggested adjustment
-			removeIDPVolumes(deployment)
-			
-			_, volumeMountInfo, _ := ConvertIdentityProviders(cpContext, identityProviders, providerOverrides(cpContext.HCP), cpContext.Client, deployment.Namespace)
+			removeIDPVolumes(deployment)
+			removeIDPVolumeMounts(deployment)
+
+			_, volumeMountInfo, _ := ConvertIdentityProviders(cpContext, identityProviders, providerOverrides(cpContext.HCP), cpContext.Client, deployment.Namespace)
 			// Ignore the error here, since we don't want to fail the deployment if the identity providers are invalid
 			// A condition will be set on the HC to indicate the error
 			if len(volumeMountInfo.Volumes) > 0 {
-				// Remove any existing IDP volume mounts before adding new ones
-				removeIDPVolumeMounts(deployment)
-				
 				deployment.Spec.Template.Spec.Volumes = append(deployment.Spec.Template.Spec.Volumes, volumeMountInfo.Volumes...)
 				util.UpdateContainer(ComponentName, deployment.Spec.Template.Spec.Containers, func(c *corev1.Container) {
 					c.VolumeMounts = append(c.VolumeMounts, volumeMountInfo.VolumeMounts.ContainerMounts(ComponentName)...)
 				})
 			}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
identityProviders := configuration.OAuth.IdentityProviders
if len(identityProviders) > 0 {
// Remove any existing IDP volumes to ensure clean state after restore
// This is important for OADP restore scenarios where the deployment
// might be restored with stale volume configurations
removeIDPVolumes(deployment)
_, volumeMountInfo, _ := ConvertIdentityProviders(cpContext, identityProviders, providerOverrides(cpContext.HCP), cpContext.Client, deployment.Namespace)
// Ignore the error here, since we don't want to fail the deployment if the identity providers are invalid
// A condition will be set on the HC to indicate the error
if len(volumeMountInfo.Volumes) > 0 {
// Remove any existing IDP volume mounts before adding new ones
removeIDPVolumeMounts(deployment)
deployment.Spec.Template.Spec.Volumes = append(deployment.Spec.Template.Spec.Volumes, volumeMountInfo.Volumes...)
util.UpdateContainer(ComponentName, deployment.Spec.Template.Spec.Containers, func(c *corev1.Container) {
c.VolumeMounts = append(c.VolumeMounts, volumeMountInfo.VolumeMounts.ContainerMounts(ComponentName)...)
})
}
} else {
// If no identity providers are configured, ensure any stale IDP volumes are removed
removeIDPVolumes(deployment)
removeIDPVolumeMounts(deployment)
}
identityProviders := configuration.OAuth.IdentityProviders
if len(identityProviders) > 0 {
// Remove any existing IDP volumes to ensure clean state after restore
// This is important for OADP restore scenarios where the deployment
// might be restored with stale volume configurations
removeIDPVolumes(deployment)
removeIDPVolumeMounts(deployment)
_, volumeMountInfo, _ := ConvertIdentityProviders(cpContext, identityProviders, providerOverrides(cpContext.HCP), cpContext.Client, deployment.Namespace)
// Ignore the error here, since we don't want to fail the deployment if the identity providers are invalid
// A condition will be set on the HC to indicate the error
if len(volumeMountInfo.Volumes) > 0 {
deployment.Spec.Template.Spec.Volumes = append(deployment.Spec.Template.Spec.Volumes, volumeMountInfo.Volumes...)
util.UpdateContainer(ComponentName, deployment.Spec.Template.Spec.Containers, func(c *corev1.Container) {
c.VolumeMounts = append(c.VolumeMounts, volumeMountInfo.VolumeMounts.ContainerMounts(ComponentName)...)
})
}
} else {
// If no identity providers are configured, ensure any stale IDP volumes are removed
removeIDPVolumes(deployment)
removeIDPVolumeMounts(deployment)
}
🤖 Prompt for AI Agents
In `@control-plane-operator/controllers/hostedcontrolplane/v2/oauth/deployment.go`
around lines 95 - 118, When identityProviders > 0, removeIDPVolumeMounts must
run regardless of whether ConvertIdentityProviders returned volumes to avoid
leaving stale mounts; change the block handling ConvertIdentityProviders so that
after calling removeIDPVolumes(deployment) and calling
ConvertIdentityProviders(...) you always call removeIDPVolumeMounts(deployment)
before inspecting volumeMountInfo.Volumes, then only append
volumeMountInfo.Volumes and update container mounts via
util.UpdateContainer(ComponentName, ...) if len(volumeMountInfo.Volumes) > 0.
Ensure the same functions (removeIDPVolumes, removeIDPVolumeMounts,
ConvertIdentityProviders, util.UpdateContainer, ComponentName, deployment) are
used and no other behavior changes.

@jparrill
Copy link
Copy Markdown
Contributor

jparrill commented Feb 4, 2026

/assign @jparrill

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 25, 2026
@openshift-ci openshift-ci Bot added area/ai Indicates the PR includes changes related to AI - Claude agents, Cursor rules, etc. area/api Indicates the PR includes changes for the API area/ci-tooling Indicates the PR includes changes for CI or tooling area/cli Indicates the PR includes changes for CLI area/control-plane-pki-operator Indicates the PR includes changes for the control plane PKI operator - in an OCP release area/documentation Indicates the PR includes changes for documentation area/platform/aws PR/issue for AWS (AWSPlatform) platform area/platform/azure PR/issue for Azure (AzurePlatform) platform area/platform/gcp PR/issue for GCP (GCPPlatform) platform area/platform/kubevirt PR/issue for KubeVirt (KubevirtPlatform) platform area/platform/none PR/issue for None (NonePlatform) platform - user-supplied infrastructure area/platform/openstack PR/issue for OpenStack (OpenStackPlatform) platform area/platform/powervs PR/issue for PowerVS (PowerVSPlatform) platform labels Feb 25, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label Feb 25, 2026
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 25, 2026
@mehabhalodiya mehabhalodiya force-pushed the oadp-oauth branch 3 times, most recently from 08f2779 to 717712a Compare March 2, 2026 09:30
Comment thread control-plane-operator/controllers/hostedcontrolplane/v2/oauth/deployment.go Outdated
@jparrill
Copy link
Copy Markdown
Contributor

jparrill commented Mar 5, 2026

/test e2e-aks

@jparrill
Copy link
Copy Markdown
Contributor

jparrill commented Mar 5, 2026

/test e2e-aws

@jparrill
Copy link
Copy Markdown
Contributor

jparrill commented Mar 5, 2026

/test e2e-aws-upgrade-hypershift-operator

@jparrill
Copy link
Copy Markdown
Contributor

jparrill commented Mar 5, 2026

/test e2e-kubevirt-aws-ovn-reduced

@jparrill
Copy link
Copy Markdown
Contributor

jparrill commented Mar 5, 2026

/test e2e-v2-aws

@jparrill
Copy link
Copy Markdown
Contributor

jparrill commented Mar 5, 2026

Thanks for the PR!, one question, how are you testing this?, do you need some help to make sure this fully works?

@openshift-ci-robot
Copy link
Copy Markdown

@mehabhalodiya: This pull request references Jira Issue OCPBUGS-66251, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

No GitHub users were found matching the public email listed for the QA contact in Jira (mbhalodi@redhat.com), skipping review request.

Details

In response to this:

This PR fixes an issue where OAuth identity provider (IDP) secrets are not mounted as volumes in the oauth-openshift deployment after OADP restore operations.

✅ Changes Made & Tests Created

1. Fixed Error Handling (deployment.go & config.go)

The Root Cause:

The previous code was silently ignoring errors from ConvertIdentityProviders() using _, volumeMountInfo, _ := ...
When IDP conversion failed (e.g., during transient OADP restore conditions), no volumes were added
Result: HTPasswd secret was never mounted to the oauth-openshift deployment

The Fix:

_, volumeMountInfo, err := ConvertIdentityProviders(...)
if err != nil {
   // Return error to trigger reconciliation retry
   return fmt.Errorf("failed to convert identity providers: %w", err)
}

This ensures:
✅ Errors are not silently ignored
✅ Reconciliation retries automatically on failure
✅ When OADP-restored secrets become available, conversion succeeds
✅ IDP volumes are properly added to the deployment

2. Comprehensive Testing

Created deployment_test.go with tests verifying:

✅ HTPasswd IDP volumes are added to deployment
Test: When HTPasswd IDP is configured, it should add IDP volumes to deployment

  • Verifies IDP secret volume is added
  • Verifies volume mount is added to oauth-openshift container

✅ Handles missing secrets correctly (OADP restore scenario)
Test: When HTPasswd IDP secret is missing, it should still add volume reference

  • Volume reference is created even if secret doesn't exist yet
  • Pod will wait for secret (important for OADP restore timing)

✅ Supports multiple IDPs
Test: When multiple IDPs are configured, it should add all IDP volumes

  • Tests HTPasswd + GitHub IDPs
  • Verifies all volumes are properly added

✅ OADP Restore Scenario Test
Test: TestAdaptDeploymentOADPRestoreScenario

  • Simulates post-OADP-restore environment
  • Verifies deployment gets IDP volumes when secret exists
  • Validates volume mounts are under /etc/oauth/idp path

Created config_test.go verifying:

✅ OAuth config includes IDPs

  • HTPasswd IDP is added to OAuth server config
  • Multiple IDPs are all included
  • Empty IDP list results in no IDPs in config

3. Test Results
All tests pass successfully:

  • TestAdaptDeploymentWithHTPasswdIDP - PASS
    • When HTPasswd IDP is configured - PASS
    • When HTPasswd IDP secret is missing - PASS
    • When multiple IDPs are configured - PASS
    • When no IDPs are configured - PASS
  • TestAdaptDeploymentOADPRestoreScenario - PASS
  • TestAdaptOAuthConfigWithHTPasswd - PASS
  • All existing tests continue to pass
  • Linting: 0 issues

Which issue(s) this PR fixes:

Fixes https://issues.redhat.com/browse/OCPBUGS-66251

Special notes for your reviewer:

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

Summary by CodeRabbit

Release Notes

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 8, 2026

Codecov Report

❌ Patch coverage is 21.05263% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 34.75%. Comparing base (783f795) to head (c3d1589).
⚠️ Report is 301 commits behind head on main.

Files with missing lines Patch % Lines
.../controllers/hostedcontrolplane/v2/oauth/config.go 25.00% 8 Missing and 1 partial ⚠️
...trollers/hostedcontrolplane/v2/oauth/deployment.go 14.28% 5 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7628      +/-   ##
==========================================
+ Coverage   34.63%   34.75%   +0.11%     
==========================================
  Files         767      767              
  Lines       93186    93196      +10     
==========================================
+ Hits        32277    32389     +112     
+ Misses      58236    58116     -120     
- Partials     2673     2691      +18     
Files with missing lines Coverage Δ
...trollers/hostedcontrolplane/v2/oauth/deployment.go 17.89% <14.28%> (+17.89%) ⬆️
.../controllers/hostedcontrolplane/v2/oauth/config.go 42.30% <25.00%> (+42.30%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@openshift-ci openshift-ci Bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release area/karpenter-operator Indicates the PR includes changes related to the Karpenter operator area/platform/ibmcloud PR/issue for IBMCloud (IBMCloudPlatform) platform area/testing Indicates the PR includes changes for e2e testing labels Apr 13, 2026
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 13, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 13, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mehabhalodiya
Once this PR has been reviewed and has the lgtm label, please ask for approval from jparrill. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

This PR fixes an issue where OAuth identity provider (IDP)
secrets are not mounted as volumes in the oauth-openshift
deployment after OADP restore operations.

Signed-off-by: mehabhalodiya <mehabhalodiya@gmail.com>
@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 8, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 8, 2026

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 11, 2026

@mehabhalodiya: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aks-4-21 cf02839 link true /test e2e-aks-4-21
ci/prow/docs-preview 3f75e61 link false /test docs-preview
ci/prow/e2e-aws 717712a link true /test e2e-aws
ci/prow/e2e-aks-override d0e1de7 link true /test e2e-aks-override
ci/prow/e2e-v2-gke d0e1de7 link false /test e2e-v2-gke
ci/prow/e2e-aws-override d0e1de7 link true /test e2e-aws-override
ci/prow/e2e-gke d0e1de7 link false /test e2e-gke
ci/prow/security c3d1589 link true /test security

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@bryan-cox
Copy link
Copy Markdown
Member

/uncc @bryan-cox

@openshift-ci openshift-ci Bot removed the request for review from bryan-cox May 19, 2026 14:59
@hypershift-jira-solve-ci
Copy link
Copy Markdown

Test Failure Analysis Complete

Job Information

Test Failure Analysis

Error

Auto-merging control-plane-operator/controllers/hostedcontrolplane/v2/oauth/config.go
CONFLICT (content): Merge conflict in control-plane-operator/controllers/hostedcontrolplane/v2/oauth/config.go
Auto-merging control-plane-operator/controllers/hostedcontrolplane/v2/oauth/deployment.go
Automatic merge failed; fix conflicts and then commit the result.

Summary

All three failures stem from two root issues: (1) a git merge conflict in oauth/config.go that prevents the CI system from merging the PR branch onto main, which blocks the security scan and causes the tide error; and (2) insufficient test coverage on new error-handling code paths, with only 21% patch coverage (15 lines missing). The PR itself changes error handling in the OAuth identity provider conversion — previously ignored errors from ConvertIdentityProviders() are now propagated — but the new test cases only cover happy paths (expectError: false) and never exercise the error-return branches.

Root Cause

ci/prow/security (FAILURE): The job failed during the git clone/checkout phase before any security scan could execute. Prow attempted to merge PR commit c3d1589 onto main at f16ca0d22 (merged PR #8478 by bryan-cox) and hit a content conflict in control-plane-operator/controllers/hostedcontrolplane/v2/oauth/config.go. Since the merge failed, no CI step ran — no artifacts directory was created. This is a deterministic failure that will persist until the branch is rebased.

codecov/patch (FAILURE): Patch coverage is 21.05% with 15 lines of new/changed production code not covered by tests. Specifically:

  • config.go: 25% patch coverage — 8 missing lines, 1 partial. The adaptConfigMap error-return path and the adaptOAuthConfig error-wrapping path (return fmt.Errorf("failed to convert identity providers: %w", err)) are never executed by tests.
  • deployment.go: 14.28% patch coverage — 5 missing lines, 1 partial. The adaptDeployment error path from ConvertIdentityProviders is similarly untested.
  • The test files (config_test.go, deployment_test.go) define expectError and errorContains fields in their test case structs but never set expectError: true in any test case.

tide (ERROR): Tide cannot merge the PR because: (1) merge conflicts exist (mergeable: CONFLICTING, mergeStateStatus: DIRTY), (2) the needs-rebase label was automatically applied, (3) ci/prow/security and codecov/patch are failing, (4) the PR lacks approved and lgtm labels, and (5) six e2e jobs are still pending.

Recommendations
  1. Rebase the branch onto current main to resolve the merge conflict in oauth/config.go. This is the blocking prerequisite — without it, ci/prow/security and all other Prow jobs will continue to fail at the clone step.

  2. Add error-path test cases to improve patch coverage:

    • In config_test.go: Add a test case with expectError: true where ConvertIdentityProviders returns an error (e.g., configure an IDP referencing a non-existent or invalid secret). The test struct already supports expectError and errorContains fields.
    • In deployment_test.go: Similarly add an error-path test case exercising the new if err != nil { return fmt.Errorf(...) } block.
    • Consider adding a test for adaptConfigMap directly (currently only adaptOAuthConfig and adaptDeployment are tested directly).
  3. Re-trigger CI after rebasing with /test all or /test security to validate the fixes.

  4. Obtain reviewer approval (/lgtm + /approve) once CI passes.

Evidence
Evidence Detail
Merge conflict file control-plane-operator/controllers/hostedcontrolplane/v2/oauth/config.go
Base SHA (main) f16ca0d22941d58a170aaa4b1471b1456017c7c8 (merged PR #8478)
PR HEAD SHA c3d1589746abfa4a20a4d05ecec6dace97ed787a
Mergeable status CONFLICTING / DIRTY
Patch coverage 21.05% (15 lines missing)
config.go coverage 25.00% patch — 8 missing, 1 partial
deployment.go coverage 14.28% patch — 5 missing, 1 partial
Uncovered code pattern if err != nil { return fmt.Errorf("failed to convert identity providers: %w", err) }
Test gap All test cases have expectError: false; no error-path test cases defined
Tide blockers needs-rebase label, failing checks, missing approved/lgtm labels, 6 pending e2e jobs
Security scan status Never executed — job failed at git clone phase
Clone log Confirms Automatic merge failed; fix conflicts and then commit the result

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ai Indicates the PR includes changes related to AI - Claude agents, Cursor rules, etc. area/api Indicates the PR includes changes for the API area/ci-tooling Indicates the PR includes changes for CI or tooling area/cli Indicates the PR includes changes for CLI area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/control-plane-pki-operator Indicates the PR includes changes for the control plane PKI operator - in an OCP release area/documentation Indicates the PR includes changes for documentation area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release area/karpenter-operator Indicates the PR includes changes related to the Karpenter operator area/platform/aws PR/issue for AWS (AWSPlatform) platform area/platform/azure PR/issue for Azure (AzurePlatform) platform area/platform/gcp PR/issue for GCP (GCPPlatform) platform area/platform/ibmcloud PR/issue for IBMCloud (IBMCloudPlatform) platform area/platform/kubevirt PR/issue for KubeVirt (KubevirtPlatform) platform area/platform/none PR/issue for None (NonePlatform) platform - user-supplied infrastructure area/platform/openstack PR/issue for OpenStack (OpenStackPlatform) platform area/platform/powervs PR/issue for PowerVS (PowerVSPlatform) platform area/testing Indicates the PR includes changes for e2e testing jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants