fix unable to add/delete new hard disk

Signed-off-by: andy.lee <andy.lee@suse.com>
(cherry picked from commit cbb66175f6dda835f557dd098103fc1d78b53468)
This commit is contained in:
andy.lee 2025-02-06 21:41:25 +08:00 committed by Mergify
parent e79f493cb6
commit 18bfbbaac1
2 changed files with 7 additions and 1 deletions

View File

@ -58,7 +58,7 @@ export default {
const out = []; const out = [];
blockDevices.map((b) => { blockDevices.map((b) => {
if (b.metadata.state.error) { if (b?.metadata?.state?.error) {
out.push(b.metadata.state.message); out.push(b.metadata.state.message);
} }
}); });

View File

@ -64,4 +64,10 @@ export default class HciBlockDevice extends HarvesterResource {
// spec.fileSystem.provisioned is deprecated // spec.fileSystem.provisioned is deprecated
return this.spec?.fileSystem?.provisioned || this.spec?.provision; return this.spec?.fileSystem?.provisioned || this.spec?.provision;
} }
// Overwrite cleanForSave() in shell/plugins/steve/steve-class.js as it deleted status object in harvesterhci.io.blockdevice CRD
// but /v1/harvester/harvesterhci.io.blockdevices/longhorn-system/{id} API requires status object
cleanForSave(data) {
return data;
}
} }