vendor: update buildkit with typed errors support
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
5
vendor/github.com/docker/cli/cli-plugins/manager/error.go
generated
vendored
5
vendor/github.com/docker/cli/cli-plugins/manager/error.go
generated
vendored
@@ -25,6 +25,11 @@ func (e *pluginError) Cause() error {
|
||||
return e.cause
|
||||
}
|
||||
|
||||
// Unwrap provides compatibility for Go 1.13 error chains.
|
||||
func (e *pluginError) Unwrap() error {
|
||||
return e.cause
|
||||
}
|
||||
|
||||
// MarshalText marshalls the pluginError into a textual form.
|
||||
func (e *pluginError) MarshalText() (text []byte, err error) {
|
||||
return []byte(e.cause.Error()), nil
|
||||
|
||||
2
vendor/github.com/docker/cli/cli-plugins/manager/manager.go
generated
vendored
2
vendor/github.com/docker/cli/cli-plugins/manager/manager.go
generated
vendored
@@ -11,8 +11,8 @@ import (
|
||||
|
||||
"github.com/docker/cli/cli/command"
|
||||
"github.com/docker/cli/cli/config"
|
||||
"github.com/fvbommel/sortorder"
|
||||
"github.com/spf13/cobra"
|
||||
"vbom.ml/util/sortorder"
|
||||
)
|
||||
|
||||
// ReexecEnvvar is the name of an ennvar which is set to the command
|
||||
|
||||
2
vendor/github.com/docker/cli/cli-plugins/manager/metadata.go
generated
vendored
2
vendor/github.com/docker/cli/cli-plugins/manager/metadata.go
generated
vendored
@@ -10,7 +10,7 @@ const (
|
||||
MetadataSubcommandName = "docker-cli-plugin-metadata"
|
||||
)
|
||||
|
||||
// Metadata provided by the plugin. See docs/extend/cli_plugins.md for canonical information.
|
||||
// Metadata provided by the plugin.
|
||||
type Metadata struct {
|
||||
// SchemaVersion describes the version of this struct. Mandatory, must be "0.1.0"
|
||||
SchemaVersion string `json:",omitempty"`
|
||||
|
||||
7
vendor/github.com/docker/cli/cli-plugins/plugin/plugin.go
generated
vendored
7
vendor/github.com/docker/cli/cli-plugins/plugin/plugin.go
generated
vendored
@@ -24,7 +24,8 @@ import (
|
||||
// called.
|
||||
var PersistentPreRunE func(*cobra.Command, []string) error
|
||||
|
||||
func runPlugin(dockerCli *command.DockerCli, plugin *cobra.Command, meta manager.Metadata) error {
|
||||
// RunPlugin executes the specified plugin command
|
||||
func RunPlugin(dockerCli *command.DockerCli, plugin *cobra.Command, meta manager.Metadata) error {
|
||||
tcmd := newPluginCommand(dockerCli, plugin, meta)
|
||||
|
||||
var persistentPreRunOnce sync.Once
|
||||
@@ -60,7 +61,7 @@ func Run(makeCmd func(command.Cli) *cobra.Command, meta manager.Metadata) {
|
||||
|
||||
plugin := makeCmd(dockerCli)
|
||||
|
||||
if err := runPlugin(dockerCli, plugin, meta); err != nil {
|
||||
if err := RunPlugin(dockerCli, plugin, meta); err != nil {
|
||||
if sterr, ok := err.(cli.StatusError); ok {
|
||||
if sterr.Status != "" {
|
||||
fmt.Fprintln(dockerCli.Err(), sterr.Status)
|
||||
@@ -127,7 +128,7 @@ func newPluginCommand(dockerCli *command.DockerCli, plugin *cobra.Command, meta
|
||||
}
|
||||
opts, flags := cli.SetupPluginRootCommand(cmd)
|
||||
|
||||
cmd.SetOutput(dockerCli.Out())
|
||||
cmd.SetOut(dockerCli.Out())
|
||||
|
||||
cmd.AddCommand(
|
||||
plugin,
|
||||
|
||||
Reference in New Issue
Block a user