Skip to content

Conversation

@everettraven
Copy link

@everettraven everettraven commented Jul 1, 2025

What this PR does / why we need it:

Updates the OpenShift-specific admission plugin for admission time validation of the authentications.config.openshift.io resource to add validation for CEL expressions that can be specified in claim mappings as of openshift/api#2234 in TPNU clusters.

This changes makes it so that we can reject, at admission time, CEL expressions that will not successfully compile.

@openshift-ci-robot openshift-ci-robot added the backports/unvalidated-commits Indicates that not all commits come to merged upstream PRs. label Jul 1, 2025
@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 Jul 1, 2025
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 1, 2025
@openshift-ci
Copy link

openshift-ci bot commented Jul 1, 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

@openshift-ci-robot
Copy link

openshift-ci-robot commented Jul 1, 2025

@everettraven: This pull request references CNTRLPLANE-940 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.20.0" version, but no target version was set.

In response to this:

What type of PR is this?

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


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-robot
Copy link

@everettraven: the contents of this pull request could not be automatically validated.

The following commits could not be validated and must be approved by a top-level approver:

Comment /validate-backports to re-evaluate validity of the upstream PRs, for example when they are merged upstream.

@openshift-ci openshift-ci bot added the vendor-update Touching vendor dir or related files label Jul 1, 2025
@everettraven
Copy link
Author

/test all

1 similar comment
@everettraven
Copy link
Author

/test all

@everettraven
Copy link
Author

/retest-required

@everettraven everettraven force-pushed the feature/oidc-cel-admission-plugin branch from 435949d to ec4738b Compare July 9, 2025 12:45
@openshift-ci-robot
Copy link

@everettraven: the contents of this pull request could not be automatically validated.

The following commits could not be validated and must be approved by a top-level approver:

Comment /validate-backports to re-evaluate validity of the upstream PRs, for example when they are merged upstream.

@everettraven everettraven marked this pull request as ready for review July 9, 2025 12:46
@openshift-ci openshift-ci bot requested review from benluddy and deads2k July 9, 2025 12:47
@everettraven everettraven force-pushed the feature/oidc-cel-admission-plugin branch from ec4738b to 9b472e3 Compare July 9, 2025 15:20
@openshift-ci-robot
Copy link

@everettraven: the contents of this pull request could not be automatically validated.

The following commits could not be validated and must be approved by a top-level approver:

Comment /validate-backports to re-evaluate validity of the upstream PRs, for example when they are merged upstream.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Jul 9, 2025

@everettraven: This pull request references CNTRLPLANE-940 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.20.0" version, but no target version was set.

In response to this:

What this PR does / why we need it:

Updates the OpenShift-specific admission plugin for admission time validation of the authentications.config.openshift.io resource to add validation for CEL expressions that can be specified in claim mappings as of openshift/api#2234 in TPNU clusters.

This changes makes it so that we can reject, at admission time, CEL expressions that will not successfully compile.

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.

@everettraven
Copy link
Author

/retest-required

}
}

if spec.Type == configv1.AuthenticationTypeOIDC {
Copy link
Member

Choose a reason for hiding this comment

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

It might make sense to split the validations of this func into two sub-funcs, one for OAuth and one for OIDC, as it's currently mixed.

Copy link
Author

Choose a reason for hiding this comment

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

Are you thinking along the lines of having something like:

switch spec.Type {
    case configv1.AuthenticationTypeOIDC:
        validateOIDC(...)
    case ...:
        ...
}

?

I considered doing something like that, but wasn't sold on it being worth the potential scope creep. If you think it would be useful to do that though I can make some changes.

Copy link
Member

Choose a reason for hiding this comment

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

I think I would prefer it, but no strong opinion. You could maybe at least separate the respective validations (i.e. put the oidc validation after the oauth metadata) and add some comments to section them out; that'd be fine as well.

Copy link
Author

Choose a reason for hiding this comment

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

When I went to change towards a switch-based approach I noticed that there are not any other admission validations that ensure that the oauthMetadata field is only set when a particular type is set. Nor do we have a guarantee for the oidcProviders field on a type requirement.

For now, I'll section with comments, but I'd like to avoid any changes in this PR that might change how this validation has worked historically

@openshift-ci-robot
Copy link

@everettraven: the contents of this pull request could not be automatically validated.

The following commits could not be validated and must be approved by a top-level approver:

Comment /validate-backports to re-evaluate validity of the upstream PRs, for example when they are merged upstream.

@everettraven everettraven force-pushed the feature/oidc-cel-admission-plugin branch from f0026aa to f92c8e7 Compare July 14, 2025 15:33
@openshift-ci-robot
Copy link

@everettraven: the contents of this pull request could not be automatically validated.

The following commits could not be validated and must be approved by a top-level approver:

Comment /validate-backports to re-evaluate validity of the upstream PRs, for example when they are merged upstream.

@everettraven everettraven changed the title WIP: CNTRLPLANE-940: Add CEL expression compile validation for Authentication admission CNTRLPLANE-940: Add CEL expression compile validation for Authentication admission Jul 14, 2025
@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 Jul 14, 2025
@everettraven
Copy link
Author

Should not merge until after kube 1.33 rebase is complete.

/hold

@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 Jul 14, 2025
@liouk
Copy link
Member

liouk commented Jul 16, 2025

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 16, 2025
@openshift-ci openshift-ci bot added backports/validated-commits Indicates that all commits come to merged upstream PRs. and removed backports/unvalidated-commits Indicates that not all commits come to merged upstream PRs. labels Jul 31, 2025
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 8fee314 and 2 for PR HEAD 2c5cdef in total

1 similar comment
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 8fee314 and 2 for PR HEAD 2c5cdef in total

@everettraven
Copy link
Author

/retest-required

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 050f9ab and 1 for PR HEAD 2c5cdef in total

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD b7fd57a and 0 for PR HEAD 2c5cdef in total

@openshift-ci-robot
Copy link

/hold

Revision 2c5cdef was retested 3 times: holding

@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 Aug 2, 2025
@p0lyn0mial
Copy link

/retest-required

@everettraven
Copy link
Author

Required tests look to be passing. Non-required tests seem to be unrelated failures. Removing hold.

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 4, 2025
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 9c2642e and 2 for PR HEAD 2c5cdef in total

1 similar comment
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 9c2642e and 2 for PR HEAD 2c5cdef in total

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 36f2a99 and 2 for PR HEAD 2c5cdef in total

1 similar comment
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 36f2a99 and 2 for PR HEAD 2c5cdef in total

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD af24321 and 2 for PR HEAD 2c5cdef in total

1 similar comment
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD af24321 and 2 for PR HEAD 2c5cdef in total

@everettraven
Copy link
Author

everettraven commented Aug 6, 2025

Looks like the e2e-aws-crun-wasm and e2e-aws-ovn-crun jobs are failing on a known regression

The regression appears to be because the test itself is extremely flaky. From what I can tell from the PR test history, these tests have passed on the latest changes but are flaking while re-running jobs while this PR is in the merge pool.

@everettraven
Copy link
Author

@p0lyn0mial @benluddy Are both of you comfortable with an override on the failures hung up on the known regression?

@everettraven
Copy link
Author

/test e2e-aws-ovn-fips

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 3e4371f and 1 for PR HEAD 2c5cdef in total

@everettraven
Copy link
Author

/retest

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 00d4655 and 2 for PR HEAD 2c5cdef in total

@openshift-merge-bot openshift-merge-bot bot merged commit 9faed01 into openshift:master Aug 7, 2025
34 of 39 checks passed
@openshift-ci
Copy link

openshift-ci bot commented Aug 7, 2025

@everettraven: 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-openstack-csi-cinder 2c5cdef link false /test e2e-openstack-csi-cinder
ci/prow/e2e-openstack-csi-manila 2c5cdef link false /test e2e-openstack-csi-manila
ci/prow/e2e-aws-disruptive 2c5cdef link false /test e2e-aws-disruptive

Full PR test history. Your PR dashboard.

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.

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. backports/validated-commits Indicates that all commits come to merged upstream PRs. 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. vendor-update Touching vendor dir or related files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants