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
This commit is contained in:
Kubernetes Submit Queue 2016-08-21 02:29:33 -07:00 committed by GitHub
commit 4e571eafab

View File

@ -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)