diff options
Diffstat (limited to 'lib/container_registry')
-rw-r--r-- | lib/container_registry/gitlab_api_client.rb | 2 | ||||
-rw-r--r-- | lib/container_registry/tag.rb | 13 |
2 files changed, 13 insertions, 2 deletions
diff --git a/lib/container_registry/gitlab_api_client.rb b/lib/container_registry/gitlab_api_client.rb index be99fa75ffe..2947dcb4b40 100644 --- a/lib/container_registry/gitlab_api_client.rb +++ b/lib/container_registry/gitlab_api_client.rb @@ -31,7 +31,7 @@ module ContainerRegistry def self.deduplicated_size(path) with_dummy_client(token_config: { type: :nested_repositories_token, path: path&.downcase }) do |client| - client.repository_details(path, sizing: :self_with_descendants)['size_bytes'] + client.repository_details(path&.downcase, sizing: :self_with_descendants)['size_bytes'] end end diff --git a/lib/container_registry/tag.rb b/lib/container_registry/tag.rb index 76188a937c0..bf44b74cf7b 100644 --- a/lib/container_registry/tag.rb +++ b/lib/container_registry/tag.rb @@ -4,7 +4,7 @@ module ContainerRegistry class Tag include Gitlab::Utils::StrongMemoize - attr_reader :repository, :name + attr_reader :repository, :name, :updated_at attr_writer :created_at delegate :registry, :client, to: :repository @@ -97,6 +97,17 @@ module ContainerRegistry instance_variable_set(ivar(:memoized_created_at), date) end + def updated_at=(string_value) + return unless string_value + + @updated_at = + begin + DateTime.iso8601(string_value) + rescue ArgumentError + nil + end + end + def layers return unless manifest |