Skip to content

Commit 39ca7ca

Browse files
adwk67Techassi
andauthored
Update rust/stackable-cockpit/src/oci.rs
Co-authored-by: Techassi <git@techassi.dev>
1 parent d4e3b32 commit 39ca7ca

File tree

1 file changed

+13
-10
lines changed
  • rust/stackable-cockpit/src

1 file changed

+13
-10
lines changed

rust/stackable-cockpit/src/oci.rs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,22 +95,25 @@ pub async fn get_oci_index<'a>() -> Result<HashMap<&'a str, ChartSourceMetadata>
9595
let mut page = 1;
9696
let page_size = 20;
9797

98-
while let Ok(artifacts_page) = client
99-
.get(format!(
98+
loop {
99+
let url = format!(
100100
"{}/projects/{}/repositories/{}/artifacts?page_size={}&page={}",
101101
base_url,
102102
encode(project_name),
103103
encode(repository_name),
104104
page_size,
105105
page
106-
))
107-
.send()
108-
.await
109-
.context(GetArtifactsSnafu)?
110-
.json::<Vec<Artifact>>()
111-
.await
112-
.context(ParseArtifactsSnafu)
113-
{
106+
);
107+
108+
let artifact_page = client
109+
.get(url)
110+
.send()
111+
.await
112+
.context(GetArtifactsSnafu)?
113+
.json::<Vec<Artifact>>()
114+
.await
115+
.context(ParseArtifactsSnafu)?;
116+
114117
let count = artifacts_page.len();
115118
artifacts.extend(artifacts_page);
116119
if count < page_size {

0 commit comments

Comments
 (0)