Skip to content

Commit 8ce6b9f

Browse files
authored
Scheduler: set broadcast address to localhost:50006 in selfhosted (#1480)
* Scheduler: set broadcast address to localhost:50006 in selfhosted Signed-off-by: joshvanl <[email protected]> * Set schedulder override flag for edge and dev Signed-off-by: joshvanl <[email protected]> --------- Signed-off-by: joshvanl <[email protected]>
1 parent 953c4a2 commit 8ce6b9f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Diff for: pkg/standalone/standalone.go

+19
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,10 @@ func runSchedulerService(wg *sync.WaitGroup, errorChan chan<- error, info initIn
683683
args = append(args, image, "--etcd-data-dir=/var/lock/dapr/scheduler")
684684
}
685685

686+
if schedulerOverrideHostPort(info) {
687+
args = append(args, "--override-broadcast-host-port=localhost:50006")
688+
}
689+
686690
_, err = utils.RunCmdAndWait(runtimeCmd, args...)
687691
if err != nil {
688692
runError := isContainerRunError(err)
@@ -696,6 +700,21 @@ func runSchedulerService(wg *sync.WaitGroup, errorChan chan<- error, info initIn
696700
errorChan <- nil
697701
}
698702

703+
func schedulerOverrideHostPort(info initInfo) bool {
704+
if info.runtimeVersion == "edge" || info.runtimeVersion == "dev" {
705+
return true
706+
}
707+
708+
runV, err := semver.NewVersion(info.runtimeVersion)
709+
if err != nil {
710+
return true
711+
}
712+
713+
v115rc5, _ := semver.NewVersion("1.15.0-rc.5")
714+
715+
return runV.GreaterThan(v115rc5)
716+
}
717+
699718
func moveDashboardFiles(extractedFilePath string, dir string) (string, error) {
700719
// Move /release/os/web directory to /web.
701720
oldPath := path_filepath.Join(path_filepath.Dir(extractedFilePath), "web")

0 commit comments

Comments
 (0)