Bug 1743160 - machineconfig showing wrong ownerReferences kind for kubeletconfig
Summary: machineconfig showing wrong ownerReferences kind for kubeletconfig
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Node
Version: 4.1.z
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
: 4.2.0
Assignee: Ryan Phillips
QA Contact: Sunil Choudhary
URL:
Whiteboard:
Depends On:
Blocks: 1743759 1743771
TreeView+ depends on / blocked
 
Reported: 2019-08-19 08:50 UTC by MinLi
Modified: 2019-10-16 06:36 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1743759 1743771 (view as bug list)
Environment:
Last Closed: 2019-10-16 06:36:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift machine-config-operator pull 1022 0 None closed Bug 1743160: pkg/controller/kubelet-config: fix owener reference 2021-01-21 07:47:46 UTC
Red Hat Product Errata RHBA-2019:2922 0 None None None 2019-10-16 06:36:36 UTC

Description MinLi 2019-08-19 08:50:56 UTC
Description of problem:
when create a kubeletconfig, there will generate a relevant machineconfig whose ownerReferences kind should be "KubeletConfig". But now ownerReferences kind shows "ContainerRuntimeConfig"


Version-Release number of selected component (if applicable):
# oc version 
oc v4.0.0-alpha.0+1cdd4a1-781
kubernetes v1.11.0+1cdd4a1
Server https://api.qe-aws-411.qe.devcluster.openshift.com:6443
kubernetes v1.13.4+4715f6e

#oc get clusterversion 
NAME      VERSION   AVAILABLE   PROGRESSING   SINCE     STATUS
version   4.1.11    True        True          64m       Working towards quay.io/openshift-release-dev/ocp-release:4.1.12: downloading update

How reproducible:
always

Steps to Reproduce:
1.$ oc label machineconfigpool worker custom-kubelet=sysctl

2.$ cat custom-kubelet.yaml 
apiVersion: machineconfiguration.openshift.io/v1
kind: KubeletConfig
metadata:
  name: custom-kubelet
spec:
  machineConfigPoolSelector:
    matchLabels:
      custom-kubelet: sysctl
  kubeletConfig:
    allowedUnsafeSysctls:
      - "kernel.msg*"
      - "net.ipv4.route.min_pmtu"

$ oc create -f custom-kubelet.yaml

3.$ oc get kubeletconfig  custom-kubelet -o yaml
apiVersion: machineconfiguration.openshift.io/v1
kind: KubeletConfig
metadata:
  creationTimestamp: 2019-08-19T06:57:46Z
  finalizers:
  - 99-worker-e1e937c6-c232-11e9-92cb-02f5e47f12aa-kubelet
  generation: 1
  name: custom-kubelet
  resourceVersion: "88078"
  selfLink: /apis/machineconfiguration.openshift.io/v1/kubeletconfigs/custom-kubelet
  uid: a660fab5-c24e-11e9-a7bb-02b883e5dd18
spec:
  kubeletConfig:
    allowedUnsafeSysctls:
    - kernel.msg*
    - net.ipv4.route.min_pmtu
  machineConfigPoolSelector:
    matchLabels:
      custom-kubelet: sysctl
status:
  conditions:
  - lastTransitionTime: 2019-08-19T06:57:46Z
    message: Success
    status: "True"
    type: Success

4. $ oc get machineconfig 99-worker-e1e937c6-c232-11e9-92cb-02f5e47f12aa-kubelet -o yaml
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
  annotations:
    machineconfiguration.openshift.io/generated-by-controller-version: 83392b13a5c17e56656acf3f7b0031e3303fb5c0
  creationTimestamp: 2019-08-19T05:33:15Z
  generation: 2
  labels:
    machineconfiguration.openshift.io/role: worker
  name: 99-worker-e1e937c6-c232-11e9-92cb-02f5e47f12aa-kubelet
  ownerReferences:
  - apiVersion: machineconfiguration.openshift.io/v1
    blockOwnerDeletion: true
    controller: true
    kind: ContainerRuntimeConfig  // this line is wrong
    name: custom-kubelet
    uid: a660fab5-c24e-11e9-a7bb-02b883e5dd18
  resourceVersion: "88076"
  selfLink: /apis/machineconfiguration.openshift.io/v1/machineconfigs/99-worker-e1e937c6-c232-11e9-92cb-02f5e47f12aa-kubelet
  uid: d78d2f97-c242-11e9-8c59-06f827e8a358
...


Actual results:
in step 4, metadata-->ownerReferences-->kind show "ContainerRuntimeConfig"

Expected results:
in step 4, metadata-->ownerReferences-->kind show "KubeletConfig"

Additional info:

Comment 1 Ryan Phillips 2019-08-20 01:09:17 UTC
I've been testing this on 4.2 and can't reproduce the issue. Is this reproducible with 4.2 or above?

Comment 2 Ryan Phillips 2019-08-20 01:54:20 UTC
Found the issue

Comment 4 MinLi 2019-08-21 07:53:20 UTC
verified on version : 4.2.0-0.nightly-2019-08-19-201622

Comment 5 errata-xmlrpc 2019-10-16 06:36:23 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-2019:2922


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