Skip to content

Commit

Permalink
feat: add clone capability back for LVM volume
Browse files Browse the repository at this point in the history
    - LVM CSI driver support clone operation, so we add it capability
      back

Signed-off-by: Vicente Cheng <[email protected]>
(cherry picked from commit fe3a214)
  • Loading branch information
Vicente-Cheng authored and a110605 committed Oct 17, 2024
1 parent a22d9a7 commit b02f628
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions pkg/harvester/models/harvester/persistentvolumeclaim.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { PRODUCT_NAME as HARVESTER_PRODUCT } from '../../config/harvester';

import { LONGHORN_DRIVER } from '@shell/models/persistentvolume';
import { DATA_ENGINE_V2 } from '../../edit/harvesterhci.io.storage/index.vue';
import { LVM_DRIVER } from './storage.k8s.io.storageclass';

const DEGRADED_ERRORS = ['replica scheduling failed', 'precheck new replica failed'];

Expand All @@ -36,8 +35,8 @@ export default class HciPv extends HarvesterResource {
get availableActions() {
let out = super._availableActions;

// LVM and Longhorn V2 provisioner do not support volume clone feature yet
if (this.storageClass.provisioner === LVM_DRIVER || this.storageClass.longhornVersion === DATA_ENGINE_V2) {
// Longhorn V2 provisioner do not support volume clone feature yet
if (this.storageClass.longhornVersion === DATA_ENGINE_V2) {
out = out.filter(action => action.action !== 'goToClone');
} else {
const clone = out.find(action => action.action === 'goToClone');
Expand Down
4 changes: 2 additions & 2 deletions pkg/harvester/models/kubevirt.io.virtualmachine.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ export default class VirtVm extends HarvesterResource {
get availableActions() {
let out = super._availableActions;

// VM attached with Longhorn V2 or LVM volume doesn't support clone feature
if (this.longhornV2Volumes.length > 0 || this.lvmVolumes.length > 0) {
// VM attached with Longhorn V2 volume doesn't support clone feature
if (this.longhornV2Volumes.length > 0) {
out = out.filter(action => action.action !== 'goToClone');
} else {
const clone = out.find(action => action.action === 'goToClone');
Expand Down

0 comments on commit b02f628

Please sign in to comment.