1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2025-04-23 20:57:10 +00:00

Merge pull request from k8s-infra-cherrypick-robot/cherry-pick-1169-to-release-0.13

[release-0.13] nfd-master: reject malformed extended resource dynamic capacity assignment
This commit is contained in:
Kubernetes Prow Robot 2023-04-24 00:33:16 -07:00 committed by GitHub
commit 103315fbb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -713,6 +713,10 @@ func (m *nfdMaster) filterExtendedResources(features *nfdv1alpha1.Features, exte
if strings.HasPrefix(capacity, "@") {
// capacity is a string in the form of attribute.featureset.elements
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]
elementName := split[2]
attrFeatureSet, ok := features.Attributes[featureName]