Skip to content

Commit

Permalink
[Bugfix] Fix AF Mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ajanikow committed Mar 7, 2024
1 parent 25542de commit f81c382
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- (Bugfix) Check Connection to the ArangoDB before creating Backup
- (Feature) Deployment & Members Condition metrics
- (Maintenance) Update Go to 1.21.8 & Dependencies
- (Bugfix) Fix ActiveFailover Mode

## [1.2.38](https://github.com/arangodb/kube-arangodb/tree/1.2.38) (2024-02-22)
- (Feature) Extract GRPC Server
Expand Down
14 changes: 8 additions & 6 deletions pkg/deployment/deployment_inspector.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ func (d *Deployment) inspectDeploymentWithError(ctx context.Context, lastInterva

return minInspectionInterval, nil
} else {
isUpToDate, reason := d.isUpToDateStatus(status)
isUpToDate, reason := d.isUpToDateStatus(currentSpec.GetMode(), status)

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

func (d *Deployment) isUpToDateStatus(status api.DeploymentStatus) (upToDate bool, reason string) {
func (d *Deployment) isUpToDateStatus(mode api.DeploymentMode, status api.DeploymentStatus) (upToDate bool, reason string) {
if status.NonInternalActions() > 0 {
return false, "Plan is not empty"
}
Expand Down Expand Up @@ -494,10 +494,12 @@ func (d *Deployment) isUpToDateStatus(status api.DeploymentStatus) (upToDate boo
reason = "PVC is resizing"
return
}
if !member.Conditions.IsTrue(api.ConditionTypeReady) {
upToDate = false
reason = "Not all members are ready"
return
if mode != api.DeploymentModeActiveFailover {
if !member.Conditions.IsTrue(api.ConditionTypeReady) {
upToDate = false
reason = "Not all members are ready"
return
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/util/affinity/affinity.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func MergeNodeSelector(a, b *core.NodeSelector) *core.NodeSelector {
sa.MatchExpressions = append(sa.MatchExpressions, sb.MatchExpressions...)
sa.MatchFields = append(sa.MatchFields, sb.MatchFields...)

if len(sa.MatchExpressions) == 0 || len(sa.MatchFields) == 0 {
if len(sa.MatchExpressions) == 0 && len(sa.MatchFields) == 0 {
continue
}

Expand Down

0 comments on commit f81c382

Please sign in to comment.