mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #16065 from Microsoft/10662-fix2panics
Fixes 2 panics initialising tests
This commit is contained in:
commit
6b14d9a645
1 changed files with 3 additions and 4 deletions
|
@ -502,10 +502,9 @@ func init() {
|
||||||
// Obtain the daemon platform so that it can be used by tests to make
|
// Obtain the daemon platform so that it can be used by tests to make
|
||||||
// intelligent decisions about how to configure themselves, and validate
|
// intelligent decisions about how to configure themselves, and validate
|
||||||
// that the target platform is valid.
|
// that the target platform is valid.
|
||||||
res, b, err := sockRequestRaw("GET", "/version", nil, "application/json")
|
res, _, err := sockRequestRaw("GET", "/version", nil, "application/json")
|
||||||
defer b.Close()
|
if err != nil || res == nil || (res != nil && res.StatusCode != http.StatusOK) {
|
||||||
if err != nil || res.StatusCode != http.StatusOK {
|
panic(fmt.Errorf("Init failed to get version: %v. Res=%v", err.Error(), res))
|
||||||
panic("Init failed to get version: " + err.Error() + " " + string(res.StatusCode))
|
|
||||||
}
|
}
|
||||||
svrHeader, _ := httputils.ParseServerHeader(res.Header.Get("Server"))
|
svrHeader, _ := httputils.ParseServerHeader(res.Header.Get("Server"))
|
||||||
daemonPlatform = svrHeader.OS
|
daemonPlatform = svrHeader.OS
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue