Skip to content

Commit

Permalink
Update rust/stackable-cockpit/src/oci.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Techassi <[email protected]>
  • Loading branch information
adwk67 and Techassi authored Jan 23, 2025
1 parent d4e3b32 commit 39ca7ca
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions rust/stackable-cockpit/src/oci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,22 +95,25 @@ pub async fn get_oci_index<'a>() -> Result<HashMap<&'a str, ChartSourceMetadata>
let mut page = 1;
let page_size = 20;

while let Ok(artifacts_page) = client
.get(format!(
loop {
let url = format!(
"{}/projects/{}/repositories/{}/artifacts?page_size={}&page={}",
base_url,
encode(project_name),
encode(repository_name),
page_size,
page
))
.send()
.await
.context(GetArtifactsSnafu)?
.json::<Vec<Artifact>>()
.await
.context(ParseArtifactsSnafu)
{
);

let artifact_page = client
.get(url)
.send()
.await
.context(GetArtifactsSnafu)?
.json::<Vec<Artifact>>()
.await
.context(ParseArtifactsSnafu)?;

let count = artifacts_page.len();

Check failure on line 117 in rust/stackable-cockpit/src/oci.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] rust/stackable-cockpit/src/oci.rs#L117

error[E0425]: cannot find value `artifacts_page` in this scope --> rust/stackable-cockpit/src/oci.rs:117:25 | 117 | let count = artifacts_page.len(); | ^^^^^^^^^^^^^^ help: a local variable with a similar name exists: `artifact_page`
Raw output
rust/stackable-cockpit/src/oci.rs:117:25:e:error[E0425]: cannot find value `artifacts_page` in this scope
   --> rust/stackable-cockpit/src/oci.rs:117:25
    |
117 |             let count = artifacts_page.len();
    |                         ^^^^^^^^^^^^^^ help: a local variable with a similar name exists: `artifact_page`


__END__

Check failure on line 117 in rust/stackable-cockpit/src/oci.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] rust/stackable-cockpit/src/oci.rs#L117

error[E0425]: cannot find value `artifacts_page` in this scope --> rust/stackable-cockpit/src/oci.rs:117:25 | 117 | let count = artifacts_page.len(); | ^^^^^^^^^^^^^^ help: a local variable with a similar name exists: `artifact_page`
Raw output
rust/stackable-cockpit/src/oci.rs:117:25:e:error[E0425]: cannot find value `artifacts_page` in this scope
   --> rust/stackable-cockpit/src/oci.rs:117:25
    |
117 |             let count = artifacts_page.len();
    |                         ^^^^^^^^^^^^^^ help: a local variable with a similar name exists: `artifact_page`


__END__
artifacts.extend(artifacts_page);

Check failure on line 118 in rust/stackable-cockpit/src/oci.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] rust/stackable-cockpit/src/oci.rs#L118

error[E0425]: cannot find value `artifacts_page` in this scope --> rust/stackable-cockpit/src/oci.rs:118:30 | 118 | artifacts.extend(artifacts_page); | ^^^^^^^^^^^^^^ help: a local variable with a similar name exists: `artifact_page`
Raw output
rust/stackable-cockpit/src/oci.rs:118:30:e:error[E0425]: cannot find value `artifacts_page` in this scope
   --> rust/stackable-cockpit/src/oci.rs:118:30
    |
118 |             artifacts.extend(artifacts_page);
    |                              ^^^^^^^^^^^^^^ help: a local variable with a similar name exists: `artifact_page`


__END__

Check failure on line 118 in rust/stackable-cockpit/src/oci.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] rust/stackable-cockpit/src/oci.rs#L118

error[E0425]: cannot find value `artifacts_page` in this scope --> rust/stackable-cockpit/src/oci.rs:118:30 | 118 | artifacts.extend(artifacts_page); | ^^^^^^^^^^^^^^ help: a local variable with a similar name exists: `artifact_page`
Raw output
rust/stackable-cockpit/src/oci.rs:118:30:e:error[E0425]: cannot find value `artifacts_page` in this scope
   --> rust/stackable-cockpit/src/oci.rs:118:30
    |
118 |             artifacts.extend(artifacts_page);
    |                              ^^^^^^^^^^^^^^ help: a local variable with a similar name exists: `artifact_page`


__END__
if count < page_size {
Expand Down

0 comments on commit 39ca7ca

Please sign in to comment.