mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
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:
commit
4e571eafab
@ -2336,6 +2336,11 @@ func getOSReleaseInfo() (map[string]string, error) {
|
|||||||
scanner := bufio.NewScanner(f)
|
scanner := bufio.NewScanner(f)
|
||||||
for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
line := scanner.Text()
|
line := scanner.Text()
|
||||||
|
if len(strings.TrimSpace(line)) == 0 {
|
||||||
|
// Skips empty lines
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
info := strings.SplitN(line, "=", 2)
|
info := strings.SplitN(line, "=", 2)
|
||||||
if len(info) != 2 {
|
if len(info) != 2 {
|
||||||
glog.Warningf("Unexpected entry in os-release %q", line)
|
glog.Warningf("Unexpected entry in os-release %q", line)
|
||||||
|
Loading…
Reference in New Issue
Block a user