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
12b77822
Commit
12b77822
authored
Oct 27, 2016
by
Humble Chirammal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make a consistent name ( GlusterFS instead of Gluster) in variables and error messages.
Signed-off-by:
Humble Chirammal
<
hchiramm@redhat.com
>
parent
7d0b12f9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
glusterfs.go
pkg/volume/glusterfs/glusterfs.go
+8
-8
No files found.
pkg/volume/glusterfs/glusterfs.go
View file @
12b77822
...
@@ -57,7 +57,7 @@ var _ volume.Deleter = &glusterfsVolumeDeleter{}
...
@@ -57,7 +57,7 @@ var _ volume.Deleter = &glusterfsVolumeDeleter{}
const
(
const
(
glusterfsPluginName
=
"kubernetes.io/glusterfs"
glusterfsPluginName
=
"kubernetes.io/glusterfs"
volPrefix
=
"vol_"
volPrefix
=
"vol_"
dynamicEpSvcPrefix
=
"gluster-dynamic-"
dynamicEpSvcPrefix
=
"gluster
fs
-dynamic-"
replicaCount
=
3
replicaCount
=
3
durabilityType
=
"replicate"
durabilityType
=
"replicate"
secretKeyName
=
"key"
// key name used in secret
secretKeyName
=
"key"
// key name used in secret
...
@@ -325,7 +325,7 @@ func (b *glusterfsMounter) setUpAtInternal(dir string) error {
...
@@ -325,7 +325,7 @@ func (b *glusterfsMounter) setUpAtInternal(dir string) error {
}
}
// Failed mount scenario.
// Failed mount scenario.
// Since gluster does not return error text
// Since gluster
fs
does not return error text
// it all goes in a log file, we will read the log file
// it all goes in a log file, we will read the log file
logerror
:=
readGlusterLog
(
log
,
b
.
pod
.
Name
)
logerror
:=
readGlusterLog
(
log
,
b
.
pod
.
Name
)
if
logerror
!=
nil
{
if
logerror
!=
nil
{
...
@@ -344,7 +344,7 @@ func getVolumeSource(
...
@@ -344,7 +344,7 @@ func getVolumeSource(
return
spec
.
PersistentVolume
.
Spec
.
Glusterfs
,
spec
.
ReadOnly
,
nil
return
spec
.
PersistentVolume
.
Spec
.
Glusterfs
,
spec
.
ReadOnly
,
nil
}
}
return
nil
,
false
,
fmt
.
Errorf
(
"Spec does not reference a Gluster volume type"
)
return
nil
,
false
,
fmt
.
Errorf
(
"Spec does not reference a Gluster
FS
volume type"
)
}
}
func
(
plugin
*
glusterfsPlugin
)
NewProvisioner
(
options
volume
.
VolumeOptions
)
(
volume
.
Provisioner
,
error
)
{
func
(
plugin
*
glusterfsPlugin
)
NewProvisioner
(
options
volume
.
VolumeOptions
)
(
volume
.
Provisioner
,
error
)
{
...
@@ -428,8 +428,8 @@ func (d *glusterfsVolumeDeleter) Delete() error {
...
@@ -428,8 +428,8 @@ func (d *glusterfsVolumeDeleter) Delete() error {
cli
:=
gcli
.
NewClient
(
d
.
url
,
d
.
user
,
d
.
secretValue
)
cli
:=
gcli
.
NewClient
(
d
.
url
,
d
.
user
,
d
.
secretValue
)
if
cli
==
nil
{
if
cli
==
nil
{
glog
.
Errorf
(
"glusterfs: failed to create gluster rest client"
)
glog
.
Errorf
(
"glusterfs: failed to create gluster
fs
rest client"
)
return
fmt
.
Errorf
(
"glusterfs: failed to create gluster rest client, REST server authentication failed"
)
return
fmt
.
Errorf
(
"glusterfs: failed to create gluster
fs
rest client, REST server authentication failed"
)
}
}
err
=
cli
.
VolumeDelete
(
volumeId
)
err
=
cli
.
VolumeDelete
(
volumeId
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -503,12 +503,12 @@ func (p *glusterfsVolumeProvisioner) CreateVolume() (r *api.GlusterfsVolumeSourc
...
@@ -503,12 +503,12 @@ func (p *glusterfsVolumeProvisioner) CreateVolume() (r *api.GlusterfsVolumeSourc
glog
.
V
(
2
)
.
Infof
(
"glusterfs: create volume of size: %d bytes and configuration %+v"
,
volSizeBytes
,
p
.
provisioningConfig
)
glog
.
V
(
2
)
.
Infof
(
"glusterfs: create volume of size: %d bytes and configuration %+v"
,
volSizeBytes
,
p
.
provisioningConfig
)
if
p
.
url
==
""
{
if
p
.
url
==
""
{
glog
.
Errorf
(
"glusterfs : rest server endpoint is empty"
)
glog
.
Errorf
(
"glusterfs : rest server endpoint is empty"
)
return
nil
,
0
,
fmt
.
Errorf
(
"failed to create gluster REST client, REST URL is empty"
)
return
nil
,
0
,
fmt
.
Errorf
(
"failed to create gluster
fs
REST client, REST URL is empty"
)
}
}
cli
:=
gcli
.
NewClient
(
p
.
url
,
p
.
user
,
p
.
secretValue
)
cli
:=
gcli
.
NewClient
(
p
.
url
,
p
.
user
,
p
.
secretValue
)
if
cli
==
nil
{
if
cli
==
nil
{
glog
.
Errorf
(
"glusterfs: failed to create gluster rest client"
)
glog
.
Errorf
(
"glusterfs: failed to create gluster
fs
rest client"
)
return
nil
,
0
,
fmt
.
Errorf
(
"failed to create gluster REST client, REST server authentication failed"
)
return
nil
,
0
,
fmt
.
Errorf
(
"failed to create gluster
fs
REST client, REST server authentication failed"
)
}
}
volumeReq
:=
&
gapi
.
VolumeCreateRequest
{
Size
:
sz
,
Durability
:
gapi
.
VolumeDurabilityInfo
{
Type
:
durabilityType
,
Replicate
:
gapi
.
ReplicaDurability
{
Replica
:
replicaCount
}}}
volumeReq
:=
&
gapi
.
VolumeCreateRequest
{
Size
:
sz
,
Durability
:
gapi
.
VolumeDurabilityInfo
{
Type
:
durabilityType
,
Replicate
:
gapi
.
ReplicaDurability
{
Replica
:
replicaCount
}}}
volume
,
err
:=
cli
.
VolumeCreate
(
volumeReq
)
volume
,
err
:=
cli
.
VolumeCreate
(
volumeReq
)
...
...
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