mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 18:31:15 +00:00
Replace deprecated pointer function
Signed-off-by: Kante Yin <kerthcet@gmail.com>
This commit is contained in:
parent
d2504c94a0
commit
666605498a
@ -703,7 +703,7 @@ func TestPostFilterPlugin(t *testing.T) {
|
|||||||
// Setup plugins for testing.
|
// Setup plugins for testing.
|
||||||
cfg := configtesting.V1ToInternalWithDefaults(t, configv1.KubeSchedulerConfiguration{
|
cfg := configtesting.V1ToInternalWithDefaults(t, configv1.KubeSchedulerConfiguration{
|
||||||
Profiles: []configv1.KubeSchedulerProfile{{
|
Profiles: []configv1.KubeSchedulerProfile{{
|
||||||
SchedulerName: pointer.StringPtr(v1.DefaultSchedulerName),
|
SchedulerName: pointer.String(v1.DefaultSchedulerName),
|
||||||
Plugins: &configv1.Plugins{
|
Plugins: &configv1.Plugins{
|
||||||
Filter: configv1.PluginSet{
|
Filter: configv1.PluginSet{
|
||||||
Enabled: []configv1.Plugin{
|
Enabled: []configv1.Plugin{
|
||||||
@ -949,7 +949,7 @@ func TestPrebindPlugin(t *testing.T) {
|
|||||||
cfg := configtesting.V1ToInternalWithDefaults(t, configv1.KubeSchedulerConfiguration{
|
cfg := configtesting.V1ToInternalWithDefaults(t, configv1.KubeSchedulerConfiguration{
|
||||||
Profiles: []configv1.KubeSchedulerProfile{
|
Profiles: []configv1.KubeSchedulerProfile{
|
||||||
{
|
{
|
||||||
SchedulerName: pointer.StringPtr(v1.DefaultSchedulerName),
|
SchedulerName: pointer.String(v1.DefaultSchedulerName),
|
||||||
Plugins: &configv1.Plugins{
|
Plugins: &configv1.Plugins{
|
||||||
PreBind: configv1.PluginSet{
|
PreBind: configv1.PluginSet{
|
||||||
Enabled: []configv1.Plugin{
|
Enabled: []configv1.Plugin{
|
||||||
@ -959,7 +959,7 @@ func TestPrebindPlugin(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
SchedulerName: pointer.StringPtr("2nd-scheduler"),
|
SchedulerName: pointer.String("2nd-scheduler"),
|
||||||
Plugins: &configv1.Plugins{
|
Plugins: &configv1.Plugins{
|
||||||
Filter: configv1.PluginSet{
|
Filter: configv1.PluginSet{
|
||||||
Enabled: []configv1.Plugin{
|
Enabled: []configv1.Plugin{
|
||||||
@ -1491,7 +1491,7 @@ func TestBindPlugin(t *testing.T) {
|
|||||||
// Setup initial unreserve and bind plugins for testing.
|
// Setup initial unreserve and bind plugins for testing.
|
||||||
cfg := configtesting.V1ToInternalWithDefaults(t, configv1.KubeSchedulerConfiguration{
|
cfg := configtesting.V1ToInternalWithDefaults(t, configv1.KubeSchedulerConfiguration{
|
||||||
Profiles: []configv1.KubeSchedulerProfile{{
|
Profiles: []configv1.KubeSchedulerProfile{{
|
||||||
SchedulerName: pointer.StringPtr(v1.DefaultSchedulerName),
|
SchedulerName: pointer.String(v1.DefaultSchedulerName),
|
||||||
Plugins: &configv1.Plugins{
|
Plugins: &configv1.Plugins{
|
||||||
MultiPoint: configv1.PluginSet{
|
MultiPoint: configv1.PluginSet{
|
||||||
Disabled: []configv1.Plugin{
|
Disabled: []configv1.Plugin{
|
||||||
@ -2200,7 +2200,7 @@ func TestPreemptWithPermitPlugin(t *testing.T) {
|
|||||||
cfg := configtesting.V1ToInternalWithDefaults(t, configv1.KubeSchedulerConfiguration{
|
cfg := configtesting.V1ToInternalWithDefaults(t, configv1.KubeSchedulerConfiguration{
|
||||||
Profiles: []configv1.KubeSchedulerProfile{
|
Profiles: []configv1.KubeSchedulerProfile{
|
||||||
{
|
{
|
||||||
SchedulerName: pointer.StringPtr(v1.DefaultSchedulerName),
|
SchedulerName: pointer.String(v1.DefaultSchedulerName),
|
||||||
Plugins: &configv1.Plugins{
|
Plugins: &configv1.Plugins{
|
||||||
Permit: configv1.PluginSet{
|
Permit: configv1.PluginSet{
|
||||||
Enabled: []configv1.Plugin{
|
Enabled: []configv1.Plugin{
|
||||||
@ -2448,7 +2448,7 @@ func TestActivatePods(t *testing.T) {
|
|||||||
// Setup initial filter plugin for testing.
|
// Setup initial filter plugin for testing.
|
||||||
cfg := configtesting.V1ToInternalWithDefaults(t, configv1.KubeSchedulerConfiguration{
|
cfg := configtesting.V1ToInternalWithDefaults(t, configv1.KubeSchedulerConfiguration{
|
||||||
Profiles: []configv1.KubeSchedulerProfile{{
|
Profiles: []configv1.KubeSchedulerProfile{{
|
||||||
SchedulerName: pointer.StringPtr(v1.DefaultSchedulerName),
|
SchedulerName: pointer.String(v1.DefaultSchedulerName),
|
||||||
Plugins: &configv1.Plugins{
|
Plugins: &configv1.Plugins{
|
||||||
PreFilter: configv1.PluginSet{
|
PreFilter: configv1.PluginSet{
|
||||||
Enabled: []configv1.Plugin{
|
Enabled: []configv1.Plugin{
|
||||||
@ -2567,7 +2567,7 @@ func initRegistryAndConfig(t *testing.T, plugins ...framework.Plugin) (framework
|
|||||||
|
|
||||||
versionedCfg := configv1.KubeSchedulerConfiguration{
|
versionedCfg := configv1.KubeSchedulerConfiguration{
|
||||||
Profiles: []configv1.KubeSchedulerProfile{{
|
Profiles: []configv1.KubeSchedulerProfile{{
|
||||||
SchedulerName: pointer.StringPtr(v1.DefaultSchedulerName),
|
SchedulerName: pointer.String(v1.DefaultSchedulerName),
|
||||||
Plugins: pls,
|
Plugins: pls,
|
||||||
}},
|
}},
|
||||||
}
|
}
|
||||||
|
@ -155,7 +155,7 @@ func TestPreemption(t *testing.T) {
|
|||||||
}
|
}
|
||||||
cfg := configtesting.V1ToInternalWithDefaults(t, configv1.KubeSchedulerConfiguration{
|
cfg := configtesting.V1ToInternalWithDefaults(t, configv1.KubeSchedulerConfiguration{
|
||||||
Profiles: []configv1.KubeSchedulerProfile{{
|
Profiles: []configv1.KubeSchedulerProfile{{
|
||||||
SchedulerName: pointer.StringPtr(v1.DefaultSchedulerName),
|
SchedulerName: pointer.String(v1.DefaultSchedulerName),
|
||||||
Plugins: &configv1.Plugins{
|
Plugins: &configv1.Plugins{
|
||||||
Filter: configv1.PluginSet{
|
Filter: configv1.PluginSet{
|
||||||
Enabled: []configv1.Plugin{
|
Enabled: []configv1.Plugin{
|
||||||
@ -1124,7 +1124,7 @@ func TestNominatedNodeCleanUp(t *testing.T) {
|
|||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
cfg := configtesting.V1ToInternalWithDefaults(t, configv1.KubeSchedulerConfiguration{
|
cfg := configtesting.V1ToInternalWithDefaults(t, configv1.KubeSchedulerConfiguration{
|
||||||
Profiles: []configv1.KubeSchedulerProfile{{
|
Profiles: []configv1.KubeSchedulerProfile{{
|
||||||
SchedulerName: pointer.StringPtr(v1.DefaultSchedulerName),
|
SchedulerName: pointer.String(v1.DefaultSchedulerName),
|
||||||
Plugins: tt.customPlugins,
|
Plugins: tt.customPlugins,
|
||||||
}},
|
}},
|
||||||
})
|
})
|
||||||
|
@ -341,7 +341,7 @@ func TestCustomResourceEnqueue(t *testing.T) {
|
|||||||
}
|
}
|
||||||
cfg := configtesting.V1ToInternalWithDefaults(t, configv1.KubeSchedulerConfiguration{
|
cfg := configtesting.V1ToInternalWithDefaults(t, configv1.KubeSchedulerConfiguration{
|
||||||
Profiles: []configv1.KubeSchedulerProfile{{
|
Profiles: []configv1.KubeSchedulerProfile{{
|
||||||
SchedulerName: pointer.StringPtr(v1.DefaultSchedulerName),
|
SchedulerName: pointer.String(v1.DefaultSchedulerName),
|
||||||
Plugins: &configv1.Plugins{
|
Plugins: &configv1.Plugins{
|
||||||
Filter: configv1.PluginSet{
|
Filter: configv1.PluginSet{
|
||||||
Enabled: []configv1.Plugin{
|
Enabled: []configv1.Plugin{
|
||||||
|
@ -249,13 +249,13 @@ func TestMultipleSchedulers(t *testing.T) {
|
|||||||
// 5. create and start a scheduler with name "foo-scheduler"
|
// 5. create and start a scheduler with name "foo-scheduler"
|
||||||
cfg := configtesting.V1ToInternalWithDefaults(t, configv1.KubeSchedulerConfiguration{
|
cfg := configtesting.V1ToInternalWithDefaults(t, configv1.KubeSchedulerConfiguration{
|
||||||
Profiles: []configv1.KubeSchedulerProfile{{
|
Profiles: []configv1.KubeSchedulerProfile{{
|
||||||
SchedulerName: pointer.StringPtr(fooScheduler),
|
SchedulerName: pointer.String(fooScheduler),
|
||||||
PluginConfig: []configv1.PluginConfig{
|
PluginConfig: []configv1.PluginConfig{
|
||||||
{
|
{
|
||||||
Name: "VolumeBinding",
|
Name: "VolumeBinding",
|
||||||
Args: runtime.RawExtension{
|
Args: runtime.RawExtension{
|
||||||
Object: &configv1.VolumeBindingArgs{
|
Object: &configv1.VolumeBindingArgs{
|
||||||
BindTimeoutSeconds: pointer.Int64Ptr(30),
|
BindTimeoutSeconds: pointer.Int64(30),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -279,8 +279,8 @@ func TestMultipleSchedulers(t *testing.T) {
|
|||||||
func TestMultipleSchedulingProfiles(t *testing.T) {
|
func TestMultipleSchedulingProfiles(t *testing.T) {
|
||||||
cfg := configtesting.V1ToInternalWithDefaults(t, configv1.KubeSchedulerConfiguration{
|
cfg := configtesting.V1ToInternalWithDefaults(t, configv1.KubeSchedulerConfiguration{
|
||||||
Profiles: []configv1.KubeSchedulerProfile{
|
Profiles: []configv1.KubeSchedulerProfile{
|
||||||
{SchedulerName: pointer.StringPtr("default-scheduler")},
|
{SchedulerName: pointer.String("default-scheduler")},
|
||||||
{SchedulerName: pointer.StringPtr("custom-scheduler")},
|
{SchedulerName: pointer.String("custom-scheduler")},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -76,11 +76,11 @@ const (
|
|||||||
func initTestSchedulerForPriorityTest(t *testing.T, scorePluginName string) *testutils.TestContext {
|
func initTestSchedulerForPriorityTest(t *testing.T, scorePluginName string) *testutils.TestContext {
|
||||||
cfg := configtesting.V1ToInternalWithDefaults(t, configv1.KubeSchedulerConfiguration{
|
cfg := configtesting.V1ToInternalWithDefaults(t, configv1.KubeSchedulerConfiguration{
|
||||||
Profiles: []configv1.KubeSchedulerProfile{{
|
Profiles: []configv1.KubeSchedulerProfile{{
|
||||||
SchedulerName: pointer.StringPtr(v1.DefaultSchedulerName),
|
SchedulerName: pointer.String(v1.DefaultSchedulerName),
|
||||||
Plugins: &configv1.Plugins{
|
Plugins: &configv1.Plugins{
|
||||||
Score: configv1.PluginSet{
|
Score: configv1.PluginSet{
|
||||||
Enabled: []configv1.Plugin{
|
Enabled: []configv1.Plugin{
|
||||||
{Name: scorePluginName, Weight: pointer.Int32Ptr(1)},
|
{Name: scorePluginName, Weight: pointer.Int32(1)},
|
||||||
},
|
},
|
||||||
Disabled: []configv1.Plugin{
|
Disabled: []configv1.Plugin{
|
||||||
{Name: "*"},
|
{Name: "*"},
|
||||||
@ -104,10 +104,10 @@ func initTestSchedulerForNodeResourcesTest(t *testing.T) *testutils.TestContext
|
|||||||
cfg := configtesting.V1ToInternalWithDefaults(t, configv1.KubeSchedulerConfiguration{
|
cfg := configtesting.V1ToInternalWithDefaults(t, configv1.KubeSchedulerConfiguration{
|
||||||
Profiles: []configv1.KubeSchedulerProfile{
|
Profiles: []configv1.KubeSchedulerProfile{
|
||||||
{
|
{
|
||||||
SchedulerName: pointer.StringPtr(v1.DefaultSchedulerName),
|
SchedulerName: pointer.String(v1.DefaultSchedulerName),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
SchedulerName: pointer.StringPtr("gpu-binpacking-scheduler"),
|
SchedulerName: pointer.String("gpu-binpacking-scheduler"),
|
||||||
PluginConfig: []configv1.PluginConfig{
|
PluginConfig: []configv1.PluginConfig{
|
||||||
{
|
{
|
||||||
Name: noderesources.Name,
|
Name: noderesources.Name,
|
||||||
|
Loading…
Reference in New Issue
Block a user