diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/image.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/image.rs b/src/image.rs index addf4ee..6c26e7c 100644 --- a/src/image.rs +++ b/src/image.rs @@ -449,12 +449,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. @@ -485,6 +493,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, |