Skip to content
This repository was archived by the owner on Feb 27, 2022. It is now read-only.

Commit 55cec87

Browse files
author
Reto Lehmann
committed
Fixed hardcoded testing IPs.
1 parent 2490c5d commit 55cec87

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

balancer/scheduler.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/ReToCode/openshift-cross-cluster-loadbalancer/balancer/core"
1010
"github.com/ReToCode/openshift-cross-cluster-loadbalancer/balancer/stats"
1111
"github.com/sirupsen/logrus"
12+
"os"
1213
)
1314

1415
type StatsOperationAction int
@@ -121,12 +122,15 @@ func (s *Scheduler) addCluster(clusterKey string, data core.ClusterUpdate) {
121122
}
122123

123124
func (s *Scheduler) addRouterHost(clusterKey string, rh core.RouterHost) {
124-
// Hack for Local
125-
if clusterKey == "ose1" {
126-
rh.HostIP = "192.168.99.102"
125+
// For testing purposes, add an override for Router host IPs
126+
ose1Debug := os.Getenv("OSE1_OVERRIDE")
127+
ose2Debug := os.Getenv("OSE2_OVERRIDE")
128+
129+
if len(ose1Debug) > 0 && clusterKey == "ose1" {
130+
rh.HostIP = ose1Debug
127131
}
128-
if clusterKey == "ose2" {
129-
rh.HostIP = "192.168.99.103"
132+
if len(ose2Debug) > 0 && clusterKey == "ose2" {
133+
rh.HostIP = ose2Debug
130134
}
131135

132136
newHost := core.NewRouterHost(rh.Name, rh.HostIP, rh.HTTPPort, rh.HTTPSPort, s.healthCheckResults, clusterKey)

0 commit comments

Comments
 (0)