UPSTREAM: 60632: Add volumemetrics for ISCSI Plugin
@@ -112,6 +112,13 @@ 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,
@@ -168,6 +175,7 @@ func (plugin *iscsiPlugin) newUnmounterInternal(volName string, podUID types.UID
VolName: volName,
manager: manager,
plugin: plugin,
+ MetricsProvider: volume.NewMetricsStatFS(plugin.host.GetPodVolumeDir(podUID, utilstrings.EscapeQualifiedNameForDisk(iscsiPluginName), volName)),
},
mounter: mounter,
exec: exec,
@@ -264,7 +272,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 {
