Skip to content

Commit

Permalink
Log services in mesh_gateway_test. (hashicorp#757)
Browse files Browse the repository at this point in the history
This will help debug errors in connections between static-client and
static-server after federation has been set up. This will provide
information about whether DC1 (static-client) is aware of the
static-server deployment in DC2.
  • Loading branch information
ndhanushkodi authored Jan 6, 2021
1 parent 2bc2f54 commit 62a90ff
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/acceptance/tests/mesh-gateway/mesh_gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,17 @@ func TestMeshGatewayDefault(t *testing.T) {
logger.Log(t, "verifying federation was successful")
verifyFederation(t, primaryClient, secondaryClient, releaseName, false)

// Log services in DC2 that DC1 is aware of before exiting this test
// TODO: remove this code once issue has been debugged
defer func() {
svcs, _, err := primaryClient.Catalog().Services(&api.QueryOptions{Datacenter: "dc2"})
if err != nil {
logger.Logf(t, "error calling primary on /v1/catalog/services?dc=dc2: %s\n", err.Error())
return
}
logger.Logf(t, "primary on /v1/catalog/services?dc=dc2: %+v\n", svcs)
}()

// Check that we can connect services over the mesh gateways
logger.Log(t, "creating static-server in dc2")
k8s.DeployKustomize(t, secondaryContext.KubectlOptions(t), cfg.NoCleanupOnFailure, cfg.DebugDirectory, "../fixtures/cases/static-server-inject")
Expand Down

0 comments on commit 62a90ff

Please sign in to comment.