summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/container.rs5
-rw-r--r--src/image.rs13
2 files changed, 14 insertions, 4 deletions
diff --git a/src/container.rs b/src/container.rs
index dfd65d2..ad26238 100644
--- a/src/container.rs
+++ b/src/container.rs
@@ -365,9 +365,8 @@ impl<'docker> Container<'docker> {
.skip(1)
.collect::<std::path::PathBuf>(),
bytes,
- )
- .unwrap();
- let data = ar.into_inner().unwrap();
+ )?;
+ let data = ar.into_inner()?;
self.copy_to(Path::new("/"), data.into()).await?;
Ok(())
diff --git a/src/image.rs b/src/image.rs
index d32c472..f19dbad 100644
--- a/src/image.rs
+++ b/src/image.rs
@@ -445,12 +445,20 @@ impl PullOptions {
}
}
-#[derive(Default)]
pub struct PullOptionsBuilder {
auth: Option<RegistryAuth>,
params: HashMap<&'static str, String>,
}
+impl Default for PullOptionsBuilder {
+ fn default() -> Self {
+ let mut params = HashMap::new();
+ params.insert("tag", "latest".to_string());
+
+ PullOptionsBuilder { auth: None, params }
+ }
+}
+
impl PullOptionsBuilder {
/// Name of the image to pull. The name may include a tag or digest.
/// This parameter may only be used when pulling an image.
@@ -481,6 +489,9 @@ impl PullOptionsBuilder {
/// Repository name given to an image when it is imported. The repo may include a tag.
/// This parameter may only be used when importing an image.
+ ///
+ /// By default a `latest` tag is added when calling
+ /// [PullOptionsBuilder::default](PullOptionsBuilder::default].
pub fn repo<R>(
&mut self,
r: R,