Skip to content
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

Attach a label to servers with their desired deletion date #29

Merged
merged 1 commit into from
Nov 1, 2023

Conversation

bastelfreak
Copy link
Member

This then enables us to periodically scan for images with a unix timestamp in the label that's smaller than now() and delete them.

@bastelfreak bastelfreak added the enhancement New feature or request label Oct 31, 2023
@bastelfreak bastelfreak self-assigned this Oct 31, 2023
@bastelfreak bastelfreak requested a review from ekohl October 31, 2023 23:05
Copy link

codecov bot commented Oct 31, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (41229a0) 92.30% compared to head (a745311) 93.10%.

❗ Current head a745311 differs from pull request most recent head 97e65a8. Consider uploading reports for the commit 97e65a8 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #29      +/-   ##
==========================================
+ Coverage   92.30%   93.10%   +0.79%     
==========================================
  Files           3        3              
  Lines          78       87       +9     
==========================================
+ Hits           72       81       +9     
  Misses          6        6              
Files Coverage Δ
lib/beaker/hypervisor/hcloud.rb 95.23% <100.00%> (+0.79%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

README.md Outdated Show resolved Hide resolved
README.md Outdated
Comment on lines 56 to 59
It's up to the user to scan for VMs where the `delete_vm_after` points to a
past timestamp and delete them.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a normal workflow VMs are deleted right? Only where the was some timeout are they not deleted? It's mentioned in the first sentence, but perhaps worth to make it explicit here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. I rephrased it so it's hopefully more clear.

README.md Outdated
Comment on lines 53 to 54
You can modify the default of an hour by setting the `BEAKER_HCLOUD_DELETE_VM_AFTER`
environment variable to any positive integer. It will be interpreted as hours.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd consider making it seconds, so there is a bit more fine grained control. The delete_vm_after is also in seconds (since it's a UNIX timestamp), so it'd be consistent.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I switched to seconds.

@bastelfreak bastelfreak force-pushed the label2 branch 6 times, most recently from 2b7d477 to 5afc510 Compare November 1, 2023 08:37
@bastelfreak
Copy link
Member Author

This requires tonobo/hcloud-ruby#84

@ekohl
Copy link
Member

ekohl commented Nov 1, 2023

I do see failing tests. Perhaps split up the PR?

This then enables us to periodically scan for images with a unix
timestamp in the label that's smaller than now() and delete them.

Co-authored-by: Ewoud Kohl van Wijngaarden <[email protected]>
@bastelfreak
Copy link
Member Author

@ekohl I pulled the second change into #30

@bastelfreak bastelfreak merged commit e151cf0 into voxpupuli:master Nov 1, 2023
8 checks passed
@bastelfreak bastelfreak deleted the label2 branch November 1, 2023 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants