@@ -64,9 +64,9 @@ var _ = framework.KubeDescribe("Security Context", func() {
64
64
AfterEach (func () {
65
65
if podID != "" {
66
66
By ("stop PodSandbox" )
67
- rc .StopPodSandbox (context .TODO (), podID )
67
+ Expect ( rc .StopPodSandbox (context .TODO (), podID )). NotTo ( HaveOccurred () )
68
68
By ("delete PodSandbox" )
69
- rc .RemovePodSandbox (context .TODO (), podID )
69
+ Expect ( rc .RemovePodSandbox (context .TODO (), podID )). NotTo ( HaveOccurred () )
70
70
}
71
71
if podLogDir != "" {
72
72
os .RemoveAll (podLogDir )
@@ -243,7 +243,8 @@ var _ = framework.KubeDescribe("Security Context", func() {
243
243
if err != nil {
244
244
return
245
245
}
246
- conn .Write ([]byte ("hello" ))
246
+ _ , err = conn .Write ([]byte ("hello" ))
247
+ Expect (err ).NotTo (HaveOccurred ())
247
248
}
248
249
}()
249
250
defer srv .Close ()
@@ -264,7 +265,8 @@ var _ = framework.KubeDescribe("Security Context", func() {
264
265
if err != nil {
265
266
return
266
267
}
267
- conn .Write ([]byte ("hello" ))
268
+ _ , err = conn .Write ([]byte ("hello" ))
269
+ Expect (err ).NotTo (HaveOccurred ())
268
270
}
269
271
}()
270
272
defer srv .Close ()
@@ -1075,6 +1077,7 @@ var _ = framework.KubeDescribe("Security Context", func() {
1075
1077
}
1076
1078
1077
1079
runUserNamespacePodWithError (rc , podName , usernsOptions )
1080
+ podID = "" // no need to cleanup the pod
1078
1081
})
1079
1082
1080
1083
It ("runtime should fail if container ID 0 is not mapped" , func () {
@@ -1090,18 +1093,21 @@ var _ = framework.KubeDescribe("Security Context", func() {
1090
1093
}
1091
1094
1092
1095
runUserNamespacePodWithError (rc , podName , usernsOptions )
1096
+ podID = "" // no need to cleanup the pod
1093
1097
})
1094
1098
1095
1099
It ("runtime should fail with NamespaceMode_CONTAINER" , func () {
1096
1100
usernsOptions := & runtimeapi.UserNamespace {Mode : runtimeapi .NamespaceMode_CONTAINER }
1097
1101
1098
1102
runUserNamespacePodWithError (rc , podName , usernsOptions )
1103
+ podID = "" // no need to cleanup the pod
1099
1104
})
1100
1105
1101
1106
It ("runtime should fail with NamespaceMode_TARGET" , func () {
1102
1107
usernsOptions := & runtimeapi.UserNamespace {Mode : runtimeapi .NamespaceMode_TARGET }
1103
1108
1104
1109
runUserNamespacePodWithError (rc , podName , usernsOptions )
1110
+ podID = "" // no need to cleanup the pod
1105
1111
})
1106
1112
})
1107
1113
})
0 commit comments