Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
spbro
OpenXG-RAN
Commits
a36ed24b
Commit
a36ed24b
authored
2 years ago
by
Sagar Arora
Committed by
Robert Schmidt
2 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make cluster images older than 4 weeks dangling so they are deleted
parent
2e215b09
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
ci-scripts/cls_cluster.py
ci-scripts/cls_cluster.py
+8
-0
No files found.
ci-scripts/cls_cluster.py
View file @
a36ed24b
...
...
@@ -230,6 +230,14 @@ class Cluster:
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'KO'
,
CONST
.
OC_PROJECT_FAIL
)
return
False
# delete old images by Sagar Arora <sagar.arora@openairinterface.org>:
# 1. retrieve all images and their timestamp
# 2. awk retrieves those whose timestamp is older than 4 weeks
# 3. issue delete command on corresponding istags (the images are dangling and will be cleaned by the registry)
delete_cmd
=
"oc get istag -o go-template --template '{{range .items}}{{.metadata.name}} {{.metadata.creationTimestamp}}{{
\"\\
n
\"
}}{{end}}' | awk '$2 <=
\"
'$(date -d '-4weeks' -Ins --utc | sed 's/+0000/Z/')'
\"
{ print $1 }' | xargs --no-run-if-empty oc delete istag"
response
=
self
.
cmd
.
run
(
delete_cmd
)
logging
.
debug
(
f"deleted images:
\n
{
response
.
stdout
}
"
)
self
.
_recreate_entitlements
()
status
=
True
# flag to abandon compiling if any image fails
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment