Skip to content
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

[RHOAIENG-15773] Fix MR permissions management error (give dashboard ServiceAccount permission to get endpoints) #3546

Conversation

mturley
Copy link
Contributor

@mturley mturley commented Dec 4, 2024

Resolves critical bug RHOAIENG-15773.

Description

Due to a change in the Model Registry operator (PR here, issue here), the registry-user-${registryname} role that is generated for each model registry now has an additional permission: get endpoints.

The service account used by the dashboard to create rolebindings for managing model registry permissions does not have permission to get endpoints today. Because of this change, the Manage Permissions page's requests to create new rolebindings using this role are failing in the dashboard. This is due to a cluster API restriction that a user may not grant other users permissions that they don't have themselves.

We would like to discuss a longer-term solution to the constraint we've found here. It should not be possible to cause dashboard permission regressions by changing roles in another component (ideally, any user with rhoai admin permissions should have the same permissions any model registry user have). But for now, the short term fix is to add this new get endpoints permission to our ServiceAccount's ClusterRole.

How Has This Been Tested?

Observe that with these manifests changed (via a devFlag on the cluster), the odh-dashboard ClusterRole has the changes from this PR's diff. Go to Model Registry Settings, click Manage Permissions on a registry, try to add a user, group or project, and make sure it succeeds.

Test Impact

N/A, end to end tests would be nice for this case though once we are ready for that.

Request review criteria:

Self checklist (all need to be checked):

  • The developer has manually tested the changes and verified that the changes work
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has added tests or explained why testing cannot be added (unit or cypress tests for related changes)

If you have UI changes:

  • Included any necessary screenshots or gifs if it was a UI change.
  • Included tags to the UX team if it was a UI/UX change.

After the PR is posted & before it merges:

  • The developer has tested their solution on a cluster by using the image produced by the PR to main

Copy link

codecov bot commented Dec 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.56%. Comparing base (ca3d3e4) to head (425ce4c).
Report is 14 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3546      +/-   ##
==========================================
+ Coverage   85.54%   85.56%   +0.01%     
==========================================
  Files        1342     1342              
  Lines       31025    31025              
  Branches     8679     8679              
==========================================
+ Hits        26541    26546       +5     
+ Misses       4484     4479       -5     

see 3 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ca3d3e4...425ce4c. Read the comment docs.

Copy link
Contributor

openshift-ci bot commented Dec 6, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andrewballantyne

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 label Dec 6, 2024
@andrewballantyne
Copy link
Member

/hold

Double checking with the architects before we merge

@openshift-ci openshift-ci bot added the do-not-merge/hold This PR is hold for some reason label Dec 6, 2024
@andrewballantyne
Copy link
Member

/unhold

No response, lets go ahead with this -- if we need to revert it, we have time.

@openshift-ci openshift-ci bot removed the do-not-merge/hold This PR is hold for some reason label Dec 9, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 8484cd3 into opendatahub-io:main Dec 9, 2024
6 checks passed
@mturley mturley deleted the RHOAIENG-15773-mr-rolebinding-error branch December 10, 2024 17:29
ConorOM1 pushed a commit to ConorOM1/odh-dashboard that referenced this pull request Dec 12, 2024
ConorOM1 pushed a commit to ConorOM1/odh-dashboard that referenced this pull request Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants