@@ -45,8 +45,6 @@ func splitName(_ name: String) throws -> (String, String) {
4545 return ( String ( tagSplit [ 0 ] ) , String ( tagSplit [ 1 ] ) )
4646}
4747
48- /// Repository refers a repository (image namespace) on a container registry
49-
5048/// ImageReference points to an image stored on a container registry
5149public struct ImageReference : Sendable , Equatable , CustomStringConvertible , CustomDebugStringConvertible {
5250 /// The registry which contains this image
@@ -111,6 +109,7 @@ public struct ImageReference: Sendable, Equatable, CustomStringConvertible, Cust
111109}
112110
113111extension ImageReference {
112+ /// Repository refers a repository (image namespace) on a container registry
114113 public struct Repository : Sendable , Equatable , CustomStringConvertible , CustomDebugStringConvertible {
115114 var value : String
116115
@@ -121,6 +120,10 @@ extension ImageReference {
121120 throw RepositoryParseError . emptyString
122121 }
123122
123+ if ( rawValue. contains { $0. isUppercase } ) {
124+ throw RepositoryParseError . containsUppercaseLetters ( rawValue)
125+ }
126+
124127 value = rawValue
125128 }
126129
@@ -134,7 +137,8 @@ extension ImageReference {
134137 }
135138 }
136139
137- public enum RepositoryParseError : Error {
140+ public enum RepositoryParseError : Error , Equatable {
138141 case emptyString
142+ case containsUppercaseLetters( String )
139143 }
140144}
0 commit comments