Skip to content
This repository has been archived by the owner on Apr 28, 2020. It is now read-only.

Commit

Permalink
Change PVC access mode to RWM (#496)
Browse files Browse the repository at this point in the history
  • Loading branch information
rawagner authored and mareklibra committed Jun 18, 2019
1 parent ae8c9e8 commit d445c1c
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ exports[`<DesktopViewerSelector /> renders correctly 1`] = `
"spec": Object {
"pvc": Object {
"accessModes": Array [
"ReadWriteOnce",
"ReadWriteMany",
],
"resources": Object {
"requests": Object {
Expand Down
1 change: 1 addition & 0 deletions src/constants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const PROVISION_SOURCE_IMPORT = 'Import';
export const PROVISION_SOURCE_CLONED_DISK = 'Cloned Disk'; // PVC or upload image to PVC

export const PVC_ACCESSMODE_RWO = 'ReadWriteOnce';
export const PVC_ACCESSMODE_RWM = 'ReadWriteMany';

export const TEMPLATE_API_VERSION = 'template.openshift.io/v1';
export const TEMPLATE_FLAVOR_LABEL = 'flavor.template.kubevirt.io';
Expand Down
3 changes: 2 additions & 1 deletion src/k8s/objects/pvc/pvc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { PersistentVolumeClaimModel } from '../../../models/index';
import { PVC_ACCESSMODE_RWM } from '../../../constants';

export const buildPvc = ({ generateName, namespace, size, unit, storageClass }) => ({
apiVersion: PersistentVolumeClaimModel.apiVersion,
Expand All @@ -8,7 +9,7 @@ export const buildPvc = ({ generateName, namespace, size, unit, storageClass })
generateName: `${generateName}-`,
},
spec: {
accessModes: ['ReadWriteOnce'],
accessModes: [PVC_ACCESSMODE_RWM],
volumeMode: 'Filesystem',
resources: {
requests: {
Expand Down
4 changes: 2 additions & 2 deletions src/k8s/vmBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { get, last } from 'lodash';
import {
PROVISION_SOURCE_PXE,
BOOT_ORDER_FIRST,
PVC_ACCESSMODE_RWO,
BOOT_ORDER_SECOND,
DEVICE_TYPE_DISK,
DEVICE_TYPE_INTERFACE,
PVC_ACCESSMODE_RWM,
} from '../constants';

import {
Expand Down Expand Up @@ -320,7 +320,7 @@ export const getDataVolumeTemplateSpec = (storage, dvSource) => {
},
spec: {
pvc: {
accessModes: [PVC_ACCESSMODE_RWO],
accessModes: [PVC_ACCESSMODE_RWM],
resources: {
requests: {
storage: `${storage.size}Gi`,
Expand Down
10 changes: 5 additions & 5 deletions src/tests/mocks/dataVolume/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const dataVolumes = {
},
},
pvc: {
accessModes: ['ReadWriteOnce'],
accessModes: ['ReadWriteMany'],
resources: {
requests: {
storage: '1G',
Expand All @@ -38,7 +38,7 @@ export const dataVolumes = {
},
},
pvc: {
accessModes: ['ReadWriteOnce'],
accessModes: ['ReadWriteMany'],
resources: {
requests: {
storage: '1G',
Expand All @@ -62,7 +62,7 @@ export const dataVolumes = {
blank: {},
},
pvc: {
accessModes: ['ReadWriteOnce'],
accessModes: ['ReadWriteMany'],
resources: {
requests: {
storage: '1G',
Expand All @@ -86,7 +86,7 @@ export const dataVolumes = {
},
},
pvc: {
accessModes: ['ReadWriteOnce'],
accessModes: ['ReadWriteMany'],
resources: {
requests: {
storage: '1G',
Expand All @@ -110,7 +110,7 @@ export const dataVolumes = {
},
},
pvc: {
accessModes: ['ReadWriteOnce'],
accessModes: ['ReadWriteMany'],
resources: {
requests: {
storage: '1G',
Expand Down
2 changes: 1 addition & 1 deletion src/tests/mocks/user_template/pvc.mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const pvcTemplate = {
},
spec: {
pvc: {
accessModes: ['ReadWriteOnce'],
accessModes: ['ReadWriteMany'],
resources: {
requests: {
storage: '15Gi',
Expand Down
2 changes: 1 addition & 1 deletion src/tests/mocks/user_template/pxe-dv.mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const pxeDataVolumeTemplate = {
},
spec: {
pvc: {
accessModes: ['ReadWriteOnce'],
accessModes: ['ReadWriteMany'],
resources: {
requests: {
storage: '15Gi',
Expand Down
2 changes: 1 addition & 1 deletion src/tests/mocks/user_template/url-flavor.mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const urlCustomFlavorTemplate = {
},
spec: {
pvc: {
accessModes: ['ReadWriteOnce'],
accessModes: ['ReadWriteMany'],
resources: {
requests: {
storage: '10Gi',
Expand Down
2 changes: 1 addition & 1 deletion src/tests/mocks/user_template/url-nonetwork.mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const urlNoNetworkTemplate = {
},
spec: {
pvc: {
accessModes: ['ReadWriteOnce'],
accessModes: ['ReadWriteMany'],
resources: {
requests: {
storage: '10Gi',
Expand Down
2 changes: 1 addition & 1 deletion src/tests/mocks/user_template/url.mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const urlTemplateDataVolume = {
},
spec: {
pvc: {
accessModes: ['ReadWriteOnce'],
accessModes: ['ReadWriteMany'],
resources: {
requests: {
storage: '5Gi',
Expand Down
2 changes: 1 addition & 1 deletion src/tests/mocks/vm/vm.mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const fullVm = {
},
},
pvc: {
accessModes: ['ReadWriteOnce'],
accessModes: ['ReadWriteMany'],
resources: {
requests: {
storage: '1G',
Expand Down
4 changes: 2 additions & 2 deletions src/tests/mocks/vm/vm_validation.mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const vm1 = {
},
},
pvc: {
accessModes: ['ReadWriteOnce'],
accessModes: ['ReadWriteMany'],
resources: {
requests: {
storage: '1G',
Expand Down Expand Up @@ -114,7 +114,7 @@ export const vm2 = {
},
},
pvc: {
accessModes: ['ReadWriteOnce'],
accessModes: ['ReadWriteMany'],
resources: {
requests: {
storage: '1G',
Expand Down
4 changes: 2 additions & 2 deletions src/utils/patches.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import {
ANNOTATION_FIRST_BOOT,
BOOT_ORDER_FIRST,
BOOT_ORDER_SECOND,
PVC_ACCESSMODE_RWO,
TEMPLATE_FLAVOR_LABEL,
deviceTypeToPathKey,
DEVICE_TYPE_INTERFACE,
PVC_ACCESSMODE_RWM,
} from '../constants';
import { NETWORK_TYPE_POD } from '../components/Wizard/CreateVmWizard/constants';
import { assignBootOrderIndex, getBootableDevicesInOrder, getDevices, addBindingToInterface } from '../k8s/vmBuilder';
Expand Down Expand Up @@ -69,7 +69,7 @@ export const getAddDiskPatch = (vm, storage) => {
},
spec: {
pvc: {
accessModes: [PVC_ACCESSMODE_RWO],
accessModes: [PVC_ACCESSMODE_RWM],
resources: {
requests: {
storage: `${storage.size}Gi`,
Expand Down
4 changes: 2 additions & 2 deletions src/utils/tests/patches.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
ANNOTATION_FIRST_BOOT,
BOOT_ORDER_SECOND,
BOOT_ORDER_FIRST,
PVC_ACCESSMODE_RWO,
PVC_ACCESSMODE_RWM,
TEMPLATE_FLAVOR_LABEL,
POD_NETWORK,
DISK_PATH_KEY,
Expand Down Expand Up @@ -86,7 +86,7 @@ const dataVolumeTemplate = {
},
spec: {
pvc: {
accessModes: [PVC_ACCESSMODE_RWO],
accessModes: [PVC_ACCESSMODE_RWM],
resources: {
requests: {
storage: `${storageNoClass.size}Gi`,
Expand Down

0 comments on commit d445c1c

Please sign in to comment.