From 79c74bf12508a65848c81ea1fac3d3cc8e322ea6 Mon Sep 17 00:00:00 2001 From: Tim Gross Date: Thu, 30 Nov 2023 11:13:47 -0500 Subject: [PATCH] service hook: get correct NS for task-level `consul` (#19242) Ensure that the `ServiceProviderNamespace` correctly picks the task-level `consul.namespace` and falls back to the group if set. --- nomad/structs/alloc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nomad/structs/alloc.go b/nomad/structs/alloc.go index 6cb57846b..c6b23ae5b 100644 --- a/nomad/structs/alloc.go +++ b/nomad/structs/alloc.go @@ -53,7 +53,7 @@ func (a *Allocation) ServiceProviderNamespace() string { case ServiceProviderNomad: return a.Job.Namespace default: - return tg.Consul.GetNamespace() + return a.ConsulNamespaceForTask(task.Name) } } }