Skip to content

Commit

Permalink
Using non-deprecated pointer package
Browse files Browse the repository at this point in the history
Signed-off-by: mszacillo <mszacillo@bloomberg.net>
  • Loading branch information
mszacillo committed Jul 5, 2024
1 parent afc3895 commit 6339c67
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions pkg/scheduler/core/spreadconstraint/group_clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ limitations under the License.
package spreadconstraint

import (
"k8s.io/utils/ptr"

clusterv1alpha1 "github.com/karmada-io/karmada/pkg/apis/cluster/v1alpha1"
policyv1alpha1 "github.com/karmada-io/karmada/pkg/apis/policy/v1alpha1"
workv1alpha2 "github.com/karmada-io/karmada/pkg/apis/work/v1alpha2"
"github.com/karmada-io/karmada/pkg/scheduler/framework"
"k8s.io/utils/pointer"
)

// GroupClustersInfo indicate the cluster global view
Expand Down Expand Up @@ -146,7 +147,7 @@ func (info *GroupClustersInfo) generateClustersInfo(clustersScore framework.Clus

sortClusters(info.Clusters, func(i *ClusterDetailInfo, j *ClusterDetailInfo) *bool {
if i.AvailableReplicas != j.AvailableReplicas {
return pointer.Bool(i.AvailableReplicas > j.AvailableReplicas)
return ptr.To(i.AvailableReplicas > j.AvailableReplicas)
}
return nil
})
Expand Down
5 changes: 3 additions & 2 deletions pkg/scheduler/core/spreadconstraint/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ import (
"reflect"
"testing"

"k8s.io/utils/ptr"

policyv1alpha1 "github.com/karmada-io/karmada/pkg/apis/policy/v1alpha1"
"k8s.io/utils/pointer"
)

func TestIsSpreadConstraintExisted(t *testing.T) {
Expand Down Expand Up @@ -159,7 +160,7 @@ func Test_sortClusters(t *testing.T) {
},
compareFunction: func(i *ClusterDetailInfo, j *ClusterDetailInfo) *bool {
if i.AvailableReplicas != j.AvailableReplicas {
return pointer.Bool(i.AvailableReplicas > j.AvailableReplicas)
return ptr.To(i.AvailableReplicas > j.AvailableReplicas)
}
return nil
},
Expand Down

0 comments on commit 6339c67

Please sign in to comment.