Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions pkg/standalone/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ func (config *RunConfig) validatePlacementHostAddr() error {
if len(placementHostAddr) == 0 {
placementHostAddr = "localhost"
}

if strings.TrimSpace(placementHostAddr) == "" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"localhost" is being assigned above in line 130 if placementHostAddr is empty, so this check could never be true

Copy link
Author

@Gallardot Gallardot Aug 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"localhost" is being assigned above in line 130 if placementHostAddr is empty, so this check could never be true

Hi @yaron2 , Thanks for your reply.

Here is an example:

dapr run --placement-host-address " " --scheduler-host-address " " -a app-id

This is different from "empty". The part I modified is to handle such cases. I think it is OK.

When using the CLI, ensure that the provided capabilities are consistent with those of the annotations.

Comma separated list of addresses for Dapr Actor Placement servers.

When no annotation is set, the default value is set by the Sidecar Injector.

When the annotation is set and the value is a single space (' '), or “empty”, the sidecar does not connect to Placement server. This can be used when there are no actors running in the sidecar.

When the annotation is set and the value is not empty, the sidecar connects to the configured address. For example: 127.0.0.1:50057,127.0.0.1:50058

For reference, please see:
https://docs.dapr.io/reference/arguments-annotations-overview/

return nil
}

if indx := strings.Index(placementHostAddr, ":"); indx == -1 {
if runtime.GOOS == daprWindowsOS {
placementHostAddr += ":6050"
Expand All @@ -146,6 +151,10 @@ func (config *RunConfig) validateSchedulerHostAddr() error {
return nil
}

if strings.TrimSpace(schedulerHostAddr) == "" {
return nil
}

if indx := strings.Index(schedulerHostAddr, ":"); indx == -1 {
if runtime.GOOS == daprWindowsOS {
schedulerHostAddr += ":6060"
Expand Down
Loading