Skip to content

Commit 7fbada8

Browse files
committed
apis/nfd/validate: more comprehensive unit tests
Also add license header to the test.go file and fix one bug in MatchFeature validation.
1 parent a9167e6 commit 7fbada8

File tree

2 files changed

+401
-6
lines changed

2 files changed

+401
-6
lines changed

pkg/apis/nfd/validate/validate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func MatchFeatures(matchFeature nfdv1alpha1.FeatureMatcher) []error {
5757
var validationErr []error
5858

5959
for _, match := range matchFeature {
60-
nameSplit := strings.SplitN(match.Feature, ".", 2)
60+
nameSplit := strings.Split(match.Feature, ".")
6161
if len(nameSplit) != 2 {
6262
validationErr = append(validationErr, fmt.Errorf("invalid feature name %v (not <domain>.<feature>), cannot be used for templating", match.Feature))
6363
}

0 commit comments

Comments
 (0)