Skip to content

Conversation

@devguyio
Copy link
Contributor

This PR addresses three issues related to OIDC authentication:

  1. Fixed OIDC client secret lookup in oidcsetup controller to use the correct informer (configSecretsLister), namespace (openshift-config), and dynamic secret name from the Authentication CR, instead of hardcoded values.

  2. Fixed secret revision validation to compare the TARGET secret (openshift-console/console-oauth-config) with the deployment annotation, following the same pattern as ConfigMap CA trust validation. This ensures proper verification of secret sync status.

  3. Added condition cleanup in sync_v400 to properly clear the OIDCProviderTrustedAuthorityConfigGet degraded condition when authentication type changes from OIDC to non-OIDC (e.g., IntegratedOAuth). This prevents the Console Operator from remaining in a Degraded state indefinitely during rollback scenarios.

This commit addresses three issues related to OIDC authentication:

1. Fixed OIDC client secret lookup in oidcsetup controller to use
   the correct informer (configSecretsLister), namespace (openshift-config),
   and dynamic secret name from the Authentication CR, instead of
   hardcoded values.

2. Fixed secret revision validation to compare the TARGET secret
   (openshift-console/console-oauth-config) with the deployment
   annotation, following the same pattern as ConfigMap CA trust
   validation. This ensures proper verification of secret sync status.

3. Added condition cleanup in sync_v400 to properly clear the
   OIDCProviderTrustedAuthorityConfigGet degraded condition when
   authentication type changes from OIDC to non-OIDC (e.g.,
   IntegratedOAuth). This prevents the Console Operator from
   remaining in a Degraded state indefinitely during rollback
   scenarios.

Assisted-by: Claude Code 2.0.5, claude-sonnet-4-5@20250929
Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 13, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 13, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@devguyio devguyio changed the title fix(oidc): fix secret lookup, validation, and condition cleanup WIP: fix(oidc): fix secret lookup, validation, and condition cleanup Nov 13, 2025
@devguyio devguyio changed the title WIP: fix(oidc): fix secret lookup, validation, and condition cleanup WIP: fix(oidc): fix OIDC client secret lookup, validation, and condition cleanup Dec 3, 2025
@devguyio devguyio changed the title WIP: fix(oidc): fix OIDC client secret lookup, validation, and condition cleanup OCPBUGS-61432: fix(oidc): fix OIDC client secret lookup, validation, and condition cleanup Dec 3, 2025
@openshift-ci-robot openshift-ci-robot added 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 Dec 3, 2025
@openshift-ci-robot
Copy link
Contributor

@devguyio: This pull request references Jira Issue OCPBUGS-61432, which is invalid:

  • expected the bug to be in one of the following states: NEW, ASSIGNED, POST, but it is MODIFIED instead

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 addresses three issues related to OIDC authentication:

  1. Fixed OIDC client secret lookup in oidcsetup controller to use the correct informer (configSecretsLister), namespace (openshift-config), and dynamic secret name from the Authentication CR, instead of hardcoded values.

  2. Fixed secret revision validation to compare the TARGET secret (openshift-console/console-oauth-config) with the deployment annotation, following the same pattern as ConfigMap CA trust validation. This ensures proper verification of secret sync status.

  3. Added condition cleanup in sync_v400 to properly clear the OIDCProviderTrustedAuthorityConfigGet degraded condition when authentication type changes from OIDC to non-OIDC (e.g., IntegratedOAuth). This prevents the Console Operator from remaining in a Degraded state indefinitely during rollback scenarios.

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.

@devguyio
Copy link
Contributor Author

devguyio commented Dec 3, 2025

/jira refresh

@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 Dec 3, 2025
@devguyio devguyio marked this pull request as ready for review December 3, 2025 08:25
@openshift-ci-robot openshift-ci-robot removed the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Dec 3, 2025
@openshift-ci-robot
Copy link
Contributor

@devguyio: This pull request references Jira Issue OCPBUGS-61432, which is valid.

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

Requesting review from QA contact:
/cc @yanpzhan

Details

In response to this:

/jira refresh

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.

@openshift-ci openshift-ci bot requested a review from yanpzhan December 3, 2025 08:25
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 3, 2025
@openshift-ci openshift-ci bot requested review from TheRealJon and spadgett December 3, 2025 08:26
@devguyio
Copy link
Contributor Author

devguyio commented Dec 3, 2025

/cc @jhadvig @everettraven @xiuwang @xingxingxia

Previous fixes for this bug caused regression in OIDC before, can you please help review and validate? I tested it locally, verified the console works, and verified that the setting an external OIDC provider gets the console to do proper token exchange, but didn't yet reach a full login scenario due to some misconfiguration between EntraID and my cluster.

However the token exchange did happen. I'll keep trying though.

@xiuwang
Copy link

xiuwang commented Dec 3, 2025

/verified by @xiuwang

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Dec 3, 2025
@openshift-ci-robot
Copy link
Contributor

@xiuwang: This PR has been marked as verified by @xiuwang.

Details

In response to this:

/verified by @xiuwang

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.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 3, 2025

@devguyio: all tests passed!

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.

@devguyio
Copy link
Contributor Author

devguyio commented Dec 3, 2025

/payload-job e2e-aws-sno-external-oidc-configure

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 3, 2025

@devguyio: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • e2e-aws-sno-external-oidc-configure

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/c92a90e0-d04b-11f0-98a4-caad0f6d4aa6-0

@devguyio
Copy link
Contributor Author

devguyio commented Dec 3, 2025

/payload-job e2e-aws-sno-external-oidc-revertoauth

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 3, 2025

@devguyio: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • e2e-aws-sno-external-oidc-revertoauth

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/d211ec80-d04b-11f0-8ccb-984ab60b5161-0

// to compare its resource version with the deployment annotation
targetClientSecret, err := c.targetNSSecretsLister.Secrets(api.OpenShiftConsoleNamespace).Get("console-oauth-config")
if err != nil {
return false, "", err
Copy link
Contributor

Choose a reason for hiding this comment

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

Wrap the error with additional context?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

typically that's what I'd do, but this is the convention in this controller, to bubble up errors as-is and rely on the higher level to handle that 🤷🏽 you'll see that in many other places, e.g. line 278

Copy link
Contributor

Choose a reason for hiding this comment

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

Just because it is convention, doesn't mean we can't do better now ;).

But this is a more of a nit so I won't block on it.

Copy link
Contributor Author

@devguyio devguyio Dec 4, 2025

Choose a reason for hiding this comment

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

Just because it is convention, doesn't mean we can't do better now ;).
I see your point, and I try to do "leave the code better than you found it". However, I wouldn't feel comfortable introducing such a change in convention without before:

  1. I get an understanding of the reasons behind that convention from the project/repo maintainers.
  2. I agree on a scope of the change upfront, because changing this single instance, IMHO, would leave the code in a more confusing state than how it was 😉 , with inconsistencies due to the two conventions existing.

Just my two cents, but agreed, it's a nit and I am not opposing the change, just wanna make sure that it's a change that has the project approvers buy-in, and that we've clarity around unifying that moving forward 😃 .

Thanks for the feedback!

Copy link
Contributor

@everettraven everettraven left a comment

Choose a reason for hiding this comment

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

Aside from one minor comment, this looks fine to me.

@devguyio
Copy link
Contributor Author

devguyio commented Dec 8, 2025

/hold

I think this should go in after branch-cut

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 8, 2025
Copy link
Member

@jhadvig jhadvig left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 8, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 8, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: devguyio, jhadvig

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

The pull request process is described 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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 8, 2025
@openshift-bot
Copy link
Contributor

/jira refresh

The requirements for Jira bugs have changed (Jira issues linked to PRs on main branch need to target different OCP), recalculating validity.

@openshift-ci-robot openshift-ci-robot added jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. and removed jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Dec 12, 2025
@openshift-ci-robot
Copy link
Contributor

@openshift-bot: This pull request references Jira Issue OCPBUGS-61432, which is invalid:

  • expected the bug to target either version "4.22." or "openshift-4.22.", but it targets "4.21.0" instead

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.

Details

In response to this:

/jira refresh

The requirements for Jira bugs have changed (Jira issues linked to PRs on main branch need to target different OCP), recalculating validity.

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.

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants