Merge pull request #103934 from boenn/tainttoleration

De-duplicate predicate (known as filter now) logic shared in kubelet and scheduler
This commit is contained in:
Kubernetes Prow Robot
2022-02-09 16:53:46 -08:00
committed by GitHub
8 changed files with 294 additions and 188 deletions

View File

@@ -443,6 +443,12 @@ func (p *PodWrapper) PreemptionPolicy(policy v1.PreemptionPolicy) *PodWrapper {
return p
}
// Overhead sets the give resourcelist to the inner pod
func (p *PodWrapper) Overhead(rl v1.ResourceList) *PodWrapper {
p.Spec.Overhead = rl
return p
}
// NodeWrapper wraps a Node inside.
type NodeWrapper struct{ v1.Node }
@@ -502,3 +508,9 @@ func (n *NodeWrapper) Images(images map[string]int64) *NodeWrapper {
n.Status.Images = containerImages
return n
}
// Taints applies taints to the inner node.
func (n *NodeWrapper) Taints(taints []v1.Taint) *NodeWrapper {
n.Spec.Taints = taints
return n
}