Skip to content

Commit

Permalink
fedora-ostree-pruner: drop hardcoding of test mode; limit to compose …
Browse files Browse the repository at this point in the history
…repo

We're in a position right now where we need to recover some space but
Kevin Fenzi is out on a much deserved break. Let's make this script
start taking real action by unsetting `args.test = True`, but let's
be conservative and only operate on the compose repo for now until
Kevin gets back.

In the most recent test this got us 1.2T in space back:

```
Total objects: 10768149
Would delete: 7437430 objects, freeing 1.2 TB
```
  • Loading branch information
dustymabe committed Dec 14, 2022
1 parent 575b0b1 commit 5690b6b
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions fedora-ostree-pruner/fedora-ostree-pruner
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,6 @@ def main():
help="Loop forever, run once a week.", action='store_true')
args = parser.parse_args()

# set args.test = True for now. Once we have proved
# everything out in prod and the logs look good we'll
# delete this code.
args.test = True

# on startup let's print out the config that was generated
logger.info('The configured policy is: \n%s' %
pprint.pformat(PROD_REF_POLICIES, indent=8))
Expand All @@ -255,7 +250,7 @@ def main():

# Prune the compose and the prod repo based on policy
prune_compose_repo(args.test)
prune_prod_repo(args.test)
#prune_prod_repo(args.test)

# If we were asked to run in a loop, then run once a week on
# Saturday.
Expand All @@ -267,7 +262,7 @@ def main():
day = days[datetime.date.today().weekday()]
if day == 'Saturday':
prune_compose_repo(args.test)
prune_prod_repo(args.test)
#prune_prod_repo(args.test)
else:
logger.info(f"Today is {day}. Sleeping...")

Expand Down

0 comments on commit 5690b6b

Please sign in to comment.