Skip to content

Commit

Permalink
better 'cannot clear enough space' + release
Browse files Browse the repository at this point in the history
  • Loading branch information
awoimbee committed Feb 21, 2025
1 parent 048288a commit a90dec8
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## v0.7.2 (unreleased)
## v0.7.2 (2025-02-21)

* Smoke test pulls from ecr instead of docker (#408)
* Remove dead code
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "trow"
version = "0.7.2-b1"
version = "0.7.2"
authors = []
edition = "2021"

Expand Down
4 changes: 2 additions & 2 deletions charts/trow/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Changelog

## v0.9.1 (unreleased)
## v0.10.0 (2025-02-21)

* Trow v0.7.2
* Add option to limit disk space usage

## v0.9.0 (2025-01-28)
## v0.9.0 - v0.9.1 (2025-01-28)

* The chart is now pulled via OCI (`oci://ghcr.io/trow-registry/charts/trow`)
* Upgrade trow to `v0.7.0`
Expand Down
4 changes: 2 additions & 2 deletions charts/trow/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ maintainers:
- name: awoimbee
url: https://github.com/awoimbee

version: 0.9.1
appVersion: 0.7.1
version: 0.10.0
appVersion: 0.7.2
11 changes: 7 additions & 4 deletions src/registry/garbage_collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ use crate::TrowServerState;

#[derive(Debug, thiserror::Error)]
pub enum GcError {
#[error("Could not reclaim enough space")]
CouldNotReclaimEnoughSpace,
#[error("DB error: {0}")]
DbError(#[from] sqlx::Error),
#[error("Storage backend error: {0}")]
Expand Down Expand Up @@ -65,8 +63,13 @@ async fn make_room(state: &TrowServerState, space_needed: Option<usize>) -> Resu
if let Some(space_required) = space_needed {
space_reclaimed +=
delete_old_proxied_images(state, space_required - space_reclaimed).await?;
if space_reclaimed < space_required {
tracing::warn!(
needed = bytes_humanstring(space_required),
"Could not reclaim enough space"
)
}
}

if space_reclaimed > 0 {
tracing::info!(
reclaimed = bytes_humanstring(space_reclaimed),
Expand Down Expand Up @@ -173,7 +176,7 @@ async fn delete_old_proxied_images(
while bytes_reclaimed < space_needed {
let blob_to_delete = match proxied_blobs.pop() {
Some(b) => b,
None => return Err(GcError::CouldNotReclaimEnoughSpace),
None => return Ok(bytes_reclaimed),
};

let manifests_to_delete = sqlx::query!(
Expand Down

0 comments on commit a90dec8

Please sign in to comment.