2020-02-16 17:33:27 +02:00
|
|
|
/*
|
|
|
|
Copyright 2020 The Kubernetes Authors.
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
package custom
|
|
|
|
|
|
|
|
import (
|
2021-03-04 07:35:17 +02:00
|
|
|
"sigs.k8s.io/node-feature-discovery/source/custom/expression"
|
2020-02-16 17:33:27 +02:00
|
|
|
"sigs.k8s.io/node-feature-discovery/source/custom/rules"
|
|
|
|
)
|
|
|
|
|
|
|
|
// getStaticFeatures returns statically configured custom features to discover
|
|
|
|
// e.g RMDA related features. NFD configuration file may extend these custom features by adding rules.
|
2020-05-19 16:01:43 +03:00
|
|
|
func getStaticFeatureConfig() []FeatureSpec {
|
|
|
|
return []FeatureSpec{
|
2021-06-06 16:02:12 -05:00
|
|
|
{
|
2020-02-16 17:33:27 +02:00
|
|
|
Name: "rdma.capable",
|
|
|
|
MatchOn: []MatchRule{
|
2021-06-06 16:02:12 -05:00
|
|
|
{
|
2020-05-19 16:01:43 +03:00
|
|
|
PciID: &rules.PciIDRule{
|
2021-03-04 07:35:17 +02:00
|
|
|
MatchExpressionSet: expression.MatchExpressionSet{
|
|
|
|
"vendor": expression.MustCreateMatchExpression(expression.MatchIn, "15b3"),
|
|
|
|
},
|
2020-02-16 17:33:27 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2021-06-06 16:02:12 -05:00
|
|
|
{
|
2020-02-16 17:33:27 +02:00
|
|
|
Name: "rdma.available",
|
|
|
|
MatchOn: []MatchRule{
|
2021-06-06 16:02:12 -05:00
|
|
|
{
|
2021-03-04 07:35:17 +02:00
|
|
|
LoadedKMod: &rules.LoadedKModRule{
|
|
|
|
MatchExpressionSet: expression.MatchExpressionSet{
|
|
|
|
"ib_uverbs": expression.MustCreateMatchExpression(expression.MatchExists),
|
|
|
|
"rdma_ucm": expression.MustCreateMatchExpression(expression.MatchExists),
|
|
|
|
},
|
|
|
|
},
|
2020-02-16 17:33:27 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|