@@ -219,7 +219,7 @@ pub fn is_domain(value: &str) -> Result {
219219/// Tests for a string that conforms to the kubernetes-specific definition of a label in DNS (RFC 1123)
220220/// used in Namespace names, see: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-label-names
221221/// Maximum label length supported by k8s is 63 characters (minimum required).
222- pub fn is_rfc_1123_label ( value : & str ) -> Result {
222+ pub fn is_lowercase_rfc_1123_label ( value : & str ) -> Result {
223223 validate_all ( [
224224 validate_str_length ( value, RFC_1123_LABEL_MAX_LENGTH ) ,
225225 validate_str_regex (
@@ -233,7 +233,7 @@ pub fn is_rfc_1123_label(value: &str) -> Result {
233233
234234/// Tests for a string that conforms to the kubernetes-specific definition of a subdomain in DNS (RFC 1123)
235235/// used in ConfigMap names, see https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names
236- pub fn is_rfc_1123_subdomain ( value : & str ) -> Result {
236+ pub fn is_lowercase_rfc_1123_subdomain ( value : & str ) -> Result {
237237 validate_all ( [
238238 validate_str_length ( value, RFC_1123_SUBDOMAIN_MAX_LENGTH ) ,
239239 validate_str_regex (
@@ -247,7 +247,7 @@ pub fn is_rfc_1123_subdomain(value: &str) -> Result {
247247
248248/// Tests for a string that conforms to the kubernetes-specific definition of a label in DNS (RFC 1035)
249249/// used in Service names, see: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#rfc-1035-label-names
250- pub fn is_rfc_1035_label ( value : & str ) -> Result {
250+ pub fn is_lowercase_rfc_1035_label ( value : & str ) -> Result {
251251 validate_all ( [
252252 validate_str_length ( value, RFC_1035_LABEL_MAX_LENGTH ) ,
253253 validate_str_regex (
@@ -295,7 +295,7 @@ pub fn name_is_dns_label(name: &str, prefix: bool) -> Result {
295295 name = mask_trailing_dash ( name) ;
296296 }
297297
298- is_rfc_1035_label ( & name)
298+ is_lowercase_rfc_1035_label ( & name)
299299}
300300
301301/// Validates a namespace name.
@@ -373,7 +373,7 @@ mod tests {
373373 #[ case( "a$b" ) ]
374374 #[ case( & "a" . repeat( 254 ) ) ]
375375 fn is_rfc_1123_subdomain_fail ( #[ case] value : & str ) {
376- assert ! ( is_rfc_1123_subdomain ( value) . is_err( ) ) ;
376+ assert ! ( is_lowercase_rfc_1123_subdomain ( value) . is_err( ) ) ;
377377 }
378378
379379 #[ rstest]
@@ -419,7 +419,7 @@ mod tests {
419419 #[ case( "11.22.33.44.55" ) ]
420420 #[ case( & "a" . repeat( 253 ) ) ]
421421 fn is_rfc_1123_subdomain_pass ( #[ case] value : & str ) {
422- assert ! ( is_rfc_1123_subdomain ( value) . is_ok( ) ) ;
422+ assert ! ( is_lowercase_rfc_1123_subdomain ( value) . is_ok( ) ) ;
423423 // Every valid RFC1123 is also a valid domain
424424 assert ! ( is_domain( value) . is_ok( ) ) ;
425425 }
@@ -483,7 +483,7 @@ mod tests {
483483 #[ case( "1 2" ) ]
484484 #[ case( & "a" . repeat( 64 ) ) ]
485485 fn is_rfc_1035_label_fail ( #[ case] value : & str ) {
486- assert ! ( is_rfc_1035_label ( value) . is_err( ) ) ;
486+ assert ! ( is_lowercase_rfc_1035_label ( value) . is_err( ) ) ;
487487 }
488488
489489 #[ rstest]
@@ -495,6 +495,6 @@ mod tests {
495495 #[ case( "a--1--2--b" ) ]
496496 #[ case( & "a" . repeat( 63 ) ) ]
497497 fn is_rfc_1035_label_pass ( #[ case] value : & str ) {
498- assert ! ( is_rfc_1035_label ( value) . is_ok( ) ) ;
498+ assert ! ( is_lowercase_rfc_1035_label ( value) . is_ok( ) ) ;
499499 }
500500}
0 commit comments