diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-21 00:11:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-21 00:11:36 +0300 |
commit | 61a1cd3b8389a7f5553bae90655710ed9b39ddff (patch) | |
tree | 52b9e65c4dbf1baf63a8ef52edc79f3eedfbf0d1 /app/models/namespace.rb | |
parent | 72c050db64bd61ae767f47c4fa2bc97b94a67592 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/namespace.rb')
-rw-r--r-- | app/models/namespace.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb index 252fb9aa308..b136c0ffac2 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -286,11 +286,15 @@ class Namespace < ApplicationRecord end def any_project_has_container_registry_tags? - all_projects.includes(:container_repositories).any?(&:has_container_registry_tags?) + first_project_with_container_registry_tags.present? end def first_project_with_container_registry_tags - all_projects.find(&:has_container_registry_tags?) + if Gitlab.com? && Feature.enabled?(:use_sub_repositories_api) + ContainerRegistry::GitlabApiClient.one_project_with_container_registry_tag(full_path) + else + all_projects.includes(:container_repositories).find(&:has_container_registry_tags?) + end end def send_update_instructions |