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

Add a support for ignoring the events from a namespace that matches regexp #386

Merged
merged 3 commits into from
Oct 2, 2020

Conversation

jkremser
Copy link
Contributor

@jkremser jkremser commented Oct 1, 2020

Fixes issue #295

ISSUE TYPE
  • Feature Pull Request
SUMMARY

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.

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 🍪

@jkremser jkremser force-pushed the issue295-ignore-regexp-ns branch from b3c44fd to e1b0f2c Compare October 1, 2020 14:59
@PrasadG193
Copy link
Collaborator

Awesome! Thanks for the PR @jkremser 🙏
We should add an e2e test for this. Will file a separate ticket for that

@jkremser jkremser force-pushed the issue295-ignore-regexp-ns branch from e1b0f2c to 13949ef Compare October 1, 2020 22:01
@jkremser jkremser changed the title Add a support for ignoring the events from a namespace that matches regexp [WIP] Add a support for ignoring the events from a namespace that matches regexp Oct 2, 2020
@jkremser jkremser force-pushed the issue295-ignore-regexp-ns branch from 13949ef to db4f63e Compare October 2, 2020 11:21
@jkremser jkremser changed the title [WIP] Add a support for ignoring the events from a namespace that matches regexp Add a support for ignoring the events from a namespace that matches regexp Oct 2, 2020
@jkremser jkremser requested a review from PrasadG193 October 2, 2020 11:32
Co-authored-by: Prasad Ghangal <prasad.ghangal@gmail.com>
@jkremser jkremser requested a review from PrasadG193 October 2, 2020 14:29
@mergify mergify bot merged commit 86d2572 into kubeshop:develop Oct 2, 2020
@jkremser jkremser deleted the issue295-ignore-regexp-ns branch October 2, 2020 16:48
@chetanpdeshmukh
Copy link

Hello @jkremser ,
Thanks again for the PR!

Thank you for contributing to BotKube. Could you please fill out this form, so we can send the well deserved awesome swags 🙂

Team BotKube

mszostok added a commit to mszostok/botkube that referenced this pull request Jun 26, 2023
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.

Ignore namespaces using regex
3 participants