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 7007fc2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/scheduler/core/spreadconstraint/group_clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
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"
"k8s.io/utils/ptr"
)

// GroupClustersInfo indicate the cluster global view
Expand Down Expand Up @@ -146,7 +146,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
4 changes: 2 additions & 2 deletions pkg/scheduler/core/spreadconstraint/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"testing"

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

func TestIsSpreadConstraintExisted(t *testing.T) {
Expand Down Expand Up @@ -159,7 +159,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 7007fc2

Please sign in to comment.