kaichiachen commented on code in PR #947:
URL: https://github.com/apache/yunikorn-k8shim/pull/947#discussion_r1923685490


##########
test/e2e/persistent_volume/persistent_volume_test.go:
##########
@@ -338,19 +342,29 @@ func createNfsProvisioner(svaName string, serverName 
string, scName string) {
 func deleteNfsRelatedRoles(serviceAccount string, clusterRole string, 
clusterRoleBinding string) {
        ginkgo.By("Deleting NFS related roles and bindings")
        err := kClient.DeleteClusterRoleBindings(clusterRoleBinding)
+       if err != nil && !k8serrors.IsNotFound(err) {
+               Ω(err).NotTo(HaveOccurred())
+       }
+
        err2 := kClient.DeleteClusterRole(clusterRole)
-       err3 := kClient.DeleteServiceAccount(serviceAccount, dev)
+       if err2 != nil && !k8serrors.IsNotFound(err2) {

Review Comment:
   Thanks Ryan for helping me review!  `k8serrors.IsNotFound` returns true if 
the resource is not found
   At line 147/148
   147          createNfsRbac(saName, crName, crbName)
   148          createNfsProvisioner(saName, serverName, scName)
   At the beginning of the test, resources are created sequentially while some 
of them might be created successfully and some of not. We don't want to show 
resource not found error when cleaning up resources.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to