Skip to content

Commit

Permalink
Merge pull request #2281 from upalatucci/disable-delete
Browse files Browse the repository at this point in the history
CNV-51418: disable delete on running vm
  • Loading branch information
openshift-merge-bot[bot] authored Nov 24, 2024
2 parents 46d1bc1 + 840e4b9 commit f0766cd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions locales/en/plugin__kubevirt-plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -1248,6 +1248,7 @@
"The SCSI reservation for disk makes the disk attached to the VirtualMachine as a SCSI LUN. This option should only be used for cluster-aware applications": "The SCSI reservation for disk makes the disk attached to the VirtualMachine as a SCSI LUN. This option should only be used for cluster-aware applications",
"The template has": "The template has",
"The virtctl client is a supplemental command-line utility for managing virtualization resources from the command line.": "The virtctl client is a supplemental command-line utility for managing virtualization resources from the command line.",
"The VirtualMachine is running": "The VirtualMachine is running",
"The VirtualMachine will be bridged to the selected network, ideal for L2 devices": "The VirtualMachine will be bridged to the selected network, ideal for L2 devices",
"The VirtualMachine will have": "The VirtualMachine will have",
"The VirtualMachine you are creating does not have an available boot source. We recommended that you select a boot source to create the VirtualMachine.": "The VirtualMachine you are creating does not have an available boot source. We recommended that you select a boot source to create the VirtualMachine.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ import { Action, k8sPatch } from '@openshift-console/dynamic-plugin-sdk';
import { CopyIcon } from '@patternfly/react-icons';
import VirtualMachineMigrateModal from '@virtualmachines/actions/components/VirtualMachineMigration/VirtualMachineMigrationModal';

import { isLiveMigratable, isRestoring, isSnapshotting, printableVMStatus } from '../utils';
import {
isLiveMigratable,
isRestoring,
isRunning,
isSnapshotting,
printableVMStatus,
} from '../utils';

import DeleteVMModal from './components/DeleteVMModal/DeleteVMModal';
import {
Expand Down Expand Up @@ -96,7 +102,8 @@ export const VirtualMachineActionFactory = {
createModal(({ isOpen, onClose }) => (
<DeleteVMModal isOpen={isOpen} onClose={onClose} vm={vm} />
)),
disabled: false,
description: isRunning(vm) && t('The VirtualMachine is running'),
disabled: isRunning(vm),
id: 'vm-action-delete',
label: t('Delete'),
};
Expand Down

0 comments on commit f0766cd

Please sign in to comment.