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
55808add
Commit
55808add
authored
May 24, 2017
by
Humble Chirammal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dont exit if 'mount.glusterfs -V' resulted in an error.
Signed-off-by:
Humble Chirammal
<
hchiramm@redhat.com
>
parent
6f7eac63
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
33 deletions
+33
-33
glusterfs.go
pkg/volume/glusterfs/glusterfs.go
+33
-33
No files found.
pkg/volume/glusterfs/glusterfs.go
View file @
55808add
...
...
@@ -379,6 +379,7 @@ func (b *glusterfsMounter) setUpAtInternal(dir string) error {
}
options
=
append
(
options
,
"backup-volfile-servers="
+
dstrings
.
Join
(
addrlist
[
:
],
":"
))
mountOptions
:=
volume
.
JoinMountOptions
(
b
.
mountOptions
,
options
)
//fetch client version.
mountBinaryVerStr
:=
""
...
...
@@ -386,44 +387,43 @@ func (b *glusterfsMounter) setUpAtInternal(dir string) error {
cmdOut
,
err
:=
b
.
exe
.
Command
(
linuxGlusterMountBinary
,
"-V"
)
.
CombinedOutput
()
if
err
!=
nil
{
return
fmt
.
Errorf
(
"Failed to get binary %s
version"
,
linuxGlusterMountBinary
)
}
//cmdOut will be filled as shown below.
/*
[root@]# mount.glusterfs -V
glusterfs 3.10.1
Repository revision: git://git.gluster.org/glusterfs.git
Copyright (c) 2006-2016 Red Hat, Inc. <https://www.gluster.org/>
GlusterFS comes with ABSOLUTELY NO WARRANTY.
.........
*/
parseStr
:=
string
(
cmdOut
)
if
parseStr
!=
""
{
//Store the version line from parseStr
mountStrSlice
:=
dstrings
.
Split
(
parseStr
,
"
\n
"
)
if
len
(
mountStrSlice
)
>
0
{
mountStr
=
mountStrSlice
[
0
]
}
if
mountStr
!=
""
{
glog
.
Warningf
(
"Failed to get binary %q
version"
,
linuxGlusterMountBinary
)
}
else
{
//cmdOut will be filled as shown below.
/*
[root@]# mount.glusterfs -V
glusterfs 3.10.1
Repository revision: git://git.gluster.org/glusterfs.git
Copyright (c) 2006-2016 Red Hat, Inc. <https://www.gluster.org/>
GlusterFS comes with ABSOLUTELY NO WARRANTY.
.........
*/
parseStr
:=
string
(
cmdOut
)
if
parseStr
!=
""
{
//Store the version line from parseStr
mountStrSlice
:=
dstrings
.
Split
(
parseStr
,
"
\n
"
)
if
len
(
mountStrSlice
)
>
0
{
mountStr
=
mountStrSlice
[
0
]
}
if
mountStr
!=
""
{
// Get the [binary, version] slice.
mountBinaryVerSlice
:=
dstrings
.
Split
(
mountStr
,
" "
)
if
len
(
mountBinaryVerSlice
)
>=
2
{
// Get the [binary, version] slice.
mountBinaryVerSlice
:=
dstrings
.
Split
(
mountStr
,
" "
)
if
len
(
mountBinaryVerSlice
)
>=
2
{
// Get the 'version' string in mountBinaryVerStr
mountBinaryVerStr
=
mountBinaryVerSlice
[
1
]
}
// Get the 'version' string in mountBinaryVerStr
mountBinaryVerStr
=
mountBinaryVerSlice
[
1
]
}
}
}
}
mountOptions
:=
volume
.
JoinMountOptions
(
b
.
mountOptions
,
options
)
for
i
:=
len
(
mountOptions
)
-
1
;
i
>=
0
;
i
--
{
if
mountOptions
[
i
]
==
"auto_unmount"
&&
mountBinaryVerStr
!=
""
&&
mountBinaryVerStr
<
autoUnmountBinaryVer
{
mountOptions
=
append
(
mountOptions
[
:
i
],
mountOptions
[
i
+
1
:
]
...
)
for
i
:=
len
(
mountOptions
)
-
1
;
i
>=
0
;
i
--
{
if
mountOptions
[
i
]
==
"auto_unmount"
&&
mountBinaryVerStr
!=
""
&&
mountBinaryVerStr
<
autoUnmountBinaryVer
{
mountOptions
=
append
(
mountOptions
[
:
i
],
mountOptions
[
i
+
1
:
]
...
)
}
}
}
...
...
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