Skip to content

Commit

Permalink
OCPBUGS-27779: fix bug where Expand PVC modal assumes pvc.spec.resour…
Browse files Browse the repository at this point in the history
…ces.requests.storage value includes a unit
  • Loading branch information
rhamilto authored and openshift-cherrypick-robot committed Jan 31, 2024
1 parent db52e9c commit c7478bc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frontend/public/components/modals/expand-pvc-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ import {
validate,
withHandlePromise,
HandlePromiseProps,
convertToBaseValue,
humanizeBinaryBytesWithoutB,
} from '../utils';
import { k8sPatch, referenceFor, K8sKind, K8sResourceKind } from '../../module/k8s/';
import { getRequestedPVCSize } from '@console/shared';

// Modal for expanding persistent volume claims
const ExpandPVCModal = withHandlePromise((props: ExpandPVCModalProps) => {
const defaultSize = validate.split(getRequestedPVCSize(props.resource));
const baseValue = convertToBaseValue(getRequestedPVCSize(props.resource));
const defaultSize = validate.split(humanizeBinaryBytesWithoutB(baseValue).string);
const [requestSizeValue, setRequestSizeValue] = React.useState(defaultSize[0] || '');
const [requestSizeUnit, setRequestSizeUnit] = React.useState(defaultSize[1] || 'Gi');
const [errorMessage, setErrorMessage] = React.useState<string>();
Expand Down

0 comments on commit c7478bc

Please sign in to comment.