File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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.
135135static 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
138138impl 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 ) ]
176170pub 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}
You can’t perform that action at this time.
0 commit comments