From 96476fd054b3b0253c6e3cd8d92637d7bec2e1a7 Mon Sep 17 00:00:00 2001 From: Travis Rhoden Date: Thu, 11 Apr 2019 13:22:14 -0600 Subject: [PATCH] Fix linting issues for exec mounter --- pkg/volume/util/exec/exec_mount.go | 4 +++- pkg/volume/util/exec/exec_mount_unsupported.go | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/volume/util/exec/exec_mount.go b/pkg/volume/util/exec/exec_mount.go index 9171085418..a5ab848a85 100644 --- a/pkg/volume/util/exec/exec_mount.go +++ b/pkg/volume/util/exec/exec_mount.go @@ -34,6 +34,8 @@ type execMounter struct { exec mount.Exec } +// NewExecMounter returns a mounter that uses provided Exec interface to mount and +// unmount a filesystem. For all other calls it uses a wrapped mounter. func NewExecMounter(exec mount.Exec, wrapped mount.Interface) mount.Interface { return &execMounter{ wrappedMounter: wrapped, @@ -66,7 +68,7 @@ func (m *execMounter) doExecMount(source, target, fstype string, options []strin output, err := m.exec.Run("mount", mountArgs...) klog.V(5).Infof("Exec mounted %v: %v: %s", mountArgs, err, string(output)) if err != nil { - return fmt.Errorf("mount failed: %v\nMounting command: %s\nMounting arguments: %s %s %s %v\nOutput: %s\n", + return fmt.Errorf("mount failed: %v\nMounting command: %s\nMounting arguments: %s %s %s %v\nOutput: %s", err, "mount", source, target, fstype, options, string(output)) } diff --git a/pkg/volume/util/exec/exec_mount_unsupported.go b/pkg/volume/util/exec/exec_mount_unsupported.go index 09667c070f..fa02c1fa25 100644 --- a/pkg/volume/util/exec/exec_mount_unsupported.go +++ b/pkg/volume/util/exec/exec_mount_unsupported.go @@ -27,7 +27,7 @@ import ( type execMounter struct{} -// ExecMounter is a mounter that uses provided Exec interface to mount and +// NewExecMounter returns a mounter that uses provided Exec interface to mount and // unmount a filesystem. For all other calls it uses a wrapped mounter. func NewExecMounter(exec mount.Exec, wrapped mount.Interface) mount.Interface { return &execMounter{} @@ -85,7 +85,7 @@ func (mounter *execMounter) ExistsPath(pathname string) (bool, error) { return true, errors.New("not implemented") } -func (m *execMounter) EvalHostSymlinks(pathname string) (string, error) { +func (mounter *execMounter) EvalHostSymlinks(pathname string) (string, error) { return "", errors.New("not implemented") }