-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NETOBSERV-223 allow empty values, and some maintenance #96
NETOBSERV-223 allow empty values, and some maintenance #96
Conversation
pkg/handler/csv/loki_csv.go
Outdated
//set Timestamp as first data | ||
if columns == nil || utils.Contains(columns, timestampCol) { | ||
includeTimestamp := false | ||
if _, exists := columnsMap[timestampCol]; columns == nil || exists { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could it happen that columns != nil
but len(columns)==0
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know but I can write len(columns) == 0
instead of columns == nil
for safety
pkg/loki/query.go
Outdated
for key, values := range params { | ||
if len(values) == 0 { | ||
// Silently ignore | ||
return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't it be a continue
to keep looking for the other params?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch! thanks
@@ -155,10 +154,13 @@ export const FiltersToolbar: React.FC<FiltersToolbarProps> = ({ | |||
if (!selectedFilterColumn) { | |||
return { err: t('Column must be selected') }; | |||
} else if (_.isEmpty(value)) { | |||
if (selectedFilterColumn.filterType === FilterType.NAMESPACE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we do that for any enriched columns ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (selectedFilterColumn.filterType === FilterType.NAMESPACE) { | |
if (selectedFilterColumn.filterType === FilterType.NAMESPACE || selectedFilterColumn.filterType === FilterType.K8S_NAMES) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that was my plan initially, but on logql side it's more complicated, I want to do that on a next PR, see my comment in JIRA: https://issues.redhat.com/browse/NETOBSERV-223?focusedCommentId=19941741&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-19941741
I need to dig more in the loki query builder for that. Whereas for labels like namespace, it works out of the box.
- Empty values allowed on names and namespaces - Address Mario's comments on netobserv#94 (a few optimizations in CSV code) - Decrease log level for some logs (Info -> Debug) - Move Filters Hints into a new React component - Nit: change message "Not a valid kubernetes label" to "Not a valid Kubernetes name" ("label" has a special meaning in Kube) + equivalent renamings in code - Catch errors on autocompletion calls
ef8cbd2
to
938fb60
Compare
/retest |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jotak The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
NETOBSERV-227 fix filtering by namespace or owner #94
(a few optimizations in CSV code)