Skip to content

Commit

Permalink
vendor: update buildx to latest docker/cli
Browse files Browse the repository at this point in the history
This version of docker/cli has changes to remove compose-cli wrapper and
move all CLI metrics to OTEL.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
  • Loading branch information
jsternberg committed May 16, 2024
1 parent afcb609 commit 3d63fa3
Show file tree
Hide file tree
Showing 14 changed files with 186 additions and 108 deletions.
3 changes: 1 addition & 2 deletions commands/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,7 @@ func (o *buildOptionsHash) String() string {
}

func runBuild(ctx context.Context, dockerCli command.Cli, options buildOptions) (err error) {
mp := dockerCli.MeterProvider(ctx)
defer metricutil.Shutdown(ctx, mp)
mp := dockerCli.MeterProvider()

ctx, end, err := tracing.TraceCurrentCommand(ctx, "build")
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/docker/buildx

go 1.21
go 1.22

require (
github.com/Masterminds/semver/v3 v3.2.1
Expand All @@ -14,7 +14,7 @@ require (
github.com/containerd/typeurl/v2 v2.1.1
github.com/creack/pty v1.1.18
github.com/distribution/reference v0.5.0
github.com/docker/cli v26.0.1-0.20240410153731-b6c552212837+incompatible // v26.1.0-dev
github.com/docker/cli v26.1.3+incompatible // v26.1.0-dev
github.com/docker/cli-docs-tool v0.7.0
github.com/docker/docker v26.0.0+incompatible
github.com/docker/go-units v0.5.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0=
github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
github.com/docker/cli v26.0.1-0.20240410153731-b6c552212837+incompatible h1:KTmSJjZSQM+cpaczHecGsBNlgJtRccef/62pCOeiA9o=
github.com/docker/cli v26.0.1-0.20240410153731-b6c552212837+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/cli v26.1.3+incompatible h1:bUpXT/N0kDE3VUHI2r5VMsYQgi38kYuoC0oL9yt3lqc=
github.com/docker/cli v26.1.3+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/cli-docs-tool v0.7.0 h1:M2Da98Unz2kz3A5d4yeSGbhyOge2mfYSNjAFt01Rw0M=
github.com/docker/cli-docs-tool v0.7.0/go.mod h1:zMjqTFCU361PRh8apiXzeAZ1Q/xupbIwTusYpzCXS/o=
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
Expand Down
11 changes: 0 additions & 11 deletions util/metricutil/metric.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
package metricutil

import (
"context"

"github.com/docker/buildx/version"
"github.com/docker/cli/cli/command"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/metric"
)

Expand All @@ -15,10 +11,3 @@ func Meter(mp metric.MeterProvider) metric.Meter {
return mp.Meter(version.Package,
metric.WithInstrumentationVersion(version.Version))
}

// Shutdown invokes Shutdown on the MeterProvider and then reports any error to the OTEL handler.
func Shutdown(ctx context.Context, mp command.MeterProvider) {
if err := mp.Shutdown(ctx); err != nil {
otel.Handle(err)
}
}
9 changes: 5 additions & 4 deletions vendor/github.com/docker/cli/cli-plugins/hooks/template.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

99 changes: 69 additions & 30 deletions vendor/github.com/docker/cli/cli-plugins/manager/hooks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions vendor/github.com/docker/cli/cli-plugins/manager/manager.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions vendor/github.com/docker/cli/cli-plugins/manager/plugin.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions vendor/github.com/docker/cli/cli-plugins/plugin/plugin.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions vendor/github.com/docker/cli/cli/command/cli.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3d63fa3

Please sign in to comment.