Skip to content

Commit 7c9b8fd

Browse files
author
Dan Larkin-York
committed
Added placeholder checks for headers and fixed VST issue.
1 parent 85ac0a0 commit 7c9b8fd

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

tests/load_balancer_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ func LoadBalancingCursorSubtest(t *testing.T, useVst bool) {
197197

198198
// keep track of whether at least one request was forwarded internally to the
199199
// correct coordinator behind the load balancer
200-
someRequestForwarded = false
200+
someRequestForwarded := false
201201

202202
// Run tests for every context alternative
203203
for _, qctx := range contexts {
@@ -239,6 +239,8 @@ func LoadBalancingCursorSubtest(t *testing.T, useVst bool) {
239239
t.Error("HasMore returned false, but ReadDocument returns a document")
240240
}
241241
result = append(result, doc.Elem().Interface())
242+
// TODO extract `x-arango-request-served-by` header
243+
// if header exists, set someRequestForwarded = true
242244
}
243245
if len(result) != len(test.ExpectedDocuments) {
244246
t.Errorf("Expected %d documents, got %d in query %d (%s)", len(test.ExpectedDocuments), len(result), i, test.Query)
@@ -261,4 +263,8 @@ func LoadBalancingCursorSubtest(t *testing.T, useVst bool) {
261263
}
262264
}
263265
}
266+
267+
if !someRequestForwarded {
268+
t.Error("Did not detect any request being forwarded behind load balancer!")
269+
}
264270
}

tests/test_util.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ func createArangodVSTClientForDNSName(ctx context.Context, cli corev1.CoreV1Inte
9797
// createArangodVSTConfigForDNSNames creates a go-driver VST connection config for a given DNS names.
9898
func createArangodVSTConfigForDNSNames(ctx context.Context, cli corev1.CoreV1Interface, apiObject *api.ArangoDeployment, dnsNames []string) (vst.ConnectionConfig, error) {
9999
scheme := "http"
100-
tlsConfig := &tls.Config{InsecureSkipVerify: true}
100+
tlsConfig := &tls.Config{}
101101
if apiObject != nil && apiObject.Spec.IsSecure() {
102102
scheme = "https"
103-
tlsConfig = &tls.Config{}
103+
tlsConfig = &tls.Config{InsecureSkipVerify: true}
104104
}
105105
transport := vstProtocol.TransportConfig{
106106
Version: vstProtocol.Version1_1,

0 commit comments

Comments
 (0)