Skip uninstall and resource cleanup when fail-fast is enabled.

Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
This commit is contained in:
Xun Jiang
2024-09-23 20:24:14 +08:00
parent 3f9c2dc789
commit 1ba78b83bf
26 changed files with 380 additions and 242 deletions
@@ -131,13 +131,16 @@ func (r *ResourceModifiersCase) Verify() error {
func (r *ResourceModifiersCase) Clean() error {
// If created some resources which is not in current test namespace, we NEED to override the base Clean function
if !r.VeleroCfg.Debug {
if CurrentSpecReport().Failed() && r.VeleroCfg.FailFast {
fmt.Println("Test case failed and fail fast is enabled. Skip resource clean up.")
} else {
if err := DeleteConfigmap(r.Client.ClientGo, r.VeleroCfg.VeleroNamespace, r.cmName); err != nil {
return err
}
return r.GetTestCase().Clean() // only clean up resources in test namespace
}
return nil
}