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

Ignore namespaces using regex #295

Closed
semoac opened this issue Jun 23, 2020 · 5 comments · Fixed by #386
Closed

Ignore namespaces using regex #295

semoac opened this issue Jun 23, 2020 · 5 comments · Fixed by #386
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest

Comments

@semoac
Copy link

semoac commented Jun 23, 2020

Is your feature request related to a problem? Please describe.

I want to ignore multiple namespaces using a wildcard like: project-experimental-*

Describe the solution you'd like

It would be awesome if we can specify labels or regex to ignore short-lived namespaces.

Describe alternatives you've considered

None.

Additional context

I try using project-experimental hoping that string.Contains will match but it didn't.

@semoac semoac added the enhancement New feature or request label Jun 23, 2020
@PrasadG193
Copy link
Collaborator

This sounds good. We should definitely have this

@PrasadG193 PrasadG193 added the good first issue Good for newcomers label Sep 17, 2020
@God-father1
Copy link

God-father1 commented Sep 28, 2020

You could put \s* in between every character in your search string so if you were looking for cat you would use c\s* a\s* t\s* s\s* s.

@PrasadG193
Copy link
Collaborator

@God-father1 would you like to give a try?

@God-father1
Copy link

God-father1 commented Sep 29, 2020 via email

@jkremser
Copy link
Contributor

jkremser commented Oct 1, 2020

I am also looking into this..

jkremser added a commit to jkremser/botkube that referenced this issue Oct 1, 2020
jkremser added a commit to jkremser/botkube that referenced this issue Oct 1, 2020
jkremser added a commit to jkremser/botkube that referenced this issue Oct 1, 2020
jkremser added a commit to jkremser/botkube that referenced this issue Oct 2, 2020
@mergify mergify bot closed this as completed in #386 Oct 2, 2020
mergify bot pushed a commit that referenced this issue Oct 2, 2020
…egexp (#386)

Fixes issue #295

##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Feature Pull Request

##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
This change allows to ignore whole sets of namespaces using the asterix expansion. It still does the exact match check for all the namespaces (separated by comma in config), but if it contains a `*`, it's actually replaced with `.*` and passed to `regexp.MatchString` to do the job.

PR also contains couple of very simple test cases.

<!---
If you are fixing an existing issue, please include "Fixes #nnn" in your
PR comment; and describe briefly what the change does.
-->

<!--- Please list dependencies added with your change also -->
deps:
`namespace_checker.go` now imports also `regexp`

Fixes #295

It's my very first golang code, so please let me know if it's not idiomatic go 🍪
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants