Bug 1813369 - Wrong key for selecting nodes in MachineConfigPool
Summary: Wrong key for selecting nodes in MachineConfigPool
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.3.z
Hardware: All
OS: All
unspecified
medium
Target Milestone: ---
: 4.5.0
Assignee: David Taylor
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On:
Blocks: 1818944
TreeView+ depends on / blocked
 
Reported: 2020-03-13 15:32 UTC by rdomnu
Modified: 2020-07-13 17:20 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Compute -> Machine Config Pools -> "Create Machine Config Pool". Consequence: The template used has a 'spec.machineSelector' key for selecting the nodes to match, this key is not recognize by the API. The GUI will display a Machine Selector which seem to work correctly but the MachineConfigPool doesn't match any nodes Fix: Changed key in template to "spec.nodeSelector". Result: The GUI displays a Machine Selector which now matches nodes.
Clone Of:
: 1818944 (view as bug list)
Environment:
Last Closed: 2020-07-13 17:19:58 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift console pull 4927 0 None closed Bug 1813369: Wrong key for selecting nodes in MachineConfigPool 2020-10-09 18:51:46 UTC
Red Hat Product Errata RHBA-2020:2409 0 None None None 2020-07-13 17:20:26 UTC

Description rdomnu 2020-03-13 15:32:21 UTC
Description of problem: When attempting to create a new MachineConfigPool from console , the template has a spec.machineSelector key for selecting the nodes to match. Additionally, The MachineConfigPool view from the console displays a MachineSelector. However, this key is not recognised by the API, but the correct one for selecting a Node is actually spec.nodeSelector.

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

How reproducible: Create a new MachineConfigPool from GUI

Steps to Reproduce:
1. Template will present a spec.machineSelector key
2. GUI will also display a Machine Selector which seem to work correctly


Actual results:
MachineConfigPool doesn't match any node

Expected results:
MachineConfigPool should match the node

Fix:
- replace machineSelector with nodeSelector for the MachineConfigPool template and for the GUI view.

Additional info: 
The node is selected by spec.NodeSelector: https://github.com/openshift/machine-config-operator/blob/f4bf2f4cf8a37a63436877efb397e98f4ef2124d/docs/MachineConfigController.md

Comment 2 Samuel Padgett 2020-03-16 13:28:22 UTC
This should be a small change from the console side:

$ rg machineSelector
public/models/yaml-templates.ts
1010:  machineSelector:

public/components/machine-config-pool.tsx
158:  const machineSelector = _.get(obj, 'spec.machineSelector');
167:        <Selector kind={nodeReference} selector={machineSelector} />

public/module/k8s/index.ts
669:  machineSelector?: Selector;

Comment 5 Yanping Zhang 2020-04-09 04:27:18 UTC
Checked on OCP 4.5 cluster with payload 4.5.0-0.nightly-2020-04-08-194554. 
1. Go to "Compute" -> "Machine Config Pools" page, click into "master" mcp, check the yaml, there is 
"  nodeSelector:
    matchLabels:
      node-role.kubernetes.io/master: ''
"
And on the detail page, the Node Selector field shows "node-role.kubernetes.io/master".
2. Create mcp with default example yaml, there is also nodeselector in the yaml template:
  nodeSelector:
    matchLabels:
      node-role.kubernetes.io/master: ''
 After create with default yaml, the "Node Selector" field shows "node-role.kubernetes.io/master", click on it, will go to search page with related nodes filtered out.
The bug is fixed, so move it to Verified.

Comment 7 errata-xmlrpc 2020-07-13 17:19:58 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, 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-2020:2409


Note You need to log in before you can comment on or make changes to this bug.