@@ -51,24 +51,24 @@ var _ = SIGDescribe("[Feature:NodeAuthorizer]", func() {
51
51
ns = f .Namespace .Name
52
52
53
53
nodeList , err := f .ClientSet .CoreV1 ().Nodes ().List (metav1.ListOptions {})
54
- Expect ( err ). NotTo ( HaveOccurred () , "failed to list nodes in namespace: %s" , ns )
54
+ framework . ExpectNoError ( err , "failed to list nodes in namespace: %s" , ns )
55
55
Expect (len (nodeList .Items )).NotTo (Equal (0 ))
56
56
nodeName = nodeList .Items [0 ].Name
57
57
asUser = NodeNamePrefix + nodeName
58
58
saName := "default"
59
59
sa , err := f .ClientSet .CoreV1 ().ServiceAccounts (ns ).Get (saName , metav1.GetOptions {})
60
60
Expect (len (sa .Secrets )).NotTo (Equal (0 ))
61
- Expect ( err ). NotTo ( HaveOccurred () , "failed to retrieve service account (%s:%s)" , ns , saName )
61
+ framework . ExpectNoError ( err , "failed to retrieve service account (%s:%s)" , ns , saName )
62
62
defaultSaSecret = sa .Secrets [0 ].Name
63
63
By ("Creating a kubernetes client that impersonates a node" )
64
64
config , err := framework .LoadConfig ()
65
- Expect ( err ). NotTo ( HaveOccurred () , "failed to load kubernetes client config" )
65
+ framework . ExpectNoError ( err , "failed to load kubernetes client config" )
66
66
config .Impersonate = restclient.ImpersonationConfig {
67
67
UserName : asUser ,
68
68
Groups : []string {NodesGroup },
69
69
}
70
70
c , err = clientset .NewForConfig (config )
71
- Expect ( err ). NotTo ( HaveOccurred () , "failed to create Clientset for the given config: %+v" , * config )
71
+ framework . ExpectNoError ( err , "failed to create Clientset for the given config: %+v" , * config )
72
72
73
73
})
74
74
It ("Getting a non-existent secret should exit with the Forbidden error, not a NotFound error" , func () {
@@ -98,7 +98,7 @@ var _ = SIGDescribe("[Feature:NodeAuthorizer]", func() {
98
98
},
99
99
}
100
100
_ , err := f .ClientSet .CoreV1 ().ConfigMaps (ns ).Create (configmap )
101
- Expect ( err ). NotTo ( HaveOccurred () , "failed to create configmap (%s:%s) %+v" , ns , configmap .Name , * configmap )
101
+ framework . ExpectNoError ( err , "failed to create configmap (%s:%s) %+v" , ns , configmap .Name , * configmap )
102
102
_ , err = c .CoreV1 ().ConfigMaps (ns ).Get (configmap .Name , metav1.GetOptions {})
103
103
Expect (apierrors .IsForbidden (err )).Should (Equal (true ))
104
104
})
@@ -115,7 +115,7 @@ var _ = SIGDescribe("[Feature:NodeAuthorizer]", func() {
115
115
},
116
116
}
117
117
_ , err := f .ClientSet .CoreV1 ().Secrets (ns ).Create (secret )
118
- Expect ( err ). NotTo ( HaveOccurred () , "failed to create secret (%s:%s)" , ns , secret .Name )
118
+ framework . ExpectNoError ( err , "failed to create secret (%s:%s)" , ns , secret .Name )
119
119
120
120
By ("Node should not get the secret" )
121
121
_ , err = c .CoreV1 ().Secrets (ns ).Get (secret .Name , metav1.GetOptions {})
@@ -148,7 +148,7 @@ var _ = SIGDescribe("[Feature:NodeAuthorizer]", func() {
148
148
}
149
149
150
150
_ , err = f .ClientSet .CoreV1 ().Pods (ns ).Create (pod )
151
- Expect ( err ). NotTo ( HaveOccurred () , "failed to create pod (%s:%s)" , ns , pod .Name )
151
+ framework . ExpectNoError ( err , "failed to create pod (%s:%s)" , ns , pod .Name )
152
152
153
153
By ("The node should able to access the secret" )
154
154
itv := framework .Poll
@@ -161,7 +161,7 @@ var _ = SIGDescribe("[Feature:NodeAuthorizer]", func() {
161
161
}
162
162
return true , nil
163
163
})
164
- Expect ( err ). NotTo ( HaveOccurred () , "failed to get secret after trying every %v for %v (%s:%s)" , itv , dur , ns , secret .Name )
164
+ framework . ExpectNoError ( err , "failed to get secret after trying every %v for %v (%s:%s)" , itv , dur , ns , secret .Name )
165
165
})
166
166
167
167
It ("A node shouldn't be able to create another node" , func () {
0 commit comments