-
Notifications
You must be signed in to change notification settings - Fork 584
Update NamespaceFilter description in the ConsoleExternalLogLink #385
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
Update NamespaceFilter description in the ConsoleExternalLogLink #385
Conversation
spadgett
left a comment
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.
thanks @jhadvig. i should have caught this on my original review
/lgtm
|
/assign @bparees |
| // namespaceFilter is a regular expression used to restrict a log link to a | ||
| // matching set of namespaces (e.g., `/^openshift-/g`). If not specified, links will | ||
| // be displayed for all the namespaces. | ||
| // matching set of namespaces (e.g., `^openshift-`). The string is converted |
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.
My bad to make a mess of this one 😬
Aiming to make it clear that there is a little potential gotcha hidden in here:
var str = "openshift-is-cool-openshift-is-fun"
var regex7 = "^(openshift|openshift-.*|kube-.*|kubernetes-.*|default)$"
// the user cann't provide this one, it is a regex literal. in our definition we
// have declared NamespaceFilter a string, so it will be passed to JS as a string
var regex8 = /^(openshift|openshift-.*|kube-.*|kubernetes-.*|default)$/
// That probably means it will end up looking like this, which will not work:
var regex9 = "/^(openshift|openshift-.*|kube-.*|kubernetes-.*|default)$/"
console.log("regex7", str.search(regex7)); // returns index 0
console.log("regex8", str.search(regex8)); // can't provide a regex literal, will convert to regex9 style
console.log("regex9", str.search(regex9)); // this will always return -1There 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.
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.
TL;DR: We should probably imply, do not use the / at all.
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 won't hold on it tho)
|
/approve i'm indifferent about clarifying that |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bparees, jhadvig, spadgett The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/hold |
|
(remove the hold at will) |
|
No need to hold on my comment so lets see if I can /hold cancel |
@spadgett @benjaminapetersen