Make restricted TopologyManager policy inherit from best-effort policy

These policies only differ on whether they admit the pod or not when a
TopologyHint is preferred or not. As such, the restricted policy should
simply inherit whatever it can from the best effort policy and only
overwrite what is necessary.

This does not matter for now, but will become important when we add a
new 'Merge()' abstraction to a Policy later on.
This commit is contained in:
Adrian Chiris 2019-11-04 11:52:22 +01:00 committed by Kevin Klues
parent 3391daeb00
commit 6fd8a6eb69

View File

@ -20,7 +20,9 @@ import (
"k8s.io/kubernetes/pkg/kubelet/lifecycle"
)
type restrictedPolicy struct{}
type restrictedPolicy struct {
bestEffortPolicy
}
var _ Policy = &restrictedPolicy{}
@ -29,7 +31,7 @@ const PolicyRestricted string = "restricted"
// NewRestrictedPolicy returns restricted policy.
func NewRestrictedPolicy() Policy {
return &restrictedPolicy{}
return &restrictedPolicy{bestEffortPolicy{}}
}
func (p *restrictedPolicy) Name() string {