Description of problem: MachineConfigDaemon does not prune files that don't exist in the desiredConfig but existed before Version-Release number of the following components: # ./openshift-install version ./openshift-install v0.8.0-master-8-g713289e20bd6afccb06f2e4ff7ed89d2483fac9a # oc get clusterversion NAME VERSION AVAILABLE PROGRESSING SINCE STATUS version 4.0.0-0.alpha-2019-01-03-031244 True False 7m Cluster version is 4.0.0-0.alpha-2019-01-03-031244 How reproducible: Always Steps to Reproduce: 1. Setup a cluster 2. Create a machineconfnig to write a file onto the machine # cat customized_master.yaml apiVersion: machineconfiguration.openshift.io/v1 kind: MachineConfig metadata: labels: machineconfiguration.openshift.io/role: master name: master-customization1 spec: config: ignition: config: {} security: tls: {} timeouts: {} version: 2.2.0 networkd: {} passwd: {} storage: files: - contents: source: data:,testing1 verification: {} filesystem: root mode: 420 path: /etc/custom1.txt osImageURL: "" # oc create -f customized_master.yaml 3. Check the new generated machineconfig take effect # oc get machineconfig NAME AGE 00-master 1h 00-worker 1h 01-master-kubelet 1h 01-worker-kubelet 1h master-0c99241e37b235e1dc1ae3fd98e1a329 1h master-7f6162f8e56ab5a461301e10b588c640 13s master-bc3342fb14b6afc253e7a0152d1a18bc 1h master-customization1 13s worker-1b808daba3e3e583a13ee10f805adb16 1h worker-df55614d2c4782d133a310c118d89fea 1h # oc describe node|grep machineconfig machineconfiguration.openshift.io/currentConfig=worker-df55614d2c4782d133a310c118d89fea machineconfiguration.openshift.io/desiredConfig=worker-df55614d2c4782d133a310c118d89fea machineconfiguration.openshift.io/state=Done machineconfiguration.openshift.io/currentConfig=master-bc3342fb14b6afc253e7a0152d1a18bc machineconfiguration.openshift.io/desiredConfig=master-bc3342fb14b6afc253e7a0152d1a18bc machineconfiguration.openshift.io/state=Done machineconfiguration.openshift.io/currentConfig=worker-df55614d2c4782d133a310c118d89fea machineconfiguration.openshift.io/desiredConfig=worker-df55614d2c4782d133a310c118d89fea machineconfiguration.openshift.io/state=Done machineconfiguration.openshift.io/currentConfig=master-bc3342fb14b6afc253e7a0152d1a18bc machineconfiguration.openshift.io/desiredConfig=master-7f6162f8e56ab5a461301e10b588c640 machineconfiguration.openshift.io/state=Working machineconfiguration.openshift.io/currentConfig=master-bc3342fb14b6afc253e7a0152d1a18bc machineconfiguration.openshift.io/desiredConfig=master-bc3342fb14b6afc253e7a0152d1a18bc machineconfiguration.openshift.io/state=Done 4. From the above output, the newly generated machineconfig (master-7f6162f8e56ab5a461301e10b588c640) is being applied to replace old one (master-bc3342fb14b6afc253e7a0152d1a18bc). 5. Once done, go to master node, check /etc/custom1.txt is written to disk. # cat /etc/custom1.txt testing1 6. Remove 'master-customization1' machineconfig, make sure the desiredconfig is changed back. # oc delete machineconfig master-customization1 machineconfig.machineconfiguration.openshift.io "master-customization1" deleted # oc describe node|grep machineconfig machineconfiguration.openshift.io/currentConfig=worker-df55614d2c4782d133a310c118d89fea machineconfiguration.openshift.io/desiredConfig=worker-df55614d2c4782d133a310c118d89fea machineconfiguration.openshift.io/state=Done machineconfiguration.openshift.io/currentConfig=master-bc3342fb14b6afc253e7a0152d1a18bc machineconfiguration.openshift.io/desiredConfig=master-bc3342fb14b6afc253e7a0152d1a18bc machineconfiguration.openshift.io/state=Done machineconfiguration.openshift.io/currentConfig=worker-df55614d2c4782d133a310c118d89fea machineconfiguration.openshift.io/desiredConfig=worker-df55614d2c4782d133a310c118d89fea machineconfiguration.openshift.io/state=Done machineconfiguration.openshift.io/currentConfig=master-bc3342fb14b6afc253e7a0152d1a18bc machineconfiguration.openshift.io/desiredConfig=master-bc3342fb14b6afc253e7a0152d1a18bc machineconfiguration.openshift.io/state=Done machineconfiguration.openshift.io/currentConfig=master-bc3342fb14b6afc253e7a0152d1a18bc machineconfiguration.openshift.io/desiredConfig=master-bc3342fb14b6afc253e7a0152d1a18bc machineconfiguration.openshift.io/state=Done 7. get diff output between master-7f6162f8e56ab5a461301e10b588c640 and master-bc3342fb14b6afc253e7a0152d1a18bc, according to https://github.com/openshift/machine-config-operator/blob/master/docs/MachineConfigDaemon.md#directory--file-updates: ''' The daemon should prune all the files and directories that don't exist in the desiredConfig but existed before. Diff the current config and desired config, then remove the nodes that were removed. ''' Actual results: Go to master node, check again, '/etc/custom1.txt' is still existing. # cat /etc/custom1.txt testing1 Expected results: '/etc/custom1.txt' should be pruned. Additional info: Please attach logs from ansible-playbook with the -vvv flag
This is not an installer issue. You'll need to assign this to the RHCOS team. They maintain the Machine Config Operator.
Good to know that, Changing to RHCOS component.
https://github.com/openshift/machine-config-operator/issues/268
PR: https://github.com/openshift/machine-config-operator/pull/272
Second PR: https://github.com/openshift/machine-config-operator/pull/274 Both merged.
Verified this bug with quay.io/openshift-release-dev/ocp-release:4.0.0-0.1, and PASS. After customized machineconfig is removed, the created file is cleaned up. $ cat /etc/custom1.txt cat: /etc/custom1.txt: No such file or directory
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:0758