Skip to content

Commit

Permalink
Scheduler: set broadcast address to localhost:50006 in selfhosted (#1480
Browse files Browse the repository at this point in the history
)

* 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]>
  • Loading branch information
JoshVanL authored Jan 27, 2025
1 parent 953c4a2 commit 8ce6b9f
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pkg/standalone/standalone.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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")
Expand Down

0 comments on commit 8ce6b9f

Please sign in to comment.