ociswrapper: mark server ready if the server sends any response

This commit is contained in:
Saw-jan
2023-09-21 12:33:12 +05:45
parent 2b67d0c382
commit 6e6ae38963

View File

@@ -124,7 +124,11 @@ func WaitForConnection() bool {
req.Header.Set("X-Request-ID", "ociswrapper-"+strconv.Itoa(int(time.Now().UnixMilli())))
res, err := client.Do(req)
if err != nil || res.StatusCode != 200 {
if err != nil || res.StatusCode >= 400 {
if res != nil {
log.Println(fmt.Sprintf("oCIS server up but request failed: %v", res.StatusCode))
return true
}
// 500 milliseconds poll interval
time.Sleep(500 * time.Millisecond)
continue