-
Bug
-
Resolution: Unresolved
-
Undefined
-
None
-
4.20
-
None
-
Quality / Stability / Reliability
-
False
-
-
None
-
Moderate
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Description of problem:
When attempting to filter a list on optional fields, such as with /o2ims-infrastructureMonitoring/v1/alarmSubscriptions?filter=(eq,filter,'ACKNOWLEDGE') , the API returns { "detail": "failed to evaluate selector: failed to evaluate 'filter': map doesn't have a 'filter' key", "status": 400 } . This seems to be a result of internal/search/path_evaluator.go:133, where the fact that the field does not get returned for some objects means that it fails the query on all objects. Although this bug references AlarmSubscriptionInfo, it really applies to any object with filtering.
Version-Release number of selected component (if applicable):
every o-cloud-manager release with filtering it seems
How reproducible:
100%
Steps to Reproduce:
1. Perform API request as in the description where only some alarmSubscriptions have a filter specified 2. Observe API result as in the description
Actual results:
400 Bad Request
Expected results:
As per v8 of the spec, All attribute names that appear in the AlarmSubscriptionInfo and in data types referenced from it shall be supported by the O-Cloud in the filter expression. I would expect a null/missing value to be incomparable and always not equal to other values, similar to how NaNs get handled. This means that querying (eq,'filter',ACKNOWLEDGE) would not include AlarmSubscriptionInfo without filter attributes but (neq,'filter',ACKNOWLEDGE) would include all matching AlarmSubscriptionInfo objects and every AlarmSubscriptionInfo without a filter attribute.
Additional info: