Skip to content

Commit a16ff9b

Browse files
committed
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 <[email protected]>
1 parent c1c0b81 commit a16ff9b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: pkg/nfd-master/nfd-master.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,6 @@ func (m *nfdMaster) filterFeatureLabels(labels Labels, features *nfdv1alpha1.Fea
482482

483483
return outLabels
484484
}
485-
486485
func (m *nfdMaster) filterFeatureLabel(name, value string, features *nfdv1alpha1.Features) (string, error) {
487486
// Check if Value is dynamic
488487
var filteredValue string
@@ -504,7 +503,9 @@ func (m *nfdMaster) filterFeatureLabel(name, value string, features *nfdv1alpha1
504503
return "", fmt.Errorf("namespace %q is not allowed", ns)
505504
}
506505
} else if err != nil {
507-
return "", err
506+
if !nfdfeatures.NFDFeatureGate.Enabled(nfdfeatures.DisableAutoPrefix) || err != validate.ErrUnprefixedKeysNotAllowed {
507+
return "", err
508+
}
508509
}
509510

510511
// Skip if label doesn't match labelWhiteList

0 commit comments

Comments
 (0)