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:
commit
6d30ca9660
1 changed files with 3 additions and 2 deletions
|
@ -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]
|
||||
|
||||
|
|
Loading…
Reference in a new issue