Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It's LGTM generally. Some kind suggestions are as follows:
else
section like this:else if job.IsPending()
, which may be more readable and clean.completed
status at the stage of snapshot. If that, only podgroups, which are to be allocated resources, will enter the session. Besides, it will improve the performance.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.
Thanks for your suggestion, the first question has been optimized.
There are still some doubts about the second question. The function implemented here is to prevent the job in the pending state from blocking when the enqueue action is not configured, so the processing logic for updating the pending job to the inqueue state is added.
However, before the update, the status of the job was not judged, but all status jobs were updated to inqueue (including
running
,unknown
, andcompleted
). This kind of processing did not meet the original intention, and also caused the problem recorded in the issue.I understand that by correcting this, the problem in the issue should be solved first. For the filtering of the job in the completed state, can it not be processed for the time being?
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 got you. Before reviewing this PR, I've looked through the related issue. If available, can you help for the filter in the later PR?