1
0
Fork 0
mirror of https://github.com/arangodb/kube-arangodb.git synced 2024-12-14 11:57:37 +00:00

[QA] MemberMaintenance feature (#1079)

This commit is contained in:
Adam Janikowski 2022-08-04 13:06:23 +02:00 committed by GitHub
parent 78e29b0d17
commit 46260630dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 7 deletions

View file

@ -13,6 +13,7 @@
- (Bugfix) Ensure that client cache is initialized before using it
- (Feature) (DBServer Maintenance) Agency adjustments
- (Logging) Internal client trace
- (QA) Member maintenance feature
## [1.2.15](https://github.com/arangodb/kube-arangodb/tree/1.2.15) (2022-07-20)
- (Bugfix) Ensure pod names not too long

View file

@ -42,7 +42,7 @@ func withMaintenanceStart(plan ...api.Action) api.Plan {
actions.NewClusterAction(api.ActionTypeEnableMaintenance, "Enable maintenance before actions"))
}
func withMemberMaintenance(group api.ServerGroup, member api.MemberStatus, reason string, plan ...api.Action) api.Plan {
func withMemberMaintenance(group api.ServerGroup, member api.MemberStatus, reason string, plan api.Plan) api.Plan {
if member.Image == nil {
return plan
}
@ -55,12 +55,11 @@ func withMemberMaintenance(group api.ServerGroup, member api.MemberStatus, reaso
return plan
}
return withResignLeadership(group, member, reason, plan...).
Wrap(actions.NewAction(api.ActionTypeEnableMemberMaintenance, group, member, reason),
actions.NewAction(api.ActionTypeDisableMemberMaintenance, group, member, reason))
return plan.Wrap(actions.NewAction(api.ActionTypeEnableMemberMaintenance, group, member, reason),
actions.NewAction(api.ActionTypeDisableMemberMaintenance, group, member, reason))
}
func withResignLeadership(group api.ServerGroup, member api.MemberStatus, reason string, plan ...api.Action) api.Plan {
func withResignLeadership(group api.ServerGroup, member api.MemberStatus, reason string, plan api.Plan) api.Plan {
if member.Image == nil {
return plan
}

View file

@ -510,7 +510,7 @@ func (r *Reconciler) createUpgradeMemberPlan(member api.MemberStatus,
plan = plan.Before(actions.NewClusterAction(api.ActionTypeSetCurrentImage, reason).SetImage(spec.GetImage()))
}
return withSecureWrap(member, group, spec, plan...)
return plan
}
func withSecureWrap(member api.MemberStatus,
@ -524,7 +524,7 @@ func withSecureWrap(member api.MemberStatus,
// In this case we skip resign leadership but we enable maintenance
return withMaintenanceStart(plan...)
} else {
return withMemberMaintenance(group, member, "ResignLeadership", plan...)
return withResignLeadership(group, member, "ResignLeadership", plan)
}
}

View file

@ -59,6 +59,8 @@ func createRotateMemberPlanWithAction(member api.MemberStatus,
actions.NewAction(api.ActionTypeWaitForMemberInSync, group, member),
)
plan = withMemberMaintenance(group, member, "Enable member maintenance", plan)
return plan
}