diff --git a/CHANGELOG.md b/CHANGELOG.md index e945ce9c9..e4c6111c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/pkg/deployment/deployment_inspector.go b/pkg/deployment/deployment_inspector.go index ce69feee7..c3a50a5d1 100644 --- a/pkg/deployment/deployment_inspector.go +++ b/pkg/deployment/deployment_inspector.go @@ -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 { @@ -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" } @@ -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 + } } } diff --git a/pkg/util/affinity/affinity.go b/pkg/util/affinity/affinity.go index 2b40fc264..b5a84a80b 100644 --- a/pkg/util/affinity/affinity.go +++ b/pkg/util/affinity/affinity.go @@ -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 }