зеркало из https://github.com/microsoft/docker.git
Merge pull request #32897 from crosbymichael/unix-group
Don't error with empty group
This commit is contained in:
Коммит
cfae6278be
|
@ -22,10 +22,12 @@ func Init(proto, addr, socketGroup string, tlsConfig *tls.Config) (ls []net.List
|
|||
case "unix":
|
||||
gid, err := lookupGID(socketGroup)
|
||||
if err != nil {
|
||||
if socketGroup != defaultSocketGroup {
|
||||
return nil, err
|
||||
if socketGroup != "" {
|
||||
if socketGroup != defaultSocketGroup {
|
||||
return nil, err
|
||||
}
|
||||
logrus.Warnf("could not change group %s to %s: %v", addr, defaultSocketGroup, err)
|
||||
}
|
||||
logrus.Warnf("could not change group %s to %s: %v", addr, defaultSocketGroup, err)
|
||||
gid = os.Getgid()
|
||||
}
|
||||
l, err := sockets.NewUnixSocket(addr, gid)
|
||||
|
|
|
@ -35,10 +35,12 @@ func Init(proto, addr, socketGroup string, tlsConfig *tls.Config) ([]net.Listene
|
|||
case "unix":
|
||||
gid, err := lookupGID(socketGroup)
|
||||
if err != nil {
|
||||
if socketGroup != defaultSocketGroup {
|
||||
return nil, err
|
||||
if socketGroup != "" {
|
||||
if socketGroup != defaultSocketGroup {
|
||||
return nil, err
|
||||
}
|
||||
logrus.Warnf("could not change group %s to %s: %v", addr, defaultSocketGroup, err)
|
||||
}
|
||||
logrus.Warnf("could not change group %s to %s: %v", addr, defaultSocketGroup, err)
|
||||
gid = os.Getgid()
|
||||
}
|
||||
l, err := sockets.NewUnixSocket(addr, gid)
|
||||
|
|
Загрузка…
Ссылка в новой задаче