Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
aec46961
Commit
aec46961
authored
May 06, 2017
by
zhangxiaoyu-zidif
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nfs.go: cleancode err
parent
79a2e359
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
+3
-7
nfs.go
pkg/volume/nfs/nfs.go
+3
-7
No files found.
pkg/volume/nfs/nfs.go
View file @
aec46961
...
...
@@ -195,19 +195,15 @@ func (nfsMounter *nfsMounter) CanMount() error {
exe
:=
exec
.
New
()
switch
runtime
.
GOOS
{
case
"linux"
:
_
,
err1
:=
exe
.
Command
(
"/bin/ls"
,
"/sbin/mount.nfs"
)
.
CombinedOutput
()
_
,
err2
:=
exe
.
Command
(
"/bin/ls"
,
"/sbin/mount.nfs4"
)
.
CombinedOutput
()
if
err1
!=
nil
{
if
_
,
err
:=
exe
.
Command
(
"/bin/ls"
,
"/sbin/mount.nfs"
)
.
CombinedOutput
();
err
!=
nil
{
return
fmt
.
Errorf
(
"Required binary /sbin/mount.nfs is missing"
)
}
if
err2
!=
nil
{
if
_
,
err
:=
exe
.
Command
(
"/bin/ls"
,
"/sbin/mount.nfs4"
)
.
CombinedOutput
();
err
!=
nil
{
return
fmt
.
Errorf
(
"Required binary /sbin/mount.nfs4 is missing"
)
}
return
nil
case
"darwin"
:
_
,
err
:=
exe
.
Command
(
"/bin/ls"
,
"/sbin/mount_nfs"
)
.
CombinedOutput
()
if
err
!=
nil
{
if
_
,
err
:=
exe
.
Command
(
"/bin/ls"
,
"/sbin/mount_nfs"
)
.
CombinedOutput
();
err
!=
nil
{
return
fmt
.
Errorf
(
"Required binary /sbin/mount_nfs is missing"
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment