Skip to content

Commit

Permalink
[Feature] Keep only recent terminations (#865)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajanikow authored Dec 23, 2021
1 parent b8c687c commit dba0a37
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Add Plan BackOff functionality
- Fix Core InitContainers check
- Remove unused `status.members.<group>.sidecars-specs` variable
- Keep only recent terminations

## [1.2.6](https://github.com/arangodb/kube-arangodb/tree/1.2.6) (2021-12-15)
- Add ArangoBackup backoff functionality
Expand Down
8 changes: 8 additions & 0 deletions pkg/deployment/member/phase_updates.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,16 @@
package member

import (
"time"

api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
"k8s.io/apimachinery/pkg/util/uuid"
)

const (
recentTerminationsKeepPeriod = time.Minute * 30
)

type phaseMapFunc func(action api.Action, m *api.MemberStatus)
type phaseMapTo map[api.MemberPhase]phaseMapFunc
type phaseMap map[api.MemberPhase]phaseMapTo
Expand Down Expand Up @@ -77,6 +83,8 @@ func removeMemberConditionsMapFunc(m *api.MemberStatus) {
m.Conditions.Remove(api.ConditionTypeCleanedOut)
m.Conditions.Remove(api.ConditionTypeTopologyAware)

m.RemoveTerminationsBefore(time.Now().Add(-1 * recentTerminationsKeepPeriod))

m.Upgrade = false
}

Expand Down

0 comments on commit dba0a37

Please sign in to comment.