builder: use variadic options in LoadNodes func

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2023-08-22 22:11:50 +02:00
parent 5836c24e7d
commit fd251d2a7b
11 changed files with 34 additions and 15 deletions

View File

@ -114,7 +114,7 @@ func runBake(dockerCli command.Cli, targets []string, in bakeOptions, cFlags com
if err = updateLastActivity(dockerCli, b.NodeGroup); err != nil {
return errors.Wrapf(err, "failed to update builder last activity time")
}
nodes, err = b.LoadNodes(ctx, false)
nodes, err = b.LoadNodes(ctx)
if err != nil {
return err
}

View File

@ -252,7 +252,7 @@ func runBuild(dockerCli command.Cli, options buildOptions) (err error) {
if err != nil {
return err
}
_, err = b.LoadNodes(ctx, false)
_, err = b.LoadNodes(ctx)
if err != nil {
return err
}

View File

@ -270,7 +270,7 @@ func runCreate(dockerCli command.Cli, in createOptions, args []string) error {
timeoutCtx, cancel := context.WithTimeout(ctx, 20*time.Second)
defer cancel()
nodes, err := b.LoadNodes(timeoutCtx, true)
nodes, err := b.LoadNodes(timeoutCtx, builder.WithData())
if err != nil {
return err
}

View File

@ -39,7 +39,7 @@ func runDiskUsage(dockerCli command.Cli, opts duOptions) error {
return err
}
nodes, err := b.LoadNodes(ctx, false)
nodes, err := b.LoadNodes(ctx)
if err != nil {
return err
}

View File

@ -40,7 +40,7 @@ func runInspect(dockerCli command.Cli, in inspectOptions) error {
timeoutCtx, cancel := context.WithTimeout(ctx, 20*time.Second)
defer cancel()
nodes, err := b.LoadNodes(timeoutCtx, true)
nodes, err := b.LoadNodes(timeoutCtx, builder.WithData())
if in.bootstrap {
var ok bool
ok, err = b.Boot(ctx)
@ -48,7 +48,7 @@ func runInspect(dockerCli command.Cli, in inspectOptions) error {
return err
}
if ok {
nodes, err = b.LoadNodes(timeoutCtx, true)
nodes, err = b.LoadNodes(timeoutCtx, builder.WithData())
}
}

View File

@ -49,7 +49,7 @@ func runLs(dockerCli command.Cli, in lsOptions) error {
for _, b := range builders {
func(b *builder.Builder) {
eg.Go(func() error {
_, _ = b.LoadNodes(timeoutCtx, true)
_, _ = b.LoadNodes(timeoutCtx, builder.WithData())
return nil
})
}(b)

View File

@ -60,7 +60,7 @@ func runPrune(dockerCli command.Cli, opts pruneOptions) error {
return err
}
nodes, err := b.LoadNodes(ctx, false)
nodes, err := b.LoadNodes(ctx)
if err != nil {
return err
}

View File

@ -55,7 +55,7 @@ func runRm(dockerCli command.Cli, in rmOptions) error {
return err
}
nodes, err := b.LoadNodes(ctx, false)
nodes, err := b.LoadNodes(ctx)
if err != nil {
return err
}
@ -139,7 +139,7 @@ func rmAllInactive(ctx context.Context, txn *store.Txn, dockerCli command.Cli, i
for _, b := range builders {
func(b *builder.Builder) {
eg.Go(func() error {
nodes, err := b.LoadNodes(timeoutCtx, true)
nodes, err := b.LoadNodes(timeoutCtx, builder.WithData())
if err != nil {
return errors.Wrapf(err, "cannot load %s", b.Name)
}

View File

@ -25,7 +25,7 @@ func runStop(dockerCli command.Cli, in stopOptions) error {
if err != nil {
return err
}
nodes, err := b.LoadNodes(ctx, false)
nodes, err := b.LoadNodes(ctx)
if err != nil {
return err
}