Skip to content

Commit

Permalink
csi: check networkFence status before deleting
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
subhamkrai committed Feb 21, 2024
1 parent 6ce7b1f commit 0ace7cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/operator/ceph/cluster/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 0ace7cf

Please sign in to comment.