-
Notifications
You must be signed in to change notification settings - Fork 247
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
Allow wildcard or regrx in "extra label ns" #1022
Comments
node-feature-discovery/pkg/nfd-master/nfd-master.go Lines 403 to 405 in d97297e
Seems like it all comes down to updating the condition above. If you're worried about maintaining high performance of this lookup, I think a TreeMap could work since it can use a StringComparator in its key lookup. https://pkg.go.dev/github.com/emirpasic/gods/maps/treemap#NewWithStringComparator |
I think this makes sense. Especially in the context you mentioned i.e. replacing some existing labeling scenarios with NFD. We've prolly been too restrictive on the labels namespaces – originally we wanted to prevent NFD to replace or "steal" existing labels, especially in
Any thoughts/comments @zvonkok @ArangoGutierrez @fmuyassarov ? |
@marquiz Thanks for the prompt response. This is great new. Looking forward to seeing how you all plan to implement it! Happy to help if needed |
I think it makes sense to have this feature improvement. However, I don't have a strong opinion which of those options would be the best to use. |
I like @marquiz option 3. Maybe something to add to the next release milestones |
Now after sleeping over it, I'm also inclined to prefer this one.
Yes. Added to v0.13 milestone. |
Hey @marquiz, should the |
I'm open to discussion on the details. At a quick thought I'd say that probably not. But probably deny all "sub-namespaces" of the given names. I.e. specifying |
IMHO, passing directly the regex would give more flexibility to users. In some cases, users would need to deny some "sub-namespaces", but not all of them. wdyt? |
Hmm, need to think about this 🧐 The reason I sort of don't like regexp is that the format is a bit involved for the usual use cases (i.e. remember to specify If we'd automatically deny all sub-namespaces then there's no way to allow all of them (or only deny SOME sub-namespaces as you put it). If we automatically allow all sub-namespaces then it becomes impossible to deny ALL subnamespaces. Regexps or simple glob would resolve those use cases. Don't remember if golang has a library glob function - one possibility would to hack in a simple glob support like "if item Any thoughts @cedricmckinnie @fmuyassarov @ArangoGutierrez @zvonkok on this? |
Agree with you Markus, enabling the input of regex can come back and bite us. |
@ArangoGutierrez hit the mark with a deny flag although, I can't really think of any reason why someone would want to control any |
Good considerations @cedricmckinnie and @ArangoGutierrez, I think you got a good point there. It probably is a good idea and and safe measure to always forcibly deny We can probably keep the current behavior where |
Yes sure 👍. |
What would you like to be added:
The ability to pass a wildcard or regex etc. to the label namespace whitelist i.e.
Another possibility could be to disable whitelist altogether because my use case doesn't need to prevent any label namespaces.
Why is this needed:
Thanks so much in advance for your consideration! Happy to help if needed!
The text was updated successfully, but these errors were encountered: