Skip to content

Commit

Permalink
revert and add dev version to check scheduler host
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Troshin <anton@diagrid.io>
  • Loading branch information
antontroshin committed Jan 24, 2025
1 parent 026fc28 commit fd465d5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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"
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/standalone/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit fd465d5

Please sign in to comment.