Skip to content

Commit 9daee96

Browse files
committed
chore(boil): Remove length checking from vendor version portion of the tag
We can't know how long the earlier part is at this point. Co-authored-by: Nick <10092581+NickLarsenNZ@users.noreply.github.com>
1 parent 6f1a715 commit 9daee96

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

rust/boil/src/cli/build.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -133,17 +133,11 @@ pub struct BuildArguments {
133133
// This is derived from the general rule where the length of the tag can be up to 128 chars
134134
// But that checking needs to be at a higher layer.
135135
static VALID_IMAGE_TAG: LazyLock<Regex> =
136-
LazyLock::new(|| Regex::new(r"^[a-zA-Z0-9_][a-zA-Z0-9_.-]{0,127}$").expect("regex is valid"));
136+
LazyLock::new(|| Regex::new(r"^[a-zA-Z0-9_][a-zA-Z0-9_.-]+$").expect("regex is valid"));
137137

138138
impl BuildArguments {
139139
/// Ensure that the given version will be valid for use in the image tag
140140
fn parse_image_version(version: &str) -> Result<String, ParseImageVersionError> {
141-
// TODO (@NickLarsenNZ): Probably want to minus the characters used in front (x.y.z-stackable).
142-
// But maybe that validation needs to go up a layer.
143-
if version.len() > 128 {
144-
return VersionTooLongSnafu.fail();
145-
}
146-
147141
if !VALID_IMAGE_TAG.is_match(version) {
148142
return ParseVersionSnafu { version }.fail();
149143
}
@@ -174,9 +168,6 @@ impl BuildArguments {
174168

175169
#[derive(Debug, Snafu)]
176170
pub enum ParseImageVersionError {
177-
#[snafu(display("The version exceeds the 128 character limit"))]
178-
VersionTooLong,
179-
180171
#[snafu(display("invalid image tag characters for {version:?}"))]
181172
ParseVersion { version: String },
182173
}

0 commit comments

Comments
 (0)