Skip to content

Commit 6b33cd7

Browse files
committed
feat(oci): set token expiration for oci client
Signed-off-by: Vaughn Dice <[email protected]>
1 parent e198b9f commit 6b33cd7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

crates/oci/src/client.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ const MAX_LAYER_COUNT: usize = 500;
4848
/// rather than pushing as a separate layer
4949
const DEFAULT_CONTENT_REF_INLINE_MAX_SIZE: usize = 128;
5050

51+
/// Default token expiration when pushing/pulling an image to/from a registry.
52+
/// This value is used by the underyling OCI client when the token expiration
53+
/// is unspecified on a claim.
54+
/// This essentially equates to a timeout for push/pull.
55+
const DEFAULT_TOKEN_EXPIRATION_SECS: usize = 300;
56+
5157
/// Mode of assembly of a Spin application into an OCI image
5258
enum AssemblyMode {
5359
/// Assemble the application as one layer per component and one layer for
@@ -643,6 +649,7 @@ impl Client {
643649

644650
oci_distribution::client::ClientConfig {
645651
protocol,
652+
default_token_expiration_secs: DEFAULT_TOKEN_EXPIRATION_SECS,
646653
..Default::default()
647654
}
648655
}

0 commit comments

Comments
 (0)