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

Add owner references to Elyra role binding when creating notebooks #1770

Merged
merged 1 commit into from
Oct 3, 2023

Conversation

DaoDaoNoCode
Copy link
Member

@DaoDaoNoCode DaoDaoNoCode commented Sep 8, 2023

Closes #1721

Description

Check the Elyra service account role binding every time we create/restart a notebook with the enabled pipelines feature. If the role binding is there, check the ownerReferences field to see if the notebook is the owner, if not, patch it. If the role binding is not there, create a new one with the ownerReferences field and set the notebook as the owner. In this way, every time the user deletes the notebook, it will also delete the role binding.

How Has This Been Tested?

  1. Enable pipelines
  2. Create a workbench
  3. Check the role binding named elyra-pipelines-${workbenchName} is created and has the ownerReferences field
  4. Try to delete the workbench, make sure the role binding is also deleted along with the deletion of the workbench
  5. Create a workbench again, then remove the ownerReferences field in the role binding
  6. Delete the workbench, you will find the role binding is not deleted
  7. Then create a workbench with the same name in step 5
  8. Check the role binding and you will find it's patched with the ownerReferences field again with the new workbench uid
  9. Delete the workbench, and make sure the role binding is deleted too
  10. Repeat step 5
  11. Stop the workbench, then restart it
  12. You will find the ownerReferences field is added
  13. Toggle the status, make sure the role binding is not affected and no error out

Test Impact

N/A, it's about a field in role binding,

Request review criteria:

Self checklist (all need to be checked):

  • The developer has manually tested the changes and verified that the changes work
  • Commits have been squashed into descriptive, self-contained units of work (e.g. 'WIP' and 'Implements feedback' style messages have been removed)
  • 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 tests & storybook 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 (find relevant UX in the SMEs section).

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

@DaoDaoNoCode DaoDaoNoCode force-pushed the upstream-issue-1721 branch 2 times, most recently from affa4e6 to 67cc7da Compare September 19, 2023 18:33
@christianvogt
Copy link
Contributor

/lgtm
/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 3, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: christianvogt

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 Oct 3, 2023
@openshift-ci openshift-ci bot merged commit 94a421f into opendatahub-io:main Oct 3, 2023
3 checks passed
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.

[Bug]: Elyra rbac already exists error
3 participants