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.
This commit is contained in:
Tim Gross
2023-11-30 11:13:47 -05:00
committed by GitHub
parent ae403dcb4b
commit 79c74bf125

View File

@@ -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)
}
}
}