Bug 2031082

Summary: Updated CPU unit is wrong in OpenShift Web Console
Product: OpenShift Container Platform Reporter: Suruchi Dharma <sdharma>
Component: Dev ConsoleAssignee: Debsmita Santra <dsantra>
Status: CLOSED ERRATA QA Contact: spathak <spathak>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.8CC: aos-bugs, cjerolim, dsantra, kdoberst, nmukherj
Target Milestone: ---   
Target Release: 4.8.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-02-23 08:43:18 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:
Bug Depends On: 2036044    
Bug Blocks:    
Attachments:
Description Flags
Updated CPU unit is wrong in OpenShift Web Console none

Description Suruchi Dharma 2021-12-10 13:26:33 UTC
Created attachment 1845638 [details]
Updated CPU unit is wrong in OpenShift Web Console

Description of problem:
Updated CPU unit is wrong in OpenShift Web Console

Version-Release number of selected component (if applicable):
OCP 4.8.x

How reproducible:
Always

Steps to Reproduce:
1. Go to the Console -> Workload -> DeploymentConfig -> <choose One>
2. Go to Actions -> Edit resource limits -> change the Unit from Cores to Milicores first! -> then enter a Number for CPU
3. Save
4. Check DeploymentConfig's configuration file for updated CPU number and unit.

Actual results:
If we edit CPU unit first, and then CPU number, configuration file is updated incorrectly (with correct CPU number but incorrect CPU unit).

Expected results:
If we edit CPU unit first, and then CPU number, we are expecting the same CPU number and unit updated in configuration file.

Additional info:
The updated CPU Unit is different if we edit Unit first and then value.

Scenario which is working fine =
- Go to the Console -> Workload -> DeploymentConfig -> <choose One>
- Go to Actions -> Edit resource limits -> Enter a Number you want for CPU (for example 10) -> then change the Unit from Cores to milicores -> save
The Pods are restarted with correct Number and correct Unit for CPU -> 10m -> Everything is Fine

The Problematic Way =
- Go to the Console -> Workload -> DeploymentConfig -> <choose another One>
- Go to Actions -> Edit resource limits -> change the Unit from Cores to Milicores first! -> then enter a Number for CPU (for example 10) -> save
The Pods are restarted with the correct Number BUT not with the correct Unit! ->  10 -> here in configuration file, we got 10Cores instead of 10Milicores (Correct Number but incorrect unit).

Note- Screenshots are attached with outputs.
Also we checked the same things in OCP 4.9.x, both scenarios are working fine and we are getting the same output. But facing issues in OCP 4.8.x

Can you please check and help us find out the reason behind this change?

Comment 1 Kim Dobestein 2021-12-21 21:16:31 UTC
I was able to verify the issue when using "The Problematic Way" in version 4.8.

The issue appears to be fixed in both versions 4.9 and 4.10 (nightly).

Comment 7 Debsmita Santra 2022-02-11 07:17:38 UTC
The PR for this issue has merged

Comment 10 spathak@redhat.com 2022-02-18 13:45:35 UTC
Verified on build version: 4.8.0-0.nightly-2022-02-16-110134
Browser: Google Chrome 98

Comment 12 errata-xmlrpc 2022-02-23 08:43:18 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 (OpenShift Container Platform 4.8.32 bug fix 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/RHBA-2022:0559