From 5aa7dc09e594617e838b917d5fe68068432327c5 Mon Sep 17 00:00:00 2001 From: yusing Date: Fri, 9 Jan 2026 00:40:08 +0800 Subject: [PATCH] fix(health): remove unnecessary containerId parameter --- internal/health/check/docker.go | 4 ++-- internal/health/monitor/new.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/health/check/docker.go b/internal/health/check/docker.go index 49462827..5d1d4cff 100644 --- a/internal/health/check/docker.go +++ b/internal/health/check/docker.go @@ -35,7 +35,7 @@ func NewDockerHealthcheckState(client *docker.SharedClient, containerId string) } } -func Docker(ctx context.Context, state *DockerHealthcheckState, containerId string, timeout time.Duration) (types.HealthCheckResult, error) { +func Docker(ctx context.Context, state *DockerHealthcheckState, timeout time.Duration) (types.HealthCheckResult, error) { if state.numDockerFailures > dockerFailuresThreshold { return types.HealthCheckResult{}, ErrDockerHealthCheckFailedTooManyTimes } @@ -44,7 +44,7 @@ func Docker(ctx context.Context, state *DockerHealthcheckState, containerId stri defer cancel() // the actual inspect response is intercepted and returned as RequestInterceptedError - _, err := state.client.ContainerInspect(ctx, containerId, client.ContainerInspectOptions{}) + _, err := state.client.ContainerInspect(ctx, state.containerId, client.ContainerInspectOptions{}) var interceptedErr *httputils.RequestInterceptedError if !httputils.AsRequestInterceptedError(err, &interceptedErr) { diff --git a/internal/health/monitor/new.go b/internal/health/monitor/new.go index d7e99eb5..5c2913de 100644 --- a/internal/health/monitor/new.go +++ b/internal/health/monitor/new.go @@ -98,7 +98,7 @@ func NewDockerHealthMonitor(config types.HealthCheckConfig, client *docker.Share var mon monitor mon.init(displayURL, config, func(u *url.URL) (result Result, err error) { - result, err = healthcheck.Docker(mon.Context(), state, containerId, config.Timeout) + result, err = healthcheck.Docker(mon.Context(), state, config.Timeout) if err != nil { if isFirstFailure { isFirstFailure = false