Revert "support registry auth"

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi
2021-04-23 16:58:29 -07:00
parent d77c6f46ff
commit 2b7dfcae29
9 changed files with 18 additions and 204 deletions

View File

@@ -19,7 +19,6 @@ import (
_ "github.com/moby/buildkit/client/connhelper/dockercontainer" // import the container connection driver
"github.com/moby/buildkit/client/llb"
bkgw "github.com/moby/buildkit/frontend/gateway/client"
"github.com/moby/buildkit/session"
// docker output
"dagger.io/go/pkg/buildkitd"
@@ -102,13 +101,9 @@ func (c *Client) buildfn(ctx context.Context, deployment *Deployment, fn ClientD
localdirs[label] = abs
}
// buildkit auth provider (registry)
auth := newRegistryAuthProvider()
// Setup solve options
opts := bk.SolveOpt{
LocalDirs: localdirs,
Session: []session.Attachable{auth},
}
// Call buildkit solver
@@ -118,16 +113,13 @@ func (c *Client) buildfn(ctx context.Context, deployment *Deployment, fn ClientD
Msg("spawning buildkit job")
resp, err := c.c.Build(ctx, opts, "", func(ctx context.Context, gw bkgw.Client) (*bkgw.Result, error) {
s := NewSolver(c.c, gw, ch, opts.Session, c.noCache)
s := NewSolver(c.c, gw, ch, c.noCache)
lg.Debug().Msg("loading configuration")
if err := deployment.LoadPlan(ctx, s); err != nil {
return nil, err
}
lg.Debug().Msg("loading registry credentials from plan")
auth.SetCredentials(deployment.RegistryCredentials(ctx))
// Compute output overlay
if fn != nil {
if err := fn(ctx, deployment, s); err != nil {