Bug fix token request in oc tag test
@@ -153,10 +153,9 @@ RUN touch /test-image
err = oc.Run("policy").Args("add-role-to-user", "testrole", "-z", "testsa", "--role-namespace="+oc.Namespace()).Execute()
o.Expect(err).NotTo(o.HaveOccurred())
- err = exutil.WaitForServiceAccount(oc.AdminKubeClient().CoreV1().ServiceAccounts(oc.Namespace()), "testsa")
- o.Expect(err).NotTo(o.HaveOccurred())
-
- token, err := oc.Run("serviceaccounts").Args("get-token", "testsa").Output()
+ // TODO (soltysh): after k8s 1.24 lands we should be able to replace this with:
+ // token, err := oc.Run("create").Args("token", "testsa").Output()
+ token, _, err := oc.Run("serviceaccounts").Args("new-token", "testsa").Outputs()
o.Expect(err).NotTo(o.HaveOccurred())
err = oc.Run("login").Args("--token=" + token).Execute()
