Skip to content

Commit dba0a37

Browse files
authored
[Feature] Keep only recent terminations (#865)
1 parent b8c687c commit dba0a37

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- Add Plan BackOff functionality
55
- Fix Core InitContainers check
66
- Remove unused `status.members.<group>.sidecars-specs` variable
7+
- Keep only recent terminations
78

89
## [1.2.6](https://github.com/arangodb/kube-arangodb/tree/1.2.6) (2021-12-15)
910
- Add ArangoBackup backoff functionality

pkg/deployment/member/phase_updates.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,16 @@
2323
package member
2424

2525
import (
26+
"time"
27+
2628
api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
2729
"k8s.io/apimachinery/pkg/util/uuid"
2830
)
2931

32+
const (
33+
recentTerminationsKeepPeriod = time.Minute * 30
34+
)
35+
3036
type phaseMapFunc func(action api.Action, m *api.MemberStatus)
3137
type phaseMapTo map[api.MemberPhase]phaseMapFunc
3238
type phaseMap map[api.MemberPhase]phaseMapTo
@@ -77,6 +83,8 @@ func removeMemberConditionsMapFunc(m *api.MemberStatus) {
7783
m.Conditions.Remove(api.ConditionTypeCleanedOut)
7884
m.Conditions.Remove(api.ConditionTypeTopologyAware)
7985

86+
m.RemoveTerminationsBefore(time.Now().Add(-1 * recentTerminationsKeepPeriod))
87+
8088
m.Upgrade = false
8189
}
8290

0 commit comments

Comments
 (0)