prevent panic if TINI_COMMIT isn't set during build
If TINI_COMMIT isn't set, .go-autogen sets an empty value as the "expected" commit. Attempting to truncate the value caused a panic in that situation. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
f7065313ec
commit
339fb74cbc
1 changed files with 3 additions and 1 deletions
|
@ -72,7 +72,9 @@ func (daemon *Daemon) fillPlatformInfo(v *types.Info, sysInfo *sysinfo.SysInfo)
|
|||
v.InitCommit.ID = "N/A"
|
||||
} else {
|
||||
v.InitCommit.ID = commit
|
||||
v.InitCommit.Expected = dockerversion.InitCommitID[0:len(commit)]
|
||||
if len(dockerversion.InitCommitID) > len(commit) {
|
||||
v.InitCommit.Expected = dockerversion.InitCommitID[0:len(commit)]
|
||||
}
|
||||
}
|
||||
} else {
|
||||
logrus.Warnf("failed to retrieve %s version: %s", defaultInitBinary, err)
|
||||
|
|
Loading…
Add table
Reference in a new issue