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 5, 2024
1 parent 0f3dfde commit 15ffbeb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/go-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,10 @@ jobs:
set -ex
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;})
kubectl -n test-cluster get deployments --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
node_name=$(kubectl get node --no-headers | awk '{print $1}')
kubectl -n test-cluster get pod -l job-name=cluster-cleanup-job-${node_name} --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 @@ -166,6 +166,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 15ffbeb

Please sign in to comment.