fix(monitor): handle missing container state in Docker health check

This commit is contained in:
yusing
2025-10-28 23:49:59 +08:00
parent 975354cdc1
commit 921a8fb935

View File

@@ -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)
}