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

[Bugfix] Fix Maintenance typo (#964)

This commit is contained in:
Adam Janikowski 2022-04-25 20:01:12 +02:00 committed by GitHub
parent 2e152c35b0
commit ca81d32025
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 13 deletions

View file

@ -12,6 +12,7 @@
- (Bugfix) Reorder Topology management plan steps
- (Feature) UpdateInProgress & UpgradeInProgress Conditions
- (Bugfix) Fix Maintenance switch and HotBackup race
- (Bugfix) Fix Maintenance Condition typo
## [1.2.9](https://github.com/arangodb/kube-arangodb/tree/1.2.9) (2022-03-30)
- (Feature) Improve Kubernetes clientsets management

View file

@ -418,7 +418,7 @@ func (d *Deployment) refreshMaintenanceTTL(ctx context.Context) {
// Check GracePeriod
if t, ok := maintenance.Time(); ok {
if time.Until(t) < d.apiObject.Spec.Timeouts.GetMaintenanceGracePeriod() {
if time.Until(t) < time.Hour-d.apiObject.Spec.Timeouts.GetMaintenanceGracePeriod() {
if err := d.SetAgencyMaintenanceMode(ctx, true); err != nil {
return
}

View file

@ -45,11 +45,11 @@ func createBackupInProgressConditionPlan(ctx context.Context,
currentCondition, currentConditionExists := status.Conditions.Get(api.ConditionTypeBackupInProgress)
backupInProgress := cache.Target.HotBackup.Create
maintenance := cache.Target.HotBackup.Create
if currentConditionExists {
// Condition exists
if !backupInProgress.Exists() {
if !maintenance.Exists() {
// Condition needs to be removed
return api.Plan{
removeConditionActionV2("Backup not in progress", api.ConditionTypeBackupInProgress),
@ -58,7 +58,7 @@ func createBackupInProgressConditionPlan(ctx context.Context,
// Backup is in progress
hash := backupInProgress.Hash()
hash := maintenance.Hash()
if !currentCondition.IsTrue() || currentCondition.Hash != hash {
return api.Plan{
@ -68,9 +68,9 @@ func createBackupInProgressConditionPlan(ctx context.Context,
return nil
} else {
if backupInProgress.Exists() {
if maintenance.Exists() {
return api.Plan{
updateConditionActionV2("Backup in progress", api.ConditionTypeBackupInProgress, true, "Backup In Progress", "", backupInProgress.Hash()),
updateConditionActionV2("Backup in progress", api.ConditionTypeBackupInProgress, true, "Backup In Progress", "", maintenance.Hash()),
}
}
@ -94,32 +94,32 @@ func createMaintenanceConditionPlan(ctx context.Context,
currentCondition, currentConditionExists := status.Conditions.Get(api.ConditionTypeMaintenance)
backupInProgress := cache.Target.HotBackup.Create
maintenance := cache.Supervision.Maintenance
if currentConditionExists {
// Condition exists
if !backupInProgress.Exists() {
if !maintenance.Exists() {
// Condition needs to be removed
return api.Plan{
removeConditionActionV2("Backup not in progress", api.ConditionTypeMaintenance),
removeConditionActionV2("Maintenance Disabled", api.ConditionTypeMaintenance),
}
}
// Backup is in progress
hash := backupInProgress.Hash()
hash := maintenance.Hash()
if !currentCondition.IsTrue() || currentCondition.Hash != hash {
return api.Plan{
updateConditionActionV2("Backup in progress", api.ConditionTypeMaintenance, true, "Backup In Progress", "", hash),
updateConditionActionV2("Maintenance Enabled", api.ConditionTypeMaintenance, true, "Maintenance Enabled", "", hash),
}
}
return nil
} else {
if backupInProgress.Exists() {
if maintenance.Exists() {
return api.Plan{
updateConditionActionV2("Backup in progress", api.ConditionTypeMaintenance, true, "Backup In Progress", "", backupInProgress.Hash()),
updateConditionActionV2("Maintenance Enabled", api.ConditionTypeMaintenance, true, "Maintenance Enabled", "", maintenance.Hash()),
}
}