cli: add --all-inactive and --force flags for rm command

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2022-02-03 13:39:44 +01:00
parent 33c121df01
commit 378f0b45c6
3 changed files with 102 additions and 11 deletions

View File

@ -389,6 +389,17 @@ type nginfo struct {
err error
}
// inactive checks if all nodes are inactive for this builder
func (n *nginfo) inactive() bool {
for idx := range n.ng.Nodes {
d := n.drivers[idx]
if d.info != nil && d.info.Status == driver.Running {
return false
}
}
return true
}
func boot(ctx context.Context, ngi *nginfo) (bool, error) {
toBoot := make([]int, 0, len(ngi.drivers))
for i, d := range ngi.drivers {