mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
services: get Consul token from hook resources (#18600)
When Workload Identity is being used with Consul, the `consul_hook` will add Consul tokens to the alloc hook resources. Update the `group_service_hook` and `service_hook` to use those tokens when available for registering and deregistering Consul workloads.
This commit is contained in:
@@ -22,6 +22,7 @@ import (
|
||||
regMock "github.com/hashicorp/nomad/client/serviceregistration/mock"
|
||||
"github.com/hashicorp/nomad/client/serviceregistration/wrapper"
|
||||
"github.com/hashicorp/nomad/client/state"
|
||||
cstructs "github.com/hashicorp/nomad/client/structs"
|
||||
"github.com/hashicorp/nomad/client/vaultclient"
|
||||
"github.com/hashicorp/nomad/command/agent/consul"
|
||||
"github.com/hashicorp/nomad/helper/testlog"
|
||||
@@ -173,6 +174,7 @@ func TestConsul_Integration(t *testing.T) {
|
||||
StartConditionMetCh: closedCh,
|
||||
ServiceRegWrapper: wrapper.NewHandlerWrapper(logger, serviceClient, regMock.NewServiceRegistrationHandler(logger)),
|
||||
Wranglers: proclib.MockWranglers(t),
|
||||
AllocHookResources: cstructs.NewAllocHookResources(),
|
||||
}
|
||||
|
||||
tr, err := taskrunner.NewTaskRunner(config)
|
||||
|
||||
Reference in New Issue
Block a user