Skip to content

Commit 84643e6

Browse files
authored
[Bugfix] Change SyncWorker Affinity to Soft (#1128)
1 parent 198cac5 commit 84643e6

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- (Feature) Active Member condition
77
- (Bugfix) Accept Initial Spec
88
- (Bugfix) Prevent LifeCycle restarts
9+
- (Bugfix) Change SyncWorker Affinity to Soft
910

1011
## [1.2.17](https://github.com/arangodb/kube-arangodb/tree/1.2.17) (2022-09-22)
1112
- (Feature) Add new field to DeploymentReplicationStatus with details on DC2DC sync status=

pkg/deployment/pod/affinity.go

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,13 @@ func AppendAffinityWithRole(p interfaces.PodCreator, a *core.PodAffinity, role s
6464
labelSelector := &meta.LabelSelector{
6565
MatchLabels: k8sutil.LabelsForDeployment(p.GetName(), role),
6666
}
67-
if !p.IsDeploymentMode() {
68-
a.RequiredDuringSchedulingIgnoredDuringExecution = append(a.RequiredDuringSchedulingIgnoredDuringExecution, core.PodAffinityTerm{
67+
a.PreferredDuringSchedulingIgnoredDuringExecution = append(a.PreferredDuringSchedulingIgnoredDuringExecution, core.WeightedPodAffinityTerm{
68+
Weight: 1,
69+
PodAffinityTerm: core.PodAffinityTerm{
6970
LabelSelector: labelSelector,
7071
TopologyKey: shared.TopologyKeyHostname,
71-
})
72-
} else {
73-
a.PreferredDuringSchedulingIgnoredDuringExecution = append(a.PreferredDuringSchedulingIgnoredDuringExecution, core.WeightedPodAffinityTerm{
74-
Weight: 1,
75-
PodAffinityTerm: core.PodAffinityTerm{
76-
LabelSelector: labelSelector,
77-
TopologyKey: shared.TopologyKeyHostname,
78-
},
79-
})
80-
}
72+
},
73+
})
8174
}
8275

8376
func MergePodAntiAffinity(a, b *core.PodAntiAffinity) {

0 commit comments

Comments
 (0)