1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-14 11:57:51 +00:00

Merge pull request #1293 from marquiz/devel/feature-file-whitespace

source/local: trim whitespace from input
This commit is contained in:
Kubernetes Prow Robot 2023-08-04 06:38:24 -07:00 committed by GitHub
commit 6d30ca9660
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -147,9 +147,10 @@ func (s *localSource) GetFeatures() *nfdv1alpha1.Features {
func parseFeatures(lines [][]byte) map[string]string {
features := make(map[string]string)
for _, line := range lines {
for _, l := range lines {
line := strings.TrimSpace(string(l))
if len(line) > 0 {
lineSplit := strings.SplitN(string(line), "=", 2)
lineSplit := strings.SplitN(line, "=", 2)
key := lineSplit[0]