rm: reject context builders before loading nodes

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2026-04-24 17:27:57 +02:00
parent 872d8e5e58
commit 2574d4c0d0
+4 -4
View File
@@ -74,15 +74,15 @@ func runRm(ctx context.Context, dockerCli command.Cli, in rmOptions) error {
return err
}
if b.DockerContext {
return errors.Errorf("context builder cannot be removed, run `docker context rm %s` to remove this context", b.Name)
}
nodes, err := b.LoadNodes(timeoutCtx)
if err != nil {
return err
}
if cb := b.ContextName(); cb != "" {
return errors.Errorf("context builder cannot be removed, run `docker context rm %s` to remove this context", cb)
}
err1 := rm(ctx, nodes, in)
if err := txn.Remove(b.Name); err != nil {
return err