Skip to content

Add proper clean up of jobs upon success

Ahmad Hassan requested to merge cleanup-jobs into master

Problem

We did not do clean ups properly which lead to hanging pod entries and jobs after a successful run. The problem becomes more damaging when a user attempts to disable the operator since running shared secrets will attempt to create rbac and will find that rbac was left in place uncleaned by the operator last run and so will fail.

The solution here is to delete jobs, pods and rbac after the job has successfully run allowing the operator to be disabled later and keeping a cleaner look in gitlab get pods|jobs

Note: The rbac part both creation and cleanups requires refactoring however this can be done in the next iteration

Closes: https://gitlab.com/charts/components/gitlab-operator/issues/30 cc: @marin @twk3 @WarheadsSE

Edited by Ahmad Hassan

Merge request reports