Bug 1907875

Summary: No response when try to expand pvc with an invalid size
Product: OpenShift Container Platform Reporter: Yanping Zhang <yanpzhan>
Component: Management ConsoleAssignee: Jakub Hadvig <jhadvig>
Status: CLOSED ERRATA QA Contact: Yadan Pei <yapei>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.7CC: aos-bugs, jokerman
Target Milestone: ---   
Target Release: 4.7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: When patching PCV, console is not catching errors. Consequence: No error info about the invalid value is shown when expanding PVC with negative number Fix: Put patching of the PVC into a catch block, to catch an error. Result: Error info about the invalid value is shown when expanding PVC with negative number
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-02-24 15:44:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Yanping Zhang 2020-12-15 12:28:19 UTC
Description of problem:
When expand pvc with an invalid size, clicking "Expand" gets no response.

Version-Release number of selected component (if applicable):
4.6.0-0.nightly-2020-12-14-142858

How reproducible:
Always

Steps to Reproduce:
1.Create a StorageClass 'expand-sc' with AllowVolumeExpansion set to true (if default SC doesn't support `allowVolumeExpansion`)
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: expand-sc
provisioner: kubernetes.io/aws-ebs
parameters:
  fstype: xfs
reclaimPolicy: Delete
allowVolumeExpansion: true
volumeBindingMode: Immediate

2.Create a PVC using 'expand-sc'
3.When PVC becomes Bound,  go to Storage -> Persistent Volume Claims -> choose the PVC -> Actions -> Expand PVC
And set the new value to a smaller value or a negative number, eg -1, click "Expand"

Actual results:
3. There is no response after clicking.

Expected results:
3. Should show error info about the invalid value.

Additional info:

Comment 3 Yanping Zhang 2020-12-21 07:09:24 UTC
Checked on ocp 4.7 cluster with payload 4.7.0-0.nightly-2020-12-20-031835
When set the new value to a smaller value or a negative number on expand pvc modal, eg -1, click "Expand", there are alerts shown:
Danger alert:An error occurred
Error "Forbidden: field can not be less than previous value" for field "spec.resources.requests.storage".
Danger alert:An error occurred
Error "Invalid value: "-1Gi": must be greater than zero" for field "spec.resources[storage]".
The bug is fixed.

Comment 5 errata-xmlrpc 2021-02-24 15:44:28 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.7.0 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:5633