mirror of https://github.com/k3s-io/k3s
Merge pull request #67641 from mborsz/preparenodes
Automatic merge from submit-queue (batch tested with PRs 66229, 67682, 67585, 67641, 67697). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Fix validation logic in E2ETestNodePreparer. **What this PR does / why we need it**: There is a bug in E2ETestNodePreparer validation logic. **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: **Special notes for your reviewer**: **Release note**: ```release-note NONE ```pull/8/head
commit
7b2fa0a21f
|
@ -4876,8 +4876,8 @@ func NewE2ETestNodePreparer(client clientset.Interface, countToStrategy []testut
|
|||
func (p *E2ETestNodePreparer) PrepareNodes() error {
|
||||
nodes := GetReadySchedulableNodesOrDie(p.client)
|
||||
numTemplates := 0
|
||||
for k := range p.countToStrategy {
|
||||
numTemplates += k
|
||||
for _, v := range p.countToStrategy {
|
||||
numTemplates += v.Count
|
||||
}
|
||||
if numTemplates > len(nodes.Items) {
|
||||
return fmt.Errorf("Can't prepare Nodes. Got more templates than existing Nodes.")
|
||||
|
|
Loading…
Reference in New Issue