diff --git a/daemon/config.go b/daemon/config.go index b0d418149b..e6f64f710b 100644 --- a/daemon/config.go +++ b/daemon/config.go @@ -8,6 +8,7 @@ import ( "io" "io/ioutil" "runtime" + "sort" "strings" "sync" @@ -523,3 +524,16 @@ func ValidateConfiguration(config *Config) error { return nil } + +// GetAuthorizationPlugins returns daemon's sorted authorization plugins +func (config *Config) GetAuthorizationPlugins() []string { + config.reloadLock.Lock() + defer config.reloadLock.Unlock() + + authPlugins := make([]string, 0, len(config.AuthorizationPlugins)) + for _, p := range config.AuthorizationPlugins { + authPlugins = append(authPlugins, p) + } + sort.Strings(authPlugins) + return authPlugins +} diff --git a/daemon/info.go b/daemon/info.go index 4ee5b1c377..919e8ed3d1 100644 --- a/daemon/info.go +++ b/daemon/info.go @@ -174,7 +174,7 @@ func (daemon *Daemon) showPluginsInfo() types.PluginsInfo { pluginsInfo.Volume = volumedrivers.GetDriverList() pluginsInfo.Network = daemon.GetNetworkDriverList() - pluginsInfo.Authorization = daemon.configStore.AuthorizationPlugins + pluginsInfo.Authorization = daemon.configStore.GetAuthorizationPlugins() return pluginsInfo } diff --git a/volume/drivers/extpoint.go b/volume/drivers/extpoint.go index 23e98b42b4..da230dcc76 100644 --- a/volume/drivers/extpoint.go +++ b/volume/drivers/extpoint.go @@ -4,6 +4,7 @@ package volumedrivers import ( "fmt" + "sort" "sync" "github.com/docker/docker/pkg/locker" @@ -176,6 +177,7 @@ func GetDriverList() []string { driverList = append(driverList, driverName) } drivers.Unlock() + sort.Strings(driverList) return driverList }