mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-03 03:38:15 +00:00
Add profile level percentageOfNodesToScore
Fix conversion errors Changed the order update update fix manaul coversions keep the global parameter for backward compatibility Address Wei's comments Fix an error Fix issues Add unit tests for validation Fix a comment Address comments Update comments fix verifiation errors Add tests for scheme_test.go Convert percentageOfNodesToScore to pointer Fix errors Resolve conflicts Fix testing errors Address Wei's comments Revert IntPtr to Int changes Address comments Not overrite percentageOfNodesToScore Fix a bug Fix a bug change errs to err Fix a nit Remove duplication Address comments Fix lint warning Fix an issue Update comments Clean up Address comments Revert changes to defaults fix unit test error Update Fix tests Use default PluginConfigs
This commit is contained in:
@@ -48,6 +48,7 @@ func TestCodecsDecodePluginConfig(t *testing.T) {
|
||||
data: []byte(`
|
||||
apiVersion: kubescheduler.config.k8s.io/v1beta2
|
||||
kind: KubeSchedulerConfiguration
|
||||
percentageOfNodesToScore: 0
|
||||
profiles:
|
||||
- pluginConfig:
|
||||
- name: DefaultPreemption
|
||||
@@ -94,8 +95,9 @@ profiles:
|
||||
`),
|
||||
wantProfiles: []config.KubeSchedulerProfile{
|
||||
{
|
||||
SchedulerName: "default-scheduler",
|
||||
Plugins: defaults.PluginsV1beta2,
|
||||
SchedulerName: "default-scheduler",
|
||||
PercentageOfNodesToScore: nil,
|
||||
Plugins: defaults.PluginsV1beta2,
|
||||
PluginConfig: []config.PluginConfig{
|
||||
{
|
||||
Name: "DefaultPreemption",
|
||||
@@ -169,6 +171,22 @@ profiles:
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "v1beta2 with non-default global percentageOfNodesToScore",
|
||||
data: []byte(`
|
||||
apiVersion: kubescheduler.config.k8s.io/v1beta2
|
||||
kind: KubeSchedulerConfiguration
|
||||
percentageOfNodesToScore: 10
|
||||
`),
|
||||
wantProfiles: []config.KubeSchedulerProfile{
|
||||
{
|
||||
SchedulerName: "default-scheduler",
|
||||
PercentageOfNodesToScore: nil,
|
||||
Plugins: defaults.PluginsV1beta2,
|
||||
PluginConfig: defaults.PluginConfigsV1beta2,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "v1beta2 plugins can include version and kind",
|
||||
data: []byte(`
|
||||
@@ -510,6 +528,22 @@ profiles:
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "v1beta3 with non-default global percentageOfNodesToScore",
|
||||
data: []byte(`
|
||||
apiVersion: kubescheduler.config.k8s.io/v1beta3
|
||||
kind: KubeSchedulerConfiguration
|
||||
percentageOfNodesToScore: 10
|
||||
`),
|
||||
wantProfiles: []config.KubeSchedulerProfile{
|
||||
{
|
||||
SchedulerName: "default-scheduler",
|
||||
PercentageOfNodesToScore: nil,
|
||||
Plugins: defaults.PluginsV1beta3,
|
||||
PluginConfig: defaults.PluginConfigsV1beta3,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "v1beta3 plugins can include version and kind",
|
||||
data: []byte(`
|
||||
@@ -776,8 +810,9 @@ profiles:
|
||||
`),
|
||||
wantProfiles: []config.KubeSchedulerProfile{
|
||||
{
|
||||
SchedulerName: "default-scheduler",
|
||||
Plugins: defaults.PluginsV1,
|
||||
SchedulerName: "default-scheduler",
|
||||
PercentageOfNodesToScore: nil,
|
||||
Plugins: defaults.PluginsV1,
|
||||
PluginConfig: []config.PluginConfig{
|
||||
{
|
||||
Name: "DefaultPreemption",
|
||||
@@ -851,6 +886,40 @@ profiles:
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "v1 with non-default global percentageOfNodesToScore",
|
||||
data: []byte(`
|
||||
apiVersion: kubescheduler.config.k8s.io/v1
|
||||
kind: KubeSchedulerConfiguration
|
||||
percentageOfNodesToScore: 10
|
||||
`),
|
||||
wantProfiles: []config.KubeSchedulerProfile{
|
||||
{
|
||||
SchedulerName: "default-scheduler",
|
||||
PercentageOfNodesToScore: nil,
|
||||
Plugins: defaults.PluginsV1,
|
||||
PluginConfig: defaults.PluginConfigsV1,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "v1 with non-default global and profile percentageOfNodesToScore",
|
||||
data: []byte(`
|
||||
apiVersion: kubescheduler.config.k8s.io/v1
|
||||
kind: KubeSchedulerConfiguration
|
||||
percentageOfNodesToScore: 10
|
||||
profiles:
|
||||
- percentageOfNodesToScore: 20
|
||||
`),
|
||||
wantProfiles: []config.KubeSchedulerProfile{
|
||||
{
|
||||
SchedulerName: "default-scheduler",
|
||||
PercentageOfNodesToScore: pointer.Int32(20),
|
||||
Plugins: defaults.PluginsV1,
|
||||
PluginConfig: defaults.PluginConfigsV1,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "v1 plugins can include version and kind",
|
||||
data: []byte(`
|
||||
@@ -1284,7 +1353,6 @@ leaderElection:
|
||||
retryPeriod: 0s
|
||||
metricsBindAddress: ""
|
||||
parallelism: 8
|
||||
percentageOfNodesToScore: 0
|
||||
podInitialBackoffSeconds: 0
|
||||
podMaxBackoffSeconds: 0
|
||||
profiles:
|
||||
@@ -1503,7 +1571,6 @@ leaderElection:
|
||||
resourceNamespace: ""
|
||||
retryPeriod: 0s
|
||||
parallelism: 8
|
||||
percentageOfNodesToScore: 0
|
||||
podInitialBackoffSeconds: 0
|
||||
podMaxBackoffSeconds: 0
|
||||
profiles:
|
||||
@@ -1722,7 +1789,6 @@ leaderElection:
|
||||
resourceNamespace: ""
|
||||
retryPeriod: 0s
|
||||
parallelism: 8
|
||||
percentageOfNodesToScore: 0
|
||||
podInitialBackoffSeconds: 0
|
||||
podMaxBackoffSeconds: 0
|
||||
profiles:
|
||||
|
||||
Reference in New Issue
Block a user