From da4c27e9af38f93973986a66816147bcecf09650 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Apayd=C4=B1n?= Date: Tue, 15 Mar 2022 21:52:11 +0300 Subject: [PATCH] feat: printing driver options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Batuhan Apaydın --- commands/inspect.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/commands/inspect.go b/commands/inspect.go index ecb1c61626e..5876dae41ea 100644 --- a/commands/inspect.go +++ b/commands/inspect.go @@ -79,6 +79,7 @@ func runInspect(dockerCli command.Cli, in inspectOptions) error { w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', 0) fmt.Fprintf(w, "Name:\t%s\n", ngi.ng.Name) fmt.Fprintf(w, "Driver:\t%s\n", ngi.ng.Driver) + if err != nil { fmt.Fprintf(w, "Error:\t%s\n", err.Error()) } else if ngi.err != nil { @@ -94,6 +95,16 @@ func runInspect(dockerCli command.Cli, in inspectOptions) error { } fmt.Fprintf(w, "Name:\t%s\n", n.Name) fmt.Fprintf(w, "Endpoint:\t%s\n", n.Endpoint) + + var driverOpts []string + for k, v := range n.DriverOpts { + driverOpts = append(driverOpts, fmt.Sprintf("\t%s=%s\n", k, v)) + } + + if len(driverOpts) > 0 { + fmt.Fprintf(w, "Driver Options: %s", strings.Join(driverOpts, ",")) + } + if err := ngi.drivers[i].di.Err; err != nil { fmt.Fprintf(w, "Error:\t%s\n", err.Error()) } else if err := ngi.drivers[i].err; err != nil {