-
Notifications
You must be signed in to change notification settings - Fork 294
[Projects] Fix leader project creation flow #9146
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
[Projects] Fix leader project creation flow #9146
Conversation
liranbg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
elbamit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 questions:
- Why do you check read permissions? How does that solve if the user performs not a read operation on the project resources?
- Is this change only relevant for project creation/storing operations? What about other resources/operations?
It's a minimal check only to verify that OPA has received the changes in the manifest.
It's a must for create / store, to allow accessing the project at all. |
📝 Description
This PR addresses a few issues that were found in the project creation flow when MLRun is the project Leader:
sortedlist of followers. When the followers are defined['igz', 'nuclio']this ensures the project policies are created before the project is created on Nuclio.store_projectto decide if it a "create" or "update" based on ifcreate_projectraises a 409 Conflict error. If conflict - it is an "update", if not - it is a "create".get_project_policy_assignments, we would get a 403 and not a 404, so we couldn't really tell if that 403 is because the project doesn't exist or we really don't have permissions.🛠️ Changes Made
Added
ensure_project_permissions()method toAuthVerifier(server/py/framework/utils/auth/verifier.py):Updated project endpoints (
server/py/services/api/api/endpoints/projects.py):ensure_project_permissions()call aftercreate_projectcompletes (before returning 201)ensure_project_permissions()call afterstore_projectcompletesRefactored iguazio's
store_project(server/py/framework/utils/clients/iguazio/v4.py):Sorted followers list when running all on all followers (
server/py/framework/utils/projects/leader.py):igzfollower operations run beforenucliofollwer.✅ Checklist
🧪 Testing
🔗 References
🚨 Breaking Changes?
🔍️ Additional Notes