Merge pull request #3817 from crazy-max/rm-reject-context

rm: reject context builders before loading nodes
This commit is contained in:
Tõnis Tiigi
2026-04-24 09:21:10 -07:00
committed by GitHub
+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