refactor driver auth for easier passing

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi
2020-11-15 20:49:58 -08:00
parent 1ccf0bd7d8
commit 378bf70d4b
9 changed files with 23 additions and 18 deletions

View File

@@ -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
}