8000 [Bugfix] Clean Phase change properly during upgrade by ajanikow · Pull Request #1832 · arangodb/kube-arangodb · GitHub
[go: up one dir, main page]

Skip to content

[Bugfix] Clean Phase change properly during upgrade #1832

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Change Log

## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A)
- (Bugfix) Clean Phase change properly during upgrade

## [1.2.45](https://github.com/arangodb/kube-arangodb/tree/1.2.45) (2025-02-21)
- (Feature) (Platform) Inventory as Proto
Expand Down
15 changes: 14 additions & 1 deletion pkg/deployment/member/phase_updates.go
10000
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// DISCLAIMER
//
// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany
// Copyright 2016-2025 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.
Expand Down Expand Up @@ -66,6 +66,8 @@ var phase = phaseMap{
d := spec.Architecture.GetDefault()
m.Architecture = &d
}

removeBaseMemberConditionsMapFunc(m)
},
},
api.MemberPhasePending: {
Expand All @@ -79,6 +81,17 @@ var phase = phaseMap{
},
}

func removeBaseMemberConditionsMapFunc(m *api.MemberStatus) {
// Clean conditions
m.Conditions.Remove(api.ConditionTypeReady)
m.Conditions.Remove(api.ConditionTypeActive)
m.Conditions.Remove(api.ConditionTypeStarted)
m.Conditions.Remove(api.ConditionTypeScheduled)
m.Conditions.Remove(api.ConditionTypeReachable)
m.Conditions.Remove(api.ConditionTypeServing)
m.Conditions.Remove(api.ConditionTypeTerminating)
}

func removeMemberConditionsMapFunc(m *api.MemberStatus) {
// Clean conditions
m.Conditions.Remove(api.ConditionTypeReady)
Expand Down
6 changes: 5 additions & 1 deletion pkg/deployment/reconcile/action_wait_for_member_in_sync.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// DISCLAIMER
//
// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany
// Copyright 2016-2025 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.
Expand Down Expand Up @@ -61,6 +61,10 @@ func (a *actionWaitForMemberInSync) CheckProgress(_ context.Context) (bool, bool
return true, false, nil
}

if member.Phase.IsPending() {
return false, false, nil
}

ready, err := a.check()
if err != nil {
return false, false, err
Expand Down
4 changes: 4 additions & 0 deletions pkg/deployment/reconcile/action_wait_for_member_ready.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ func (a *actionWaitForMemberReady) CheckProgress(ctx context.Context) (bool, boo
return true, false, nil
}

if member.Phase.IsPending() {
return false, false, nil
}

if a.actionCtx.GetMode() == api.DeploymentModeActiveFailover {
return true, false, nil
}
Expand Down
20 changes: 16 additions & 4 deletions pkg/deployment/reconcile/action_wait_for_member_up.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ func (a *actionWaitForMemberUp) CheckProgress(ctx context.Context) (bool, bool,
return true, false, nil
}

if member.Phase.IsPending() {
return false, false, nil
}

ctxChild, cancel := globals.GetGlobalTimeouts().ArangoD().WithTimeout(ctx)
defer cancel()

Expand Down Expand Up @@ -106,8 +110,12 @@ func (a *actionWaitForMemberUp) checkProgressSingle() bool {
return false
}

if !m.Conditions.IsTrue(api.ConditionTypeActive) {
a.log.Debug("Member not yet active")
if m.Phase.IsPending() {
return false
}

if !m.Conditions.IsTrue(api.ConditionTypeServing) {
a.log.Debug("Member not yet serving")
return false
}

Expand Down Expand Up @@ -189,8 +197,12 @@ func (a *actionWaitForMemberUp) checkProgressCluster(ctx context.Context) bool {
}
}

if !m.Conditions.IsTrue(api.ConditionTypeActive) {
a.log.Debug("Member not yet active")
if m.Phase.IsPending() {
return false
}

if !m.Conditions.IsTrue(api.ConditionTypeServing) {
a.log.Debug("Member not yet serving")
return false
}

Expand Down
0