Bug 2069764 - Incorrect Yaml in MCO causes the resource to crash
Summary: Incorrect Yaml in MCO causes the resource to crash
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Node
Version: 4.10
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ---
: ---
Assignee: Qi Wang
QA Contact: Sunil Choudhary
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-03-29 16:05 UTC by Devon
Modified: 2023-09-15 01:22 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-04-19 15:00:19 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift machine-config-operator pull 3099 0 None open [release-4.3] Bug 2076648: Fix KubeletConfig nil error 2022-04-19 14:38:34 UTC

Description Devon 2022-03-29 16:05:44 UTC
Opening this bug as it was originally opened as an RFE in the JIRA below but it was decided that this should be considered a bug instead.

    [RFE-674] Add yaml formatting check when configuration changes are added from file - Red Hat Issue Tracker
    URL:   https://issues.redhat.com/browse/RFE-674

In this case, the following yaml has incorrect spacing but the MCO doesnt recognize the incorrect yaml and instead causes the resource to fail.

issues adding a custom KubeletConfig:

apiVersion: machineconfiguration.openshift.io/v1
kind: KubeletConfig
metadata:
  name: worker-memory-kubeconfig
spec:
  machineConfigPoolSelector:
    matchLabels:
      custom-kubelet: 'reserved-system-memory'
    kubeletConfig:
      systemReserved:
        cpu: 500m
        memory: 1Gi
      kubeReserved:
        cpu: 500m
        memory: 2Gi
      eviction-hard:
        cpu: 500m
        memory: 512Mi

The crash is caused by incorrect formatting.

Let me know if you need anything else from me.

Comment 2 Yu Qi Zhang 2022-03-30 14:00:30 UTC
So I see the original RFE was open against config and yaml checking and not the MCO. There's a few things to break down here:

1. There are multiple layers of validation. the first validator is at the api level, which can reject "bad" configs if either
  a) the parser itself rejects it, or
  b) the crd definition has fields to reject it
Which seems like neither is the case. Now this is relatively low level checking which probably isn't going to be enough for most error cases

2. The second validator should be happening in the kubeletconfig. You say that this is causing a crash, which definitely shouldn't be happening. Could you attach the must-gather somewhere? What exactly is "crash"ing? Is it a panic somewhere?

Given that this is the kubeletconfigcontroller, I will pass the to the node team for now. If it seems that it is instead the core MCO that is having trouble, feel free to move back.

Comment 4 Qi Wang 2022-04-19 15:00:19 UTC

*** This bug has been marked as a duplicate of bug 2041814 ***

Comment 5 Qi Wang 2022-04-19 15:27:43 UTC
The crash error is a duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=1975626. This issue which will be tracked by https://github.com/openshift/machine-config-operator/pull/3099.

Comment 6 Qi Wang 2022-04-19 15:33:04 UTC

*** This bug has been marked as a duplicate of bug 1975626 ***

Comment 7 Qi Wang 2022-04-19 16:20:57 UTC

*** This bug has been marked as a duplicate of bug 2076648 ***

Comment 9 Red Hat Bugzilla 2023-09-15 01:22:59 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days


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