Mark complete after upgrade success
This commit is contained in:
@@ -18,11 +18,18 @@ const (
|
|||||||
OSUpgradeProgressPhasePending OSUpgradeProgressPhase = "pending"
|
OSUpgradeProgressPhasePending OSUpgradeProgressPhase = "pending"
|
||||||
OSUpgradeProgressPhaseDownloading OSUpgradeProgressPhase = "downloading"
|
OSUpgradeProgressPhaseDownloading OSUpgradeProgressPhase = "downloading"
|
||||||
OSUpgradeProgressPhaseWriting OSUpgradeProgressPhase = "writing"
|
OSUpgradeProgressPhaseWriting OSUpgradeProgressPhase = "writing"
|
||||||
OSUpgradeProgressPhaseRebooting OSUpgradeProgressPhase = "rebooting"
|
|
||||||
OSUpgradeProgressPhaseVerifying OSUpgradeProgressPhase = "verifying"
|
OSUpgradeProgressPhaseVerifying OSUpgradeProgressPhase = "verifying"
|
||||||
OSUpgradeProgressPhaseCompleted OSUpgradeProgressPhase = "completed"
|
OSUpgradeProgressPhaseCompleted OSUpgradeProgressPhase = "completed"
|
||||||
OSUpgradeProgressPhaseFailed OSUpgradeProgressPhase = "failed"
|
OSUpgradeProgressPhaseFailed OSUpgradeProgressPhase = "failed"
|
||||||
OSUpgradeProgressPhaseRejected OSUpgradeProgressPhase = "rejected"
|
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
|
// +genclient
|
||||||
@@ -36,7 +43,10 @@ type OSUpgrade struct {
|
|||||||
metav1.TypeMeta `json:",inline" yaml:",inline"`
|
metav1.TypeMeta `json:",inline" yaml:",inline"`
|
||||||
metav1.ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`
|
metav1.ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`
|
||||||
|
|
||||||
|
// Specification of the desired behavior of the OSUpgrade.
|
||||||
Spec OSUpgradeSpec `json:"spec,omitempty" yaml:"spec,omitempty"`
|
Spec OSUpgradeSpec `json:"spec,omitempty" yaml:"spec,omitempty"`
|
||||||
|
|
||||||
|
// Most recently observed status of the OSUpgrade.
|
||||||
Status *OSUpgradeStatus `json:"status,omitempty" yaml:"status,omitempty"`
|
Status *OSUpgradeStatus `json:"status,omitempty" yaml:"status,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,7 +101,10 @@ type OSUpgradeProgress struct {
|
|||||||
metav1.TypeMeta `json:",inline" yaml:",inline"`
|
metav1.TypeMeta `json:",inline" yaml:",inline"`
|
||||||
metav1.ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`
|
metav1.ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`
|
||||||
|
|
||||||
|
// Specification of the desired behavior of the OSUpgradeProgress.
|
||||||
Spec OSUpgradeProgressSpec `json:"spec,omitempty" yaml:"spec,omitempty"`
|
Spec OSUpgradeProgressSpec `json:"spec,omitempty" yaml:"spec,omitempty"`
|
||||||
|
|
||||||
|
// Most recently observed status of the OSUpgradeProgress.
|
||||||
Status *OSUpgradeProgressStatus `json:"status,omitempty" yaml:"status,omitempty"`
|
Status *OSUpgradeProgressStatus `json:"status,omitempty" yaml:"status,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -258,7 +258,8 @@ func shouldProcessProgress(osup *monov1alpha1.OSUpgradeProgress) bool {
|
|||||||
|
|
||||||
switch osup.Status.Phase {
|
switch osup.Status.Phase {
|
||||||
case "",
|
case "",
|
||||||
monov1alpha1.OSUpgradeProgressPhasePending:
|
monov1alpha1.OSUpgradeProgressPhasePending,
|
||||||
|
monov1alpha1.OSUpgradeProgressPhaseRebooting:
|
||||||
return true
|
return true
|
||||||
case monov1alpha1.OSUpgradeProgressPhaseFailed:
|
case monov1alpha1.OSUpgradeProgressPhaseFailed:
|
||||||
return osup.Spec.RetryNonce != osup.Status.ObservedRetryNonce
|
return osup.Spec.RetryNonce != osup.Status.ObservedRetryNonce
|
||||||
|
|||||||
Reference in New Issue
Block a user