Skip to content

Commit

Permalink
Fix scheduler pod count for 1.15 version when testing master and late…
Browse files Browse the repository at this point in the history
…st (#1492)

Signed-off-by: Anton Troshin <anton@diagrid.io>
  • Loading branch information
antontroshin authored Feb 22, 2025
1 parent 0cd0585 commit 06f38ed
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions tests/e2e/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,21 @@ const (
ClusterRoles
ClusterRoleBindings

numHAPodsWithScheduler = 16
numHAPodsOld = 13
numNonHAPodsWithScheduler = 6
numNonHAPodsOld = 5
numHAPodsWithScheduler = 16
numHAPodsOld = 13
numNonHAPodsWithHAScheduler = 8
numNonHAPodsWithScheduler = 6
numNonHAPodsOld = 5

thirdPartyDevNamespace = "default"
devRedisReleaseName = "dapr-dev-redis"
devZipkinReleaseName = "dapr-dev-zipkin"
)

var VersionWithScheduler = semver.MustParse("1.14.0-rc.1")
var (
VersionWithScheduler = semver.MustParse("1.14.0-rc.1")
VersionWithHAScheduler = semver.MustParse("1.15.0-rc.1")
)

type VersionDetails struct {
RuntimeVersion string
Expand Down Expand Up @@ -1232,23 +1236,26 @@ func getVersionedNumberOfPods(isHAEnabled bool, details VersionDetails) (int, er
return 0, err
}

if rv.LessThan(VersionWithScheduler) {
return numHAPodsOld, nil
if rv.GreaterThanEqual(VersionWithScheduler) {
return numHAPodsWithScheduler, nil
}
return numHAPodsWithScheduler, nil
return numHAPodsOld, nil
} else {
if details.UseDaprLatestVersion {
return numNonHAPodsWithScheduler, nil
return numNonHAPodsWithHAScheduler, nil
}
rv, err := semver.NewVersion(details.RuntimeVersion)
if err != nil {
return 0, err
}

if rv.LessThan(VersionWithScheduler) {
return numNonHAPodsOld, nil
if rv.GreaterThanEqual(VersionWithHAScheduler) {
return numNonHAPodsWithHAScheduler, nil
}
if rv.GreaterThanEqual(VersionWithScheduler) {
return numNonHAPodsWithScheduler, nil
}
return numNonHAPodsWithScheduler, nil
return numNonHAPodsOld, nil
}
}

Expand Down

0 comments on commit 06f38ed

Please sign in to comment.