Commit d992c0e7 authored by Tamer Tas's avatar Tamer Tas

pkg/kubelet/rkt: skip empty lines in getOSReleaseInfo

parent 2707c46a
......@@ -2336,6 +2336,11 @@ func getOSReleaseInfo() (map[string]string, error) {
scanner := bufio.NewScanner(f)
for scanner.Scan() {
line := scanner.Text()
if len(strings.TrimSpace(line)) == 0 {
// Skips empty lines
continue
}
info := strings.SplitN(line, "=", 2)
if len(info) != 2 {
return nil, fmt.Errorf("unexpected entry in os-release %q", line)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment