Skip to content

Conversation

@scotwells
Copy link
Contributor

Filtering with an unknown field on an object would lead to a "503 Service Unavailable" error instead of an "Invalid request" error.

This change adjusts the filter validation to confirm that all fields under an object are actually filterable fields so appropriate validation is returned.

Current Behavior:

$ datumctl activity query --project datum-cloud --filter 'objectRef.resources == "test"' -v 6
...
I0120 12:36:20.074227 54523 round_trippers.go:632] "Response" verb="POST" url="https://api.staging.env.datum.net/apis/resourcemanager.miloapis.com/v1alpha1/projects/datum-cloud/control-plane/apis/activity.miloapis.com/v1alpha1/auditlogqueries" status="503 Service Unavailable" milliseconds=427
error: query failed: Failed to execute query. Please try again later or contact support for help.

New Behavior:

$ datumctl activity query --project datum-cloud --filter 'objectRef.resources == "test"'
error: query failed: AuditLogQuery.activity.miloapis.com "" is invalid: spec.filter: Invalid value: "objectRef.resources == "test"": Invalid filter: field 'objectRef.resources' is not available for filtering. Available fields for objectRef: [objectRef.resource objectRef.name objectRef.apiGroup objectRef.namespace]. Available fields: auditID, verb, requestReceivedTimestamp, objectRef.namespace, objectRef.resource, objectRef.name, user.username, user.groups, responseStatus.code. See https://cel.dev for CEL syntax


Relates to datum-cloud/enhancements#536

Filtering with an unknown field on an object would lead to a "503
Service Unavailable" error instead of an "Invalid request" error.

This change adjusts the filter validation to confirm that all fields
under an object are actually filterable fields so appropriate validation
is returned.
@scotwells scotwells merged commit 21a6228 into main Jan 20, 2026
10 of 11 checks passed
@scotwells scotwells deleted the fix/improved-filtering-validation branch January 20, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants