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
85495bd1
Commit
85495bd1
authored
Aug 22, 2017
by
Jan Safranek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nfs: Use VolumeHost.GetExec() to execute stuff in volume plugins
parent
07dea6b4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
BUILD
pkg/volume/nfs/BUILD
+0
-1
nfs.go
pkg/volume/nfs/nfs.go
+4
-5
No files found.
pkg/volume/nfs/BUILD
View file @
85495bd1
...
...
@@ -21,7 +21,6 @@ go_library(
"//vendor/k8s.io/api/core/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
"//vendor/k8s.io/utils/exec:go_default_library",
],
)
...
...
pkg/volume/nfs/nfs.go
View file @
85495bd1
...
...
@@ -29,7 +29,6 @@ import (
"k8s.io/kubernetes/pkg/util/strings"
"k8s.io/kubernetes/pkg/volume"
"k8s.io/kubernetes/pkg/volume/util"
"k8s.io/utils/exec"
)
// This is the primary entrypoint for volume plugins.
...
...
@@ -192,18 +191,18 @@ func (nfsVolume *nfs) GetPath() string {
// to mount the volume are available on the underlying node.
// If not, it returns an error
func
(
nfsMounter
*
nfsMounter
)
CanMount
()
error
{
exe
:=
exec
.
New
(
)
exe
c
:=
nfsMounter
.
plugin
.
host
.
GetExec
(
nfsMounter
.
plugin
.
GetPluginName
()
)
switch
runtime
.
GOOS
{
case
"linux"
:
if
_
,
err
:=
exe
.
Command
(
"/bin/ls"
,
"/sbin/mount.nfs"
)
.
CombinedOutput
(
);
err
!=
nil
{
if
_
,
err
:=
exe
c
.
Run
(
"/bin/ls"
,
"/sbin/mount.nfs"
);
err
!=
nil
{
return
fmt
.
Errorf
(
"Required binary /sbin/mount.nfs is missing"
)
}
if
_
,
err
:=
exe
.
Command
(
"/bin/ls"
,
"/sbin/mount.nfs4"
)
.
CombinedOutput
(
);
err
!=
nil
{
if
_
,
err
:=
exe
c
.
Run
(
"/bin/ls"
,
"/sbin/mount.nfs4"
);
err
!=
nil
{
return
fmt
.
Errorf
(
"Required binary /sbin/mount.nfs4 is missing"
)
}
return
nil
case
"darwin"
:
if
_
,
err
:=
exe
.
Command
(
"/bin/ls"
,
"/sbin/mount_nfs"
)
.
CombinedOutput
(
);
err
!=
nil
{
if
_
,
err
:=
exe
c
.
Run
(
"/bin/ls"
,
"/sbin/mount_nfs"
);
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