diff --git a/internal/watcher/health/monitor/docker.go b/internal/watcher/health/monitor/docker.go index 74df91a8..d7414ca7 100644 --- a/internal/watcher/health/monitor/docker.go +++ b/internal/watcher/health/monitor/docker.go @@ -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) }