csi: check networkFence status before deleting

earlier, we were only checking the specs of networkFence to see if
unfencing is done before proceeding with deletion but we should also
check the status of networkFence before proceeding with deletion.

Signed-off-by: subhamkrai <srai@redhat.com>
This commit is contained in:
subhamkrai
2024-02-21 21:52:55 +05:30
parent 6ce7b1f7d1
commit 0ace7cf8cf
+2 -2
View File
@@ -604,8 +604,8 @@ func (c *clientCluster) unfenceAndDeleteNetworkFence(ctx context.Context, node c
return false, err
}
if networkFence.Spec.FenceState != addonsv1alpha1.Unfenced {
logger.Infof("waiting for network fence CR %s to get in %s state before deletion", networkFence.Name, addonsv1alpha1.Unfenced)
if networkFence.Status.Message != addonsv1alpha1.UnFenceOperationSuccessfulMessage {
logger.Infof("waiting for network fence CR %q status to get result %q", networkFence.Name, addonsv1alpha1.UnFenceOperationSuccessfulMessage)
return false, err
}