Description
_label_satisfies_expression silently returns False when given an unrecognized operator string (including empty string ''). This masks bugs in callers -- an invalid operator produces the same result as a legitimate non-match, with no indication that something is wrong.
Steps to reproduce
from jumpstarter.client.selectors import _label_satisfies_expression
result = _label_satisfies_expression({"key": "value"}, "key", "", ["value"])
# Returns False silently -- no error raised
Expected behavior
Should raise ValueError for unrecognized operator strings, so callers are alerted to the invalid input rather than silently getting a False match result.
Actual behavior
Returns False without any error. The function only recognizes "in", "notin", "exists", "!exists", and "!=", and falls through to return False for anything else.
Location
python/packages/jumpstarter/jumpstarter/client/selectors.py, _label_satisfies_expression -- the final return False should be raise ValueError(f"unknown label selector operator: {operator!r}").
Description
_label_satisfies_expressionsilently returnsFalsewhen given an unrecognized operator string (including empty string''). This masks bugs in callers -- an invalid operator produces the same result as a legitimate non-match, with no indication that something is wrong.Steps to reproduce
Expected behavior
Should raise
ValueErrorfor unrecognized operator strings, so callers are alerted to the invalid input rather than silently getting aFalsematch result.Actual behavior
Returns
Falsewithout any error. The function only recognizes"in","notin","exists","!exists", and"!=", and falls through toreturn Falsefor anything else.Location
python/packages/jumpstarter/jumpstarter/client/selectors.py,_label_satisfies_expression-- the finalreturn Falseshould beraise ValueError(f"unknown label selector operator: {operator!r}").