Add authorization plugins to docker info

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
Vincent Demeester 2015-12-29 22:10:23 +01:00
Родитель eb551baf6f
Коммит 4a1eb3f3e2
3 изменённых файлов: 19 добавлений и 6 удалений

Просмотреть файл

@ -2,6 +2,7 @@ package client
import ( import (
"fmt" "fmt"
"strings"
Cli "github.com/docker/docker/cli" Cli "github.com/docker/docker/cli"
"github.com/docker/docker/pkg/ioutils" "github.com/docker/docker/pkg/ioutils"
@ -43,16 +44,18 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
fmt.Fprintf(cli.out, "Plugins: \n") fmt.Fprintf(cli.out, "Plugins: \n")
fmt.Fprintf(cli.out, " Volume:") fmt.Fprintf(cli.out, " Volume:")
for _, driver := range info.Plugins.Volume { fmt.Fprintf(cli.out, " %s", strings.Join(info.Plugins.Volume, " "))
fmt.Fprintf(cli.out, " %s", driver)
}
fmt.Fprintf(cli.out, "\n") fmt.Fprintf(cli.out, "\n")
fmt.Fprintf(cli.out, " Network:") fmt.Fprintf(cli.out, " Network:")
for _, driver := range info.Plugins.Network { fmt.Fprintf(cli.out, " %s", strings.Join(info.Plugins.Network, " "))
fmt.Fprintf(cli.out, " %s", driver)
}
fmt.Fprintf(cli.out, "\n") fmt.Fprintf(cli.out, "\n")
if len(info.Plugins.Authorization) != 0 {
fmt.Fprintf(cli.out, " Authorization:")
fmt.Fprintf(cli.out, " %s", strings.Join(info.Plugins.Authorization, " "))
fmt.Fprintf(cli.out, "\n")
}
ioutils.FprintfIfNotEmpty(cli.out, "Kernel Version: %s\n", info.KernelVersion) ioutils.FprintfIfNotEmpty(cli.out, "Kernel Version: %s\n", info.KernelVersion)
ioutils.FprintfIfNotEmpty(cli.out, "Operating System: %s\n", info.OperatingSystem) ioutils.FprintfIfNotEmpty(cli.out, "Operating System: %s\n", info.OperatingSystem)
ioutils.FprintfIfNotEmpty(cli.out, "OSType: %s\n", info.OSType) ioutils.FprintfIfNotEmpty(cli.out, "OSType: %s\n", info.OSType)

Просмотреть файл

@ -243,6 +243,8 @@ type PluginsInfo struct {
Volume []string Volume []string
// List of Network plugins registered // List of Network plugins registered
Network []string Network []string
// List of Authorization plugins registered
Authorization []string
} }
// ExecStartCheck is a temp struct used by execStart // ExecStartCheck is a temp struct used by execStart

Просмотреть файл

@ -142,9 +142,17 @@ func (daemon *Daemon) showPluginsInfo() types.PluginsInfo {
pluginsInfo.Network = append(pluginsInfo.Network, nd) pluginsInfo.Network = append(pluginsInfo.Network, nd)
} }
pluginsInfo.Authorization = daemon.GetAuthorizationPluginsList()
return pluginsInfo return pluginsInfo
} }
// GetAuthorizationPluginsList returns the list of plugins drivers
// registered for authorization.
func (daemon *Daemon) GetAuthorizationPluginsList() []string {
return daemon.configStore.AuthZPlugins
}
// The uppercase and the lowercase are available for the proxy settings. // The uppercase and the lowercase are available for the proxy settings.
// See the Go specification for details on these variables. https://golang.org/pkg/net/http/ // See the Go specification for details on these variables. https://golang.org/pkg/net/http/
func getProxyEnv(key string) string { func getProxyEnv(key string) string {