Closed andrewazores closed 3 weeks ago
Not a real bug: the user can and should write this as has(target.labels.url) && target.labels.url != ''
.
Alternatively, the in
operator can be used: 'io.buildah.version' in target.labels && target.labels['io.buildah.version'] == '1.29.0'
Current Behavior
For example, testing a match expression like
target.labels.url != ''
throws an exception if the target evaluated does not have aurl
key in itslabels
map. This results in the evaluation request failing prematurely and returning an HTTP 400 response. This should be more lenient and return a successful response with afalse
result instead, or else expressions that test for map entries on labels or annotations are very likely to fail unless all of the discovered targets happen to have the key being tested for.Expected Behavior
No response
Steps To Reproduce
No response
Environment
No response
Anything else?
No response