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
69b283bd
Commit
69b283bd
authored
Sep 12, 2015
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #13807 from bodgit/glusterfs
Auto commit by PR queue bot
parents
4aa412e0
8bbc86d8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
glusterfs.go
pkg/volume/glusterfs/glusterfs.go
+16
-5
No files found.
pkg/volume/glusterfs/glusterfs.go
View file @
69b283bd
...
...
@@ -17,8 +17,8 @@ limitations under the License.
package
glusterfs
import
(
"math/rand"
"os"
"path"
"github.com/golang/glog"
"k8s.io/kubernetes/pkg/api"
...
...
@@ -221,12 +221,23 @@ func (b *glusterfsBuilder) setUpAtInternal(dir string) error {
options
=
append
(
options
,
"ro"
)
}
l
:=
len
(
b
.
hosts
.
Subsets
)
p
:=
path
.
Join
(
b
.
glusterfs
.
plugin
.
host
.
GetPluginDir
(
glusterfsPluginName
),
b
.
glusterfs
.
volName
)
if
err
:=
os
.
MkdirAll
(
p
,
0750
);
err
!=
nil
{
return
err
}
log
:=
path
.
Join
(
p
,
"glusterfs.log"
)
options
=
append
(
options
,
"log-file="
+
log
)
addr
:=
make
(
map
[
string
]
struct
{})
for
_
,
s
:=
range
b
.
hosts
.
Subsets
{
for
_
,
a
:=
range
s
.
Addresses
{
addr
[
a
.
IP
]
=
struct
{}{}
}
}
// Avoid mount storm, pick a host randomly.
start
:=
rand
.
Int
()
%
l
// Iterate all hosts until mount succeeds.
for
i
:=
start
;
i
<
start
+
l
;
i
++
{
hostIP
:=
b
.
hosts
.
Subsets
[
i
%
l
]
.
Addresses
[
0
]
.
IP
for
hostIP
:=
range
addr
{
errs
=
b
.
mounter
.
Mount
(
hostIP
+
":"
+
b
.
path
,
dir
,
"glusterfs"
,
options
)
if
errs
==
nil
{
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