Add a Kyverno CleanupPolicy to delete the leftover volume of sync-openstack-images job

The current behavior of sync-openstack-images job is that after completion it leaves an orphan volume that is not being cleaned up.

This MR is fixing this issue, by adding a new label on the pods created by the job and a Kyverno CleanupPolicy that is matching the pods by the new added label. Once the parent job is completed, the pods are deleted, which leads to the deletion of the PVC/PV, leaving no orphan volumes in the cluster.

Related to sylva-projects/sylva-core#2224 (closed)

Tested in sylva-projects/sylva-core!7512 (closed)

Merge request reports

Loading