Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add log-level mount option support for glusterfs plugin #68440

Merged
merged 1 commit into from
Oct 4, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 13 additions & 4 deletions pkg/volume/glusterfs/glusterfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,20 +290,27 @@ func (b *glusterfsMounter) setUpAtInternal(dir string) error {
var errs error
options := []string{}
hasLogFile := false
hasLogLevel := false
log := ""

if b.readOnly {
options = append(options, "ro")

}

// 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.
Expand All @@ -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 {
Expand Down