Skip to content

Commit

Permalink
Merge pull request #6582 from suomiy/bug.1873779
Browse files Browse the repository at this point in the history
Bug 1873779: show the correct access mode for ovirt import
  • Loading branch information
openshift-merge-robot committed Sep 10, 2020
2 parents 33f1d39 + 189555a commit afb8074
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
NetworkInterfaceType,
NetworkType,
VolumeType,
AccessMode,
} from '../../../../../../constants/vm';
import { NetworkWrapper } from '../../../../../../k8s/wrapper/vm/network-wrapper';
import { NetworkInterfaceWrapper } from '../../../../../../k8s/wrapper/vm/network-interface-wrapper';
Expand Down Expand Up @@ -49,6 +50,7 @@ export const getDisks = (vm: OvirtVM, storageClassConfigMap: ConfigMapKind): VMW
const name = alignWithDNS1123(getUniqueName(disk.name) || disk.id);
const size = convertToHighestUnit(disk.size, BinaryUnit.B);
const bootable = boot.includes('hd') && disk.bootable;
const accessMode = AccessMode.fromString(disk.mode);

if (bootable) {
bootOrder++;
Expand All @@ -74,7 +76,7 @@ export const getDisks = (vm: OvirtVM, storageClassConfigMap: ConfigMapKind): VMW
unit: size.unit,
})
.setVolumeMode(getDefaultSCVolumeMode(storageClassConfigMap))
.setAccessModes(getDefaultSCAccessModes(storageClassConfigMap))
.setAccessModes(accessMode ? [accessMode] : getDefaultSCAccessModes(storageClassConfigMap))
.asResource(),
importData: {
id: disk.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export type OvirtDisk = {
interface: string;
name: string;
size: number;
mode: string;
sdname: string;
sdid: string;
};
Expand Down

0 comments on commit afb8074

Please sign in to comment.