From fd465d565d24e23bbaf4c98f28c600579817bbdb Mon Sep 17 00:00:00 2001 From: Anton Troshin Date: Thu, 23 Jan 2025 23:21:04 -0600 Subject: [PATCH] revert and add dev version to check scheduler host Signed-off-by: Anton Troshin --- cmd/run.go | 9 +++++++-- pkg/standalone/run.go | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/cmd/run.go b/cmd/run.go index 9111e25d9..f61990062 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -230,8 +230,13 @@ dapr run --run-file /path/to/directory -k output.DaprGRPCPort) } - if (daprVer.RuntimeVersion != "edge") && (semver.Compare(fmt.Sprintf("v%v", daprVer.RuntimeVersion), "v1.14.0-rc.1") == -1) { + if (daprVer.RuntimeVersion != "edge") && (daprVer.RuntimeVersion != "dev") && (semver.Compare(fmt.Sprintf("v%v", daprVer.RuntimeVersion), "v1.14.0-rc.1") == -1) { print.InfoStatusEvent(os.Stdout, "The scheduler is only compatible with dapr runtime 1.14 onwards.") + for i, arg := range output.DaprCMD.Args { + if strings.HasPrefix(arg, "--scheduler-host-address") { + output.DaprCMD.Args[i] = "" + } + } } print.InfoStatusEvent(os.Stdout, startInfo) @@ -665,7 +670,7 @@ func executeRunWithAppsConfigFile(runFilePath string, k8sEnabled bool) { // populate the scheduler host address based on the dapr version. func validateSchedulerHostAddress(version, address string) string { // If no SchedulerHostAddress is supplied, set it to default value. - if semver.Compare(fmt.Sprintf("v%v", version), "v1.15.0-rc.0") == 1 { + if version == "dev" || version == "edge" || semver.Compare(fmt.Sprintf("v%v", version), "v1.15.0-rc.0") == 1 { if address == "" { return "localhost:50006" } diff --git a/pkg/standalone/run.go b/pkg/standalone/run.go index f675f3f5b..57781e4b5 100644 --- a/pkg/standalone/run.go +++ b/pkg/standalone/run.go @@ -141,7 +141,7 @@ func (config *RunConfig) validatePlacementHostAddr() error { func (config *RunConfig) validateSchedulerHostAddr() error { schedulerHostAddr := config.SchedulerHostAddress if len(schedulerHostAddr) == 0 { - schedulerHostAddr = "localhost" + return nil } if indx := strings.Index(schedulerHostAddr, ":"); indx == -1 {