fmt
This commit is contained in:
parent
30afb977ff
commit
71654a6fe2
2 changed files with 21 additions and 21 deletions
|
|
@ -102,25 +102,23 @@ impl ComposeUpdater {
|
|||
}
|
||||
|
||||
match self.update_service_image(service).await {
|
||||
Ok(Some(new_image)) => match self.replace_image_in_content(
|
||||
&new_content,
|
||||
service,
|
||||
&new_image,
|
||||
) {
|
||||
Ok(replaced) => {
|
||||
new_content = replaced;
|
||||
updated = true;
|
||||
info!(
|
||||
"Updated {}: {} -> {}",
|
||||
service.service_name, service.image_ref, new_image
|
||||
);
|
||||
Ok(Some(new_image)) => {
|
||||
match self.replace_image_in_content(&new_content, service, &new_image) {
|
||||
Ok(replaced) => {
|
||||
new_content = replaced;
|
||||
updated = true;
|
||||
info!(
|
||||
"Updated {}: {} -> {}",
|
||||
service.service_name, service.image_ref, new_image
|
||||
);
|
||||
}
|
||||
Err(e) => {
|
||||
let msg = format!("service {}: {:#}", service.service_name, e);
|
||||
warn!("Failed to update {} in {}", msg, file_path);
|
||||
errors.push(msg);
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
let msg = format!("service {}: {:#}", service.service_name, e);
|
||||
warn!("Failed to update {} in {}", msg, file_path);
|
||||
errors.push(msg);
|
||||
}
|
||||
},
|
||||
}
|
||||
Ok(None) => {
|
||||
debug!(
|
||||
"No update needed for {}: {}",
|
||||
|
|
|
|||
|
|
@ -198,8 +198,9 @@ impl Client {
|
|||
// before and aborted the whole update run. Retry them with
|
||||
// the same bounded, exponential backoff used for 429s.
|
||||
if !is_transient_transport_error(&err) || attempt > MAX_RETRY_ATTEMPTS {
|
||||
return Err(anyhow::Error::new(err)
|
||||
.context(format!("{operation_name} failed")));
|
||||
return Err(
|
||||
anyhow::Error::new(err).context(format!("{operation_name} failed"))
|
||||
);
|
||||
}
|
||||
|
||||
warn!(
|
||||
|
|
@ -726,7 +727,8 @@ mod tests {
|
|||
// Mixed semver and non-semver tags. The raw cursor must be the literal
|
||||
// last tag (even though it is not semver) so pagination advances past it,
|
||||
// and the raw count must include every tag for the scan budget.
|
||||
let body = r#"{"name":"linuxserver/radarr","tags":["6.1.0","6.1.1","latest","amd64-nightly"]}"#;
|
||||
let body =
|
||||
r#"{"name":"linuxserver/radarr","tags":["6.1.0","6.1.1","latest","amd64-nightly"]}"#;
|
||||
let (versions, raw_last_tag, raw_count) = client.parse_v2_response(body).unwrap();
|
||||
|
||||
assert_eq!(raw_count, 4);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue