Protected containers: Delete protection
Context
This is part of Container Registry: Granular protection for rep... (&9825). See this epic's description for context. Here we'll focus on the described Delete protection
.
Change
-
Add a new attribute to image repositories on the Rails side ( container_repositories
table) to denote when they are locked against deletes; -
Allow frontend calls triggered by project owners/maintainers to toggle the delete protection for individual repositories; -
When a user requests a JWT token to allow them to delete against a given image repository, Rails should (within the container registry auth service) check if the corresponding repository is locked against deletes and refuse the request if so, effectively protecting the repository and all images within; -
Refuse frontend/API requests to delete a container repository if deletion protection is turned on for that repository.
-
Create a new project configuration section/setting where users can see the list of container repositories and toggle delete protection for them. Requires UX Design; -
Allow project owners/maintainers to toggle the delete protection for individual repositories; -
Display a special label (?) alongside container repositories with delete protection enabled in the repository list view. Requires UX Design.
-
Make it clear that changes to the delete protection policy will take up to N
minutes to come into effect, whereN
is the configured JWT token expiry. -
Make it clear that deletion protection does not apply to tag cleanup policies, those act on individual tags, this protection is for the repository as a whole.
Edited by João Pereira