diff --git a/exp/addons/internal/controllers/clusterresourceset_controller.go b/exp/addons/internal/controllers/clusterresourceset_controller.go index 0bb4a35a4f1e..c17eb0cc5454 100644 --- a/exp/addons/internal/controllers/clusterresourceset_controller.go +++ b/exp/addons/internal/controllers/clusterresourceset_controller.go @@ -222,7 +222,7 @@ func (r *ClusterResourceSetReconciler) getClustersByClusterResourceSetSelector(c return nil, errors.Wrap(err, "failed to list clusters") } - clusters := make([]*clusterv1.Cluster, 0) + clusters := []*clusterv1.Cluster{} for i := range clusterList.Items { c := &clusterList.Items[i] if c.DeletionTimestamp.IsZero() { @@ -417,7 +417,7 @@ func (r *ClusterResourceSetReconciler) ensureResourceOwnerRef(ctx context.Contex // clusterToClusterResourceSet is mapper function that maps clusters to ClusterResourceSet. func (r *ClusterResourceSetReconciler) clusterToClusterResourceSet(o client.Object) []ctrl.Request { - result := make([]ctrl.Request, 0) + result := []ctrl.Request{} cluster, ok := o.(*clusterv1.Cluster) if !ok { @@ -455,7 +455,7 @@ func (r *ClusterResourceSetReconciler) clusterToClusterResourceSet(o client.Obje // resourceToClusterResourceSet is mapper function that maps resources to ClusterResourceSet. func (r *ClusterResourceSetReconciler) resourceToClusterResourceSet(o client.Object) []ctrl.Request { - result := make([]ctrl.Request, 0) + result := []ctrl.Request{} // Add all ClusterResourceSet owners. for _, owner := range o.GetOwnerReferences() {