Limit the maximum name length
Created by: wansir
Signed-off-by: hongming talonwan@yunify.com
fix: https://github.com/kubesphere/kubesphere/issues/3784
Limit the maximum name length, avoid accidentally deleting role bindings.
We use username as the label value when deleting resources in batch, If the label value is invalid, all resources will be deleted accidentally. The length of the username must be limited to ensure that the length of the UserReferenceLabel
is less than 64.
listOptions := metav1.ListOptions{
LabelSelector: labels.SelectorFromSet(labels.Set{iamv1alpha2.UserReferenceLabel: user.Name}).String(),
}