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

When the member is terminated do not set cleaned out state when resigning. Added test for upgrade. (#450)

This commit is contained in:
Lars Maier 2019-09-24 09:23:13 +02:00 committed by Adam Janikowski
parent a4aae7b1fe
commit 83598c4ab6
2 changed files with 19 additions and 5 deletions

View file

@ -216,11 +216,16 @@ func (r *Resources) prepareDBServerPodTermination(ctx context.Context, log zerol
// At this point we have to set CleanedOut to true,
// because we can no longer reason about the state in the agency and
// bringing back the dbserver again may result in an cleaned out server without us knowing
if dbserverDataWillBeGone {
memberStatus.Conditions.Update(api.ConditionTypeCleanedOut, true, "Draining server failed", "")
memberStatus.CleanoutJobID = ""
if memberStatus.Phase == api.MemberPhaseDrain {
memberStatus.Phase = api.MemberPhaseCreated
}
} else if memberStatus.Phase == api.MemberPhaseResign {
memberStatus.Phase = api.MemberPhaseCreated
}
if err := updateMember(memberStatus); err != nil {
return maskAny(err)
}

View file

@ -109,6 +109,15 @@ func TestUpgradeClusterRocksDB346Cto347C(t *testing.T) {
})
}
func TestUpgradeClusterRocksDB348Eto351E(t *testing.T) {
runUpgradeTest(t, &upgradeTest{
fromVersion: "3.4.8",
toVersion: "3.5.1",
toImage: "arangodb/enterprise-preview",
shortTest: true,
})
}
type upgradeTest struct {
fromVersion string
toVersion string