-
Notifications
You must be signed in to change notification settings - Fork 259
Enable unprefixed label setting via feature gate #2114
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
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for kubernetes-sigs-nfd ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
/cc @marquiz |
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.
Thank you @fmuyassarov for working on this 🙏 Would it be possible to add some testing for this. E.g. in e2e tests enable feature gate in some test and check that unprefixed label gets created or smth?
Absolutely! |
Currently, unprefixed labels are not allowed, despite the existence of the DisableAutoPrefix feature gate, which is intended for this purpose. This change ensures that when DisableAutoPrefix is set to True, the namespace addition is skipped, allowing unprefixed labels. Signed-off-by: Feruzjon Muyassarov <[email protected]>
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.
Pull Request Overview
This PR enables unprefixed labels when the DisableAutoPrefix feature gate is set to true, bypassing the namespace addition for such labels.
- Adjusts error handling in filterFeatureLabel to allow unprefixed labels when the feature gate is enabled.
- Updates documentation to clarify the behavior of label prefixing with and without the feature gate.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
pkg/nfd-master/nfd-master.go | Refactored error handling in filterFeatureLabel to bypass errors for unprefixed labels when the feature gate is enabled. |
docs/reference/feature-gates.md | Updated the description of label prefixing behavior to align with the new feature gate functionality. |
Comments suppressed due to low confidence (1)
pkg/nfd-master/nfd-master.go:506
- [nitpick] The compound conditional here could be refactored for better clarity; consider assigning sub-conditions to well-named variables or adding inline comments to explain the logic of bypassing the error when the feature gate is enabled.
if !nfdfeatures.NFDFeatureGate.Enabled(nfdfeatures.DisableAutoPrefix) || err != validate.ErrUnprefixedKeysNotAllowed {
LGTM will come after testing. PR looks good |
Signed-off-by: Feruzjon Muyassarov <[email protected]>
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.
Thank you @fmuyassarov for this PR.
I think that a similar treatment for annotations and extended resources, for consistency 🧐
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fmuyassarov, marquiz 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 |
Sure, will do that. |
ping @ArangoGutierrez |
1 similar comment
ping @ArangoGutierrez |
Currently, unprefixed labels are not allowed, despite the existence of the
DisableAutoPrefix
feature gate, which is intended for this purpose. This change ensures that whenDisableAutoPrefix
is set to True, the namespace addition is skipped, allowing unprefixed labels.Fixes: #2074