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
b85ac951
Commit
b85ac951
authored
Nov 11, 2016
by
rkouj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement CanMount() for gfsMounter for linux
parent
f228edbf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
11 deletions
+20
-11
glusterfs.go
pkg/volume/glusterfs/glusterfs.go
+20
-11
No files found.
pkg/volume/glusterfs/glusterfs.go
View file @
b85ac951
...
...
@@ -35,6 +35,7 @@ import (
"k8s.io/kubernetes/pkg/util/strings"
"k8s.io/kubernetes/pkg/volume"
volutil
"k8s.io/kubernetes/pkg/volume/util"
"runtime"
)
// This is the primary entrypoint for volume plugins.
...
...
@@ -55,17 +56,18 @@ var _ volume.Provisioner = &glusterfsVolumeProvisioner{}
var
_
volume
.
Deleter
=
&
glusterfsVolumeDeleter
{}
const
(
glusterfsPluginName
=
"kubernetes.io/glusterfs"
volPrefix
=
"vol_"
dynamicEpSvcPrefix
=
"glusterfs-dynamic-"
replicaCount
=
3
durabilityType
=
"replicate"
secretKeyName
=
"key"
// key name used in secret
annGlusterURL
=
"glusterfs.kubernetes.io/url"
annGlusterSecretName
=
"glusterfs.kubernetes.io/secretname"
annGlusterSecretNamespace
=
"glusterfs.kubernetes.io/secretnamespace"
annGlusterUserKey
=
"glusterfs.kubernetes.io/userkey"
annGlusterUser
=
"glusterfs.kubernetes.io/userid"
glusterfsPluginName
=
"kubernetes.io/glusterfs"
volPrefix
=
"vol_"
dynamicEpSvcPrefix
=
"glusterfs-dynamic-"
replicaCount
=
3
durabilityType
=
"replicate"
secretKeyName
=
"key"
// key name used in secret
annGlusterURL
=
"glusterfs.kubernetes.io/url"
annGlusterSecretName
=
"glusterfs.kubernetes.io/secretname"
annGlusterSecretNamespace
=
"glusterfs.kubernetes.io/secretnamespace"
annGlusterUserKey
=
"glusterfs.kubernetes.io/userkey"
annGlusterUser
=
"glusterfs.kubernetes.io/userid"
gciGlusterMountBinariesPath
=
"/sbin/mount.glusterfs"
)
func
(
plugin
*
glusterfsPlugin
)
Init
(
host
volume
.
VolumeHost
)
error
{
...
...
@@ -211,6 +213,13 @@ func (b *glusterfsMounter) GetAttributes() volume.Attributes {
// to mount the volume are available on the underlying node.
// If not, it returns an error
func
(
b
*
glusterfsMounter
)
CanMount
()
error
{
exe
:=
exec
.
New
()
switch
runtime
.
GOOS
{
case
"linux"
:
if
_
,
err
:=
exe
.
Command
(
"/bin/ls"
,
gciGlusterMountBinariesPath
)
.
CombinedOutput
();
err
!=
nil
{
return
fmt
.
Errorf
(
"Required binary %s is missing"
,
gciGlusterMountBinariesPath
)
}
}
return
nil
}
...
...
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