From 730e3a2ab446c94f6f985577fe35ac3ec2f9b02f Mon Sep 17 00:00:00 2001 From: yusing Date: Tue, 27 Jan 2026 00:37:55 +0800 Subject: [PATCH] fix(docker): improve error handling for missing Docker agent Replaced panic with an error return in the NewClient --- internal/docker/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/docker/client.go b/internal/docker/client.go index 428d6483..d0555331 100644 --- a/internal/docker/client.go +++ b/internal/docker/client.go @@ -152,7 +152,7 @@ func NewClient(cfg types.DockerProviderConfig, unique ...bool) (*SharedClient, e if agent.IsDockerHostAgent(host) { a, ok := agentpool.Get(host) if !ok { - panic(fmt.Errorf("agent %q not found", host)) + return nil, fmt.Errorf("agent %q not found", host) } opt = []client.Opt{ client.WithHost(agent.DockerHost),