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:
parent
c22ac17dfe
commit
dae62929e0
@ -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.
|
// Check that we can't use the impersonation proxy to execute kubectl commands yet.
|
||||||
_, err = impersonationProxyViaSquidKubeClientWithoutCredential().CoreV1().Namespaces().List(ctx, metav1.ListOptions{})
|
_, 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).
|
// Create configuration to make the impersonation proxy turn on with a hard coded endpoint (without a load balancer).
|
||||||
configMap := configMapForConfig(t, env, impersonator.Config{
|
configMap := configMapForConfig(t, env, impersonator.Config{
|
||||||
|
Loading…
Reference in New Issue
Block a user