Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
kata-env: kata-env error out when there is no VERSION_ID.
Browse files Browse the repository at this point in the history
For example, under debian buster/sid. Those information should be
provide with best effort instead of error out. Set name and version
to "<<unknown>>" if they are not defined.

Fixes: #1177

Signed-off-by: Yang Bo <[email protected]>
  • Loading branch information
yyyeerbo committed Jan 28, 2019
1 parent 6f2c036 commit 3efbd8c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cli/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,15 @@ func getDistroDetails() (name, version string, err error) {
}
}

if name != "" && version != "" {
return name, version, nil
if name == "" {
name = unknown
}

if version == "" {
version = unknown
}

return name, version, nil
}

return "", "", fmt.Errorf("failed to find expected fields in one of %v", files)
Expand Down

0 comments on commit 3efbd8c

Please sign in to comment.