• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

elastic / cloudbeat / 14131670707
76%
main: 76%

Build:
Build:
LAST BUILD BRANCH: renovate/main-github.com-go-chi-chi-5.x
DEFAULT BRANCH: main
Ran 28 Mar 2025 03:06PM UTC
Jobs 1
Files 224
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Mar 2025 02:52PM UTC coverage: 76.021% (+0.3%) from 75.69%
14131670707

push

github

web-flow
[8.x](backport #3143) cnvm: Delete old snapshots on startup (#3151)

cnvm: Delete old snapshots on startup (#3143)

### Summary of your changes

Change CNVM to add a background job cleaning up old snapshots.

The logic here is:
1. Background routine is started. Since the amount of leftover snapshots can be quite high (e.g. 40k in our account),  3 cleanup workers are used
2. `IterOwnedSnapshots()` is called which goes over all snapshots, returning an iterator. Snapshots are selected if:
    1. They are more than 48 hours old
    2. They have a tag with key "Name" and value starting with "elastic-vulnerability"
    3. They are "self-owned"
3. Cleanup returns. On context cancelled, no extra grace period is added so the process doesn't block restarts/shutdown.

### Screenshot/Data

Deleted 1178 snapshots from `2025-03-25T16:17:08.384Z` to `2025-03-25T16:20:19.504Z`

### Related Issues

Closes https://github.com/elastic/cloudbeat/issues/3105
Closes https://github.com/elastic/sdh-security-team/issues/1168

### Checklist
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] I have added the necessary README/documentation (if appropriate)

#### Introducing a new rule?
No

(cherry picked from commit 8860b9d9c)

Co-authored-by: Orestis Floros <orestis.floros@elastic.co>

96 of 101 new or added lines in 4 files covered. (95.05%)

9099 of 11969 relevant lines covered (76.02%)

16.19 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
33.33
33.33% internal/resources/providers/awslib/ec2/ebs_snapshot.go
3
77.57
4.1% internal/resources/providers/awslib/ec2/provider.go
Jobs
ID Job ID Ran Files Coverage
1 14131670707.1 28 Mar 2025 03:06PM UTC 224
76.02
GitHub Action Run
Source Files on build 14131670707
  • Tree
  • List 224
  • Changed 4
  • Source Changed 0
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 8cffd34a on github
  • Prev Build on 8.x (#14061399707)
  • Next Build on 8.x (#14167864694)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc