Fix integration test expectation for AKS clusters
This commit is contained in:
parent
0d215566d8
commit
563c193499
@ -1032,5 +1032,12 @@ func TestOIDCClientSecretRequestUnauthenticated_Parallel(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}, metav1.CreateOptions{})
|
}, metav1.CreateOptions{})
|
||||||
require.Error(t, err)
|
require.Error(t, err)
|
||||||
require.Contains(t, err.Error(), `User "system:anonymous" cannot create resource "oidcclientsecretrequests"`)
|
|
||||||
|
if env.KubernetesDistribution == testlib.AKSDistro {
|
||||||
|
// On AKS the error just says "Unauthorized".
|
||||||
|
require.Contains(t, err.Error(), "Unauthorized")
|
||||||
|
} else {
|
||||||
|
// Clusters which allow anonymous auth will give a more detailed error.
|
||||||
|
require.Contains(t, err.Error(), `User "system:anonymous" cannot create resource "oidcclientsecretrequests"`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user