Class: Aws::ECR::Types::ImageDetail
- Inherits:
-
Object
- Object
- Aws::ECR::Types::ImageDetail
- Defined in:
- lib/awsclean/aws_extensions.rb
Instance Attribute Summary collapse
-
#elegible_for_cleanup ⇒ Object
Returns the value of attribute elegible_for_cleanup.
-
#in_use ⇒ Object
Returns the value of attribute in_use.
-
#region ⇒ Object
Returns the value of attribute region.
Instance Method Summary collapse
- #days_since_creation ⇒ Object
- #image_uris ⇒ Object
- #repository_uri ⇒ Object
- #stale?(max_age) ⇒ Boolean
Instance Attribute Details
#elegible_for_cleanup ⇒ Object
Returns the value of attribute elegible_for_cleanup.
25 26 27 |
# File 'lib/awsclean/aws_extensions.rb', line 25 def elegible_for_cleanup @elegible_for_cleanup end |
#in_use ⇒ Object
Returns the value of attribute in_use.
25 26 27 |
# File 'lib/awsclean/aws_extensions.rb', line 25 def in_use @in_use end |
#region ⇒ Object
Returns the value of attribute region.
25 26 27 |
# File 'lib/awsclean/aws_extensions.rb', line 25 def region @region end |
Instance Method Details
#days_since_creation ⇒ Object
27 28 29 |
# File 'lib/awsclean/aws_extensions.rb', line 27 def days_since_creation (DateTime.now - image_pushed_at.to_datetime).to_i end |
#image_uris ⇒ Object
35 36 37 |
# File 'lib/awsclean/aws_extensions.rb', line 35 def image_uris ( || []).map { |tag| repository_uri << ':' << tag } end |
#repository_uri ⇒ Object
39 40 41 42 43 |
# File 'lib/awsclean/aws_extensions.rb', line 39 def repository_uri sprintf('%i.dkr.ecr.%s.amazonaws.com/%s', registry_id, region, repository_name, ) end |
#stale?(max_age) ⇒ Boolean
31 32 33 |
# File 'lib/awsclean/aws_extensions.rb', line 31 def stale?(max_age) days_since_creation >= max_age end |