Merge pull request #3817 from crazy-max/rm-reject-context
rm: reject context builders before loading nodes
This commit is contained in:
+4
-4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user