Skip to content

Comments

NETOBSERV-1020 Fix empty namespace list#512

Closed
jotak wants to merge 1 commit intoobservatorium:mainfrom
jotak:fix-no-namespaces
Closed

NETOBSERV-1020 Fix empty namespace list#512
jotak wants to merge 1 commit intoobservatorium:mainfrom
jotak:fix-no-namespaces

Conversation

@jotak
Copy link
Contributor

@jotak jotak commented May 5, 2023

cf observatorium/opa-openshift#18

We need to prevent attempts to run queries when the matchers list exists but is empty, which corresponds to having 0 allowed namespaces

cf observatorium/opa-openshift#18

We need to prevent attempts to run queries when the matchers list
exists but is empty, which corresponds to having 0 allowed namespaces
}

if len(matchersInfo.Matchers) == 0 {
httperr.PrometheusAPIError(w, "empty authorization label matchers", http.StatusInternalServerError)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might do something different than returning such an error. Ideally, we should not run any loki query but directly return an empty result set. (I need to check how to do that...)

@jotak
Copy link
Contributor Author

jotak commented May 9, 2023

closing: amended the opa-openshift PR to make it self-contained, so there's no need to change something on the API side.

@jotak jotak closed this May 9, 2023
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.

1 participant