Move Plugin Args defaults to versioned packages

Signed-off-by: Aldo Culquicondor <acondor@google.com>
This commit is contained in:
Aldo Culquicondor
2020-04-30 18:11:37 -04:00
parent ffec75da81
commit 2935480cc8
23 changed files with 279 additions and 140 deletions

View File

@@ -30,8 +30,6 @@ const (
// Name is the name of the plugin used in the plugin registry and configurations.
Name = "InterPodAffinity"
// DefaultHardPodAffinityWeight is the default HardPodAffinityWeight.
DefaultHardPodAffinityWeight int32 = 1
// MinHardPodAffinityWeight is the minimum HardPodAffinityWeight.
MinHardPodAffinityWeight int32 = 0
// MaxHardPodAffinityWeight is the maximum HardPodAffinityWeight.
@@ -79,11 +77,6 @@ func New(plArgs runtime.Object, h framework.FrameworkHandle) (framework.Plugin,
}
func getArgs(obj runtime.Object) (config.InterPodAffinityArgs, error) {
if obj == nil {
return config.InterPodAffinityArgs{
HardPodAffinityWeight: DefaultHardPodAffinityWeight,
}, nil
}
ptr, ok := obj.(*config.InterPodAffinityArgs)
if !ok {
return config.InterPodAffinityArgs{}, fmt.Errorf("want args to be of type InterPodAffinityArgs, got %T", obj)