@@ -377,24 +377,27 @@ macro_rules! attributed_string_type {
377377 . combine( attributed_string_type!( @regex $( $attribute) * ) )
378378 } ;
379379 ( @regex is_rfc_1035_label_name $( $attribute: tt) * ) => {
380- $crate:: framework:: macros:: attributed_string_type:: Regex :: Expression ( stackable_operator:: validation:: LOWERCASE_RFC_1035_LABEL_FMT )
380+ // see https://github.com/kubernetes/kubernetes/blob/v1.35.0/staging/src/k8s.io/apimachinery/pkg/util/validation/validation.go#L228
381+ $crate:: framework:: macros:: attributed_string_type:: Regex :: Expression ( "^[a-z]([-a-z0-9]*[a-z0-9])?$" )
381382 . combine( attributed_string_type!( @regex $( $attribute) * ) )
382383 } ;
383384 ( @regex is_rfc_1123_dns_subdomain_name $( $attribute: tt) * ) => {
384- $crate:: framework:: macros:: attributed_string_type:: Regex :: Expression ( stackable_operator:: validation:: LOWERCASE_RFC_1123_SUBDOMAIN_FMT )
385+ // see https://github.com/kubernetes/kubernetes/blob/v1.35.0/staging/src/k8s.io/apimachinery/pkg/util/validation/validation.go#L193
386+ $crate:: framework:: macros:: attributed_string_type:: Regex :: Expression ( "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\ .[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" )
385387 . combine( attributed_string_type!( @regex $( $attribute) * ) )
386388 } ;
387389 ( @regex is_rfc_1123_label_name $( $attribute: tt) * ) => {
388- $crate:: framework:: macros:: attributed_string_type:: Regex :: Expression ( stackable_operator:: validation:: LOWERCASE_RFC_1123_LABEL_FMT )
390+ // see https://github.com/kubernetes/kubernetes/blob/v1.35.0/staging/src/k8s.io/apimachinery/pkg/util/validation/validation.go#L163
391+ $crate:: framework:: macros:: attributed_string_type:: Regex :: Expression ( "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" )
389392 . combine( attributed_string_type!( @regex $( $attribute) * ) )
390393 } ;
391394 ( @regex is_valid_label_value $( $attribute: tt) * ) => {
392395 // regular expression from stackable_operator::kvp::label::LABEL_VALUE_REGEX
393- $crate:: framework:: macros:: attributed_string_type:: Regex :: Expression ( "[a-z0-9A-Z]([a-z0-9A-Z-_.]*[a-z0-9A-Z]+)?" )
396+ $crate:: framework:: macros:: attributed_string_type:: Regex :: Expression ( "^ [a-z0-9A-Z]([a-z0-9A-Z-_.]*[a-z0-9A-Z]+)?$ " )
394397 . combine( attributed_string_type!( @regex $( $attribute) * ) )
395398 } ;
396399 ( @regex is_uid $( $attribute: tt) * ) => {
397- $crate:: framework:: macros:: attributed_string_type:: Regex :: Expression ( "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}" )
400+ $crate:: framework:: macros:: attributed_string_type:: Regex :: Expression ( "^ [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$ " )
398401 . combine( attributed_string_type!( @regex $( $attribute) * ) )
399402 } ;
400403
0 commit comments