Skip to content

Commit

Permalink
apis/nfd/validate: more comprehensive unit tests
Browse files Browse the repository at this point in the history
Also add license header to the test.go file and fix one bug in
MatchFeature validation.
  • Loading branch information
marquiz committed Apr 11, 2024
1 parent a9167e6 commit 7fbada8
Show file tree
Hide file tree
Showing 2 changed files with 401 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/apis/nfd/validate/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func MatchFeatures(matchFeature nfdv1alpha1.FeatureMatcher) []error {
var validationErr []error

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

0 comments on commit 7fbada8

Please sign in to comment.