Skip to content

Commit ca81d32

Browse files
authored
[Bugfix] Fix Maintenance typo (#964)
1 parent 2e152c3 commit ca81d32

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- (Bugfix) Reorder Topology management plan steps
1313
- (Feature) UpdateInProgress & UpgradeInProgress Conditions
1414
- (Bugfix) Fix Maintenance switch and HotBackup race
15+
- (Bugfix) Fix Maintenance Condition typo
1516

1617
## [1.2.9](https://github.com/arangodb/kube-arangodb/tree/1.2.9) (2022-03-30)
1718
- (Feature) Improve Kubernetes clientsets management

pkg/deployment/deployment_inspector.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ func (d *Deployment) refreshMaintenanceTTL(ctx context.Context) {
418418

419419
// Check GracePeriod
420420
if t, ok := maintenance.Time(); ok {
421-
if time.Until(t) < d.apiObject.Spec.Timeouts.GetMaintenanceGracePeriod() {
421+
if time.Until(t) < time.Hour-d.apiObject.Spec.Timeouts.GetMaintenanceGracePeriod() {
422422
if err := d.SetAgencyMaintenanceMode(ctx, true); err != nil {
423423
return
424424
}

pkg/deployment/reconcile/plan_builder_maintenance.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ func createBackupInProgressConditionPlan(ctx context.Context,
4545

4646
currentCondition, currentConditionExists := status.Conditions.Get(api.ConditionTypeBackupInProgress)
4747

48-
backupInProgress := cache.Target.HotBackup.Create
48+
maintenance := cache.Target.HotBackup.Create
4949

5050
if currentConditionExists {
5151
// Condition exists
52-
if !backupInProgress.Exists() {
52+
if !maintenance.Exists() {
5353
// Condition needs to be removed
5454
return api.Plan{
5555
removeConditionActionV2("Backup not in progress", api.ConditionTypeBackupInProgress),
@@ -58,7 +58,7 @@ func createBackupInProgressConditionPlan(ctx context.Context,
5858

5959
// Backup is in progress
6060

61-
hash := backupInProgress.Hash()
61+
hash := maintenance.Hash()
6262

6363
if !currentCondition.IsTrue() || currentCondition.Hash != hash {
6464
return api.Plan{
@@ -68,9 +68,9 @@ func createBackupInProgressConditionPlan(ctx context.Context,
6868

6969
return nil
7070
} else {
71-
if backupInProgress.Exists() {
71+
if maintenance.Exists() {
7272
return api.Plan{
73-
updateConditionActionV2("Backup in progress", api.ConditionTypeBackupInProgress, true, "Backup In Progress", "", backupInProgress.Hash()),
73+
updateConditionActionV2("Backup in progress", api.ConditionTypeBackupInProgress, true, "Backup In Progress", "", maintenance.Hash()),
7474
}
7575
}
7676

@@ -94,32 +94,32 @@ func createMaintenanceConditionPlan(ctx context.Context,
9494

9595
currentCondition, currentConditionExists := status.Conditions.Get(api.ConditionTypeMaintenance)
9696

97-
backupInProgress := cache.Target.HotBackup.Create
97+
maintenance := cache.Supervision.Maintenance
9898

9999
if currentConditionExists {
100100
// Condition exists
101-
if !backupInProgress.Exists() {
101+
if !maintenance.Exists() {
102102
// Condition needs to be removed
103103
return api.Plan{
104-
removeConditionActionV2("Backup not in progress", api.ConditionTypeMaintenance),
104+
removeConditionActionV2("Maintenance Disabled", api.ConditionTypeMaintenance),
105105
}
106106
}
107107

108108
// Backup is in progress
109109

110-
hash := backupInProgress.Hash()
110+
hash := maintenance.Hash()
111111

112112
if !currentCondition.IsTrue() || currentCondition.Hash != hash {
113113
return api.Plan{
114-
updateConditionActionV2("Backup in progress", api.ConditionTypeMaintenance, true, "Backup In Progress", "", hash),
114+
updateConditionActionV2("Maintenance Enabled", api.ConditionTypeMaintenance, true, "Maintenance Enabled", "", hash),
115115
}
116116
}
117117

118118
return nil
119119
} else {
120-
if backupInProgress.Exists() {
120+
if maintenance.Exists() {
121121
return api.Plan{
122-
updateConditionActionV2("Backup in progress", api.ConditionTypeMaintenance, true, "Backup In Progress", "", backupInProgress.Hash()),
122+
updateConditionActionV2("Maintenance Enabled", api.ConditionTypeMaintenance, true, "Maintenance Enabled", "", maintenance.Hash()),
123123
}
124124
}
125125

0 commit comments

Comments
 (0)