Skip to content

Commit 2985f93

Browse files
committed
chore(oci): api updates per oci-distribution crate rev
Signed-off-by: Vaughn Dice <[email protected]>
1 parent 237cc1f commit 2985f93

File tree

3 files changed

+88
-30
lines changed

3 files changed

+88
-30
lines changed

Cargo.lock

Lines changed: 83 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/oci/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ docker_credential = "1.0"
1717
dirs = "4.0"
1818
futures-util = "0.3"
1919
itertools = "0.12.1"
20-
# TODO: use commit from fermyon/oci-distribution once required changes are in
21-
oci-distribution = { git = "https://github.com/vdice/oci-distribution", rev = "36b987cf433d25d968a717294fd07f3d6087869c" }
20+
oci-distribution = { git = "https://github.com/fermyon/oci-distribution", rev = "7e4ce9be9bcd22e78a28f06204931f10c44402ba" }
2221
reqwest = "0.11"
2322
serde = { version = "1.0", features = ["derive"] }
2423
serde_json = "1.0"

crates/oci/src/client.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ impl Client {
368368
// Assume that these bytes may represent the locked app config and write it as such.
369369
let mut cfg_bytes = Vec::new();
370370
self.oci
371-
.pull_blob(&reference, &manifest.config.digest, &mut cfg_bytes)
371+
.pull_blob(&reference, &manifest.config, &mut cfg_bytes)
372372
.await?;
373373
self.write_locked_app_config(&reference.to_string(), &cfg_bytes)
374374
.await
@@ -391,9 +391,7 @@ impl Client {
391391

392392
tracing::debug!("Pulling layer {}", &layer.digest);
393393
let mut bytes = Vec::with_capacity(layer.size.try_into()?);
394-
this.oci
395-
.pull_blob(&reference, &layer.digest, &mut bytes)
396-
.await?;
394+
this.oci.pull_blob(&reference, &layer, &mut bytes).await?;
397395
match layer.media_type.as_str() {
398396
SPIN_APPLICATION_MEDIA_TYPE => {
399397
this.write_locked_app_config(&reference.to_string(), &bytes)
@@ -569,13 +567,13 @@ impl Client {
569567
}
570568

571569
/// Insert a token in the OCI client token cache.
572-
pub fn insert_token(
570+
pub async fn insert_token(
573571
&mut self,
574572
reference: &Reference,
575573
op: RegistryOperation,
576574
token: RegistryTokenType,
577575
) {
578-
self.oci.tokens.insert(reference, op, token);
576+
self.oci.tokens.insert(reference, op, token).await;
579577
}
580578

581579
/// Validate the credentials by attempting to send an authenticated request to the registry.

0 commit comments

Comments
 (0)