Skip to content

Commit 31f4527

Browse files
authored
Env: Set DAPR_HOST_IP=127.0.0.1 (#1589)
By default, set the DAPR_HOST_IP to localhost on daprd when using the run command. This ensures remote actors (workflows) works out of the box running in standalone mode. Will not override DAPR_HOST_IP if it is already set in the environment. Signed-off-by: joshvanl <me@joshvanl.dev>
1 parent 9ee60e3 commit 31f4527

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cmd/run.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,11 @@ func startDaprdProcess(runConfig *standalone.RunConfig, runE *runExec.RunExec,
929929
}
930930
print.StatusEvent(runE.DaprCMD.OutputWriter, print.LogInfo, startInfo)
931931

932+
// If DAPR_HOST_IP is not set, set to localhost.
933+
if _, ok := os.LookupEnv("DAPR_HOST_IP"); !ok {
934+
runE.DaprCMD.Command.Env = append(runE.DaprCMD.Command.Environ(), "DAPR_HOST_IP=127.0.0.1")
935+
}
936+
932937
err := runE.DaprCMD.Command.Start()
933938
if err != nil {
934939
errorChan <- err

0 commit comments

Comments
 (0)