mirror of https://github.com/docker/docs.git
Skip and warn on wonky /etc/os-release lines
If the lines don't split cleanly (occasionally STDERR gets mixed in, for instance, due to our current SSH output setup), we should simply log.Warn in the output instead of bailing completely. Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
This commit is contained in:
parent
ef9acc98b6
commit
802393f253
|
@ -69,7 +69,8 @@ func (osr *OsRelease) ParseOsRelease(osReleaseContents []byte) error {
|
|||
for scanner.Scan() {
|
||||
key, val, err := parseLine(scanner.Text())
|
||||
if err != nil {
|
||||
return err
|
||||
log.Warn("Warning: got an invalid line error parsing /etc/os-release: %s", err)
|
||||
continue
|
||||
}
|
||||
if err := osr.setIfPossible(key, val); err != nil {
|
||||
log.Debug(err)
|
||||
|
|
Loading…
Reference in New Issue