Skip to content

Commit dc43263

Browse files
authored
[Bugfix] Fix AF Mode (#1611)
1 parent 095e261 commit dc43263

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- (Feature) Deployment & Members Condition metrics
1414
- (Maintenance) Update Go to 1.21.8 & Dependencies
1515
- (Feature) (ArangoBackup) Propagate message during retries
16+
- (Bugfix) Fix ActiveFailover Mode
1617

1718
## [1.2.38](https://github.com/arangodb/kube-arangodb/tree/1.2.38) (2024-02-22)
1819
- (Feature) Extract GRPC Server

pkg/deployment/deployment_inspector.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ func (d *Deployment) inspectDeploymentWithError(ctx context.Context, lastInterva
384384

385385
return minInspectionInterval, nil
386386
} else {
387-
isUpToDate, reason := d.isUpToDateStatus(status)
387+
isUpToDate, reason := d.isUpToDateStatus(currentSpec.GetMode(), status)
388388

389389
if !isUpToDate && status.Conditions.IsTrue(api.ConditionTypeUpToDate) {
390390
if err = d.updateConditionWithHash(ctx, api.ConditionTypeUpToDate, false, reason, "There are pending operations in plan or members are in restart process", *v); err != nil {
@@ -451,7 +451,7 @@ func (d *Deployment) sendCIUpdate() {
451451
}
452452
}
453453

454-
func (d *Deployment) isUpToDateStatus(status api.DeploymentStatus) (upToDate bool, reason string) {
454+
func (d *Deployment) isUpToDateStatus(mode api.DeploymentMode, status api.DeploymentStatus) (upToDate bool, reason string) {
455455
if status.NonInternalActions() > 0 {
456456
return false, "Plan is not empty"
457457
}
@@ -494,10 +494,12 @@ func (d *Deployment) isUpToDateStatus(status api.DeploymentStatus) (upToDate boo
494494
reason = "PVC is resizing"
495495
return
496496
}
497-
if !member.Conditions.IsTrue(api.ConditionTypeReady) {
498-
upToDate = false
499-
reason = "Not all members are ready"
500-
return
497+
if mode != api.DeploymentModeActiveFailover {
498+
if !member.Conditions.IsTrue(api.ConditionTypeReady) {
499+
upToDate = false
500+
reason = "Not all members are ready"
501+
return
502+
}
501503
}
502504
}
503505

pkg/util/affinity/affinity.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ func MergeNodeSelector(a, b *core.NodeSelector) *core.NodeSelector {
182182
sa.MatchExpressions = append(sa.MatchExpressions, sb.MatchExpressions...)
183183
sa.MatchFields = append(sa.MatchFields, sb.MatchFields...)
184184

185-
if len(sa.MatchExpressions) == 0 || len(sa.MatchFields) == 0 {
185+
if len(sa.MatchExpressions) == 0 && len(sa.MatchFields) == 0 {
186186
continue
187187
}
188188

0 commit comments

Comments
 (0)