Skip to content

Developer role users do not see the cleanup schedule on a container registry

Summary

A container registry can have a schedule to cleanup projects defined.

When a user navigates to the container registry for a project they can see when the next cleanup is scheduled: e.g. https://gitlab.com/gitlab-org/gitlab/container_registry

If a user clicks on a specific image repository, they will see Cleanup disabled rendered if they do not have MAINTAINER or above permissions. https://gitlab.com/gitlab-org/gitlab/container_registry/3728789

The expected behaviour here should be that all users should be able to see the next cleanup schedule run time irregardless of permissions when they are inside an image repository.

image image image

Steps to reproduce

  1. Setup an environment that has container registry enabled
  2. Add a project, and follow steps in http://gdk.test:3000/{group}/{project}/container_registry to publish an image
  3. Under /{group}/{project}/-/settings/packages_and_registries click to setup 'Cleanup policies', and set config to run every day.
  4. Navigate to the

Example Project

What is the current bug behavior?

What is the expected correct behavior?

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

Implementation guide

Update authorization for the ContainerExpirationPolicyType from :admin_container_image to :read_container_image in https://gitlab.com/gitlab-org/gitlab/-/blob/b6d01670d3f1cf51ecf8d4347af119483f834aa2/app/graphql/types/container_expiration_policy_type.rb#L9

Edited by Rahul Chanila