Use the `expiration_policy_cleanup_status` to report the cleanup policy current status
Summary
- When a cleanup policy runs, the start timestamp is recorded in the container repository.
- When the cleanup policy completes successfully, the timestamp is removed
- When the cleanup policy execution times out, the timestamp is not removed
This timestamp is used by the UI to provide a warning that tells the user that the policy execution timed out.
The issue is that the timestamp is set during the execution so the UI has no way to tell if the cleanup policy is being executed or has timed out.
Improvements
- Update the UI to use the
expiration_policy_cleanup_status
field. This field has the following possible values:-
cleanup_unscheduled
: There is nothing in particular (default state) -
cleanup_scheduled
: A cleanup has been scheduled and it will be picked up by the backend shortly -
cleanup_ongoing
: The backend is currently executing the cleanup -
cleanup_unfinished
: The backend had to stop the cleanup and was not able to fully complete it (timeout)
-
- Update the frontend conditions so that the timed out message is displayed only when we are in
cleanup_unfinished
.
Risks
- I don't see a lot of risks but we could display the wrong information on the UI.
Testing
At the end to end level, not yet scheduled: Add test for container registry cleanup policy
Proposal
To subtly inform users of the status of their cleanup.
Cleanup_unscheduled |
---|
Cleanup_unscheduled should show the user the next time the cleanup policy for this project is scheduled to run. Note: There is no tooltip |
Cleanup_scheduled |
---|
Cleanup_scheduled should show users that the cleanup for this container repository will run soon |
Cleanup_ongoing |
---|
Cleanup_ongoing should tell users that cleanup is currently removing tags for this container repository |
Cleanup_unfinished |
---|
Cleanup_unfinished should tell users that cleanup ran but wasn't able to delete all tags. There should still be an alert informing users with more detail. @nmezzopera is this alert dismisable? |
Edited by Sofia Vistas