File tree 4 files changed +16
-4
lines changed
4 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -20,10 +20,10 @@ type: application
20
20
# This is the chart version. This version number should be incremented each time you make changes
21
21
# to the chart and its templates, including the app version.
22
22
# Versions are expected to follow Semantic Versioning (https://semver.org/)
23
- version : 0.3.1
23
+ version : 0.3.2
24
24
25
25
# This is the version number of the application being deployed. This version number should be
26
26
# incremented each time you make changes to the application. Versions are not expected to
27
27
# follow Semantic Versioning. They should reflect the version the application is using.
28
28
# It is recommended to use it with quotes.
29
- appVersion : " 0.3.1 "
29
+ appVersion : " 0.3.2 "
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ Deploys a job that cleans up an ECR repo based on the following rules.
6
6
3 . Has the container been tagged with the word ` keep `
7
7
4 . Is the container the only tag in the ECR repository
8
8
9
- ![ Version: 0.3.1 ] ( https://img.shields.io/badge/Version-0.3.1 -informational?style=flat-square ) ![ Type: application] ( https://img.shields.io/badge/Type-application-informational?style=flat-square ) ![ AppVersion: 0.3.1 ] ( https://img.shields.io/badge/AppVersion-0.3.1 -informational?style=flat-square )
9
+ ![ Version: 0.3.2 ] ( https://img.shields.io/badge/Version-0.3.2 -informational?style=flat-square ) ![ Type: application] ( https://img.shields.io/badge/Type-application-informational?style=flat-square ) ![ AppVersion: 0.3.2 ] ( https://img.shields.io/badge/AppVersion-0.3.2 -informational?style=flat-square )
10
10
11
11
## Values
12
12
Original file line number Diff line number Diff line change @@ -176,6 +176,18 @@ def get_ecr_images(
176
176
logger .info (
177
177
f"Image { repository ['repository_uri' ]} @{ imageDetails [0 ]['imageDigest' ]} is the only image in the repository skipping"
178
178
)
179
+ if "lastRecordedPullTime" in imageDetails :
180
+ last_pull_time = imageDetails ["lastRecordedPullTime" ]
181
+ localized_now_ts = UTC .localize (datetime .now () - timedelta (7 ))
182
+ if last_pull_time > localized_now_ts :
183
+ logger .debug ("The last pulltime was more than 7 days ago" )
184
+ logger .info (
185
+ f"Image { repository ['repository_uri' ]} @{ imageDetails [0 ]['imageDigest' ]} is the only image in the repository skipping and hasn't been pulled in 7 days, consider deleting"
186
+ )
187
+ else :
188
+ logger .info (
189
+ f"Image { repository ['repository_uri' ]} @{ imageDetails [0 ]['imageDigest' ]} is the only image in the repository skipping and hasn't been pulled in 7 days, consider deleting"
190
+ )
179
191
break
180
192
images = append_image (images , imageDetails , repository )
181
193
Original file line number Diff line number Diff line change 1
1
[tool .poetry ]
2
2
name = " ecr-image-cleanup-job"
3
- version = " 0.2.1 "
3
+ version = " 0.3.2 "
4
4
description = " "
5
5
authors = [
" Hans Knecht <[email protected] >" ]
6
6
readme = " README.md"
You can’t perform that action at this time.
0 commit comments