1
0
Fork 0
mirror of https://github.com/arangodb/kube-arangodb.git synced 2024-12-14 11:57:37 +00:00

[Bugfix] Remove Condition Check (#1681)

This commit is contained in:
Adam Janikowski 2024-07-17 13:07:36 +02:00 committed by GitHub
parent 70cdbff501
commit dad2c2d347
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 10 deletions

View file

@ -5,6 +5,7 @@
- (Feature) Fix CRD Schema types
- (Bugfix) Adjust Prometheus Monitor labels
- (Feature) Expose HTTP Client Config
- (Bugfix) MarkedToRemove Condition Check
## [1.2.41](https://github.com/arangodb/kube-arangodb/tree/1.2.41) (2024-05-24)
- (Maintenance) Bump Prometheus API Version

View file

@ -61,11 +61,6 @@ func getShutdownHelper(a actionImpl) (ActionCore, api.MemberStatus, bool) {
return nil, api.MemberStatus{}, false
}
if ifPodUIDMismatch(m, a.action, cache) {
a.log.Error("Member UID is changed")
return NewActionSuccess(), m, true
}
pod, ok := cache.Pod().V1().GetSimple(m.Pod.GetName())
if !ok {
a.log.Str("pod-name", m.Pod.GetName()).Warn("pod is already gone")
@ -73,6 +68,11 @@ func getShutdownHelper(a actionImpl) (ActionCore, api.MemberStatus, bool) {
return NewActionSuccess(), m, true
}
if ifPodUIDMismatch(m, a.action, cache) {
a.log.Error("Member UID is changed")
return NewActionSuccess(), m, true
}
if _, ok := pod.GetAnnotations()[deployment.ArangoDeploymentPodDeleteNow]; ok {
// The pod contains annotation, so pod must be deleted immediately.
return shutdownNow{actionImpl: a, memberStatus: m}, m, true

View file

@ -1,7 +1,7 @@
//
// DISCLAIMER
//
// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany
// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// 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
switch group {
case api.ServerGroupDBServers:
plan = append(plan, actions.NewAction(api.ActionTypeAddMember, group, sharedReconcile.WithPredefinedMember("")))
r.planLogger.
Str("role", group.AsRole()).
Debug("Creating replacement plan")
if len(status.Members.DBServers) <= spec.DBServers.GetCount() {
plan = append(plan, actions.NewAction(api.ActionTypeAddMember, group, sharedReconcile.WithPredefinedMember("")))
r.planLogger.
Str("role", group.AsRole()).
Debug("Creating replacement plan")
}
case api.ServerGroupCoordinators:
plan = append(plan, cleanOutMember(group, member)...)
r.planLogger.