mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-12-08 02:15:27 +00:00
pkg/scheduler: Replace deprecated func usage from the k8s.io/utils/pointer pkg
This commit is contained in:
@@ -35,7 +35,7 @@ import (
|
||||
fakeframework "k8s.io/kubernetes/pkg/scheduler/framework/fake"
|
||||
st "k8s.io/kubernetes/pkg/scheduler/testing"
|
||||
volumeutil "k8s.io/kubernetes/pkg/volume/util"
|
||||
utilpointer "k8s.io/utils/pointer"
|
||||
"k8s.io/utils/pointer"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -638,7 +638,7 @@ func getNodeWithPodAndVolumeLimits(limitSource string, pods []*v1.Pod, limit int
|
||||
}
|
||||
if addLimits {
|
||||
driver.Allocatable = &storagev1.VolumeNodeResources{
|
||||
Count: utilpointer.Int32Ptr(int32(limit)),
|
||||
Count: pointer.Int32(int32(limit)),
|
||||
}
|
||||
}
|
||||
csiNode.Spec.Drivers = append(csiNode.Spec.Drivers, driver)
|
||||
|
||||
@@ -31,7 +31,7 @@ import (
|
||||
fakeframework "k8s.io/kubernetes/pkg/scheduler/framework/fake"
|
||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/feature"
|
||||
st "k8s.io/kubernetes/pkg/scheduler/testing"
|
||||
utilpointer "k8s.io/utils/pointer"
|
||||
"k8s.io/utils/pointer"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -792,14 +792,14 @@ func getFakePVCLister(filterName string) fakeframework.PersistentVolumeClaimList
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "unboundPVCWithDefaultSCPod"},
|
||||
Spec: v1.PersistentVolumeClaimSpec{
|
||||
VolumeName: "",
|
||||
StorageClassName: utilpointer.StringPtr("standard-sc"),
|
||||
StorageClassName: pointer.String("standard-sc"),
|
||||
},
|
||||
},
|
||||
{
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "unboundPVCWithInvalidSCPod"},
|
||||
Spec: v1.PersistentVolumeClaimSpec{
|
||||
VolumeName: "",
|
||||
StorageClassName: utilpointer.StringPtr("invalid-sc"),
|
||||
StorageClassName: pointer.String("invalid-sc"),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -86,8 +86,8 @@ func TestPreScoreStateEmptyNodes(t *testing.T) {
|
||||
},
|
||||
IgnoredNodes: sets.NewString(),
|
||||
TopologyPairToPodCounts: map[topologyPair]*int64{
|
||||
{key: "zone", value: "zone1"}: pointer.Int64Ptr(0),
|
||||
{key: "zone", value: "zone2"}: pointer.Int64Ptr(0),
|
||||
{key: "zone", value: "zone1"}: pointer.Int64(0),
|
||||
{key: "zone", value: "zone2"}: pointer.Int64(0),
|
||||
},
|
||||
TopologyNormalizingWeight: []float64{topologyNormalizingWeight(2), topologyNormalizingWeight(3)},
|
||||
},
|
||||
@@ -127,7 +127,7 @@ func TestPreScoreStateEmptyNodes(t *testing.T) {
|
||||
},
|
||||
IgnoredNodes: sets.NewString("node-x"),
|
||||
TopologyPairToPodCounts: map[topologyPair]*int64{
|
||||
{key: "zone", value: "zone1"}: pointer.Int64Ptr(0),
|
||||
{key: "zone", value: "zone1"}: pointer.Int64(0),
|
||||
},
|
||||
TopologyNormalizingWeight: []float64{topologyNormalizingWeight(1), topologyNormalizingWeight(2)},
|
||||
},
|
||||
@@ -169,8 +169,8 @@ func TestPreScoreStateEmptyNodes(t *testing.T) {
|
||||
},
|
||||
IgnoredNodes: sets.NewString(),
|
||||
TopologyPairToPodCounts: map[topologyPair]*int64{
|
||||
{key: v1.LabelTopologyZone, value: "mars"}: pointer.Int64Ptr(0),
|
||||
{key: v1.LabelTopologyZone, value: ""}: pointer.Int64Ptr(0),
|
||||
{key: v1.LabelTopologyZone, value: "mars"}: pointer.Int64(0),
|
||||
{key: v1.LabelTopologyZone, value: ""}: pointer.Int64(0),
|
||||
},
|
||||
TopologyNormalizingWeight: []float64{topologyNormalizingWeight(4), topologyNormalizingWeight(2)},
|
||||
},
|
||||
@@ -220,7 +220,7 @@ func TestPreScoreStateEmptyNodes(t *testing.T) {
|
||||
},
|
||||
IgnoredNodes: sets.NewString(),
|
||||
TopologyPairToPodCounts: map[topologyPair]*int64{
|
||||
{key: "planet", value: "mars"}: pointer.Int64Ptr(0),
|
||||
{key: "planet", value: "mars"}: pointer.Int64(0),
|
||||
},
|
||||
TopologyNormalizingWeight: []float64{topologyNormalizingWeight(1), topologyNormalizingWeight(1)},
|
||||
},
|
||||
@@ -284,7 +284,7 @@ func TestPreScoreStateEmptyNodes(t *testing.T) {
|
||||
},
|
||||
IgnoredNodes: sets.NewString(),
|
||||
TopologyPairToPodCounts: map[topologyPair]*int64{
|
||||
{"planet", "mars"}: pointer.Int64Ptr(0),
|
||||
{"planet", "mars"}: pointer.Int64(0),
|
||||
},
|
||||
TopologyNormalizingWeight: []float64{topologyNormalizingWeight(1)},
|
||||
},
|
||||
@@ -316,8 +316,8 @@ func TestPreScoreStateEmptyNodes(t *testing.T) {
|
||||
},
|
||||
IgnoredNodes: sets.NewString(),
|
||||
TopologyPairToPodCounts: map[topologyPair]*int64{
|
||||
{key: "zone", value: "zone1"}: pointer.Int64Ptr(0),
|
||||
{key: "zone", value: "zone2"}: pointer.Int64Ptr(0),
|
||||
{key: "zone", value: "zone1"}: pointer.Int64(0),
|
||||
{key: "zone", value: "zone2"}: pointer.Int64(0),
|
||||
},
|
||||
TopologyNormalizingWeight: []float64{topologyNormalizingWeight(2)},
|
||||
},
|
||||
@@ -350,8 +350,8 @@ func TestPreScoreStateEmptyNodes(t *testing.T) {
|
||||
},
|
||||
IgnoredNodes: sets.NewString(),
|
||||
TopologyPairToPodCounts: map[topologyPair]*int64{
|
||||
{key: "zone", value: "zone1"}: pointer.Int64Ptr(0),
|
||||
{key: "zone", value: "zone2"}: pointer.Int64Ptr(0),
|
||||
{key: "zone", value: "zone1"}: pointer.Int64(0),
|
||||
{key: "zone", value: "zone2"}: pointer.Int64(0),
|
||||
},
|
||||
TopologyNormalizingWeight: []float64{topologyNormalizingWeight(2)},
|
||||
},
|
||||
@@ -384,8 +384,8 @@ func TestPreScoreStateEmptyNodes(t *testing.T) {
|
||||
},
|
||||
IgnoredNodes: sets.NewString(),
|
||||
TopologyPairToPodCounts: map[topologyPair]*int64{
|
||||
{key: "zone", value: "zone1"}: pointer.Int64Ptr(0),
|
||||
{key: "zone", value: "zone2"}: pointer.Int64Ptr(0),
|
||||
{key: "zone", value: "zone1"}: pointer.Int64(0),
|
||||
{key: "zone", value: "zone2"}: pointer.Int64(0),
|
||||
},
|
||||
TopologyNormalizingWeight: []float64{topologyNormalizingWeight(2)},
|
||||
},
|
||||
@@ -418,8 +418,8 @@ func TestPreScoreStateEmptyNodes(t *testing.T) {
|
||||
},
|
||||
IgnoredNodes: sets.NewString(),
|
||||
TopologyPairToPodCounts: map[topologyPair]*int64{
|
||||
{key: "zone", value: "zone1"}: pointer.Int64Ptr(0),
|
||||
{key: "zone", value: "zone2"}: pointer.Int64Ptr(0),
|
||||
{key: "zone", value: "zone1"}: pointer.Int64(0),
|
||||
{key: "zone", value: "zone2"}: pointer.Int64(0),
|
||||
},
|
||||
TopologyNormalizingWeight: []float64{topologyNormalizingWeight(2)},
|
||||
},
|
||||
@@ -451,8 +451,8 @@ func TestPreScoreStateEmptyNodes(t *testing.T) {
|
||||
},
|
||||
IgnoredNodes: sets.NewString(),
|
||||
TopologyPairToPodCounts: map[topologyPair]*int64{
|
||||
{key: "zone", value: "zone1"}: pointer.Int64Ptr(0),
|
||||
{key: "zone", value: "zone2"}: pointer.Int64Ptr(0),
|
||||
{key: "zone", value: "zone1"}: pointer.Int64(0),
|
||||
{key: "zone", value: "zone2"}: pointer.Int64(0),
|
||||
},
|
||||
TopologyNormalizingWeight: []float64{topologyNormalizingWeight(2)},
|
||||
},
|
||||
@@ -484,8 +484,8 @@ func TestPreScoreStateEmptyNodes(t *testing.T) {
|
||||
},
|
||||
IgnoredNodes: sets.NewString(),
|
||||
TopologyPairToPodCounts: map[topologyPair]*int64{
|
||||
{key: "zone", value: "zone1"}: pointer.Int64Ptr(0),
|
||||
{key: "zone", value: "zone2"}: pointer.Int64Ptr(0),
|
||||
{key: "zone", value: "zone1"}: pointer.Int64(0),
|
||||
{key: "zone", value: "zone2"}: pointer.Int64(0),
|
||||
},
|
||||
TopologyNormalizingWeight: []float64{topologyNormalizingWeight(2)},
|
||||
},
|
||||
|
||||
@@ -50,7 +50,7 @@ func controllerRef(name string, gvk schema.GroupVersionKind) []metav1.OwnerRefer
|
||||
APIVersion: gvk.GroupVersion().String(),
|
||||
Kind: gvk.Kind,
|
||||
Name: name,
|
||||
Controller: pointer.BoolPtr(true),
|
||||
Controller: pointer.Bool(true),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ func makePVC(name string, storageClassName string) pvcBuilder {
|
||||
Namespace: v1.NamespaceDefault,
|
||||
},
|
||||
Spec: v1.PersistentVolumeClaimSpec{
|
||||
StorageClassName: pointer.StringPtr(storageClassName),
|
||||
StorageClassName: pointer.String(storageClassName),
|
||||
},
|
||||
}}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user