@@ -1976,22 +1976,23 @@ var _ = Describe("Fake client", func() {
1976
1976
sa := & corev1.ServiceAccount {ObjectMeta : metav1.ObjectMeta {Name : "foo" }}
1977
1977
cl := NewClientBuilder ().Build ()
1978
1978
1979
- tokenRequest := & authenticationv1.TokenRequest {}
1980
- err := cl .SubResource ("token" ).Create (context .Background (), sa , tokenRequest )
1979
+ err := cl .SubResource ("token" ).Create (context .Background (), sa , & authenticationv1.TokenRequest {})
1981
1980
Expect (err ).To (HaveOccurred ())
1982
1981
Expect (apierrors .IsNotFound (err )).To (BeTrue ())
1983
1982
})
1984
1983
1985
1984
It ("should error when creating a token with the wrong subresource type" , func () {
1986
1985
cl := NewClientBuilder ().Build ()
1987
1986
err := cl .SubResource ("token" ).Create (context .Background (), & corev1.ServiceAccount {}, & corev1.Namespace {})
1987
+ Expect (err ).To (HaveOccurred ())
1988
1988
Expect (apierrors .IsBadRequest (err )).To (BeTrue ())
1989
1989
})
1990
1990
1991
1991
It ("should error when creating a token with the wrong type" , func () {
1992
1992
cl := NewClientBuilder ().Build ()
1993
- err := cl .SubResource ("token" ).Create (context .Background (), & corev1.Secret {}, & corev1.Namespace {})
1994
- Expect (apierrors .IsBadRequest (err )).To (BeTrue ())
1993
+ err := cl .SubResource ("token" ).Create (context .Background (), & corev1.Secret {}, & authenticationv1.TokenRequest {})
1994
+ Expect (err ).To (HaveOccurred ())
1995
+ Expect (apierrors .IsNotFound (err )).To (BeTrue ())
1995
1996
})
1996
1997
1997
1998
It ("should leave typemeta empty on typed get" , func () {
0 commit comments