mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-06 19:52:42 +00:00
Use internal config types in scheduling plugin args
Signed-off-by: Aldo Culquicondor <acondor@google.com>
This commit is contained in:
@@ -19,7 +19,6 @@ go_library(
|
||||
"//pkg/scheduler/apis/config/scheme:go_default_library",
|
||||
"//pkg/scheduler/apis/config/v1alpha2:go_default_library",
|
||||
"//pkg/scheduler/apis/config/validation:go_default_library",
|
||||
"//pkg/scheduler/framework/plugins:go_default_library",
|
||||
"//pkg/scheduler/framework/plugins/interpodaffinity:go_default_library",
|
||||
"//staging/src/k8s.io/api/core/v1:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
|
@@ -21,10 +21,8 @@ import (
|
||||
|
||||
"github.com/spf13/pflag"
|
||||
"k8s.io/apimachinery/pkg/util/validation/field"
|
||||
kubeschedulerv1alpha2 "k8s.io/kube-scheduler/config/v1alpha2"
|
||||
"k8s.io/kubernetes/pkg/scheduler/algorithmprovider"
|
||||
kubeschedulerconfig "k8s.io/kubernetes/pkg/scheduler/apis/config"
|
||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins"
|
||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity"
|
||||
)
|
||||
|
||||
@@ -129,10 +127,13 @@ func (o *DeprecatedOptions) ApplyTo(cfg *kubeschedulerconfig.KubeSchedulerConfig
|
||||
profile.SchedulerName = o.SchedulerName
|
||||
}
|
||||
if o.HardPodAffinitySymmetricWeight != interpodaffinity.DefaultHardPodAffinityWeight {
|
||||
args := kubeschedulerv1alpha2.InterPodAffinityArgs{
|
||||
HardPodAffinityWeight: &o.HardPodAffinitySymmetricWeight,
|
||||
plCfg := kubeschedulerconfig.PluginConfig{
|
||||
Name: interpodaffinity.Name,
|
||||
Args: &kubeschedulerconfig.InterPodAffinityArgs{
|
||||
HardPodAffinityWeight: o.HardPodAffinitySymmetricWeight,
|
||||
},
|
||||
}
|
||||
profile.PluginConfig = append(profile.PluginConfig, plugins.NewPluginConfig(interpodaffinity.Name, args))
|
||||
profile.PluginConfig = append(profile.PluginConfig, plCfg)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@@ -203,6 +203,9 @@ profiles:
|
||||
disabled:
|
||||
- name: baz
|
||||
pluginConfig:
|
||||
- name: InterPodAffinity
|
||||
args:
|
||||
hardPodAffinityWeight: 2
|
||||
- name: foo
|
||||
args:
|
||||
bar: baz
|
||||
@@ -543,6 +546,12 @@ profiles:
|
||||
},
|
||||
},
|
||||
PluginConfig: []kubeschedulerconfig.PluginConfig{
|
||||
{
|
||||
Name: "InterPodAffinity",
|
||||
Args: &kubeschedulerconfig.InterPodAffinityArgs{
|
||||
HardPodAffinityWeight: 2,
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "foo",
|
||||
Args: &runtime.Unknown{
|
||||
@@ -670,9 +679,7 @@ profiles:
|
||||
PluginConfig: []kubeschedulerconfig.PluginConfig{
|
||||
{
|
||||
Name: "InterPodAffinity",
|
||||
Args: &runtime.Unknown{
|
||||
Raw: []byte(`{"hardPodAffinityWeight":5}`),
|
||||
},
|
||||
Args: &kubeschedulerconfig.InterPodAffinityArgs{HardPodAffinityWeight: 5},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
Reference in New Issue
Block a user