mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-31 14:13:09 +02:00
fix(monitor): handle missing container state in Docker health check
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package monitor
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net/http"
|
||||
|
||||
"github.com/bytedance/sonic"
|
||||
@@ -70,6 +71,10 @@ func (mon *DockerHealthMonitor) interceptInspectResponse(resp *http.Response) (i
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
if state.State == nil {
|
||||
return false, errors.New("container state not found")
|
||||
}
|
||||
return true, httputils.NewRequestInterceptedError(resp, state)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user