Skip to content

CNTRLPLANE-71: update cao to manage rolebindingrestriction crd #748

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

everettraven
Copy link
Contributor

@everettraven everettraven commented Jan 7, 2025

Description

Updates the cluster-authentication-operator to manage the RoleBindingRestriction CRD.

More specifically, this PR:

  • Vendors the authorization.openshift.io/RoleBindingRestriction CRD manifest from https://github.com/openshift/api
  • Adds targets to the Makefile to:
    • Copy the RoleBindingRestriction CRD manifests to the bindata/ directory so the manifest can be embedded into the binary using the embed FS.
    • Verify the bindata/ directory is up to date
    • Verify the RoleBindingRestriction CRD manifest in bindata/ is up to date based on the latest vendored manifest.
  • Adds the oauth-openshift/authorization.openshift.io_rolebindingrestrictions.yaml file to the list of manifest files managed by the static resource controller
  • Adds an apiextensions client to support the management of CustomResourceDefinition resources using the static resource controller.
  • Adds a render subcommand to be used by the openshift installer during bootstrapping because the RoleBindingRestriction CRD is required during bootstrapping. Without it, the authorization.openshift.io/RestrictSubjectBindings admission plugin will reject creation of system:* RoleBindings during the installation process.

Motivation

Update the cluster-authentication-operator to manage the RoleBindingRestriction CRD, as outlined in openshift/enhancements#1726, to allow for this CRD to be removed from the cluster when the oauth stack is no longer desired.

@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 Jan 7, 2025
Copy link
Contributor

openshift-ci bot commented Jan 7, 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-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 9, 2025
@everettraven everettraven force-pushed the feature/manage-rbrs branch 2 times, most recently from 7727139 to 990efd5 Compare January 22, 2025 19:35
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 22, 2025
@everettraven everettraven changed the title WIP: update cao to manage rolebindingrestriction crd CNTRLPLANE-71: update cao to manage rolebindingrestriction crd Jan 22, 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 Jan 22, 2025
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jan 22, 2025

@everettraven: This pull request references CNTRLPLANE-71 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.19.0" version, but no target version was set.

In response to this:

Description

Updates the cluster-authentication-operator to manage the RoleBindingRestriction CRD.

More specifically, this PR:

  • Vendors the authorization.openshift.io/RoleBindingRestriction CRD manifest from https://github.com/openshift/api
  • Adds targets to the Makefile to:
    • Copy the RoleBindingRestriction CRD manifests to the bindata/ directory so the manifest can be embedded into the binary using the embed FS.
    • Verify the bindata/ directory is up to date
    • Verify the RoleBindingRestriction CRD manifest in bindata/ is up to date based on the latest vendored manifest.
  • Adds the oauth-openshift/authorization.openshift.io_rolebindingrestrictions.yaml file to the list of manifest files managed by the static resource controller
  • Adds an apiextensions client to support the management of CustomResourceDefinition resources using the static resource controller.

Motivation

Update the cluster-authentication-operator to manage the RoleBindingRestriction CRD, as outlined in openshift/enhancements#1726, to allow for this CRD to be removed from the cluster when the oauth stack is no longer desired.

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 everettraven marked this pull request as ready for review January 22, 2025 19:36
@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 Jan 22, 2025
@openshift-ci openshift-ci bot requested review from ibihim and liouk January 22, 2025 19:38
@everettraven
Copy link
Contributor Author

/retest

@everettraven
Copy link
Contributor Author

After some testing in conjunction with openshift/api#2138 , it does appear that the RoleBindingRestriction CRD is required as part of bootstrapping so that the authorization.openshift.io/SubjectBindingRestrictions admission plugin doesn't reject admission of system:* RoleBindings.

/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 Jan 30, 2025
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Feb 3, 2025

@everettraven: This pull request references CNTRLPLANE-71 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.19.0" version, but no target version was set.

In response to this:

Description

Updates the cluster-authentication-operator to manage the RoleBindingRestriction CRD.

More specifically, this PR:

  • Vendors the authorization.openshift.io/RoleBindingRestriction CRD manifest from https://github.com/openshift/api
  • Adds targets to the Makefile to:
    • Copy the RoleBindingRestriction CRD manifests to the bindata/ directory so the manifest can be embedded into the binary using the embed FS.
    • Verify the bindata/ directory is up to date
    • Verify the RoleBindingRestriction CRD manifest in bindata/ is up to date based on the latest vendored manifest.
  • Adds the oauth-openshift/authorization.openshift.io_rolebindingrestrictions.yaml file to the list of manifest files managed by the static resource controller
  • Adds an apiextensions client to support the management of CustomResourceDefinition resources using the static resource controller.
  • Adds a render subcommand to be used by the openshift installer during bootstrapping because the RoleBindingRestriction CRD is required during bootstrapping. Without it, the authorization.openshift.io/RestrictSubjectBindings admission plugin will reject creation of system:* RoleBindings during the installation process.

Motivation

Update the cluster-authentication-operator to manage the RoleBindingRestriction CRD, as outlined in openshift/enhancements#1726, to allow for this CRD to be removed from the cluster when the oauth stack is no longer desired.

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
Contributor Author

After testing with some related PRs, this PR should be ready to go. Removing the hold.

Tested standing up a cluster with this PR and openshift/installer#9424 as well as this PR, openshift/installer#9424, and openshift/api#2138

/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 Feb 3, 2025
@everettraven everettraven force-pushed the feature/manage-rbrs branch 2 times, most recently from c3d08c0 to 0449aa4 Compare February 3, 2025 15:27
@everettraven everettraven force-pushed the feature/manage-rbrs branch 2 times, most recently from a660be5 to 7364ff4 Compare February 4, 2025 14:33
so that it can be added to the set of resources
managed by the staticresourcecontroller.

Signed-off-by: Bryce Palmer <[email protected]>
Signed-off-by: Bryce Palmer <[email protected]>
@@ -15,7 +15,7 @@ include $(addprefix ./vendor/github.com/openshift/build-machinery-go/make/, \
#
# Example:
# make check
check: | verify test-unit
check: | verify verify-bindata test-unit
Copy link
Member

Choose a reason for hiding this comment

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

Just to make sure -- CI will run check which means that bindata will also be verified, and in case there's a diff between the api copy and the local copy, we'll get a failed test, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looking at https://github.com/openshift/release/blob/master/ci-operator/config/openshift/cluster-authentication-operator/openshift-cluster-authentication-operator-master.yaml I don't actually think check is run in CI explicitly, but I added this here since it seemed like a natural fit.

I'll plan to add a new CI check to run this make target today (although it will fail until this PR is merged).

Copy link
Contributor Author

@everettraven everettraven Feb 10, 2025

Choose a reason for hiding this comment

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

Created openshift/release#61456 to add verify-bindata as an explicit CI check

@liouk
Copy link
Member

liouk commented Feb 10, 2025

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 10, 2025
to add the rolebindingrestriction crd as a bootstrap manifest

Signed-off-by: Bryce Palmer <[email protected]>
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Feb 11, 2025
@everettraven
Copy link
Contributor Author

/retest

@everettraven
Copy link
Contributor Author

/retest-required

Copy link
Contributor

openshift-ci bot commented Feb 12, 2025

@everettraven: The following test 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/test-operator-integration 2dc36e0 link false /test test-operator-integration

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.

@everettraven
Copy link
Contributor Author

/retest-required

@liouk
Copy link
Member

liouk commented Feb 14, 2025

/lgtm

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

openshift-ci bot commented Feb 14, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: everettraven, liouk

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

The pull request process is described here

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 Feb 14, 2025
@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 514e843 and 2 for PR HEAD 2dc36e0 in total

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD e44a923 and 1 for PR HEAD 2dc36e0 in total

@openshift-merge-bot openshift-merge-bot bot merged commit 8664bab into openshift:master Feb 20, 2025
12 of 13 checks passed
@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

Distgit: ose-cluster-authentication-operator
This PR has been included in build ose-cluster-authentication-operator-container-v4.19.0-202502201237.p0.g8664bab.assembly.stream.el9.
All builds following this will include this PR.

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. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants