mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-06-13 13:32:20 +00:00
feat: add autoattachPodInterface in edit VM mode if no network interface configured (#888)
* feat: add autoattachPodInterface in edit VM mode if no network interface configured Signed-off-by: Andy Lee <andy.lee@suse.com> * refactor: remove unneeded code Signed-off-by: Andy Lee <andy.lee@suse.com> --------- Signed-off-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
parent
3e5ee422ce
commit
45872cef3b
@ -907,14 +907,22 @@ export default {
|
||||
const specInterfaces = this.spec?.template?.spec?.domain?.devices?.interfaces;
|
||||
const mergedInterfaces = this.mergeInterfaceList(specInterfaces, interfaces);
|
||||
|
||||
const devices = {
|
||||
...this.spec.template.spec.domain.devices,
|
||||
interfaces: mergedInterfaces,
|
||||
};
|
||||
|
||||
if (this.isEdit && networkRow.length === 0) {
|
||||
devices.autoattachPodInterface = false;
|
||||
} else {
|
||||
delete devices.autoattachPodInterface;
|
||||
}
|
||||
|
||||
const spec = {
|
||||
...this.spec.template.spec,
|
||||
domain: {
|
||||
...this.spec.template.spec.domain,
|
||||
devices: {
|
||||
...this.spec.template.spec.domain.devices,
|
||||
interfaces: mergedInterfaces,
|
||||
},
|
||||
devices,
|
||||
},
|
||||
networks
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user