From ff906e9799fdd961147898998bea6a83d33d3f39 Mon Sep 17 00:00:00 2001 From: sp98 Date: Mon, 24 Jul 2023 20:50:26 +0530 Subject: [PATCH] core: force delete rook-ceph-exporter pod Force delete rook-ceph-exporter pod that is stuck in terminating state due to unavailability of node. Signed-off-by: sp98 (cherry picked from commit dd90ef5db24bdea0654ebf04fbf6044ab070fd78) --- pkg/operator/ceph/cluster/cephstatus.go | 1 + pkg/operator/ceph/cluster/cephstatus_test.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/operator/ceph/cluster/cephstatus.go b/pkg/operator/ceph/cluster/cephstatus.go index c8045f5dbd23..9cc8ae5151a4 100644 --- a/pkg/operator/ceph/cluster/cephstatus.go +++ b/pkg/operator/ceph/cluster/cephstatus.go @@ -323,6 +323,7 @@ func (c *cephStatusChecker) getRookPodsOnNode(node string) ([]v1.Pod, error) { "rook-ceph-mgr", "rook-ceph-mds", "rook-ceph-rgw", + "rook-ceph-exporter", } podsOnNode := []v1.Pod{} listOpts := metav1.ListOptions{ diff --git a/pkg/operator/ceph/cluster/cephstatus_test.go b/pkg/operator/ceph/cluster/cephstatus_test.go index 1652d3051bc9..564f723163e0 100644 --- a/pkg/operator/ceph/cluster/cephstatus_test.go +++ b/pkg/operator/ceph/cluster/cephstatus_test.go @@ -335,6 +335,7 @@ func TestGetRookPodsOnNode(t *testing.T) { {"app": "rook-ceph-rgw"}, {"app": "user-app"}, {"app": "rook-ceph-mon"}, + {"app": "rook-ceph-exporter"}, } pod := v1.Pod{ @@ -362,7 +363,7 @@ func TestGetRookPodsOnNode(t *testing.T) { pods, err := c.getRookPodsOnNode("node0") assert.NoError(t, err) // A pod is having two matching labels and its returned only once - assert.Equal(t, 11, len(pods)) + assert.Equal(t, 12, len(pods)) podNames := []string{} for _, pod := range pods {