Skip to content

Commit

Permalink
Merge pull request #6348 from yaacov/disable-model-for-sriov-network-…
Browse files Browse the repository at this point in the history
…card

Bug 1869196: Disable card model if using SRIOV interface
  • Loading branch information
openshift-merge-robot committed Aug 18, 2020
2 parents 7d62645 + e1cd379 commit ab20017
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,14 @@ export const NICModal = withHandlePromise((props: NICModalProps) => {
setMultusNetworkName(newMultusNetworkName);
};

const onNetworkInterfaceChange = (iType: string) => {
if (iType === NetworkInterfaceType.SRIOV.toString()) {
setModel(NetworkInterfaceModel.VIRTIO);
}

setInterfaceType(NetworkInterfaceType.fromString(iType));
};

const submit = (e) => {
e.preventDefault();

Expand Down Expand Up @@ -246,7 +254,7 @@ export const NICModal = withHandlePromise((props: NICModalProps) => {
}
value={asFormSelectValue(model)}
id={asId('model')}
isDisabled={isDisabled('model')}
isDisabled={isDisabled('model') || interfaceType === NetworkInterfaceType.SRIOV}
>
<FormSelectPlaceholderOption isDisabled placeholder="--- Select Model ---" />
{NetworkInterfaceModel.getAll().map((ifaceModel) => {
Expand Down Expand Up @@ -275,7 +283,7 @@ export const NICModal = withHandlePromise((props: NICModalProps) => {
/>
<FormRow title="Type" fieldId={asId('type')} isRequired>
<FormSelect
onChange={(iType) => setInterfaceType(NetworkInterfaceType.fromString(iType))}
onChange={onNetworkInterfaceChange}
value={asFormSelectValue(interfaceType)}
id={asId('type')}
isDisabled={isDisabled('type')}
Expand Down

0 comments on commit ab20017

Please sign in to comment.