mirror of https://github.com/k3s-io/k3s
Add volumemetrics for ISCSI Plugin.
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>pull/8/head
parent
5f8b0438fb
commit
2f9f78206e
|
@ -112,6 +112,12 @@ func (plugin *iscsiPlugin) newMounterInternal(spec *volume.Spec, podUID types.UI
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if iscsiDisk != nil {
|
||||||
|
|
||||||
|
//Add volume metrics
|
||||||
|
iscsiDisk.MetricsProvider = volume.NewMetricsStatFS(iscsiDisk.GetPath())
|
||||||
|
}
|
||||||
return &iscsiDiskMounter{
|
return &iscsiDiskMounter{
|
||||||
iscsiDisk: iscsiDisk,
|
iscsiDisk: iscsiDisk,
|
||||||
fsType: fsType,
|
fsType: fsType,
|
||||||
|
@ -168,6 +174,7 @@ func (plugin *iscsiPlugin) newUnmounterInternal(volName string, podUID types.UID
|
||||||
VolName: volName,
|
VolName: volName,
|
||||||
manager: manager,
|
manager: manager,
|
||||||
plugin: plugin,
|
plugin: plugin,
|
||||||
|
MetricsProvider: volume.NewMetricsStatFS(plugin.host.GetPodVolumeDir(podUID, utilstrings.EscapeQualifiedNameForDisk(iscsiPluginName), volName)),
|
||||||
},
|
},
|
||||||
mounter: mounter,
|
mounter: mounter,
|
||||||
exec: exec,
|
exec: exec,
|
||||||
|
@ -264,7 +271,7 @@ type iscsiDisk struct {
|
||||||
plugin *iscsiPlugin
|
plugin *iscsiPlugin
|
||||||
// Utility interface that provides API calls to the provider to attach/detach disks.
|
// Utility interface that provides API calls to the provider to attach/detach disks.
|
||||||
manager diskManager
|
manager diskManager
|
||||||
volume.MetricsNil
|
volume.MetricsProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
func (iscsi *iscsiDisk) GetPath() string {
|
func (iscsi *iscsiDisk) GetPath() string {
|
||||||
|
|
Loading…
Reference in New Issue