Ensure invalid token returns 401 error

This commit is contained in:
Jordan Liggitt
2017-01-04 01:29:30 -05:00
parent ee03b9b206
commit 0902c55c8b
3 changed files with 38 additions and 4 deletions

View File

@@ -599,8 +599,7 @@ var _ = framework.KubeDescribe("Kubectl client", func() {
Expect(err).To(ContainSubstring("Using in-cluster namespace"))
Expect(err).To(ContainSubstring("Using in-cluster configuration"))
Expect(err).To(ContainSubstring("Authorization: Bearer invalid"))
// TODO(kubernetes/kubernetes#39267): We should only see a 401 from an invalid bearer token.
Expect(err).To(Or(ContainSubstring("Response Status: 403 Forbidden"), ContainSubstring("Response Status: 401 Unauthorized")))
Expect(err).To(ContainSubstring("Response Status: 401 Unauthorized"))
By("trying to use kubectl with invalid server")
_, err = framework.RunHostCmd(ns, simplePodName, "/kubectl get pods --server=invalid --v=6 2>&1")