Skip to content

Commit

Permalink
Merge pull request #177 from joonas/feat/use-monolithic-push
Browse files Browse the repository at this point in the history
feat: Add option for using monolithic push
  • Loading branch information
flavio authored Oct 24, 2024
2 parents 7c75c33 + 30c0b71 commit f2fb2e9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,10 @@ impl Client {
data: &[u8],
digest: &str,
) -> Result<String> {
if self.config.use_monolithic_push {
return self.push_blob_monolithically(image_ref, data, digest).await;
}

match self.push_blob_chunked(image_ref, data, digest).await {
Ok(url) => Ok(url),
Err(OciDistributionError::SpecViolationError(violation)) => {
Expand Down Expand Up @@ -1852,6 +1856,9 @@ pub struct ClientConfig {
/// Accept invalid certificates. Defaults to false
pub accept_invalid_certificates: bool,

/// Use monolithic push for pushing blobs. Defaults to false
pub use_monolithic_push: bool,

/// A list of extra root certificate to trust. This can be used to connect
/// to servers using self-signed certificates
pub extra_root_certificates: Vec<Certificate>,
Expand Down Expand Up @@ -1916,6 +1923,7 @@ impl Default for ClientConfig {
#[cfg(feature = "native-tls")]
accept_invalid_hostnames: false,
accept_invalid_certificates: false,
use_monolithic_push: false,
extra_root_certificates: Vec::new(),
platform_resolver: Some(Box::new(current_platform_resolver)),
max_concurrent_upload: DEFAULT_MAX_CONCURRENT_UPLOAD,
Expand Down

0 comments on commit f2fb2e9

Please sign in to comment.