Wizard: Integrate HyperV selection in Azure target options
This determines the generation the image will get registered as in Azure. V2 supports UEFI and more instance types than V1.
This commit is contained in:
parent
b4e7fe8923
commit
c1378a7913
3 changed files with 19 additions and 0 deletions
|
|
@ -14,6 +14,7 @@ import {
|
|||
import { ExternalLinkAltIcon } from '@patternfly/react-icons';
|
||||
|
||||
import { AzureAuthButton } from './AzureAuthButton';
|
||||
import { AzureHyperVSelect } from './AzureHyperVSelect';
|
||||
import { AzureResourceGroups } from './AzureResourceGroups';
|
||||
import { AzureSourcesSelect } from './AzureSourcesSelect';
|
||||
|
||||
|
|
@ -91,6 +92,7 @@ const Azure = () => {
|
|||
Learn more about OAuth 2.0
|
||||
</Button>
|
||||
</Text>
|
||||
<AzureHyperVSelect />
|
||||
<FormGroup label="Share method:">
|
||||
<Radio
|
||||
id="radio-with-description"
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ import {
|
|||
selectAzureSource,
|
||||
selectAzureSubscriptionId,
|
||||
selectAzureTenantId,
|
||||
selectAzureHyperVGeneration,
|
||||
selectBaseUrl,
|
||||
selectBlueprintDescription,
|
||||
selectBlueprintName,
|
||||
|
|
@ -244,6 +245,7 @@ function commonRequestToState(
|
|||
tenantId: azureUploadOptions?.tenant_id || '',
|
||||
subscriptionId: azureUploadOptions?.subscription_id || '',
|
||||
resourceGroup: azureUploadOptions?.resource_group,
|
||||
hyperVGeneration: azureUploadOptions?.hyper_v_generation || 'V1',
|
||||
},
|
||||
gcp: {
|
||||
shareMethod: (gcpUploadOptions?.share_with_accounts
|
||||
|
|
@ -423,12 +425,14 @@ const getImageOptions = (
|
|||
return {
|
||||
source_id: selectAzureSource(state),
|
||||
resource_group: selectAzureResourceGroup(state),
|
||||
hyper_v_generation: selectAzureHyperVGeneration(state),
|
||||
};
|
||||
else
|
||||
return {
|
||||
tenant_id: selectAzureTenantId(state),
|
||||
subscription_id: selectAzureSubscriptionId(state),
|
||||
resource_group: selectAzureResourceGroup(state),
|
||||
hyper_v_generation: selectAzureHyperVGeneration(state),
|
||||
};
|
||||
case 'gcp': {
|
||||
let googleAccount: string = '';
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ export type wizardState = {
|
|||
subscriptionId: string;
|
||||
source: string;
|
||||
resourceGroup: string;
|
||||
hyperVGeneration: 'V1' | 'V2';
|
||||
};
|
||||
gcp: {
|
||||
shareMethod: GcpShareMethod;
|
||||
|
|
@ -136,6 +137,7 @@ export const initialState: wizardState = {
|
|||
subscriptionId: '',
|
||||
source: '',
|
||||
resourceGroup: '',
|
||||
hyperVGeneration: 'V2',
|
||||
},
|
||||
gcp: {
|
||||
shareMethod: 'withGoogle',
|
||||
|
|
@ -242,6 +244,10 @@ export const selectAzureResourceGroup = (state: RootState) => {
|
|||
return state.wizard.azure.resourceGroup;
|
||||
};
|
||||
|
||||
export const selectAzureHyperVGeneration = (state: RootState) => {
|
||||
return state.wizard.azure.hyperVGeneration;
|
||||
};
|
||||
|
||||
export const selectGcpShareMethod = (state: RootState) => {
|
||||
return state.wizard.gcp.shareMethod;
|
||||
};
|
||||
|
|
@ -406,6 +412,12 @@ export const wizardSlice = createSlice({
|
|||
changeAzureResourceGroup: (state, action: PayloadAction<string>) => {
|
||||
state.azure.resourceGroup = action.payload;
|
||||
},
|
||||
changeAzureHyperVGeneration: (
|
||||
state,
|
||||
action: PayloadAction<'V1' | 'V2'>
|
||||
) => {
|
||||
state.azure.hyperVGeneration = action.payload;
|
||||
},
|
||||
reinitializeAzure: (state) => {
|
||||
state.azure.shareMethod = 'sources';
|
||||
state.azure.tenantId = '';
|
||||
|
|
@ -690,6 +702,7 @@ export const {
|
|||
changeAzureSubscriptionId,
|
||||
changeAzureSource,
|
||||
changeAzureResourceGroup,
|
||||
changeAzureHyperVGeneration,
|
||||
reinitializeAzure,
|
||||
changeGcpShareMethod,
|
||||
changeGcpAccountType,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue