mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-21 18:58:03 +08:00
refactor driver auth for easier passing
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
@@ -51,7 +51,7 @@ type Auth interface {
|
||||
|
||||
type Driver interface {
|
||||
Factory() Factory
|
||||
Bootstrap(context.Context, Auth, progress.Logger) error
|
||||
Bootstrap(context.Context, progress.Logger) error
|
||||
Info(context.Context) (*Info, error)
|
||||
Stop(ctx context.Context, force bool) error
|
||||
Rm(ctx context.Context, force bool) error
|
||||
@@ -59,7 +59,7 @@ type Driver interface {
|
||||
Features() map[Feature]bool
|
||||
}
|
||||
|
||||
func Boot(ctx context.Context, d Driver, auth Auth, pw progress.Writer) (*client.Client, error) {
|
||||
func Boot(ctx context.Context, d Driver, pw progress.Writer) (*client.Client, error) {
|
||||
try := 0
|
||||
for {
|
||||
info, err := d.Info(ctx)
|
||||
@@ -71,7 +71,7 @@ func Boot(ctx context.Context, d Driver, auth Auth, pw progress.Writer) (*client
|
||||
if try > 2 {
|
||||
return nil, errors.Errorf("failed to bootstrap %T driver in attempts", d)
|
||||
}
|
||||
if err := d.Bootstrap(ctx, auth, func(s *client.SolveStatus) {
|
||||
if err := d.Bootstrap(ctx, func(s *client.SolveStatus) {
|
||||
if pw != nil {
|
||||
pw.Status() <- s
|
||||
}
|
||||
|
Reference in New Issue
Block a user