Skip to content

Commit

Permalink
switch case change simple!
Browse files Browse the repository at this point in the history
  • Loading branch information
jiuker committed May 20, 2022
1 parent 019bc24 commit 9bccf91
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions controllers/rabbitmqcluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,25 +395,7 @@ func (r *RabbitmqClusterReconciler) SetupWithManager(mgr ctrl.Manager) error {

func addResourceToIndex(rawObj client.Object) []string {
switch resourceObject := rawObj.(type) {
case *appsv1.StatefulSet:
owner := metav1.GetControllerOf(resourceObject)
return validateAndGetOwner(owner)
case *corev1.ConfigMap:
owner := metav1.GetControllerOf(resourceObject)
return validateAndGetOwner(owner)
case *corev1.Service:
owner := metav1.GetControllerOf(resourceObject)
return validateAndGetOwner(owner)
case *rbacv1.Role:
owner := metav1.GetControllerOf(resourceObject)
return validateAndGetOwner(owner)
case *rbacv1.RoleBinding:
owner := metav1.GetControllerOf(resourceObject)
return validateAndGetOwner(owner)
case *corev1.ServiceAccount:
owner := metav1.GetControllerOf(resourceObject)
return validateAndGetOwner(owner)
case *corev1.Secret:
case *appsv1.StatefulSet, *corev1.ConfigMap, *corev1.Service, *rbacv1.Role, *rbacv1.RoleBinding, *corev1.ServiceAccount, *corev1.Secret:
owner := metav1.GetControllerOf(resourceObject)
return validateAndGetOwner(owner)
default:
Expand Down

0 comments on commit 9bccf91

Please sign in to comment.