From 082c83b825cf56bc0c17c914965eedf2320ae350 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Tue, 12 Apr 2022 20:56:52 +0200 Subject: [PATCH] inspect: fix printing of driver options Signed-off-by: CrazyMax --- commands/inspect.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/commands/inspect.go b/commands/inspect.go index 5876dae4..c6787626 100644 --- a/commands/inspect.go +++ b/commands/inspect.go @@ -98,11 +98,10 @@ func runInspect(dockerCli command.Cli, in inspectOptions) error { var driverOpts []string for k, v := range n.DriverOpts { - driverOpts = append(driverOpts, fmt.Sprintf("\t%s=%s\n", k, v)) + driverOpts = append(driverOpts, fmt.Sprintf("%s=%q", k, v)) } - if len(driverOpts) > 0 { - fmt.Fprintf(w, "Driver Options: %s", strings.Join(driverOpts, ",")) + fmt.Fprintf(w, "Driver Options:\t%s\n", strings.Join(driverOpts, " ")) } if err := ngi.drivers[i].di.Err; err != nil {