1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2025-03-05 16:27:05 +00:00

source/custom: do not return on rule errors

Skip to the next rule instead of returning immediately on
rule errors. For instance, if the static rules failed, user
provided rules would never be processed.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
This commit is contained in:
Mikko Ylinen 2020-08-11 10:55:21 +03:00
parent 8b156d49fc
commit d1cce3ba29

View file

@ -17,7 +17,6 @@ limitations under the License.
package custom
import (
"fmt"
"log"
"sigs.k8s.io/node-feature-discovery/source"
@ -76,7 +75,8 @@ func (s Source) Discover() (source.Features, error) {
for _, customFeature := range allFeatureConfig {
featureExist, err := s.discoverFeature(customFeature)
if err != nil {
return features, fmt.Errorf("failed to discover feature: %s. %s", customFeature.Name, err.Error())
log.Printf("ERROR: failed to discover feature: %q: %s", customFeature.Name, err.Error())
continue
}
if featureExist {
features[customFeature.Name] = true