Skip to content

Commit 37ed800

Browse files
committed
improve (hopefully) port forward logic readability
1 parent c359c69 commit 37ed800

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/suite/scale_test.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,12 +480,13 @@ var _ = Describe("Scale test", Ordered, Label("nfr", "scale"), func() {
480480
for i := 0; i < len(objects.ScaleIterationGroups); i++ {
481481
Expect(resourceManager.Apply(objects.ScaleIterationGroups[i])).To(Succeed())
482482

483-
url := fmt.Sprintf("%s://%d.example.com", protocol, i)
484-
483+
var url string
485484
if protocol == "http" && portFwdPort != 0 {
486485
url = fmt.Sprintf("%s://%d.example.com:%d", protocol, i, portFwdPort)
487486
} else if protocol == "https" && portFwdHTTPSPort != 0 {
488487
url = fmt.Sprintf("%s://%d.example.com:%d", protocol, i, portFwdHTTPSPort)
488+
} else {
489+
url = fmt.Sprintf("%s://%d.example.com", protocol, i)
489490
}
490491

491492
startCheck := time.Now()
@@ -517,9 +518,11 @@ var _ = Describe("Scale test", Ordered, Label("nfr", "scale"), func() {
517518
Expect(resourceManager.ApplyFromFiles(upstreamsManifests, ns.Name)).To(Succeed())
518519
Expect(resourceManager.WaitForAppsToBeReady(ns.Name)).To(Succeed())
519520

520-
url := "http://hello.example.com"
521+
var url string
521522
if portFwdPort != 0 {
522523
url = fmt.Sprintf("http://hello.example.com:%d", portFwdPort)
524+
} else {
525+
url = "http://hello.example.com"
523526
}
524527

525528
Eventually(

0 commit comments

Comments
 (0)