diff --git a/agent/agent.go b/agent/agent.go index 0c1483b954ab..295c38d9370b 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -1528,6 +1528,7 @@ func (a *Agent) AddService(service *structs.NodeService, chkTypes []*structs.Che Notes: chkType.Notes, ServiceID: service.ID, ServiceName: service.Service, + ServiceTags: service.Tags, } if chkType.Status != "" { check.Status = chkType.Status diff --git a/agent/agent_test.go b/agent/agent_test.go index 348b3b48cc05..4c2a783937ca 100644 --- a/agent/agent_test.go +++ b/agent/agent_test.go @@ -391,6 +391,7 @@ func TestAgent_AddService(t *testing.T) { Notes: "note1", ServiceID: "svcid1", ServiceName: "svcname1", + ServiceTags: []string{"tag1"}, }, }, }, @@ -430,6 +431,7 @@ func TestAgent_AddService(t *testing.T) { Notes: "note1", ServiceID: "svcid2", ServiceName: "svcname2", + ServiceTags: []string{"tag2"}, }, "check-noname": &structs.HealthCheck{ Node: "node1", @@ -438,6 +440,7 @@ func TestAgent_AddService(t *testing.T) { Status: "critical", ServiceID: "svcid2", ServiceName: "svcname2", + ServiceTags: []string{"tag2"}, }, "service:svcid2:3": &structs.HealthCheck{ Node: "node1", @@ -446,6 +449,7 @@ func TestAgent_AddService(t *testing.T) { Status: "critical", ServiceID: "svcid2", ServiceName: "svcname2", + ServiceTags: []string{"tag2"}, }, "service:svcid2:4": &structs.HealthCheck{ Node: "node1", @@ -454,6 +458,7 @@ func TestAgent_AddService(t *testing.T) { Status: "critical", ServiceID: "svcid2", ServiceName: "svcname2", + ServiceTags: []string{"tag2"}, }, }, },