Skip to content

Commit

Permalink
Add appId to consul default checks (re-do of #2490) (#2980)
Browse files Browse the repository at this point in the history
Signed-off-by: ItalyPaleAle <[email protected]>
Co-authored-by: AlbertHuang <[email protected]>
  • Loading branch information
ItalyPaleAle and alberthuang24 authored Jul 20, 2023
1 parent 22a695c commit 608e4cb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nameresolution/consul/consul.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ func getRegistrationConfig(cfg configSpec, props map[string]string) (*consul.Age
Name: "Dapr Health Status",
CheckID: fmt.Sprintf("daprHealth:%s", id),
Interval: "15s",
HTTP: fmt.Sprintf("http://%s/v1.0/healthz", net.JoinHostPort(host, httpPort)),
HTTP: fmt.Sprintf("http://%s/v1.0/healthz?appid=%s", net.JoinHostPort(host, httpPort), appID),
},
}
}
Expand Down
2 changes: 1 addition & 1 deletion nameresolution/consul/consul_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ func TestGetConfig(t *testing.T) {
assert.Equal(t, "Dapr Health Status", check.Name)
assert.Equal(t, "daprHealth:test-app-"+metadata.Properties[nr.HostAddress]+"-"+metadata.Properties[nr.DaprHTTPPort], check.CheckID)
assert.Equal(t, "15s", check.Interval)
assert.Equal(t, fmt.Sprintf("http://%s/v1.0/healthz", net.JoinHostPort(metadata.Properties[nr.HostAddress], metadata.Properties[nr.DaprHTTPPort])), check.HTTP)
assert.Equal(t, fmt.Sprintf("http://%s/v1.0/healthz?appid=%s", net.JoinHostPort(metadata.Properties[nr.HostAddress], metadata.Properties[nr.DaprHTTPPort]), metadata.Properties[nr.AppID]), check.HTTP)

// Metadata
assert.Equal(t, 1, len(actual.Registration.Meta))
Expand Down

0 comments on commit 608e4cb

Please sign in to comment.