Commit 4e571eaf authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #31032 from tmrts/fix/os-release-check

Automatic merge from submit-queue pkg/kubelet/rkt: skip empty lines in getOSReleaseInfo Follow-up of #31022
parents ad6eed40 d992c0e7
......@@ -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 {
glog.Warningf("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