Skip to content

Commit

Permalink
Fix integration test expectation for AKS clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
cfryanr committed Sep 27, 2022
1 parent 0d21556 commit 563c193
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/integration/supervisor_oidcclientsecret_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1032,5 +1032,12 @@ func TestOIDCClientSecretRequestUnauthenticated_Parallel(t *testing.T) {
},
}, metav1.CreateOptions{})
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"`)
}
}

0 comments on commit 563c193

Please sign in to comment.