-
Notifications
You must be signed in to change notification settings - Fork 670
Bug 1873402: Add deleting status #6565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,7 @@ export enum VMStatusSimpleLabel { | |
| Stopping = 'Stopping', | ||
| Running = 'Running', | ||
| Off = 'Off', | ||
| Deleting = 'Deleting', | ||
| } | ||
|
|
||
| export const VM_STATUS_SIMPLE_LABELS = [ | ||
|
|
@@ -43,6 +44,9 @@ export class VMStatus extends StatusEnum<VMStatusSimpleLabel | StatusSimpleLabel | |
| static readonly STOPPING = new VMStatus('VMStatus_STOPPING', VMStatusSimpleLabel.Stopping, { | ||
| isInProgress: true, | ||
| }); | ||
| static readonly DELETING = new VMStatus('VMStatus_DELETING', VMStatusSimpleLabel.Deleting, { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. has to be also mentioned in
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
| isInProgress: true, | ||
| }); | ||
| static readonly VM_ERROR = new VMStatus('VMStatus_VM_ERROR', 'VM error', { isError: true }); | ||
| static readonly VMI_ERROR = new VMStatus('VMStatus_VMI_ERROR', 'VMI error', { isError: true }); | ||
| static readonly LAUNCHER_POD_ERROR = new VMStatus( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,12 @@ | ||
| import * as _ from 'lodash'; | ||
| import { K8sResourceKind, PersistentVolumeClaimKind, PodKind } from '@console/internal/module/k8s'; | ||
| import { createBasicLookup } from '@console/shared/src/utils/utils'; | ||
| import { getName, getNamespace, getOwnerReferences } from '@console/shared/src/selectors/common'; // do not import just from shared - causes cycles | ||
| import { | ||
| getName, | ||
| getNamespace, | ||
| getOwnerReferences, | ||
| getDeletetionTimestamp, | ||
| } from '@console/shared/src/selectors/common'; // do not import just from shared - causes cycles | ||
| import { compareOwnerReference } from '@console/shared/src/utils/owner-references'; | ||
| import { | ||
| buildOwnerReference, | ||
|
|
@@ -215,6 +220,11 @@ const isVMError = (vm: VMKind): VMStatusBundle => { | |
| return null; | ||
| }; | ||
|
|
||
| const isDeleting = (vm: VMKind, vmi: VMIKind): VMStatusBundle => | ||
| (vm && !!getDeletetionTimestamp(vm)) || (!vm && vmi && !!getDeletetionTimestamp(vmi)) | ||
| ? { status: VMStatus.DELETING } | ||
| : null; | ||
|
|
||
| const isBeingStopped = (vm: VMKind): VMStatusBundle => { | ||
| if (vm && !isVMExpectedRunning(vm) && isVMCreated(vm)) { | ||
| return { | ||
|
|
@@ -310,6 +320,7 @@ export const getVMStatus = ({ | |
| isBeingMigrated(vm, vmi, migrations) || | ||
| isBeingImported(vm, pods, pvcs, dataVolumes) || | ||
| isVMError(vm) || | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO we should move it behind isVMError
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is the bug, users see "vmi-error" while they need to see "deleting"
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is not a vmi error but possible vm error - which should have a prefference IMO, as it could say a reason why something cannot be deleted even though it has deleteionTimestamp
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, moved |
||
| isDeleting(vm, vmi) || | ||
| isBeingStopped(vm) || | ||
| isOff(vm) || | ||
| isError(vm, vmi, launcherPod) || | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
has to be mentioned in
getVMStatusGroupsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done