@@ -14,7 +14,6 @@ limitations under the License.
1414package standalone
1515
1616import (
17- "context"
1817 "fmt"
1918 "net"
2019 "os"
@@ -24,8 +23,6 @@ import (
2423 "strconv"
2524 "strings"
2625
27- dockerClient "github.com/docker/docker/client"
28-
2926 "github.com/Pallinder/sillyname-go"
3027 "github.com/phayes/freeport"
3128 "gopkg.in/yaml.v2"
@@ -141,27 +138,21 @@ func (config *RunConfig) validatePlacementHostAddr() error {
141138}
142139
143140func (config * RunConfig ) validateSchedulerHostAddr () error {
144- // If the scheduler isn't running - don't add the flag to the runtime cmd.
145- docker , err := dockerClient .NewClientWithOpts ()
146- if err != nil {
147- return err
141+ schedulerHostAddr := config .SchedulerHostAddress
142+ if len (schedulerHostAddr ) == 0 {
143+ return nil
148144 }
149- _ , err = docker .ContainerInspect (context .Background (), "dapr_scheduler" )
150- if err == nil {
151- schedulerHostAddr := config .SchedulerHostAddress
152- if len (schedulerHostAddr ) == 0 {
153- schedulerHostAddr = "localhost"
154- }
155- if indx := strings .Index (schedulerHostAddr , ":" ); indx == - 1 {
156- if runtime .GOOS == daprWindowsOS {
157- schedulerHostAddr = fmt .Sprintf ("%s:6060" , schedulerHostAddr )
158- } else {
159- schedulerHostAddr = fmt .Sprintf ("%s:50006" , schedulerHostAddr )
160- }
145+
146+ if indx := strings .Index (schedulerHostAddr , ":" ); indx == - 1 {
147+ if runtime .GOOS == daprWindowsOS {
148+ schedulerHostAddr = fmt .Sprintf ("%s:6060" , schedulerHostAddr )
149+ } else {
150+ schedulerHostAddr = fmt .Sprintf ("%s:50006" , schedulerHostAddr )
161151 }
162- config .SchedulerHostAddress = schedulerHostAddr
163- return nil
164152 }
153+
154+ config .SchedulerHostAddress = schedulerHostAddr
155+
165156 return nil
166157}
167158
0 commit comments