mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #18836 from vdemeester/18829-info-authz-plugins
Add authorization plugins to docker info
This commit is contained in:
commit
e7e3e568d1
3 changed files with 19 additions and 6 deletions
|
@ -2,6 +2,7 @@ package client
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
Cli "github.com/docker/docker/cli"
|
||||
"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, " Volume:")
|
||||
for _, driver := range info.Plugins.Volume {
|
||||
fmt.Fprintf(cli.out, " %s", driver)
|
||||
}
|
||||
fmt.Fprintf(cli.out, " %s", strings.Join(info.Plugins.Volume, " "))
|
||||
fmt.Fprintf(cli.out, "\n")
|
||||
fmt.Fprintf(cli.out, " Network:")
|
||||
for _, driver := range info.Plugins.Network {
|
||||
fmt.Fprintf(cli.out, " %s", driver)
|
||||
}
|
||||
fmt.Fprintf(cli.out, " %s", strings.Join(info.Plugins.Network, " "))
|
||||
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, "Operating System: %s\n", info.OperatingSystem)
|
||||
ioutils.FprintfIfNotEmpty(cli.out, "OSType: %s\n", info.OSType)
|
||||
|
|
|
@ -243,6 +243,8 @@ type PluginsInfo struct {
|
|||
Volume []string
|
||||
// List of Network plugins registered
|
||||
Network []string
|
||||
// List of Authorization plugins registered
|
||||
Authorization []string
|
||||
}
|
||||
|
||||
// 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.Authorization = daemon.GetAuthorizationPluginsList()
|
||||
|
||||
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.
|
||||
// See the Go specification for details on these variables. https://golang.org/pkg/net/http/
|
||||
func getProxyEnv(key string) string {
|
||||
|
|
Loading…
Reference in a new issue