Skip to content

Commit

Permalink
Fix payload for PVCPool BackingStore
Browse files Browse the repository at this point in the history
Payload did not contain the field resources.request.storage.
  • Loading branch information
bipuladh committed May 20, 2020
1 parent 5994c64 commit 6bc42b3
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@ const PVCType: React.FC<PVCTypeProps> = ({ state, dispatch }) => {
TiB: 'TiB',
};

// Noobaa expected Ti console standrad is to show TiB
const unitConverter = {
GiB: 'Gi',
TiB: 'Ti',
};

// Fix for updating the storage class by force rerender
const forceUpdate = React.useCallback(() => updateState({}), []);

Expand All @@ -207,7 +213,7 @@ const PVCType: React.FC<PVCTypeProps> = ({ state, dispatch }) => {

const onChange = (event) => {
const { value, unit } = event;
const input = `${value} ${unit}`;
const input = `${value}${unitConverter[unit]}`;
setSize(value);
dispatch({ type: 'setVolumeSize', value: input });
};
Expand Down Expand Up @@ -546,6 +552,11 @@ const CreateBackingStoreForm: React.FC<CreateBackingStoreFormProps> = withHandle
bsPayload.spec['pvPool'] = {
numVolumes: providerDataState.numVolumes,
storageClass: providerDataState.storageClass,
resources: {
requests: {
storage: providerDataState.volumeSize,
},
},
};
} else if (externalProviders.includes(provider)) {
bsPayload.spec = {
Expand Down

0 comments on commit 6bc42b3

Please sign in to comment.