Unverified Commit da2a8ff0 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #60632 from humblec/iscsi-metrics

Automatic merge from submit-queue (batch tested with PRs 60632, 60806, 59471, 61251, 61013). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Add volumemetrics for ISCSI Plugin. Signed-off-by: 's avatarHumble Chirammal <hchiramm@redhat.com> **What this PR does / why we need it**: **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes # **Special notes for your reviewer**: **Release note**: ```release-note ```
parents 092f1d52 2f9f7820
......@@ -112,6 +112,12 @@ func (plugin *iscsiPlugin) newMounterInternal(spec *volume.Spec, podUID types.UI
if err != nil {
return nil, err
}
if iscsiDisk != nil {
//Add volume metrics
iscsiDisk.MetricsProvider = volume.NewMetricsStatFS(iscsiDisk.GetPath())
}
return &iscsiDiskMounter{
iscsiDisk: iscsiDisk,
fsType: fsType,
......@@ -164,10 +170,11 @@ func (plugin *iscsiPlugin) NewUnmounter(volName string, podUID types.UID) (volum
func (plugin *iscsiPlugin) newUnmounterInternal(volName string, podUID types.UID, manager diskManager, mounter mount.Interface, exec mount.Exec) (volume.Unmounter, error) {
return &iscsiDiskUnmounter{
iscsiDisk: &iscsiDisk{
podUID: podUID,
VolName: volName,
manager: manager,
plugin: plugin,
podUID: podUID,
VolName: volName,
manager: manager,
plugin: plugin,
MetricsProvider: volume.NewMetricsStatFS(plugin.host.GetPodVolumeDir(podUID, utilstrings.EscapeQualifiedNameForDisk(iscsiPluginName), volName)),
},
mounter: mounter,
exec: exec,
......@@ -264,7 +271,7 @@ type iscsiDisk struct {
plugin *iscsiPlugin
// Utility interface that provides API calls to the provider to attach/detach disks.
manager diskManager
volume.MetricsNil
volume.MetricsProvider
}
func (iscsi *iscsiDisk) GetPath() string {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment