Skip to content

Commit

Permalink
OCPBUGS-31868: allow for some errors checking namespace delete
Browse files Browse the repository at this point in the history
Signed-off-by: Jamo Luhrsen <[email protected]>
  • Loading branch information
jluhrsen committed May 1, 2024
1 parent 07e13e2 commit a14d10b
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"crypto/tls"
_ "embed"
"errors"
"fmt"
"net"
"net/http"
Expand Down Expand Up @@ -281,7 +282,6 @@ func (w *availability) namespaceDeleted(ctx context.Context) (bool, error) {
}

if err != nil {
logrus.Errorf("Error checking for deleted namespace: %s, %s", w.namespaceName, err.Error())
return false, err
}

Expand All @@ -301,8 +301,12 @@ func (w *availability) Cleanup(ctx context.Context) error {
log.Info("waiting for namespace deletion to complete")
err := wait.PollUntilContextTimeout(ctx, 15*time.Second, 20*time.Minute, true, w.namespaceDeleted)
if err != nil {
log.WithError(err).Error("error waiting for namespace to delete")
return err
if errors.Is(err, context.DeadlineExceeded) {
log.Errorf("Timed out after 15 minutes waiting for deleted namespace: %s, %s", w.namespaceName, err)
return err
} else {
log.Errorf("Encountered error while waiting for deleted namespace: %s, %s", w.namespaceName, err)
}
}
log.Infof("namespace deleted in %.2f seconds", time.Now().Sub(startTime).Seconds())
}
Expand Down

0 comments on commit a14d10b

Please sign in to comment.