@@ -219,7 +219,7 @@ pub fn is_domain(value: &str) -> Result {
219
219
/// Tests for a string that conforms to the kubernetes-specific definition of a label in DNS (RFC 1123)
220
220
/// used in Namespace names, see: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-label-names
221
221
/// 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 {
223
223
validate_all ( [
224
224
validate_str_length ( value, RFC_1123_LABEL_MAX_LENGTH ) ,
225
225
validate_str_regex (
@@ -233,7 +233,7 @@ pub fn is_rfc_1123_label(value: &str) -> Result {
233
233
234
234
/// Tests for a string that conforms to the kubernetes-specific definition of a subdomain in DNS (RFC 1123)
235
235
/// 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 {
237
237
validate_all ( [
238
238
validate_str_length ( value, RFC_1123_SUBDOMAIN_MAX_LENGTH ) ,
239
239
validate_str_regex (
@@ -247,7 +247,7 @@ pub fn is_rfc_1123_subdomain(value: &str) -> Result {
247
247
248
248
/// Tests for a string that conforms to the kubernetes-specific definition of a label in DNS (RFC 1035)
249
249
/// 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 {
251
251
validate_all ( [
252
252
validate_str_length ( value, RFC_1035_LABEL_MAX_LENGTH ) ,
253
253
validate_str_regex (
@@ -295,7 +295,7 @@ pub fn name_is_dns_label(name: &str, prefix: bool) -> Result {
295
295
name = mask_trailing_dash ( name) ;
296
296
}
297
297
298
- is_rfc_1035_label ( & name)
298
+ is_lowercase_rfc_1035_label ( & name)
299
299
}
300
300
301
301
/// Validates a namespace name.
@@ -373,7 +373,7 @@ mod tests {
373
373
#[ case( "a$b" ) ]
374
374
#[ case( & "a" . repeat( 254 ) ) ]
375
375
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( ) ) ;
377
377
}
378
378
379
379
#[ rstest]
@@ -419,7 +419,7 @@ mod tests {
419
419
#[ case( "11.22.33.44.55" ) ]
420
420
#[ case( & "a" . repeat( 253 ) ) ]
421
421
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( ) ) ;
423
423
// Every valid RFC1123 is also a valid domain
424
424
assert ! ( is_domain( value) . is_ok( ) ) ;
425
425
}
@@ -483,7 +483,7 @@ mod tests {
483
483
#[ case( "1 2" ) ]
484
484
#[ case( & "a" . repeat( 64 ) ) ]
485
485
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( ) ) ;
487
487
}
488
488
489
489
#[ rstest]
@@ -495,6 +495,6 @@ mod tests {
495
495
#[ case( "a--1--2--b" ) ]
496
496
#[ case( & "a" . repeat( 63 ) ) ]
497
497
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( ) ) ;
499
499
}
500
500
}
0 commit comments