mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #68440 from humblec/log-level
Add `log-level` mount option support for glusterfs plugin
This commit is contained in:
commit
a25bc8df42
@ -290,6 +290,7 @@ func (b *glusterfsMounter) setUpAtInternal(dir string) error {
|
|||||||
var errs error
|
var errs error
|
||||||
options := []string{}
|
options := []string{}
|
||||||
hasLogFile := false
|
hasLogFile := false
|
||||||
|
hasLogLevel := false
|
||||||
log := ""
|
log := ""
|
||||||
|
|
||||||
if b.readOnly {
|
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 {
|
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")
|
glog.V(4).Infof("log-file mount option has provided")
|
||||||
hasLogFile = true
|
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.
|
// 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
|
var addrlist []string
|
||||||
if b.hosts == nil {
|
if b.hosts == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user