Skip to content

Commit dad2c2d

Browse files
authored
[Bugfix] Remove Condition Check (#1681)
1 parent 70cdbff commit dad2c2d

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- (Feature) Fix CRD Schema types
66
- (Bugfix) Adjust Prometheus Monitor labels
77
- (Feature) Expose HTTP Client Config
8+
- (Bugfix) MarkedToRemove Condition Check
89

910
## [1.2.41](https://github.com/arangodb/kube-arangodb/tree/1.2.41) (2024-05-24)
1011
- (Maintenance) Bump Prometheus API Version

pkg/deployment/reconcile/helper_shutdown.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,18 @@ func getShutdownHelper(a actionImpl) (ActionCore, api.MemberStatus, bool) {
6161
return nil, api.MemberStatus{}, false
6262
}
6363

64-
if ifPodUIDMismatch(m, a.action, cache) {
65-
a.log.Error("Member UID is changed")
66-
return NewActionSuccess(), m, true
67-
}
68-
6964
pod, ok := cache.Pod().V1().GetSimple(m.Pod.GetName())
7065
if !ok {
7166
a.log.Str("pod-name", m.Pod.GetName()).Warn("pod is already gone")
7267
// Pod does not exist, so create success action to finish it immediately.
7368
return NewActionSuccess(), m, true
7469
}
7570

71+
if ifPodUIDMismatch(m, a.action, cache) {
72+
a.log.Error("Member UID is changed")
73+
return NewActionSuccess(), m, true
74+
}
75+
7676
if _, ok := pod.GetAnnotations()[deployment.ArangoDeploymentPodDeleteNow]; ok {
7777
// The pod contains annotation, so pod must be deleted immediately.
7878
return shutdownNow{actionImpl: a, memberStatus: m}, m, true

pkg/deployment/reconcile/plan_builder_scale.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -140,10 +140,12 @@ func (r *Reconciler) createReplaceMemberPlan(ctx context.Context, apiObject k8su
140140

141141
switch group {
142142
case api.ServerGroupDBServers:
143-
plan = append(plan, actions.NewAction(api.ActionTypeAddMember, group, sharedReconcile.WithPredefinedMember("")))
144-
r.planLogger.
145-
Str("role", group.AsRole()).
146-
Debug("Creating replacement plan")
143+
if len(status.Members.DBServers) <= spec.DBServers.GetCount() {
144+
plan = append(plan, actions.NewAction(api.ActionTypeAddMember, group, sharedReconcile.WithPredefinedMember("")))
145+
r.planLogger.
146+
Str("role", group.AsRole()).
147+
Debug("Creating replacement plan")
148+
}
147149
case api.ServerGroupCoordinators:
148150
plan = append(plan, cleanOutMember(group, member)...)
149151
r.planLogger.

0 commit comments

Comments
 (0)