remote/coordinator: Fix typo to allow for reservations matching multiple tags#1491
Merged
Emantor merged 1 commit intolabgrid-project:masterfrom Sep 3, 2024
Merged
Conversation
…ple tags Signed-off-by: Maciej Grela <m.grela@samsung.com>
Emantor
approved these changes
Sep 3, 2024
Member
Emantor
left a comment
There was a problem hiding this comment.
Yes, definitely a bug, the old create_reservation code looks like this:
async def create_reservation(self, spec, prio=0.0, details=None):
filter_ = {}
for pair in spec.split():
try:
k, v = pair.split("=")
except ValueError:
return None
if not TAG_KEY.match(k):
return None
if not TAG_VAL.match(v):
return None
filter_[k] = v
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
The code which is creating Reservation objects in the coordinator contains what looks to be a typo. This typo creates a bug where reservations that match more than one tag are not correctly handled.
The places needed to reproduce this problem can be created in the following way:
Before fix:
place1 is incorrectly allocated where place2 should have been selected. Also the reservation record is clearly missing the env=ci tag.
After fix:
Checklist