Skip to content

Commit e08443b

Browse files
authored
Remove Docker client dependency from standalone run (#1443)
Signed-off-by: joshvanl <[email protected]>
1 parent 027f5da commit e08443b

File tree

1 file changed

+12
-21
lines changed

1 file changed

+12
-21
lines changed

pkg/standalone/run.go

+12-21
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ limitations under the License.
1414
package standalone
1515

1616
import (
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

143140
func (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

Comments
 (0)