Merge pull request #177 from harvester/mergify/bp/release-harvester-v1.5/pr-173

Introduce VM Pending status (backport #173)
This commit is contained in:
Andy Lee 2025-03-04 10:55:29 +08:00 committed by GitHub
commit 6b8b1f68eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -700,8 +700,25 @@ export default class VirtVm extends HarvesterResource {
return null;
}
get isBeingStopped() {
if (this && !this.isVMExpectedRunning && this.isVMCreated && this.vmi?.status?.phase !== VMIPhase.Succeeded) {
get isPending() {
if (this &&
!this.isVMExpectedRunning &&
this.isVMCreated &&
this.vmi?.status?.phase === VMIPhase.Pending
) {
return { status: VMIPhase.Pending };
}
return null;
}
get isStopping() {
if (this &&
!this.isVMExpectedRunning &&
this.isVMCreated &&
this.vmi?.status?.phase !== VMIPhase.Succeeded &&
this.vmi?.status?.phase !== VMIPhase.Pending
) {
return { status: STOPPING };
}
@ -736,7 +753,7 @@ export default class VirtVm extends HarvesterResource {
}
get isUnschedulable() {
if (this.isBeingStopped || this.isStarting) {
if (this.isStopping || this.isStarting) {
const condition = this.status?.conditions?.find((c) => c.reason === UNSCHEDULABLE);
if (!!condition) {
@ -852,7 +869,8 @@ export default class VirtVm extends HarvesterResource {
this.isUnschedulable?.status ||
this.isPaused?.status ||
this.isVMError?.status ||
this.isBeingStopped?.status ||
this.isPending?.status ||
this.isStopping?.status ||
this.isOff?.status ||
this.isError?.status ||
this.isRunning?.status ||