Skip to content

Commit 0dbb817

Browse files
author
lamai93
committed
Fixed failed id container. Wait 30s before retry.
1 parent 5dc637d commit 0dbb817

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pkg/deployment/images.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,22 @@ func (ib *imagesBuilder) fetchArangoDBImageIDAndVersion(ctx context.Context, ima
112112
// Check if pod exists
113113
if pod, err := ib.KubeCli.CoreV1().Pods(ns).Get(podName, metav1.GetOptions{}); err == nil {
114114
// Pod found
115+
if k8sutil.IsPodFailed(pod) {
116+
// Wait some time before deleting the pod
117+
log.Debug().Msgf("now: %v, then: %v", time.Now(), pod.GetCreationTimestamp())
118+
if time.Now().After(pod.GetCreationTimestamp().Add(30 * time.Second)) {
119+
if err := ib.KubeCli.CoreV1().Pods(ns).Delete(podName, nil); err != nil && !k8sutil.IsNotFound(err) {
120+
log.Warn().Err(err).Msg("Failed to delete Image ID Pod")
121+
return false, nil
122+
}
123+
}
124+
return false, nil
125+
}
115126
if !k8sutil.IsPodReady(pod) {
116127
log.Debug().Msg("Image ID Pod is not yet ready")
117128
return true, nil
118129
}
130+
119131
if len(pod.Status.ContainerStatuses) == 0 {
120132
log.Warn().Msg("Empty list of ContainerStatuses")
121133
return true, nil

0 commit comments

Comments
 (0)