mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
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:
parent
3391daeb00
commit
6fd8a6eb69
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user