From b98ca77bf45b49429234c2be55d60553f49ea5c5 Mon Sep 17 00:00:00 2001 From: Dean Chen <862469039@qq.com> Date: Fri, 28 Aug 2026 02:39:54 +0500 Subject: [PATCH] commands: reload nodes after inspect --bootstrap Boot() returns ok=false when it did not start anything, including when the first LoadNodes never got DriverInfo. inspect then printed the stale inactive snapshot. Always reload after a bootstrap attempt. Fixes #1935 Signed-off-by: Dean Chen <862469039@qq.com> --- commands/inspect.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/commands/inspect.go b/commands/inspect.go index 72d74c9a06eb..5dc5f6e98e62 100644 --- a/commands/inspect.go +++ b/commands/inspect.go @@ -47,14 +47,14 @@ func runInspect(ctx context.Context, dockerCli command.Cli, in inspectOptions) e imageVerifier := policy.DefaultImageVerifier(confutil.NewConfig(dockerCli)) nodes, err := b.LoadNodes(timeoutCtx, builder.WithData(), builder.WithImageVerifier(imageVerifier)) if in.bootstrap { - var ok bool - ok, err = b.Boot(ctx) + _, err = b.Boot(ctx) if err != nil { return err } - if ok { - nodes, err = b.LoadNodes(timeoutCtx, builder.WithData(), builder.WithImageVerifier(imageVerifier)) - } + // Always reload. Boot() returns ok=false when it had nothing to start + // (already running, or the first LoadNodes never got DriverInfo). + // Skipping the reload leaves inspect printing stale "inactive" nodes. + nodes, err = b.LoadNodes(timeoutCtx, builder.WithData(), builder.WithImageVerifier(imageVerifier)) } w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', 0)