mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2025-03-31 04:04:51 +00:00
Enable unprefixed label setting via feature gate
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 <feruzjon.muyassarov@est.tech>
This commit is contained in:
parent
c1c0b813f4
commit
947072681f
2 changed files with 7 additions and 7 deletions
|
@ -55,8 +55,7 @@ to `false`, a NodeFeatureRule with
|
|||
foo: bar
|
||||
```
|
||||
|
||||
will turn into `feature.node.kubernetes.io/foo=bar` node label. With
|
||||
`DisableAutoPrefix` set to `true`, no prefix is added and the label will be
|
||||
filtered out.
|
||||
|
||||
Note that taint keys are not affected by this feature gate.
|
||||
will be automatically prefixed, resulting in the node label
|
||||
`feature.node.kubernetes.io/foo=bar`. However, when `DisableAutoPrefix` is set
|
||||
to `true`, no prefix is added, and the label remains as `foo=bar`. Note that
|
||||
taint keys are not affected by this feature gate.
|
||||
|
|
|
@ -482,7 +482,6 @@ func (m *nfdMaster) filterFeatureLabels(labels Labels, features *nfdv1alpha1.Fea
|
|||
|
||||
return outLabels
|
||||
}
|
||||
|
||||
func (m *nfdMaster) filterFeatureLabel(name, value string, features *nfdv1alpha1.Features) (string, error) {
|
||||
// Check if Value is dynamic
|
||||
var filteredValue string
|
||||
|
@ -504,7 +503,9 @@ func (m *nfdMaster) filterFeatureLabel(name, value string, features *nfdv1alpha1
|
|||
return "", fmt.Errorf("namespace %q is not allowed", ns)
|
||||
}
|
||||
} else if err != nil {
|
||||
return "", err
|
||||
if !nfdfeatures.NFDFeatureGate.Enabled(nfdfeatures.DisableAutoPrefix) || err != validate.ErrUnprefixedKeysNotAllowed {
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
|
||||
// Skip if label doesn't match labelWhiteList
|
||||
|
|
Loading…
Add table
Reference in a new issue