Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,10 @@ export class VirtualMachine extends KubevirtDetailView {
}
}
if (provisionSource.method === ProvisionConfigName.DISK) {
// Select the last Disk as the source for booting
await wizard.selectBootableDisk(storageResources[storageResources.length - 1].name);
// Select the last Disk as the source for booting or let the template select one by default
if (storageResources.length > 0) {
await wizard.selectBootableDisk(storageResources[storageResources.length - 1].name);
}
}
await wizard.next();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ export class VirtualMachineTemplate extends KubevirtDetailView {
await wizard.addDisk(resource);
}
}

if (provisionSource.method === ProvisionConfigName.DISK) {
// Select the last Disk as the source for booting
if (storageResources.length > 0) {
await wizard.selectBootableDisk(storageResources[storageResources.length - 1].name);
} else {
throw Error(`Provision source ${ProvisionConfigName.DISK} is missing a storage.`);
}
}

await wizard.next();

// Advanced - Cloud Init
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@ import { testName } from '@console/internal-integration-tests/protractor.conf';
import {
removeLeakedResources,
withResource,
deleteResource,
createResource,
createResources,
deleteResources,
} from '@console/shared/src/test-utils/utils';
import { VM_BOOTUP_TIMEOUT_SECS } from './utils/consts';
import { basicVMConfig, multusNAD } from './utils/mocks';
import { getProvisionConfigs } from './vm.wizard.configs';
import { getProvisionConfigs, getTestDataVolume } from './vm.wizard.configs';
import { VirtualMachine } from './models/virtualMachine';
import { VirtualMachineTemplate } from './models/virtualMachineTemplate';

describe('Kubevirt create VM Template using wizard', () => {
const leakedResources = new Set<string>();
const provisionConfigs = getProvisionConfigs();
const testDataVolume = getTestDataVolume();
const commonSettings = {
cloudInit: {
useCloudInit: false,
Expand Down Expand Up @@ -47,11 +48,11 @@ describe('Kubevirt create VM Template using wizard', () => {
};

beforeAll(() => {
createResource(multusNAD);
createResources([multusNAD, testDataVolume]);
});

afterAll(() => {
deleteResource(multusNAD);
deleteResources([multusNAD, testDataVolume]);
});

afterEach(() => {
Expand Down