Skip to content

Commit fd465d5

Browse files
committed
revert and add dev version to check scheduler host
Signed-off-by: Anton Troshin <anton@diagrid.io>
1 parent 026fc28 commit fd465d5

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

cmd/run.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,13 @@ dapr run --run-file /path/to/directory -k
230230
output.DaprGRPCPort)
231231
}
232232

233-
if (daprVer.RuntimeVersion != "edge") && (semver.Compare(fmt.Sprintf("v%v", daprVer.RuntimeVersion), "v1.14.0-rc.1") == -1) {
233+
if (daprVer.RuntimeVersion != "edge") && (daprVer.RuntimeVersion != "dev") && (semver.Compare(fmt.Sprintf("v%v", daprVer.RuntimeVersion), "v1.14.0-rc.1") == -1) {
234234
print.InfoStatusEvent(os.Stdout, "The scheduler is only compatible with dapr runtime 1.14 onwards.")
235+
for i, arg := range output.DaprCMD.Args {
236+
if strings.HasPrefix(arg, "--scheduler-host-address") {
237+
output.DaprCMD.Args[i] = ""
238+
}
239+
}
235240
}
236241
print.InfoStatusEvent(os.Stdout, startInfo)
237242

@@ -665,7 +670,7 @@ func executeRunWithAppsConfigFile(runFilePath string, k8sEnabled bool) {
665670
// populate the scheduler host address based on the dapr version.
666671
func validateSchedulerHostAddress(version, address string) string {
667672
// If no SchedulerHostAddress is supplied, set it to default value.
668-
if semver.Compare(fmt.Sprintf("v%v", version), "v1.15.0-rc.0") == 1 {
673+
if version == "dev" || version == "edge" || semver.Compare(fmt.Sprintf("v%v", version), "v1.15.0-rc.0") == 1 {
669674
if address == "" {
670675
return "localhost:50006"
671676
}

pkg/standalone/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ func (config *RunConfig) validatePlacementHostAddr() error {
141141
func (config *RunConfig) validateSchedulerHostAddr() error {
142142
schedulerHostAddr := config.SchedulerHostAddress
143143
if len(schedulerHostAddr) == 0 {
144-
schedulerHostAddr = "localhost"
144+
return nil
145145
}
146146

147147
if indx := strings.Index(schedulerHostAddr, ":"); indx == -1 {

0 commit comments

Comments
 (0)