Bug 1743771 - 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.1.z
Assignee: Ryan Phillips
QA Contact: Sunil Choudhary
URL:
Whiteboard:
Depends On: 1743160
Blocks: 1743759
TreeView+ depends on / blocked
 
Reported: 2019-08-20 15:58 UTC by Ryan Phillips
Modified: 2019-09-10 16:00 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1743160
Environment:
Last Closed: 2019-09-10 15:59:37 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift machine-config-operator pull 1067 0 None closed [release-4.1] Bug 1743771: pkg/controller/kubelet-config: fix owener reference 2020-12-17 15:25:04 UTC
Red Hat Product Errata RHSA-2019:2594 0 None None None 2019-09-10 16:00:09 UTC

Description Ryan Phillips 2019-08-20 15:58:30 UTC
+++ This bug was initially created as a clone of Bug #1743160 +++

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:

--- Additional comment from Ryan Phillips on 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?

--- Additional comment from Ryan Phillips on 2019-08-20 01:54:20 UTC ---

Found the issue

Comment 2 MinLi 2019-08-26 02:34:50 UTC
verified on version 4.1.0-0.nightly-2019-08-25-164016

Comment 4 errata-xmlrpc 2019-09-10 15:59:37 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/RHSA-2019:2594


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