-
Notifications
You must be signed in to change notification settings - Fork 13
Refactor to allow resource-agnostic validation #248
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
base: main
Are you sure you want to change the base?
Conversation
knikolla
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.
This is a good start, but not going as far as I would like in terms of making it "resource-agnostic", as you still have a lot of if resource_name in OPENSHIFT|OPENSTACK.
Try thinking about a way to push those resource-specific functions inside the respective allocators and creating a new function in the base Allocator that serves as the abstraction.
See my comment about validate project exist.
|
|
||
| return quota_str | ||
|
|
||
| def validate_project_exists(self, allocator, project_id, resource_name): |
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.
You should define this in the coldfront_plugin_cloud.base.ResourceAllocator and then implement these in the OpenStack and OpenShift resource allocators. This would make this part of the codebase be Resource Agnostic.
|
Note-to-self: The branch name for the original solution (before time of this comment) is |
9153d7b to
a86da68
Compare
a86da68 to
40883e2
Compare
Quota validation will now behave the same for both resource types. OpenStack's particular use of default quotas is reflected in a new test in `openstack/test_allocation.py` OpenStack integration code is slightly changed to better handle missing object storage quotas Much of the validation logic has been pushed into `base.py`, `openshift.py`, and `openstack.py`
40883e2 to
129234b
Compare
|
@knikolla I've cleaned house on |
Closes #239. This PR consists of the last commit. Built on top of #245. More details in the commit message.
@knikolla @jtriley I have a small bug in how error handling is done when the object storage quota is missing. Just want to confirm that my change is desirable.