add ErrPodRemovedUnexpectedly error and replace the errant ErrPodRemovedExpectedly errors
@@ -67,6 +67,9 @@ const defaultShutdownGracePeriod = time.Minute
// ErrPodRemovedExpectedly is a constant for the error when a pod is deleted expectedly during a check run
var ErrPodRemovedExpectedly = errors.New("pod deleted expectedly")
+// ErrPodRemovedUnexpectedly is a constant for the error when a pod is deleted unexpectedly during a check run
+var ErrPodRemovedUnexpectedly = errors.New("pod deleted unexpectedly")
+
// ErrPodDeletedBeforeRunning is a constant for the error when a pod is deleted before the check pod running
var ErrPodDeletedBeforeRunning = errors.New("the khcheck check pod is deleted, waiting for start failed")
@@ -626,7 +629,7 @@ func (ext *Checker) RunOnce() error {
ext.log("error from pod shutdown watcher when watching for checker pod to start:", err.Error)
}
ext.log("pod removed unexpectedly while waiting for pod to start running")
- return ErrPodRemovedExpectedly
+ return ErrPodRemovedUnxpectedly
case err = <-ext.waitForPodStart(): // pod started
if err != nil {
ext.cleanup()
@@ -654,7 +657,7 @@ func (ext *Checker) RunOnce() error {
ext.log("error from pod shutdown watcher when watching for checker pod to report results:", err.Error)
}
ext.log("pod removed unexpectedly while waiting for pod to report results")
- return ErrPodRemovedExpectedly
+ return ErrPodRemovedUnexpectedly
case err = <-ext.waitForPodStatusUpdate(lastReportTime): // pod reported in
if err != nil {
errorMessage := "found an error when waiting for pod status to update: " + err.Error()
