Skip to content

Limit the maximum name length

Calvin Yu请求将github/fork/wansir/crd合并到master

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.

https://github.com/kubesphere/kubesphere/blob/v3.0.0/pkg/controller/user/user_controller.go#L556-L559

	listOptions := metav1.ListOptions{
		LabelSelector: labels.SelectorFromSet(labels.Set{iamv1alpha2.UserReferenceLabel: user.Name}).String(),
	}

合并请求报告