commit de830a4e3b1b988aa04cae26ae83485df85d45a36b88f0377bd565373f4dbdff
| author | 斟酌 鵬兄 <tgckpg@gmail.com> |
| date | 2026-04-26T17:24:10Z |
| subject | Mark complete after upgrade success |
commit de830a4e3b1b988aa04cae26ae83485df85d45a36b88f0377bd565373f4dbdff
Author: 斟酌 鵬兄 <tgckpg@gmail.com>
Date: 2026-04-26T17:24:10Z
Mark complete after upgrade success
---
clitools/pkg/apis/monok8s/v1alpha1/osupgrade.go | 19 ++++++++++++++++---
clitools/pkg/controller/osupgrade/handler.go | 3 ++-
2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/clitools/pkg/apis/monok8s/v1alpha1/osupgrade.go b/clitools/pkg/apis/monok8s/v1alpha1/osupgrade.go
index b6b4c98..f172804 100644
--- a/clitools/pkg/apis/monok8s/v1alpha1/osupgrade.go
+++ b/clitools/pkg/apis/monok8s/v1alpha1/osupgrade.go
@@ -18,11 +18,18 @@ const (
OSUpgradeProgressPhasePending OSUpgradeProgressPhase = "pending"
OSUpgradeProgressPhaseDownloading OSUpgradeProgressPhase = "downloading"
OSUpgradeProgressPhaseWriting OSUpgradeProgressPhase = "writing"
- OSUpgradeProgressPhaseRebooting OSUpgradeProgressPhase = "rebooting"
OSUpgradeProgressPhaseVerifying OSUpgradeProgressPhase = "verifying"
OSUpgradeProgressPhaseCompleted OSUpgradeProgressPhase = "completed"
OSUpgradeProgressPhaseFailed OSUpgradeProgressPhase = "failed"
OSUpgradeProgressPhaseRejected OSUpgradeProgressPhase = "rejected"
+
+ // Rebooting is the point-of-no-return phase.
+ //
+ // Once a node reaches Rebooting, the agent may have already changed the boot
+ // environment and requested a reboot. The controller must not supersede,
+ // retry, retarget, or otherwise mutate this progress object until the node
+ // comes back and the agent reports Completed or Failed.
+ OSUpgradeProgressPhaseRebooting OSUpgradeProgressPhase = "rebooting"
)
// +genclient
@@ -36,7 +43,10 @@ type OSUpgrade struct {
metav1.TypeMeta `json:",inline" yaml:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`
- Spec OSUpgradeSpec `json:"spec,omitempty" yaml:"spec,omitempty"`
+ // Specification of the desired behavior of the OSUpgrade.
+ Spec OSUpgradeSpec `json:"spec,omitempty" yaml:"spec,omitempty"`
+
+ // Most recently observed status of the OSUpgrade.
Status *OSUpgradeStatus `json:"status,omitempty" yaml:"status,omitempty"`
}
@@ -91,7 +101,10 @@ type OSUpgradeProgress struct {
metav1.TypeMeta `json:",inline" yaml:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`
- Spec OSUpgradeProgressSpec `json:"spec,omitempty" yaml:"spec,omitempty"`
+ // Specification of the desired behavior of the OSUpgradeProgress.
+ Spec OSUpgradeProgressSpec `json:"spec,omitempty" yaml:"spec,omitempty"`
+
+ // Most recently observed status of the OSUpgradeProgress.
Status *OSUpgradeProgressStatus `json:"status,omitempty" yaml:"status,omitempty"`
}
diff --git a/clitools/pkg/controller/osupgrade/handler.go b/clitools/pkg/controller/osupgrade/handler.go
index 96322df..8680b88 100644
--- a/clitools/pkg/controller/osupgrade/handler.go
+++ b/clitools/pkg/controller/osupgrade/handler.go
@@ -258,7 +258,8 @@ func shouldProcessProgress(osup *monov1alpha1.OSUpgradeProgress) bool {
switch osup.Status.Phase {
case "",
- monov1alpha1.OSUpgradeProgressPhasePending:
+ monov1alpha1.OSUpgradeProgressPhasePending,
+ monov1alpha1.OSUpgradeProgressPhaseRebooting:
return true
case monov1alpha1.OSUpgradeProgressPhaseFailed:
return osup.Spec.RetryNonce != osup.Status.ObservedRetryNonce