Skip to content
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

Merged
merged 1 commit into from
Mar 17, 2022

Conversation

jotak
Copy link
Member

@jotak jotak commented Mar 16, 2022

  • Empty values allowed on namespaces
  • Address Mario's comments on
    NETOBSERV-227 fix filtering by namespace or owner #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

//set Timestamp as first data
if columns == nil || utils.Contains(columns, timestampCol) {
includeTimestamp := false
if _, exists := columnsMap[timestampCol]; columns == nil || exists {

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?

Copy link
Member Author

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

for key, values := range params {
if len(values) == 0 {
// Silently ignore
return nil

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?

Copy link
Member Author

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) {
Copy link
Contributor

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 ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (selectedFilterColumn.filterType === FilterType.NAMESPACE) {
if (selectedFilterColumn.filterType === FilterType.NAMESPACE || selectedFilterColumn.filterType === FilterType.K8S_NAMES) {

Copy link
Member Author

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
@jotak jotak force-pushed the allow-empty-namespaces branch from ef8cbd2 to 938fb60 Compare March 17, 2022 08:29
@jotak
Copy link
Member Author

jotak commented Mar 17, 2022

/retest

@jotak
Copy link
Member Author

jotak commented Mar 17, 2022

/approve

@openshift-ci
Copy link

openshift-ci bot commented Mar 17, 2022

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit dffba1f into netobserv:main Mar 17, 2022
@jotak jotak deleted the allow-empty-namespaces branch November 7, 2024 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants