mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
client: hookup service wrapper for use within client hooks.
This commit is contained in:
@@ -14,8 +14,6 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/hashicorp/nomad/lib/cpuset"
|
||||
|
||||
metrics "github.com/armon/go-metrics"
|
||||
consulapi "github.com/hashicorp/consul/api"
|
||||
"github.com/hashicorp/consul/lib"
|
||||
@@ -28,6 +26,7 @@ import (
|
||||
"github.com/hashicorp/nomad/command/agent/event"
|
||||
"github.com/hashicorp/nomad/helper/pluginutils/loader"
|
||||
"github.com/hashicorp/nomad/helper/uuid"
|
||||
"github.com/hashicorp/nomad/lib/cpuset"
|
||||
"github.com/hashicorp/nomad/nomad"
|
||||
"github.com/hashicorp/nomad/nomad/deploymentwatcher"
|
||||
"github.com/hashicorp/nomad/nomad/structs"
|
||||
@@ -891,7 +890,6 @@ func (a *Agent) setupClient() error {
|
||||
if !a.config.Client.Enabled {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Setup the configuration
|
||||
conf, err := a.clientConfig()
|
||||
if err != nil {
|
||||
|
||||
@@ -15,6 +15,8 @@ import (
|
||||
"github.com/hashicorp/nomad/client/config"
|
||||
"github.com/hashicorp/nomad/client/devicemanager"
|
||||
"github.com/hashicorp/nomad/client/pluginmanager/drivermanager"
|
||||
regMock "github.com/hashicorp/nomad/client/serviceregistration/mock"
|
||||
"github.com/hashicorp/nomad/client/serviceregistration/wrapper"
|
||||
"github.com/hashicorp/nomad/client/state"
|
||||
"github.com/hashicorp/nomad/client/vaultclient"
|
||||
"github.com/hashicorp/nomad/command/agent/consul"
|
||||
@@ -93,6 +95,7 @@ func TestConsul_Integration(t *testing.T) {
|
||||
Name: "httpd",
|
||||
PortLabel: "http",
|
||||
Tags: []string{"nomad", "test", "http"},
|
||||
Provider: structs.ServiceProviderConsul,
|
||||
Checks: []*structs.ServiceCheck{
|
||||
{
|
||||
Name: "httpd-http-check",
|
||||
@@ -114,6 +117,7 @@ func TestConsul_Integration(t *testing.T) {
|
||||
{
|
||||
Name: "httpd2",
|
||||
PortLabel: "http",
|
||||
Provider: structs.ServiceProviderConsul,
|
||||
Tags: []string{
|
||||
"test",
|
||||
// Use URL-unfriendly tags to test #3620
|
||||
@@ -162,6 +166,7 @@ func TestConsul_Integration(t *testing.T) {
|
||||
DeviceManager: devicemanager.NoopMockManager(),
|
||||
DriverManager: drivermanager.TestDriverManager(t),
|
||||
StartConditionMetCtx: closedCh,
|
||||
ServiceRegWrapper: wrapper.NewHandlerWrapper(logger, serviceClient, regMock.NewServiceRegistrationHandler(logger)),
|
||||
}
|
||||
|
||||
tr, err := taskrunner.NewTaskRunner(config)
|
||||
|
||||
Reference in New Issue
Block a user