-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd-coreos-prune: Add build pruning after other actions #3988
cmd-coreos-prune: Add build pruning after other actions #3988
Conversation
src/cmd-coreos-prune
Outdated
@@ -172,8 +172,7 @@ def main(): | |||
prune_images(s3_client, current_build, images_to_keep, args.dry_run, bucket, prefix) | |||
# Fully prune releases that are very old including deleting the directory in s3 for that build. | |||
case "build": | |||
prune_build(s3_client, bucket, prefix, build_id, args.dry_run) | |||
pruned_build_ids.append(build_id) | |||
builds_to_prune.append(build_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
builds_to_prune.append(build_id) | |
# Since pruning a build prunes s3 for all architectures | |
# we'll prune later so that we do it only once and we | |
# make sure we've completed any architecture specific | |
# operations, (i.e. pruning aarch64 AMIs). | |
builds_to_prune.append(build_id) |
src/cmd-coreos-prune
Outdated
@@ -112,7 +112,7 @@ def main(): | |||
builds_json_data = json.load(f) | |||
# Original list of builds | |||
builds = builds_json_data["builds"] | |||
pruned_build_ids = [] | |||
builds_to_prune = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we should make this a set so we can't add an entry more than once, which is what I think the below code will be doing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True that, updating.
We wanna make every other action is run before we prune a build fully and delete the s3 dir. It makes sure the meta.json is still available if needed.
831401d
to
9e795a1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
We want to complete all other actions before fully pruning a build and deleting the S3 directory. This guarantees the
meta.json
file remains accessible if needed.