-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
default to using :latest tag for images
- Loading branch information
Carsten König
committed
Jul 3, 2024
1 parent
835cedf
commit da8f405
Showing
4 changed files
with
55 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ mod api_key; | |
mod credentials; | ||
mod docker; | ||
mod error; | ||
mod parse; | ||
mod random; | ||
mod routes; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
use crate::error::ImageParseError; | ||
|
||
pub fn parse_image_tag(input: String) -> Result<String, ImageParseError> { | ||
if input.is_empty() { | ||
return Err(ImageParseError::EmptyImage); | ||
} | ||
|
||
match input.split_once(':') { | ||
Some(("", _)) | Some((_, "")) => Err(ImageParseError::EmptyPart(input)), | ||
Some((image, tag)) => Ok(format!("{}:{}", image, tag)), | ||
None => Ok(format!("{}:latest", input)), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters