Ensure proper quota is imposed when moving gears across node profiles #6172
Conversation
[test] |
This looks good to me. I couldn't find any oo-admin-move related tests (which sort of makes sense given that the tests run on a single system). I guess we'd just have to have QE test this as part of their suite. |
@tiwillia , this patch does not appear to consider the case where a user has elected to add extra storage to the gear, as they are allowed to do in OpenShift Online. |
@a13m , thanks for pointing that out. I've made changes so that any additional storage is taken into consideration. Could you review one more time? |
Online Test Results: SUCCESS (https://ci.dev.openshift.redhat.com/jenkins/job/test_pull_requests/8854/) |
# subtract source container quota from source node quota | ||
# add the difference to destination quota | ||
additional_blocks = Integer(gear_quota[3]) - get_quota_blocks | ||
additional_files = Integer(gear_quota[6]) - get_quota_files |
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.
I'd be more comfortable if we used source_container.get_quota_blocks and source_container.get_quota_files in the lines above. While the source container is implied to be the current container, it is best not to make this assumption, especially since the source_container is available and explicitly specified in line 1999 above.
@tiwillia LGTM, other than the one comment I made |
Bug 1229300 https://bugzilla.redhat.com/show_bug.cgi?id=1229300 When moving gears across node profiles, ensure that the quota for the new node profile is imposed on the gear during the move.
@abhgupta thanks for the excellent suggestion. I've made the recommended change. Could you review again and merge if it is acceptable? |
Evaluated for online test up to 4908a10 |
[merge] |
Online Merge Results: SUCCESS (https://ci.dev.openshift.redhat.com/jenkins/job/merge_pull_requests/6498/) (Image: devenv_5603) |
@abhgupta can you re-merge? Looks like an example of the merge queue failures. |
re-[merge] test failures are due to timeouts and are unrelated to this PR |
Evaluated for online merge up to 4908a10 |
Merged by openshift-bot
Bug 1229300
https://bugzilla.redhat.com/show_bug.cgi?id=1229300
When moving gears across node profiles, ensure that the quota for the new node profile is imposed on the gear during the move.