Skip to content

Commit e38dc53

Browse files
committed
backport of commit 142b9d6
1 parent 809564d commit e38dc53

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

agent/consul/catalog_endpoint.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ func servicePreApply(service *structs.NodeService, authz resolver.Result, authzC
202202
}
203203
// Check if service name and service ID are empty.
204204
if service.ID == "" && service.Service == "" {
205-
return fmt.Errorf("Must provide service name (Service.Service)")
205+
return fmt.Errorf("service name (Service.Service) is required; both Service ID (Service.ID) and Service Name cannot be empty")
206206
}
207207

208208
// If no service id, but service name, use default

agent/consul/catalog_endpoint_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ func TestCatalog_Register_RejectsMissingServiceName(t *testing.T) {
334334
var out struct{}
335335
err := msgpackrpc.CallWithCodec(codec, "Catalog.Register", &args, &out)
336336
require.Error(t, err)
337-
require.Contains(t, err.Error(), "Must provide service name (Service.Service)")
337+
require.Contains(t, err.Error(), "service name (Service.Service) is required; both Service ID (Service.ID) and Service Name cannot be empty")
338338
}
339339
func TestCatalog_Register_ForwardLeader(t *testing.T) {
340340
if testing.Short() {

0 commit comments

Comments
 (0)