Skip to content

Commit 105011f

Browse files
committed
Use localhost host for placement report when internal gRPC address is
localhost Signed-off-by: joshvanl <[email protected]>
1 parent 306f746 commit 105011f

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

pkg/runtime/runtime.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,8 +965,16 @@ func (a *DaprRuntime) initActors(ctx context.Context) error {
965965
if !ok {
966966
log.Info("actors: state store is not configured - this is okay for clients but services with hosted actors will fail to initialize!")
967967
}
968+
// Override host address if the internal gRPC listen address is localhost.
969+
hostAddress := a.hostAddress
970+
if utils.Contains(
971+
[]string{"127.0.0.1", "localhost", "[::1]"},
972+
a.runtimeConfig.internalGRPCListenAddress,
973+
) {
974+
hostAddress = a.runtimeConfig.internalGRPCListenAddress
975+
}
968976
actorConfig := actors.NewConfig(actors.ConfigOpts{
969-
HostAddress: a.hostAddress,
977+
HostAddress: hostAddress,
970978
AppID: a.runtimeConfig.id,
971979
ActorsService: a.runtimeConfig.actorsService,
972980
RemindersService: a.runtimeConfig.remindersService,

tests/integration/framework/process/daprd/daprd.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ func New(t *testing.T, fopts ...Option) *Daprd {
103103
"--dapr-http-port=" + strconv.Itoa(opts.httpPort),
104104
"--dapr-internal-grpc-port=" + strconv.Itoa(opts.internalGRPCPort),
105105
"--dapr-internal-grpc-listen-address=127.0.0.1",
106+
"--dapr-listen-addresses=127.0.0.1",
106107
"--dapr-public-port=" + strconv.Itoa(opts.publicPort),
107108
"--dapr-public-listen-address=127.0.0.1",
108109
"--metrics-port=" + strconv.Itoa(opts.metricsPort),

0 commit comments

Comments
 (0)