check if terminating before delete pod
@@ -21,7 +21,7 @@ import (
"github.com/topfreegames/maestro/errors"
"github.com/topfreegames/maestro/reporters"
- "k8s.io/api/core/v1"
+ v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/apimachinery/pkg/util/yaml"
@@ -420,6 +420,10 @@ func IsPodReady(pod *Pod) bool {
return false
}
+func IsPodTerminating(pod *v1.Pod) bool {
+ return pod.ObjectMeta.DeletionTimestamp != nil
+}
+
// ValidatePodWaitingState returns nil if pod waiting reson is valid and error otherwise
// Errors checked:
// - ErrImageNeverPull
