mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-07 22:56:07 +08:00
Add an "Enable network boot (PXE)" option to bridge network interfaces and a VM-level choice to place network boot devices before or after volumes. The form now owns interface boot order: enabled NICs get sequential boot orders ahead of or behind the volumes, and a stale bootOrder is no longer inherited from the old spec. This also fixes editing a VM whose interface bootOrder was set in YAML (the documented workaround): the form used to renumber disks from 1 while keeping the NIC's bootOrder, producing a duplicate that KubeVirt rejects. The boot order shown on the VM, snapshot and backup detail pages now includes network interfaces. Related: harvester/harvester#3325 Signed-off-by: Alejandro Bonilla <abonilla@suse.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
23 lines
634 B
JavaScript
23 lines
634 B
JavaScript
import { HCI as HCI_ANNOTATIONS } from '@pkg/harvester/config/labels-annotations';
|
|
|
|
export function parseVolumeClaimTemplates(data) {
|
|
let out = [];
|
|
|
|
try {
|
|
out = JSON.parse(data?.metadata?.annotations?.[HCI_ANNOTATIONS.VOLUME_CLAIM_TEMPLATE]) || [];
|
|
} catch (e) {}
|
|
|
|
return out;
|
|
}
|
|
|
|
export const EMPTY_IMAGE = 'EMPTY_IMAGE';
|
|
|
|
/**
|
|
* Disks and interfaces that take part in the boot sequence, sorted by boot order.
|
|
*/
|
|
export function getBootDevices(devices = {}) {
|
|
return [...(devices.disks || []), ...(devices.interfaces || [])]
|
|
.filter((device) => !!device.bootOrder)
|
|
.sort((a, b) => a.bootOrder - b.bootOrder);
|
|
}
|