Merge pull request #68440 from humblec/log-level

Add `log-level` mount option support for glusterfs plugin
This commit is contained in:
k8s-ci-robot 2018-10-04 06:21:49 -07:00 committed by GitHub
commit a25bc8df42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -290,6 +290,7 @@ func (b *glusterfsMounter) setUpAtInternal(dir string) error {
var errs error
options := []string{}
hasLogFile := false
hasLogLevel := false
log := ""
if b.readOnly {
@ -297,13 +298,19 @@ func (b *glusterfsMounter) setUpAtInternal(dir string) error {
}
// Check logfile has been provided by user, if provided, use that as the log file.
// Check for log-file,log-level options existence in user supplied mount options, if provided, use those.
for _, userOpt := range b.mountOptions {
if dstrings.HasPrefix(userOpt, "log-file") {
switch {
case dstrings.HasPrefix(userOpt, "log-file"):
glog.V(4).Infof("log-file mount option has provided")
hasLogFile = true
break
case dstrings.HasPrefix(userOpt, "log-level"):
glog.V(4).Infof("log-level mount option has provided")
hasLogLevel = true
}
}
// If logfile has not been provided, create driver specific log file.
@ -324,7 +331,9 @@ func (b *glusterfsMounter) setUpAtInternal(dir string) error {
}
options = append(options, "log-level=ERROR")
if !hasLogLevel {
options = append(options, "log-level=ERROR")
}
var addrlist []string
if b.hosts == nil {