-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement multi Rook/Ceph env e2e #27
Conversation
d237b0b
to
19433d7
Compare
test/e2e/multi_rook_ceph_test.go
Outdated
_, stderr, err := kubectl("delete", "sc", sc) | ||
Expect(err).NotTo(HaveOccurred(), string(stderr)) | ||
}) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about deleting RBD images in the second cluster as the old code did? It's the teardown logic and it should cleanup the environment as possible.
d41cd5f
to
d5729d3
Compare
test/e2e/util.go
Outdated
images := []string{} | ||
clones := []string{} | ||
snaps := []string{} | ||
// remove RBD snapshots first |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to mention RBD clone images.
// remove RBD snapshots first | |
// remove RBD clone images of targets, RBD anspshots of targets, and target images in order | |
// to remove them cleanly. |
It("delete resources in the namespace: "+ns, func() { | ||
err := deleteNamespacedResource(ns, "mantlerestore") | ||
Expect(err).NotTo(HaveOccurred()) | ||
err = deleteNamespacedResource(ns, "mantlebackup") | ||
Expect(err).NotTo(HaveOccurred()) | ||
err = deleteNamespacedResource(ns, "pvc") | ||
Expect(err).NotTo(HaveOccurred()) | ||
}) | ||
|
||
It("delete the namespace: "+ns, func() { | ||
_, stderr, err := kubectl("delete", "namespace", ns) | ||
Expect(err).NotTo(HaveOccurred(), string(stderr)) | ||
}) | ||
} | ||
|
||
It("clean up the SCs and RBD pools", func() { | ||
for _, sc := range []string{test.storageClassName1, test.storageClassName2} { | ||
_, stderr, err := kubectl("delete", "sc", sc) | ||
Expect(err).NotTo(HaveOccurred(), string(stderr)) | ||
} | ||
|
||
for _, ns := range []string{cephCluster1Namespace, cephCluster2Namespace} { | ||
err := removeAllRBDImageAndSnap(ns, test.poolName) | ||
Expect(err).NotTo(HaveOccurred()) | ||
|
||
_, _, err = kubectl("delete", "-n", ns, "cephblockpool", test.poolName, "--wait=false") | ||
Expect(err).NotTo(HaveOccurred()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to continue the teardown even if some deletion failed not to restore clean environment as possible.
It("delete resources in the namespace: "+ns, func() { | |
err := deleteNamespacedResource(ns, "mantlerestore") | |
Expect(err).NotTo(HaveOccurred()) | |
err = deleteNamespacedResource(ns, "mantlebackup") | |
Expect(err).NotTo(HaveOccurred()) | |
err = deleteNamespacedResource(ns, "pvc") | |
Expect(err).NotTo(HaveOccurred()) | |
}) | |
It("delete the namespace: "+ns, func() { | |
_, stderr, err := kubectl("delete", "namespace", ns) | |
Expect(err).NotTo(HaveOccurred(), string(stderr)) | |
}) | |
} | |
It("clean up the SCs and RBD pools", func() { | |
for _, sc := range []string{test.storageClassName1, test.storageClassName2} { | |
_, stderr, err := kubectl("delete", "sc", sc) | |
Expect(err).NotTo(HaveOccurred(), string(stderr)) | |
} | |
for _, ns := range []string{cephCluster1Namespace, cephCluster2Namespace} { | |
err := removeAllRBDImageAndSnap(ns, test.poolName) | |
Expect(err).NotTo(HaveOccurred()) | |
_, _, err = kubectl("delete", "-n", ns, "cephblockpool", test.poolName, "--wait=false") | |
Expect(err).NotTo(HaveOccurred()) | |
It("delete resources in the namespace: "+ns, func() { | |
err := deleteNamespacedResource(ns, "mantlerestore") | |
err = deleteNamespacedResource(ns, "mantlebackup") | |
err = deleteNamespacedResource(ns, "pvc") | |
}) | |
It("delete the namespace: "+ns, func() { | |
_, stderr, err := kubectl("delete", "namespace", ns) | |
}) | |
} | |
It("clean up the SCs and RBD pools", func() { | |
for _, sc := range []string{test.storageClassName1, test.storageClassName2} { | |
_, stderr, err := kubectl("delete", "sc", sc) | |
} | |
for _, ns := range []string{cephCluster1Namespace, cephCluster2Namespace} { | |
err := removeAllRBDImageAndSnap(ns, test.poolName) | |
_, _, err = kubectl("delete", "-n", ns, "cephblockpool", test.poolName, "--wait=false") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to leave these because the errors raised by tearDown sometimes made me notice cases that I was not noticed. Of course, if you know it will be an error, then it's not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I understood.
It("delete namespace: "+test.tenantNamespace, func() { | ||
_, stderr, err := kubectl("delete", "namespace", test.tenantNamespace) | ||
Expect(err).NotTo(HaveOccurred(), string(stderr)) | ||
}) | ||
|
||
It("clean up the SCs and RBD pools", func() { | ||
_, stderr, err := kubectl("delete", "sc", test.storageClassName) | ||
Expect(err).NotTo(HaveOccurred(), string(stderr)) | ||
|
||
err = removeAllRBDImageAndSnap(cephCluster1Namespace, test.poolName) | ||
Expect(err).NotTo(HaveOccurred()) | ||
|
||
_, _, err = kubectl("delete", "-n", cephCluster1Namespace, "cephblockpool", test.poolName, "--wait=false") | ||
Expect(err).NotTo(HaveOccurred()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as multi_rook_ceph_test.go#tearDownEnv().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's also OK not to fix.
@llamerada-jp This PR will be merged after my last minor change requests. |
Signed-off-by: Yuji Ito <llamerada.jp@gmail.com>
d5729d3
to
31c8679
Compare
No description provided.