Skip to content

Commit

Permalink
feat: printing driver options
Browse files Browse the repository at this point in the history
Signed-off-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com>
  • Loading branch information
developer-guy committed Mar 16, 2022
1 parent 2b4d305 commit da4c27e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions commands/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit da4c27e

Please sign in to comment.