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 {
|
match self.update_service_image(service).await {
|
||||||
Ok(Some(new_image)) => match self.replace_image_in_content(
|
Ok(Some(new_image)) => {
|
||||||
&new_content,
|
match self.replace_image_in_content(&new_content, service, &new_image) {
|
||||||
service,
|
Ok(replaced) => {
|
||||||
&new_image,
|
new_content = replaced;
|
||||||
) {
|
updated = true;
|
||||||
Ok(replaced) => {
|
info!(
|
||||||
new_content = replaced;
|
"Updated {}: {} -> {}",
|
||||||
updated = true;
|
service.service_name, service.image_ref, new_image
|
||||||
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) => {
|
Ok(None) => {
|
||||||
debug!(
|
debug!(
|
||||||
"No update needed for {}: {}",
|
"No update needed for {}: {}",
|
||||||
|
|
|
||||||
|
|
@ -198,8 +198,9 @@ impl Client {
|
||||||
// before and aborted the whole update run. Retry them with
|
// before and aborted the whole update run. Retry them with
|
||||||
// the same bounded, exponential backoff used for 429s.
|
// the same bounded, exponential backoff used for 429s.
|
||||||
if !is_transient_transport_error(&err) || attempt > MAX_RETRY_ATTEMPTS {
|
if !is_transient_transport_error(&err) || attempt > MAX_RETRY_ATTEMPTS {
|
||||||
return Err(anyhow::Error::new(err)
|
return Err(
|
||||||
.context(format!("{operation_name} failed")));
|
anyhow::Error::new(err).context(format!("{operation_name} failed"))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
warn!(
|
warn!(
|
||||||
|
|
@ -726,7 +727,8 @@ mod tests {
|
||||||
// Mixed semver and non-semver tags. The raw cursor must be the literal
|
// 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,
|
// 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.
|
// 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();
|
let (versions, raw_last_tag, raw_count) = client.parse_v2_response(body).unwrap();
|
||||||
|
|
||||||
assert_eq!(raw_count, 4);
|
assert_eq!(raw_count, 4);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue