From bc932fb346048dd2a387d0b943d8140082c95e29 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 a2bb4ab862d1..9c333c9a72f8 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 }