Merge pull request #32937 from dsheets/daemon-info-authz-dont-sort

daemon/info: don't sort authorization plugins as order matters
This commit is contained in:
Vincent Demeester 2017-05-02 14:10:59 +02:00 коммит произвёл GitHub
Родитель 1504d51701 cfcf2a0cec
Коммит 1d0b921d70
2 изменённых файлов: 3 добавлений и 15 удалений

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

@ -9,7 +9,6 @@ import (
"io/ioutil"
"reflect"
"runtime"
"sort"
"strings"
"sync"
@ -503,19 +502,6 @@ func Validate(config *Config) error {
return nil
}
// GetAuthorizationPlugins returns daemon's sorted authorization plugins
func (conf *Config) GetAuthorizationPlugins() []string {
conf.Lock()
defer conf.Unlock()
authPlugins := make([]string, 0, len(conf.AuthorizationPlugins))
for _, p := range conf.AuthorizationPlugins {
authPlugins = append(authPlugins, p)
}
sort.Strings(authPlugins)
return authPlugins
}
// ModifiedDiscoverySettings returns whether the discovery configuration has been modified or not.
func ModifiedDiscoverySettings(config *Config, backendType, advertise string, clusterOpts map[string]string) bool {
if config.ClusterStore != backendType || config.ClusterAdvertise != advertise {

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

@ -175,7 +175,9 @@ func (daemon *Daemon) showPluginsInfo() types.PluginsInfo {
pluginsInfo.Volume = volumedrivers.GetDriverList()
pluginsInfo.Network = daemon.GetNetworkDriverList()
pluginsInfo.Authorization = daemon.configStore.GetAuthorizationPlugins()
// The authorization plugins are returned in the order they are
// used as they constitute a request/response modification chain.
pluginsInfo.Authorization = daemon.configStore.AuthorizationPlugins
pluginsInfo.Log = logger.ListDrivers()
return pluginsInfo