Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-07-20 06:09:04 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-07-20 06:09:04 +0300
commit514ada7cc9af49117d6cf63966925e21d137933e (patch)
treebdde498a0c79644def9665fa4f7c05bc6b531295 /app/models/container_registry
parentf0e9d20cd8b273b2bbefd8c2cde3f63247feb61c (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/container_registry')
-rw-r--r--app/models/container_registry/event.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/models/container_registry/event.rb b/app/models/container_registry/event.rb
index 47d21d21afd..d4075e1ff1b 100644
--- a/app/models/container_registry/event.rb
+++ b/app/models/container_registry/event.rb
@@ -6,6 +6,7 @@ module ContainerRegistry
ALLOWED_ACTIONS = %w(push delete).freeze
PUSH_ACTION = 'push'
+ DELETE_ACTION = 'delete'
EVENT_TRACKING_CATEGORY = 'container_registry:notification'
attr_reader :event
@@ -41,6 +42,10 @@ module ContainerRegistry
event['target'].has_key?('tag')
end
+ def target_digest?
+ event['target'].has_key?('digest')
+ end
+
def target_repository?
!target_tag? && event['target'].has_key?('repository')
end
@@ -53,6 +58,10 @@ module ContainerRegistry
PUSH_ACTION == action
end
+ def action_delete?
+ DELETE_ACTION == action
+ end
+
def container_repository_exists?
return unless container_registry_path
@@ -74,7 +83,7 @@ module ContainerRegistry
def update_project_statistics
return unless supported?
- return unless target_tag?
+ return unless target_tag? || (action_delete? && target_digest?)
return unless project
Rails.cache.delete(project.root_ancestor.container_repositories_size_cache_key)