test/integration: error assertions pass w/ and w/o middleware

In the case where we are using middleware (e.g., when the api group is
different) in our kubeclient, these error messages have a "...middleware request
for..." bit in the middle.

Signed-off-by: Andrew Keesler <akeesler@vmware.com>
This commit is contained in:
Andrew Keesler 2021-03-18 15:33:47 -04:00
parent c22ac17dfe
commit dae62929e0
No known key found for this signature in database
GPG Key ID: 27CE0444346F9413
1 changed files with 3 additions and 1 deletions

View File

@ -196,7 +196,9 @@ func TestImpersonationProxy(t *testing.T) { //nolint:gocyclo // yeah, it's compl
// Check that we can't use the impersonation proxy to execute kubectl commands yet.
_, err = impersonationProxyViaSquidKubeClientWithoutCredential().CoreV1().Namespaces().List(ctx, metav1.ListOptions{})
require.EqualError(t, err, serviceUnavailableViaSquidError)
require.Error(t, err)
require.Contains(t, err.Error(), proxyServiceEndpoint)
require.Contains(t, err.Error(), ": Service Unavailable")
// Create configuration to make the impersonation proxy turn on with a hard coded endpoint (without a load balancer).
configMap := configMapForConfig(t, env, impersonator.Config{