Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Commit

Permalink
metrics: fix unexpected usage output shown on cli
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <[email protected]>
  • Loading branch information
crazy-max committed May 15, 2022
1 parent 84ba23e commit 8092874
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions cli/metrics/metadata/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,10 @@ func buildxDriver(dockercfg *configfile.ConfigFile, buildArgs []string) string {
// buildxBuilder returns the builder being used in the build command
func buildxBuilder(buildArgs []string) string {
var builder string
fset := pflag.NewFlagSet("buildx", pflag.ContinueOnError)
fset.String("builder", "", "")
_ = fset.ParseAll(buildArgs, func(flag *pflag.Flag, value string) error {
if flag.Name == "builder" {
builder = value
}
return nil
})
flags := pflag.NewFlagSet("buildx", pflag.ContinueOnError)
flags.Usage = func() {}
flags.StringVar(&builder, "builder", "", "")
_ = flags.Parse(buildArgs)
if len(builder) == 0 {
builder = os.Getenv("BUILDX_BUILDER")
}
Expand Down

0 comments on commit 8092874

Please sign in to comment.