diff --git a/internal/app/machined/pkg/runtime/v1alpha1/v1alpha1_sequencer.go b/internal/app/machined/pkg/runtime/v1alpha1/v1alpha1_sequencer.go index c964044ed2..4558c4f790 100644 --- a/internal/app/machined/pkg/runtime/v1alpha1/v1alpha1_sequencer.go +++ b/internal/app/machined/pkg/runtime/v1alpha1/v1alpha1_sequencer.go @@ -371,14 +371,14 @@ func (*Sequencer) StageUpgrade(r runtime.Runtime, in *machineapi.UpgradeRequest) case runtime.ModeContainer: return nil default: - phases = phases.AppendWhen( - !in.GetPreserve() && (r.Config().Machine().Type() != machine.TypeJoin), - "leave", - LeaveEtcd, - ).Append( + phases = phases.Append( "cleanup", StopAllPods, StopNetworkd, + ).AppendWhen( + !in.GetPreserve() && (r.Config().Machine().Type() != machine.TypeJoin), + "leave", + LeaveEtcd, ).AppendList( stopAllPhaselist(r), ).Append( @@ -401,10 +401,6 @@ func (*Sequencer) Upgrade(r runtime.Runtime, in *machineapi.UpgradeRequest) []ru phases = phases.Append( "drain", CordonAndDrainNode, - ).AppendWhen( - !in.GetPreserve() && (r.Config().Machine().Type() != machine.TypeJoin), - "leave", - LeaveEtcd, ).AppendWhen( !in.GetPreserve(), "cleanup", @@ -415,6 +411,10 @@ func (*Sequencer) Upgrade(r runtime.Runtime, in *machineapi.UpgradeRequest) []ru "cleanup", StopAllPods, StopNetworkd, + ).AppendWhen( + !in.GetPreserve() && (r.Config().Machine().Type() != machine.TypeJoin), + "leave", + LeaveEtcd, ).Append( "stopServices", StopServicesForUpgrade,