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