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

elastic / cloudbeat / 14130641125
76%

Build:
DEFAULT BRANCH: main
Ran 28 Mar 2025 02:15PM UTC
Jobs 1
Files 224
Run time 6min
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:01PM UTC coverage: 76.142% (+0.3%) from 75.814%
14130641125

push

github

web-flow
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

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

9166 of 12038 relevant lines covered (76.14%)

16.5 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 14130641125.1 28 Mar 2025 02:15PM UTC 224
76.14
GitHub Action Run
Source Files on build 14130641125
  • Tree
  • List 224
  • Changed 4
  • Source Changed 0
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 8860b9d9 on github
  • Prev Build on main (#14082294124)
  • Next Build on main (#14166492896)
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