Bug 1951901

Summary: incorrect Worker nodes number calculated when nodes have both master and worker role
Product: OpenShift Container Platform Reporter: Yadan Pei <yapei>
Component: Management ConsoleAssignee: Yadan Pei <yapei>
Status: CLOSED ERRATA QA Contact: Yadan Pei <yapei>
Severity: low Docs Contact:
Priority: low    
Version: 4.8CC: aballant, aos-bugs, jhadvig, nmukherj, spadgett, stevsmit
Target Milestone: ---   
Target Release: 4.12.0   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
* Previously, the wrong calculating method was used when counter master and worker nodes. With this update, the correct worker nodes are calculated when nodes have both the `master` and `worker` role. (link:https://bugzilla.redhat.com/show_bug.cgi?id=1951901[*BZ#1951901*])
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-01-17 19:46:24 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:
Description Flags
Worker 0
correct worker node count none

Description Yadan Pei 2021-04-21 07:11:21 UTC
Created attachment 1774009 [details]
Worker 0

Description of problem:
in all in one cluster´╝î a node act both as master and worker, when we count worker nodes the number for worker nodes will be 0 

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. setup All in One OCP cluster with 3 masters(workers)
2. goes to Compute -> Nodes, click the Filter dropdown

Actual results:
2. in Role filter, it shows Worker 0

Expected results:
2. since we have three workers, we should show Worker 3

Additional info:

Comment 1 Jakub Hadvig 2021-04-21 09:27:45 UTC
Looks like the `getNodeRole` filter is not taking in count case where master nodes are also workers. Triaging to DevConsole team for further investigation.

Comment 2 Andrew Ballantyne 2021-04-26 14:08:52 UTC
Not a DevConsole issue, triaging to Kubevirt for further investigation.

Comment 3 Yaacov Zamir 2021-04-27 11:36:52 UTC
looks like the code that check if node is worker or admin is in the management console:

moving to management compoenent

Comment 8 Yadan Pei 2022-08-15 09:44:51 UTC
Created attachment 1905542 [details]
correct worker node count

set up single node cluster in which the node are both master and worker, Nodes list filter shows Worker count is 1 and Master count is 1, this is correct

verified on 4.12.0-0.nightly-2022-08-12-053438

Comment 11 errata-xmlrpc 2023-01-17 19:46:24 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.12.0 bug fix and security 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.