mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
driver: initialize tracer delegate in driver handle instead of individual plugins
This refactors the driver handle to initialize the tracer delegate inside of the driver handle instead of the individual plugins. This provides more uniformity to how the tracer delegate is created by allowing the driver handle to pass additional client options to the drivers when they create the client. It also avoids creating the tracer delegate client multiple times because the driver handle will only initialize the client once. This prevents some drivers, like the remote driver, from accidentally registering multiple clients as tracer delegates. Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
This commit is contained in:
@ -158,7 +158,7 @@ func BuildWithResultHandler(ctx context.Context, nodes []builder.Node, opt map[s
|
||||
return nil, errors.Wrapf(err, "no valid drivers found")
|
||||
}
|
||||
|
||||
var noMobyDriver driver.Driver
|
||||
var noMobyDriver *driver.DriverHandle
|
||||
for _, n := range nodes {
|
||||
if !n.Driver.IsMobyDriver() {
|
||||
noMobyDriver = n.Driver
|
||||
@ -658,7 +658,7 @@ func BuildWithResultHandler(ctx context.Context, nodes []builder.Node, opt map[s
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func pushWithMoby(ctx context.Context, d driver.Driver, name string, l progress.SubLogger) error {
|
||||
func pushWithMoby(ctx context.Context, d *driver.DriverHandle, name string, l progress.SubLogger) error {
|
||||
api := d.Config().DockerAPI
|
||||
if api == nil {
|
||||
return errors.Errorf("invalid empty Docker API reference") // should never happen
|
||||
@ -738,7 +738,7 @@ func pushWithMoby(ctx context.Context, d driver.Driver, name string, l progress.
|
||||
return nil
|
||||
}
|
||||
|
||||
func remoteDigestWithMoby(ctx context.Context, d driver.Driver, name string) (string, error) {
|
||||
func remoteDigestWithMoby(ctx context.Context, d *driver.DriverHandle, name string) (string, error) {
|
||||
api := d.Config().DockerAPI
|
||||
if api == nil {
|
||||
return "", errors.Errorf("invalid empty Docker API reference") // should never happen
|
||||
|
Reference in New Issue
Block a user