Skip to content

Commit

Permalink
clean: ensure cephcluster cleanup job runs
Browse files Browse the repository at this point in the history
The cleanup policy was not allowed to take effect during the
cluster cleanup. The finalizer was immediately be removed instead
of remaining until the operator has a chance to handle the cleanup
policy and internally remove the finalizer. Now the cleanup policy
is allowed to be applied and the cleanup job(s) will be started
to cleanup the host path and disks from OSDs.

Signed-off-by: Travis Nielsen <[email protected]>
  • Loading branch information
travisn committed Apr 4, 2024
1 parent a9dad50 commit 5f5dabb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/go-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ jobs:
kubectl rook-ceph --operator-namespace test-operator -n test-cluster destroy-cluster
sleep 1
kubectl get deployments -n test-cluster --no-headers| wc -l | (read n && [ $n -le 1 ] || { echo "the crs could not be deleted"; kubectl get all -n test-cluster; exit 1;})
sleep 5
kubectl -n rook-ceph get pod -l job-name=cluster-cleanup-job-minikube --no-headers | grep Completed || { echo "cluster cleanup job not found or failed"; kubectl get all -n test-cluster; exit 1;}
- name: collect common logs
if: always()
Expand Down
2 changes: 2 additions & 0 deletions pkg/crds/crds.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ func updatingFinalizers(ctx context.Context, clientsets k8sutil.ClientsetsInterf
if err != nil {
return err
}
logging.Info("Added cleanup policy to the cephcluster CR %q", resource)
return nil
}

jsonPatchData, _ := json.Marshal(DefaultResourceRemoveFinalizers)
Expand Down

0 comments on commit 5f5dabb

Please sign in to comment.