Bug 1845457 - File restoration doesn't work as expected when it is not owned by an rpm but available in /usr/etc/
Summary: File restoration doesn't work as expected when it is not owned by an rpm but ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Machine Config Operator
Version: 4.6
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.5.0
Assignee: Sinny Kumari
QA Contact: Micah Abbott
URL:
Whiteboard:
Depends On: 1843974
Blocks: 1845492
TreeView+ depends on / blocked
 
Reported: 2020-06-09 09:50 UTC by OpenShift BugZilla Robot
Modified: 2020-07-13 17:44 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-07-13 17:43:40 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift machine-config-operator pull 1794 0 None closed [release-4.5] Bug 1845457: daemon: fix restoring file logic to avoid unnecessary deletion 2020-06-24 03:35:21 UTC
Red Hat Product Errata RHBA-2020:2409 0 None None None 2020-07-13 17:44:06 UTC

Comment 3 Micah Abbott 2020-06-18 20:10:58 UTC
Verified with 4.5.0-0.nightly-2020-06-18-114733:

```
$ oc get clusterversion                                                                                                                                                                       
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS                                                                                                                                                                                                      
version   4.5.0-0.nightly-2020-06-18-114733   True        False         2m27s   Cluster version is 4.5.0-0.nightly-2020-06-18-114733                                                                                                                                                        
$ oc get nodes                                                                                                                                                                                
NAME                                         STATUS   ROLES    AGE   VERSION                                                                                                                                                                                                                
ip-10-0-128-94.us-west-2.compute.internal    Ready    worker   14m   v1.18.3+91d0edd                                                                                                                                                                                                        
ip-10-0-138-65.us-west-2.compute.internal    Ready    master   23m   v1.18.3+91d0edd                                                                                                                                                                                                        
ip-10-0-178-167.us-west-2.compute.internal   Ready    master   23m   v1.18.3+91d0edd                                                                                                                                                                                                        
ip-10-0-178-71.us-west-2.compute.internal    Ready    worker   14m   v1.18.3+91d0edd                                                                                                                                                                                                        
ip-10-0-208-127.us-west-2.compute.internal   Ready    master   24m   v1.18.3+91d0edd                                           
ip-10-0-214-255.us-west-2.compute.internal   Ready    worker   14m   v1.18.3+91d0edd                                        
```

Check original file on node:

```
$ oc debug node/ip-10-0-128-94.us-west-2.compute.internal
Starting pod/ip-10-0-128-94us-west-2computeinternal-debug ...                                                                                 
To use host binaries, run `chroot /host`                                                                                                                                                                                                                                                    
Pod IP: 10.0.128.94                                                                                                                                                                                                                                                                         
If you don't see a command prompt, try pressing enter.                                                                                                                                                                                                                                      
sh-4.2# chroot /host                                                                                                                          
sh-4.4# cat /etc/iscsi/initiatorname.iscsi                                                                                                                                                                                                                                                  
InitiatorName=iqn.1994-05.com.redhat:3b31b0d08931                                                                                                                                                                                                                                                                                                                                  
sh-4.4# rpm -qf /etc/iscsi/initiatorname.iscsi                                                                                                                                                                                                                                              
file /etc/iscsi/initiatorname.iscsi is not owned by any package                                                                                                                                                                                                                             
sh-4.4# exit
exit
sh-4.2# exit
exit

Removing debug pod ...
```

Create MC and apply:

```
$ cat iscsi-mc.yaml 
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
  labels:
    machineconfiguration.openshift.io/role: worker
  name: 99-iscsi-initiator
spec:
  config:
    ignition:
      version: 2.2.0
    storage:
      files:
        - contents:
            source: data:text/plain;charset=utf-8;base64,SW5pdGlhdG9yTmFtZT1pcW4uMTk5NC0wNS5jb20ubnV0YW5peDprOHMtd29ya2VyCg==
          filesystem: root
          mode: 420
          path: /etc/iscsi/initiatorname.iscsi

$ oc create -f iscsi-mc.yaml                    
machineconfig.machineconfiguration.openshift.io/99-iscsi-initiator created                                                                                                                                                                                                                  
$ oc get mc                                                                                                                                                                                   
NAME                                                        GENERATEDBYCONTROLLER                      IGNITIONVERSION   AGE                                                                                                                                                                
00-master                                                   f155fb8add7f3f12da39eef6a0d3a7634443d525   2.2.0             23m                  
00-worker                                                   f155fb8add7f3f12da39eef6a0d3a7634443d525   2.2.0             23m                                                                                                                                                                
01-master-container-runtime                                 f155fb8add7f3f12da39eef6a0d3a7634443d525   2.2.0             23m                                                                                                                                                                
01-master-kubelet                                           f155fb8add7f3f12da39eef6a0d3a7634443d525   2.2.0             23m                                                                                                                                                                
01-worker-container-runtime                                 f155fb8add7f3f12da39eef6a0d3a7634443d525   2.2.0             23m
01-worker-kubelet                                           f155fb8add7f3f12da39eef6a0d3a7634443d525   2.2.0             23m        
99-iscsi-initiator                                                                                     2.2.0             11s                                                                                                                                                                
99-master-946f070c-9566-42e1-884e-3f8b272c67d3-registries   f155fb8add7f3f12da39eef6a0d3a7634443d525   2.2.0             23m                                                                                                                                                                
99-master-ssh                                                                                          2.2.0             32m                                                                                                                                                                
99-worker-529cae59-8a78-4eb9-8b8b-31893150c553-registries   f155fb8add7f3f12da39eef6a0d3a7634443d525   2.2.0             23m                                                                                                                                                                
99-worker-ssh                                                                                          2.2.0             32m
rendered-master-01acfbc1d243b63a18878994e2359610            f155fb8add7f3f12da39eef6a0d3a7634443d525   2.2.0             23m
rendered-worker-14ff1846ac0713cfb30cd1cbcf9d6b0d            f155fb8add7f3f12da39eef6a0d3a7634443d525   2.2.0             23m
rendered-worker-e3d6d8734c82cd939fbb2480e705ea59            f155fb8add7f3f12da39eef6a0d3a7634443d525   2.2.0             6s
$ oc get mcp                                                                                                                                                                                  
NAME     CONFIG                                             UPDATED   UPDATING   DEGRADED   MACHINECOUNT   READYMACHINECOUNT   UPDATEDMACHINECOUNT   DEGRADEDMACHINECOUNT   AGE                                                                                                             
master   rendered-master-01acfbc1d243b63a18878994e2359610   True      False      False      3              3                   3                     0                      24m                                                                                                             
worker   rendered-worker-14ff1846ac0713cfb30cd1cbcf9d6b0d   False     True       False      3              0                   0                     0                      24m
```

Check node for new file content:

```
$ oc debug node/ip-10-0-128-94.us-west-2.compute.internal                                                                      
Starting pod/ip-10-0-128-94us-west-2computeinternal-debug ...                                                                                                                                                                                                                               
To use host binaries, run `chroot /host`                                                                                                                                                                                                                                                    
Pod IP: 10.0.128.94                                                                                                                                                                                                                                                                         
If you don't see a command prompt, try pressing enter.                                                                                                                                                                                                                                      
sh-4.2# chroot /host                                                                                                                                                                                                                                                                        
sh-4.4# cat /etc/iscsi/initiatorname.iscsi                                                                                                                                                                                                                                                  
InitiatorName=iqn.1994-05.com.nutanix:k8s-worker                                                                                                                                                                                                                                            
sh-4.4# exit
exit
sh-4.2# exit
exit

Removing debug pod ...
```

Delete MC and check node again:

```
$ oc delete mc/99-iscsi-initiator
machineconfig.machineconfiguration.openshift.io "99-iscsi-initiator" deleted

$ oc get mc
NAME                                                        GENERATEDBYCONTROLLER                      IGNITIONVERSION   AGE
00-master                                                   f155fb8add7f3f12da39eef6a0d3a7634443d525   2.2.0             30m
00-worker                                                   f155fb8add7f3f12da39eef6a0d3a7634443d525   2.2.0             30m
01-master-container-runtime                                 f155fb8add7f3f12da39eef6a0d3a7634443d525   2.2.0             30m
01-master-kubelet                                           f155fb8add7f3f12da39eef6a0d3a7634443d525   2.2.0             30m
01-worker-container-runtime                                 f155fb8add7f3f12da39eef6a0d3a7634443d525   2.2.0             30m
01-worker-kubelet                                           f155fb8add7f3f12da39eef6a0d3a7634443d525   2.2.0             30m
99-master-946f070c-9566-42e1-884e-3f8b272c67d3-registries   f155fb8add7f3f12da39eef6a0d3a7634443d525   2.2.0             30m
99-master-ssh                                                                                          2.2.0             40m
99-worker-529cae59-8a78-4eb9-8b8b-31893150c553-registries   f155fb8add7f3f12da39eef6a0d3a7634443d525   2.2.0             30m
99-worker-ssh                                                                                          2.2.0             40m
rendered-master-01acfbc1d243b63a18878994e2359610            f155fb8add7f3f12da39eef6a0d3a7634443d525   2.2.0             30m
rendered-worker-14ff1846ac0713cfb30cd1cbcf9d6b0d            f155fb8add7f3f12da39eef6a0d3a7634443d525   2.2.0             30m
rendered-worker-e3d6d8734c82cd939fbb2480e705ea59            f155fb8add7f3f12da39eef6a0d3a7634443d525   2.2.0             7m33s

$ oc get mcp
NAME     CONFIG                                             UPDATED   UPDATING   DEGRADED   MACHINECOUNT   READYMACHINECOUNT   UPDATEDMACHINECOUNT   DEGRADEDMACHINECOUNT   AGE
master   rendered-master-01acfbc1d243b63a18878994e2359610   True      False      False      3              3                   3                     0                      31m
worker   rendered-worker-e3d6d8734c82cd939fbb2480e705ea59   False     True       False      3              0                   0                     0                      31m

$ oc get mcp
NAME     CONFIG                                             UPDATED   UPDATING   DEGRADED   MACHINECOUNT   READYMACHINECOUNT   UPDATEDMACHINECOUNT   DEGRADEDMACHINECOUNT   AGE
master   rendered-master-01acfbc1d243b63a18878994e2359610   True      False      False      3              3                   3                     0                      37m
worker   rendered-worker-14ff1846ac0713cfb30cd1cbcf9d6b0d   True      False      False      3              3                   3                     0                      37m

$ oc debug node/ip-10-0-128-94.us-west-2.compute.internal
Starting pod/ip-10-0-128-94us-west-2computeinternal-debug ...
To use host binaries, run `chroot /host`
Pod IP: 10.0.128.94
If you don't see a command prompt, try pressing enter.
sh-4.2# chroot /host
sh-4.4# cat /etc/iscsi/initiatorname.iscsi 
InitiatorName=iqn.1994-05.com.redhat:3b31b0d08931
sh-4.4# exit 
exit
sh-4.2# exit
exit

Removing debug pod ...
```

Comment 4 errata-xmlrpc 2020-07-13 17:43:40 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-2020:2409


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