From 4d3b1fc46f7d381f88e1ec859efb6204011cfd43 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Tue, 17 Oct 2023 13:55:38 +0200 Subject: [PATCH] util: if FilesystemNodeGetVolumeStats succeeds the volume is healthy When FilesystemNodeGetVolumeStats() succeeds, the volume must be healthy. This can be included in the VolumeCondition CSI message by default. Checks that detect an abnormal VolumeCondition should prevent calling FilesystemNodeGetVolumeStats() as it is possible that the function will hang. Signed-off-by: Niels de Vos --- internal/csi-common/utils.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/csi-common/utils.go b/internal/csi-common/utils.go index a2bb4ab86..9c333c9a7 100644 --- a/internal/csi-common/utils.go +++ b/internal/csi-common/utils.go @@ -312,6 +312,12 @@ func FilesystemNodeGetVolumeStats( }) } + // include marker for a healthy volume by default + res.VolumeCondition = &csi.VolumeCondition{ + Abnormal: false, + Message: "volume is in a healthy condition", + } + return res, nil }