Skip to content

Commit

Permalink
fix: statefullset retry on RunContainerError
Browse files Browse the repository at this point in the history
  • Loading branch information
devthejo committed Dec 14, 2022
1 parent 4213ddd commit f6cdbe7
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion pkg/status/statefulset.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package status

import (
"errors"
"fmt"

"github.com/SocialGouv/rollout-status/pkg/client"
Expand All @@ -17,7 +18,18 @@ func TestStatefulSetStatus(wrapper client.Kubernetes, statefulSet appsv1.Statefu
aggr := Aggregator{}
for _, pod := range podList.Items {
status := TestPodStatus(&pod, options)
aggr.Add(status)

if status.Error != nil {
if status.MaybeContinue {
aggr.Add(RolloutErrorProgressing(status.Error))
} else {
aggr.Add(status)
}
} else {
err := errors.New("")
aggr.Add(RolloutErrorProgressing(err))
}

if fatal := aggr.Fatal(); fatal != nil {
return *fatal
}
Expand Down

0 comments on commit f6cdbe7

Please sign in to comment.