Skip to content

Commit

Permalink
OCPBUGS-26722: fix bug where Clone PVC modal assumes pvc.spec.resourc…
Browse files Browse the repository at this point in the history
…es.requests.storage value includes a unit
  • Loading branch information
rhamilto committed Jan 11, 2024
1 parent 3d993a0 commit c78e8b7
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -30,6 +30,7 @@ import {
validate,
resourceObjPath,
convertToBaseValue,
humanizeBinaryBytesWithoutB,
} from '@console/internal/components/utils';
import { useK8sGet } from '@console/internal/components/utils/k8s-get-hook';
import { HandlePromiseProps } from '@console/internal/components/utils/promise-component';
Expand All @@ -54,8 +55,9 @@ const ClonePVCModal = withHandlePromise((props: ClonePVCModalProps) => {
const { t } = useTranslation();
const { close, cancel, resource, handlePromise, errorMessage, inProgress } = props;
const { name: pvcName, namespace } = resource?.metadata;
const defaultSize: string[] = validate.split(getRequestedPVCSize(resource));
const pvcRequestedSize = `${defaultSize[0]} ${dropdownUnits[defaultSize[1]]}`;
const baseValue = convertToBaseValue(getRequestedPVCSize(resource));
const defaultSize: string[] = validate.split(humanizeBinaryBytesWithoutB(baseValue).string);
const pvcRequestedSize = humanizeBinaryBytes(baseValue).string;

const [clonePVCName, setClonePVCName] = React.useState(`${pvcName}-clone`);
const [requestedSize, setRequestedSize] = React.useState(defaultSize[0] || '');
Expand Down

0 comments on commit c78e8b7

Please sign in to comment.