|
|
|
@ -529,7 +529,7 @@ func testAgent_AddService(t *testing.T, extraHCL string) {
|
|
|
|
|
t.Run(tt.desc, func(t *testing.T) { |
|
|
|
|
// check the service registration
|
|
|
|
|
t.Run(tt.srv.ID, func(t *testing.T) { |
|
|
|
|
err := a.AddService(tt.srv, tt.chkTypes, false, "", ConfigSourceLocal) |
|
|
|
|
err := a.AddServiceFromSource(tt.srv, tt.chkTypes, false, "", ConfigSourceLocal) |
|
|
|
|
if err != nil { |
|
|
|
|
t.Fatalf("err: %v", err) |
|
|
|
|
} |
|
|
|
@ -638,7 +638,7 @@ func testAgent_AddServices_AliasUpdateCheckNotReverted(t *testing.T, extraHCL st
|
|
|
|
|
chkTypes, err := service.CheckTypes() |
|
|
|
|
require.NoError(t, err) |
|
|
|
|
|
|
|
|
|
require.NoError(t, a.AddService(ns, chkTypes, false, service.Token, ConfigSourceLocal)) |
|
|
|
|
require.NoError(t, a.AddServiceFromSource(ns, chkTypes, false, service.Token, ConfigSourceLocal)) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
retry.Run(t, func(r *retry.R) { |
|
|
|
@ -665,7 +665,7 @@ func test_createAlias(t *testing.T, agent *TestAgent, chk *structs.CheckType, ex
|
|
|
|
|
if chk.CheckID == "" { |
|
|
|
|
chk.CheckID = types.CheckID(fmt.Sprintf("check-%d", serviceNum)) |
|
|
|
|
} |
|
|
|
|
err := agent.AddService(srv, []*structs.CheckType{chk}, false, "", ConfigSourceLocal) |
|
|
|
|
err := agent.AddServiceFromSource(srv, []*structs.CheckType{chk}, false, "", ConfigSourceLocal) |
|
|
|
|
assert.NoError(t, err) |
|
|
|
|
return func(r *retry.R) { |
|
|
|
|
t.Helper() |
|
|
|
@ -712,7 +712,7 @@ func TestAgent_CheckAliasRPC(t *testing.T) {
|
|
|
|
|
// We ensure to not block and update Agent's index
|
|
|
|
|
srv.Tags = []string{fmt.Sprintf("tag-%s", time.Now())} |
|
|
|
|
assert.NoError(t, a.waitForUp()) |
|
|
|
|
err := a.AddService(srv, []*structs.CheckType{}, false, "", ConfigSourceLocal) |
|
|
|
|
err := a.AddServiceFromSource(srv, []*structs.CheckType{}, false, "", ConfigSourceLocal) |
|
|
|
|
assert.NoError(t, err) |
|
|
|
|
} |
|
|
|
|
shutdownAgent := func() { |
|
|
|
@ -727,7 +727,7 @@ func TestAgent_CheckAliasRPC(t *testing.T) {
|
|
|
|
|
testrpc.WaitForTestAgent(t, a.RPC, "dc1") |
|
|
|
|
|
|
|
|
|
assert.NoError(t, a.waitForUp()) |
|
|
|
|
err := a.AddService(srv, []*structs.CheckType{}, false, "", ConfigSourceLocal) |
|
|
|
|
err := a.AddServiceFromSource(srv, []*structs.CheckType{}, false, "", ConfigSourceLocal) |
|
|
|
|
assert.NoError(t, err) |
|
|
|
|
|
|
|
|
|
retry.Run(t, func(r *retry.R) { |
|
|
|
@ -832,12 +832,12 @@ func testAgent_AddServiceNoExec(t *testing.T, extraHCL string) {
|
|
|
|
|
Interval: 15 * time.Second, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
err := a.AddService(srv, []*structs.CheckType{chk}, false, "", ConfigSourceLocal) |
|
|
|
|
err := a.AddServiceFromSource(srv, []*structs.CheckType{chk}, false, "", ConfigSourceLocal) |
|
|
|
|
if err == nil || !strings.Contains(err.Error(), "Scripts are disabled on this agent") { |
|
|
|
|
t.Fatalf("err: %v", err) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
err = a.AddService(srv, []*structs.CheckType{chk}, false, "", ConfigSourceRemote) |
|
|
|
|
err = a.AddServiceFromSource(srv, []*structs.CheckType{chk}, false, "", ConfigSourceRemote) |
|
|
|
|
if err == nil || !strings.Contains(err.Error(), "Scripts are disabled on this agent") { |
|
|
|
|
t.Fatalf("err: %v", err) |
|
|
|
|
} |
|
|
|
@ -879,7 +879,7 @@ func testAgent_AddServiceNoRemoteExec(t *testing.T, extraHCL string) {
|
|
|
|
|
Interval: 15 * time.Second, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
err := a.AddService(srv, []*structs.CheckType{chk}, false, "", ConfigSourceRemote) |
|
|
|
|
err := a.AddServiceFromSource(srv, []*structs.CheckType{chk}, false, "", ConfigSourceRemote) |
|
|
|
|
if err == nil || !strings.Contains(err.Error(), "Scripts are disabled on this agent") { |
|
|
|
|
t.Fatalf("err: %v", err) |
|
|
|
|
} |
|
|
|
@ -932,7 +932,7 @@ func TestCacheRateLimit(t *testing.T) {
|
|
|
|
|
Address: fmt.Sprintf("10.0.1.%d", i%255), |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
err := a.AddService(srv, []*structs.CheckType{}, false, "", ConfigSourceRemote) |
|
|
|
|
err := a.AddServiceFromSource(srv, []*structs.CheckType{}, false, "", ConfigSourceRemote) |
|
|
|
|
require.Nil(t, err) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1007,7 +1007,7 @@ func TestAddServiceIPv4TaggedDefault(t *testing.T) {
|
|
|
|
|
Address: "10.0.1.2", |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
err := a.AddService(srv, []*structs.CheckType{}, false, "", ConfigSourceRemote) |
|
|
|
|
err := a.AddServiceFromSource(srv, []*structs.CheckType{}, false, "", ConfigSourceRemote) |
|
|
|
|
require.Nil(t, err) |
|
|
|
|
|
|
|
|
|
ns := a.State.Service(structs.NewServiceID("my_service_id", nil)) |
|
|
|
@ -1040,7 +1040,7 @@ func TestAddServiceIPv6TaggedDefault(t *testing.T) {
|
|
|
|
|
Address: "::5", |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
err := a.AddService(srv, []*structs.CheckType{}, false, "", ConfigSourceRemote) |
|
|
|
|
err := a.AddServiceFromSource(srv, []*structs.CheckType{}, false, "", ConfigSourceRemote) |
|
|
|
|
require.Nil(t, err) |
|
|
|
|
|
|
|
|
|
ns := a.State.Service(structs.NewServiceID("my_service_id", nil)) |
|
|
|
@ -1079,7 +1079,7 @@ func TestAddServiceIPv4TaggedSet(t *testing.T) {
|
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
err := a.AddService(srv, []*structs.CheckType{}, false, "", ConfigSourceRemote) |
|
|
|
|
err := a.AddServiceFromSource(srv, []*structs.CheckType{}, false, "", ConfigSourceRemote) |
|
|
|
|
require.Nil(t, err) |
|
|
|
|
|
|
|
|
|
ns := a.State.Service(structs.NewServiceID("my_service_id", nil)) |
|
|
|
@ -1118,7 +1118,7 @@ func TestAddServiceIPv6TaggedSet(t *testing.T) {
|
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
err := a.AddService(srv, []*structs.CheckType{}, false, "", ConfigSourceRemote) |
|
|
|
|
err := a.AddServiceFromSource(srv, []*structs.CheckType{}, false, "", ConfigSourceRemote) |
|
|
|
|
require.Nil(t, err) |
|
|
|
|
|
|
|
|
|
ns := a.State.Service(structs.NewServiceID("my_service_id", nil)) |
|
|
|
@ -1173,7 +1173,7 @@ func testAgent_RemoveService(t *testing.T, extraHCL string) {
|
|
|
|
|
} |
|
|
|
|
chkTypes := []*structs.CheckType{{TTL: time.Minute}} |
|
|
|
|
|
|
|
|
|
if err := a.AddService(srv, chkTypes, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
if err := a.AddServiceFromSource(srv, chkTypes, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
t.Fatalf("err: %v", err) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1208,7 +1208,7 @@ func testAgent_RemoveService(t *testing.T, extraHCL string) {
|
|
|
|
|
{TTL: time.Minute}, |
|
|
|
|
{TTL: 30 * time.Second}, |
|
|
|
|
} |
|
|
|
|
if err := a.AddService(srv, chkTypes, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
if err := a.AddServiceFromSource(srv, chkTypes, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
t.Fatalf("err: %v", err) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1222,7 +1222,7 @@ func testAgent_RemoveService(t *testing.T, extraHCL string) {
|
|
|
|
|
{TTL: time.Minute}, |
|
|
|
|
{TTL: 30 * time.Second}, |
|
|
|
|
} |
|
|
|
|
if err := a.AddService(srv, chkTypes, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
if err := a.AddServiceFromSource(srv, chkTypes, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
t.Fatalf("err: %v", err) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1294,7 +1294,7 @@ func testAgent_RemoveServiceRemovesAllChecks(t *testing.T, extraHCL string) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// register service with chk1
|
|
|
|
|
if err := a.AddService(svc, []*structs.CheckType{chk1}, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
if err := a.AddServiceFromSource(svc, []*structs.CheckType{chk1}, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
t.Fatal("Failed to register service", err) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1302,7 +1302,7 @@ func testAgent_RemoveServiceRemovesAllChecks(t *testing.T, extraHCL string) {
|
|
|
|
|
requireCheckExists(t, a, "chk1") |
|
|
|
|
|
|
|
|
|
// update the service with chk2
|
|
|
|
|
if err := a.AddService(svc, []*structs.CheckType{chk2}, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
if err := a.AddServiceFromSource(svc, []*structs.CheckType{chk2}, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
t.Fatal("Failed to update service", err) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1359,7 +1359,7 @@ func verifyIndexChurn(t *testing.T, tags []string) {
|
|
|
|
|
Tags: tags, |
|
|
|
|
Weights: weights, |
|
|
|
|
} |
|
|
|
|
if err := a.AddService(svc, nil, true, "", ConfigSourceLocal); err != nil { |
|
|
|
|
if err := a.AddServiceFromSource(svc, nil, true, "", ConfigSourceLocal); err != nil { |
|
|
|
|
t.Fatalf("err: %v", err) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1767,7 +1767,7 @@ func TestAgent_RestoreServiceWithAliasCheck(t *testing.T) {
|
|
|
|
|
|
|
|
|
|
registerServicesAndChecks := func(t *testing.T, a *TestAgent) { |
|
|
|
|
// add one persistent service with a simple check
|
|
|
|
|
require.NoError(t, a.AddService( |
|
|
|
|
require.NoError(t, a.AddServiceFromSource( |
|
|
|
|
&structs.NodeService{ |
|
|
|
|
ID: "ping", |
|
|
|
|
Service: "ping", |
|
|
|
@ -1786,7 +1786,7 @@ func TestAgent_RestoreServiceWithAliasCheck(t *testing.T) {
|
|
|
|
|
|
|
|
|
|
// add one persistent sidecar service with an alias check in the manner
|
|
|
|
|
// of how sidecar_service would add it
|
|
|
|
|
require.NoError(t, a.AddService( |
|
|
|
|
require.NoError(t, a.AddServiceFromSource( |
|
|
|
|
&structs.NodeService{ |
|
|
|
|
ID: "ping-sidecar-proxy", |
|
|
|
|
Service: "ping-sidecar-proxy", |
|
|
|
@ -2276,7 +2276,7 @@ func testAgent_PersistService(t *testing.T, extraHCL string) {
|
|
|
|
|
file := filepath.Join(a.Config.DataDir, servicesDir, stringHash(svc.ID)) |
|
|
|
|
|
|
|
|
|
// Check is not persisted unless requested
|
|
|
|
|
if err := a.AddService(svc, nil, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
if err := a.AddServiceFromSource(svc, nil, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
t.Fatalf("err: %v", err) |
|
|
|
|
} |
|
|
|
|
if _, err := os.Stat(file); err == nil { |
|
|
|
@ -2284,7 +2284,7 @@ func testAgent_PersistService(t *testing.T, extraHCL string) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Persists to file if requested
|
|
|
|
|
if err := a.AddService(svc, nil, true, "mytoken", ConfigSourceLocal); err != nil { |
|
|
|
|
if err := a.AddServiceFromSource(svc, nil, true, "mytoken", ConfigSourceLocal); err != nil { |
|
|
|
|
t.Fatalf("err: %v", err) |
|
|
|
|
} |
|
|
|
|
if _, err := os.Stat(file); err != nil { |
|
|
|
@ -2308,7 +2308,7 @@ func testAgent_PersistService(t *testing.T, extraHCL string) {
|
|
|
|
|
|
|
|
|
|
// Updates service definition on disk
|
|
|
|
|
svc.Port = 8001 |
|
|
|
|
if err := a.AddService(svc, nil, true, "mytoken", ConfigSourceLocal); err != nil { |
|
|
|
|
if err := a.AddServiceFromSource(svc, nil, true, "mytoken", ConfigSourceLocal); err != nil { |
|
|
|
|
t.Fatalf("err: %v", err) |
|
|
|
|
} |
|
|
|
|
expected, err = json.Marshal(persistedService{ |
|
|
|
@ -2431,7 +2431,7 @@ func testAgent_PurgeService(t *testing.T, extraHCL string) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
file := filepath.Join(a.Config.DataDir, servicesDir, stringHash(svc.ID)) |
|
|
|
|
if err := a.AddService(svc, nil, true, "", ConfigSourceLocal); err != nil { |
|
|
|
|
if err := a.AddServiceFromSource(svc, nil, true, "", ConfigSourceLocal); err != nil { |
|
|
|
|
t.Fatalf("err: %v", err) |
|
|
|
|
} |
|
|
|
|
// Exists
|
|
|
|
@ -2448,7 +2448,7 @@ func testAgent_PurgeService(t *testing.T, extraHCL string) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Re-add the service
|
|
|
|
|
if err := a.AddService(svc, nil, true, "", ConfigSourceLocal); err != nil { |
|
|
|
|
if err := a.AddServiceFromSource(svc, nil, true, "", ConfigSourceLocal); err != nil { |
|
|
|
|
t.Fatalf("err: %v", err) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -2494,7 +2494,7 @@ func testAgent_PurgeServiceOnDuplicate(t *testing.T, extraHCL string) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// First persist the service
|
|
|
|
|
require.NoError(t, a.AddService(svc1, nil, true, "", ConfigSourceLocal)) |
|
|
|
|
require.NoError(t, a.AddServiceFromSource(svc1, nil, true, "", ConfigSourceLocal)) |
|
|
|
|
a.Shutdown() |
|
|
|
|
|
|
|
|
|
// Try bringing the agent back up with the service already
|
|
|
|
@ -2742,9 +2742,9 @@ func TestAgent_DeregisterPersistedSidecarAfterRestart(t *testing.T) {
|
|
|
|
|
require.NoError(t, err) |
|
|
|
|
|
|
|
|
|
// First persist the check
|
|
|
|
|
err = a.AddService(srv, nil, true, "", ConfigSourceLocal) |
|
|
|
|
err = a.AddServiceFromSource(srv, nil, true, "", ConfigSourceLocal) |
|
|
|
|
require.NoError(t, err) |
|
|
|
|
err = a.AddService(connectSrv, nil, true, "", ConfigSourceLocal) |
|
|
|
|
err = a.AddServiceFromSource(connectSrv, nil, true, "", ConfigSourceLocal) |
|
|
|
|
require.NoError(t, err) |
|
|
|
|
|
|
|
|
|
// check both services were registered
|
|
|
|
@ -2814,7 +2814,7 @@ func TestAgent_unloadChecks(t *testing.T) {
|
|
|
|
|
Tags: []string{"foo"}, |
|
|
|
|
Port: 8000, |
|
|
|
|
} |
|
|
|
|
if err := a.AddService(svc, nil, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
if err := a.AddServiceFromSource(svc, nil, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
t.Fatalf("err: %v", err) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -3093,7 +3093,7 @@ func testAgent_unloadServices(t *testing.T, extraHCL string) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Register the service
|
|
|
|
|
if err := a.AddService(svc, nil, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
if err := a.AddServiceFromSource(svc, nil, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
t.Fatalf("err: %v", err) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -3125,7 +3125,7 @@ func TestAgent_Service_MaintenanceMode(t *testing.T) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Register the service
|
|
|
|
|
if err := a.AddService(svc, nil, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
if err := a.AddServiceFromSource(svc, nil, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
t.Fatalf("err: %v", err) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -3206,7 +3206,7 @@ func TestAgent_Service_Reap(t *testing.T) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Register the service.
|
|
|
|
|
if err := a.AddService(svc, chkTypes, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
if err := a.AddServiceFromSource(svc, chkTypes, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
t.Fatalf("err: %v", err) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -3263,7 +3263,7 @@ func TestAgent_Service_NoReap(t *testing.T) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Register the service.
|
|
|
|
|
if err := a.AddService(svc, chkTypes, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
if err := a.AddServiceFromSource(svc, chkTypes, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
t.Fatalf("err: %v", err) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -3310,7 +3310,7 @@ func testAgent_AddService_restoresSnapshot(t *testing.T, extraHCL string) {
|
|
|
|
|
Tags: []string{"foo"}, |
|
|
|
|
Port: 8000, |
|
|
|
|
} |
|
|
|
|
require.NoError(t, a.AddService(svc, nil, false, "", ConfigSourceLocal)) |
|
|
|
|
require.NoError(t, a.AddServiceFromSource(svc, nil, false, "", ConfigSourceLocal)) |
|
|
|
|
|
|
|
|
|
// Register a check
|
|
|
|
|
check1 := &structs.HealthCheck{ |
|
|
|
@ -3325,7 +3325,7 @@ func testAgent_AddService_restoresSnapshot(t *testing.T, extraHCL string) {
|
|
|
|
|
|
|
|
|
|
// Re-registering the service preserves the state of the check
|
|
|
|
|
chkTypes := []*structs.CheckType{{TTL: 30 * time.Second}} |
|
|
|
|
require.NoError(t, a.AddService(svc, chkTypes, false, "", ConfigSourceLocal)) |
|
|
|
|
require.NoError(t, a.AddServiceFromSource(svc, chkTypes, false, "", ConfigSourceLocal)) |
|
|
|
|
check := requireCheckExists(t, a, "service:redis") |
|
|
|
|
require.Equal(t, api.HealthPassing, check.Status) |
|
|
|
|
} |
|
|
|
@ -3346,7 +3346,7 @@ func TestAgent_AddCheck_restoresSnapshot(t *testing.T) {
|
|
|
|
|
Tags: []string{"foo"}, |
|
|
|
|
Port: 8000, |
|
|
|
|
} |
|
|
|
|
if err := a.AddService(svc, nil, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
if err := a.AddServiceFromSource(svc, nil, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
t.Fatalf("err: %v", err) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -3431,7 +3431,7 @@ func TestAgent_checkStateSnapshot(t *testing.T) {
|
|
|
|
|
Tags: []string{"foo"}, |
|
|
|
|
Port: 8000, |
|
|
|
|
} |
|
|
|
|
if err := a.AddService(svc, nil, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
if err := a.AddServiceFromSource(svc, nil, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
t.Fatalf("err: %v", err) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -4250,7 +4250,7 @@ func TestAgent_RerouteExistingHTTPChecks(t *testing.T) {
|
|
|
|
|
TLSSkipVerify: true, |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
if err := a.AddService(svc, chks, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
if err := a.AddServiceFromSource(svc, chks, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
t.Fatalf("failed to add svc: %v", err) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -4273,7 +4273,7 @@ func TestAgent_RerouteExistingHTTPChecks(t *testing.T) {
|
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
if err := a.AddService(proxy, nil, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
if err := a.AddServiceFromSource(proxy, nil, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
t.Fatalf("failed to add svc: %v", err) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -4326,7 +4326,7 @@ func TestAgent_RerouteExistingHTTPChecks(t *testing.T) {
|
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
if err := a.AddService(proxy, nil, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
if err := a.AddServiceFromSource(proxy, nil, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
t.Fatalf("failed to add svc: %v", err) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -4369,7 +4369,7 @@ func TestAgent_RerouteNewHTTPChecks(t *testing.T) {
|
|
|
|
|
Address: "localhost", |
|
|
|
|
Port: 8080, |
|
|
|
|
} |
|
|
|
|
if err := a.AddService(svc, nil, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
if err := a.AddServiceFromSource(svc, nil, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
t.Fatalf("failed to add svc: %v", err) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -4391,7 +4391,7 @@ func TestAgent_RerouteNewHTTPChecks(t *testing.T) {
|
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
if err := a.AddService(proxy, nil, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
if err := a.AddServiceFromSource(proxy, nil, false, "", ConfigSourceLocal); err != nil { |
|
|
|
|
t.Fatalf("failed to add svc: %v", err) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|