Scheduler: set broadcast address to localhost:50006 in selfhosted (#1480)

* Scheduler: set broadcast address to localhost:50006 in selfhosted

Signed-off-by: joshvanl <me@joshvanl.dev>

* Set schedulder override flag for edge and dev

Signed-off-by: joshvanl <me@joshvanl.dev>

---------

Signed-off-by: joshvanl <me@joshvanl.dev>
This commit is contained in:
Josh van Leeuwen 2025-01-27 18:16:37 +00:00 committed by GitHub
parent 953c4a2a3f
commit 8ce6b9fed9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 19 additions and 0 deletions

View File

@ -683,6 +683,10 @@ func runSchedulerService(wg *sync.WaitGroup, errorChan chan<- error, info initIn
args = append(args, image, "--etcd-data-dir=/var/lock/dapr/scheduler")
}
if schedulerOverrideHostPort(info) {
args = append(args, "--override-broadcast-host-port=localhost:50006")
}
_, err = utils.RunCmdAndWait(runtimeCmd, args...)
if err != nil {
runError := isContainerRunError(err)
@ -696,6 +700,21 @@ func runSchedulerService(wg *sync.WaitGroup, errorChan chan<- error, info initIn
errorChan <- nil
}
func schedulerOverrideHostPort(info initInfo) bool {
if info.runtimeVersion == "edge" || info.runtimeVersion == "dev" {
return true
}
runV, err := semver.NewVersion(info.runtimeVersion)
if err != nil {
return true
}
v115rc5, _ := semver.NewVersion("1.15.0-rc.5")
return runV.GreaterThan(v115rc5)
}
func moveDashboardFiles(extractedFilePath string, dir string) (string, error) {
// Move /release/os/web directory to /web.
oldPath := path_filepath.Join(path_filepath.Dir(extractedFilePath), "web")