Bug 1880471 - kubelet-config-controller's machineConfigPoolSelector does not match all objects when empty
Summary: kubelet-config-controller's machineConfigPoolSelector does not match all obje...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Machine Config Operator
Version: 4.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Antonio Murdaca
QA Contact: Michael Nguyen
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-09-18 16:06 UTC by bmorriso
Modified: 2020-09-18 22:16 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-09-18 22:16:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description bmorriso 2020-09-18 16:06:36 UTC
Description of problem:

The documentation [1] for the KubeletConfig object states that the machineConfigPoolSelector will match all resources when the selector is empty and will match no resources when the selector is null. However, when testing I saw that an empty selector matches nothing. Also, 
the controller's source code [2] includes a comment that describes different behavior:

"// If a pool with a nil or empty selector creeps in, it should match nothing, not everything."



Version-Release number of selected component (if applicable):
OCP v4.5.9


How reproducible:
Always

Steps to Reproduce:
1. Create a KubeletConfig resource with an empty machineConfigPoolSelector
2. Look at the 'oc describe kubeletconfig <configname>' output.
3.

Actual results:
The kubeletconfig does not apply to any of the machineconfigpools and shows this condition:

'''
  Conditions:
    Last Transition Time:  2020-09-17T21:00:06Z
    Message:               Error: could not find any MachineConfigPool set for KubeletConfig
    Status:                False
    Type:                  Failure

'''


Expected results:

The kubeletconfigs behavior should be consistent with the documentation. Either the docs should be updated to reflect the current behavior of the controller or the controller should be updated to match the described behavior in the docs. 


Additional info:


[1] - https://docs.openshift.com/container-platform/4.5/rest_api/machine_apis/kubeletconfig-machineconfiguration-openshift-io-v1.html
[2] - https://github.com/openshift/machine-config-operator/blob/master/pkg/controller/kubelet-config/kubelet_config_controller.go#L614-L615

Comment 1 Kirsten Garrison 2020-09-18 22:16:29 UTC
This is expected behavior, we are in the process of updating and adding mco documentation.  Please see https://github.com/openshift/machine-config-operator/blob/master/docs/KubeletConfigDesign.md#example as we do expect a pool for the KubeletConfig.

You can follow along via the open mco documentation Jira Card here: https://issues.redhat.com/browse/GRPA-2248 which we hope to get completed soon. I have made an explicit note about this linking to this bug as well.

Thanks for pointing this out!


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