mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2025-03-31 04:04:51 +00:00
Merge pull request #1169 from ArangoGutierrez/i1168
nfd-master: reject malformed extended resource dynamic capacity assignment
This commit is contained in:
commit
64fe26ed37
1 changed files with 4 additions and 0 deletions
|
@ -714,6 +714,10 @@ func (m *nfdMaster) filterExtendedResources(features *nfdv1alpha1.Features, exte
|
||||||
if strings.HasPrefix(capacity, "@") {
|
if strings.HasPrefix(capacity, "@") {
|
||||||
// capacity is a string in the form of attribute.featureset.elements
|
// capacity is a string in the form of attribute.featureset.elements
|
||||||
split := strings.SplitN(capacity[1:], ".", 3)
|
split := strings.SplitN(capacity[1:], ".", 3)
|
||||||
|
if len(split) != 3 {
|
||||||
|
klog.Errorf("capacity %s is not in the form of '@domain.feature.element',. Ignoring Extended Resource %q", capacity, extendedResource)
|
||||||
|
continue
|
||||||
|
}
|
||||||
featureName := split[0] + "." + split[1]
|
featureName := split[0] + "." + split[1]
|
||||||
elementName := split[2]
|
elementName := split[2]
|
||||||
attrFeatureSet, ok := features.Attributes[featureName]
|
attrFeatureSet, ok := features.Attributes[featureName]
|
||||||
|
|
Loading…
Add table
Reference in a new issue