mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2025-12-13 21:21:44 +00:00
Now that Longhorn supports volume clone with the V2 data engine, we can enable volume snapshot and clone. Related issue: https://github.com/harvester/harvester/issues/6710 (cherry picked from commit a1cf41bda92ceb399be21904ec267311f9568bdb) Signed-off-by: Tim Serong <tserong@suse.com> Co-authored-by: Tim Serong <tserong@suse.com>
This commit is contained in:
parent
2c043e0a8e
commit
7785d7f469
@ -35,15 +35,10 @@ export default class HciPv extends HarvesterResource {
|
|||||||
get availableActions() {
|
get availableActions() {
|
||||||
let out = super._availableActions;
|
let out = super._availableActions;
|
||||||
|
|
||||||
// Longhorn V2 provisioner do not support volume clone feature yet
|
const clone = out.find((action) => action.action === 'goToClone');
|
||||||
if (this.isLonghornV2) {
|
|
||||||
out = out.filter((action) => action.action !== 'goToClone');
|
|
||||||
} else {
|
|
||||||
const clone = out.find((action) => action.action === 'goToClone');
|
|
||||||
|
|
||||||
if (clone) {
|
if (clone) {
|
||||||
clone.action = 'goToCloneVolume';
|
clone.action = 'goToCloneVolume';
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportImageAction = {
|
const exportImageAction = {
|
||||||
@ -65,10 +60,6 @@ export default class HciPv extends HarvesterResource {
|
|||||||
takeSnapshotAction,
|
takeSnapshotAction,
|
||||||
...out
|
...out
|
||||||
];
|
];
|
||||||
// TODO: remove this block if Longhorn V2 engine supports restore volume snapshot
|
|
||||||
if (this.isLonghornV2) {
|
|
||||||
out = out.filter((action) => action.action !== takeSnapshotAction.action);
|
|
||||||
}
|
|
||||||
} else { // v1.4 / v1.3
|
} else { // v1.4 / v1.3
|
||||||
if (!this.isLonghorn || !this.isLonghornV2) {
|
if (!this.isLonghorn || !this.isLonghornV2) {
|
||||||
out = [
|
out = [
|
||||||
|
|||||||
@ -87,17 +87,11 @@ const IgnoreMessages = ['pod has unbound immediate PersistentVolumeClaims'];
|
|||||||
|
|
||||||
export default class VirtVm extends HarvesterResource {
|
export default class VirtVm extends HarvesterResource {
|
||||||
get availableActions() {
|
get availableActions() {
|
||||||
let out = super._availableActions;
|
const out = super._availableActions;
|
||||||
|
const clone = out.find((action) => action.action === 'goToClone');
|
||||||
|
|
||||||
// VM attached with Longhorn V2 volume doesn't support clone feature
|
if (clone) {
|
||||||
if (this.longhornV2Volumes.length > 0) {
|
clone.action = 'goToCloneVM';
|
||||||
out = out.filter((action) => action.action !== 'goToClone');
|
|
||||||
} else {
|
|
||||||
const clone = out.find((action) => action.action === 'goToClone');
|
|
||||||
|
|
||||||
if (clone) {
|
|
||||||
clone.action = 'goToCloneVM';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
@ -159,7 +153,7 @@ export default class VirtVm extends HarvesterResource {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
action: 'takeVMSnapshot',
|
action: 'takeVMSnapshot',
|
||||||
enabled: (!!this.actions?.snapshot || !!this.action?.backup) && !this.longhornV2Volumes.length,
|
enabled: (!!this.actions?.snapshot || !!this.action?.backup),
|
||||||
icon: 'icon icon-snapshot',
|
icon: 'icon icon-snapshot',
|
||||||
label: this.t('harvester.action.vmSnapshot')
|
label: this.t('harvester.action.vmSnapshot')
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user