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
441dc15b
Commit
441dc15b
authored
Apr 16, 2018
by
Jesse Haka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add metrics to cinder
cd -> r fix
parent
1d94baad
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
16 deletions
+20
-16
cinder.go
pkg/volume/cinder/cinder.go
+20
-16
No files found.
pkg/volume/cinder/cinder.go
View file @
441dc15b
...
...
@@ -79,6 +79,10 @@ const (
cinderVolumePluginName
=
"kubernetes.io/cinder"
)
func
getPath
(
uid
types
.
UID
,
volName
string
,
host
volume
.
VolumeHost
)
string
{
return
host
.
GetPodVolumeDir
(
uid
,
kstrings
.
EscapeQualifiedNameForDisk
(
cinderVolumePluginName
),
volName
)
}
func
(
plugin
*
cinderPlugin
)
Init
(
host
volume
.
VolumeHost
)
error
{
plugin
.
host
=
host
plugin
.
volumeLocks
=
keymutex
.
NewKeyMutex
()
...
...
@@ -135,12 +139,13 @@ func (plugin *cinderPlugin) newMounterInternal(spec *volume.Spec, podUID types.U
return
&
cinderVolumeMounter
{
cinderVolume
:
&
cinderVolume
{
podUID
:
podUID
,
volName
:
spec
.
Name
(),
pdName
:
pdName
,
mounter
:
mounter
,
manager
:
manager
,
plugin
:
plugin
,
podUID
:
podUID
,
volName
:
spec
.
Name
(),
pdName
:
pdName
,
mounter
:
mounter
,
manager
:
manager
,
plugin
:
plugin
,
MetricsProvider
:
volume
.
NewMetricsStatFS
(
getPath
(
podUID
,
spec
.
Name
(),
plugin
.
host
)),
},
fsType
:
fsType
,
readOnly
:
readOnly
,
...
...
@@ -154,11 +159,12 @@ func (plugin *cinderPlugin) NewUnmounter(volName string, podUID types.UID) (volu
func
(
plugin
*
cinderPlugin
)
newUnmounterInternal
(
volName
string
,
podUID
types
.
UID
,
manager
cdManager
,
mounter
mount
.
Interface
)
(
volume
.
Unmounter
,
error
)
{
return
&
cinderVolumeUnmounter
{
&
cinderVolume
{
podUID
:
podUID
,
volName
:
volName
,
manager
:
manager
,
mounter
:
mounter
,
plugin
:
plugin
,
podUID
:
podUID
,
volName
:
volName
,
manager
:
manager
,
mounter
:
mounter
,
plugin
:
plugin
,
MetricsProvider
:
volume
.
NewMetricsStatFS
(
getPath
(
podUID
,
volName
,
plugin
.
host
)),
}},
nil
}
...
...
@@ -303,7 +309,7 @@ type cinderVolume struct {
// diskMounter provides the interface that is used to mount the actual block device.
blockDeviceMounter
mount
.
Interface
plugin
*
cinderPlugin
volume
.
Metrics
Nil
volume
.
Metrics
Provider
}
func
(
b
*
cinderVolumeMounter
)
GetAttributes
()
volume
.
Attributes
{
...
...
@@ -397,8 +403,7 @@ func makeGlobalPDName(host volume.VolumeHost, devName string) string {
}
func
(
cd
*
cinderVolume
)
GetPath
()
string
{
name
:=
cinderVolumePluginName
return
cd
.
plugin
.
host
.
GetPodVolumeDir
(
cd
.
podUID
,
kstrings
.
EscapeQualifiedNameForDisk
(
name
),
cd
.
volName
)
return
getPath
(
cd
.
podUID
,
cd
.
volName
,
cd
.
plugin
.
host
)
}
type
cinderVolumeUnmounter
struct
{
...
...
@@ -484,8 +489,7 @@ type cinderVolumeDeleter struct {
var
_
volume
.
Deleter
=
&
cinderVolumeDeleter
{}
func
(
r
*
cinderVolumeDeleter
)
GetPath
()
string
{
name
:=
cinderVolumePluginName
return
r
.
plugin
.
host
.
GetPodVolumeDir
(
r
.
podUID
,
kstrings
.
EscapeQualifiedNameForDisk
(
name
),
r
.
volName
)
return
getPath
(
r
.
podUID
,
r
.
volName
,
r
.
plugin
.
host
)
}
func
(
r
*
cinderVolumeDeleter
)
Delete
()
error
{
...
...
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