Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-4359

cluster-dns-operator corrupts /etc/hosts when fs full

    XMLWordPrintable

Details

    • Moderate
    • 2
    • Sprint 230, Sprint 231, Sprint 232, Sprint 233
    • 4
    • Rejected
    • False
    • Hide

      None

      Show
      None
    • Hide
      Cause: The node-resolver pods that add the cluster image registry service's name to the /etc/hosts file on the node filesystem did not properly handle errors when creating a temporary file or updating /etc/hosts.

      Consequence: When the host filesystem was full, the node-resolver pod could inadvertently remove the localhost entries from /etc/hosts.

      Fix: Error handling was added to the logic for updating /etc/hosts.

      Result: The node-resolver pods log an error and exit instead of writing incomplete content to /etc/hosts when the host filesystem is full.
      Show
      Cause: The node-resolver pods that add the cluster image registry service's name to the /etc/hosts file on the node filesystem did not properly handle errors when creating a temporary file or updating /etc/hosts. Consequence: When the host filesystem was full, the node-resolver pod could inadvertently remove the localhost entries from /etc/hosts. Fix: Error handling was added to the logic for updating /etc/hosts. Result: The node-resolver pods log an error and exit instead of writing incomplete content to /etc/hosts when the host filesystem is full.
    • Bug Fix

    Description

      Description of problem:

      when fs full, update-dns-resolver fails to build a proper /etc/hosts, resulting in /etc/hosts only containing the openshift-generated-node-resolver lines, missing the localhost lines.
      
      This causes issues on pods having hostNetwork: true  like openstack-cinder-csi-driver-controller
      
      

      Version-Release number of selected component (if applicable):

      OpenShift 4.10.39
      

      How reproducible:

      See: https://github.com/openshift/cluster-dns-operator/blob/a5ea3fcb7be49a12115bd6648403df3d65661542/assets/node-resolver/update-node-resolver.sh
      
      

      Steps to Reproduce:

      1. make sure the file system is full when running the cp at line 13
      2. 
      3.
      

      Actual results:

      /etc/hosts is missing the localhost lines
      
      

      Expected results:

      /etc/hosts should contain the localhost lines
      
      

      Additional info:

      
      

      Attachments

        Issue Links

          Activity

            People

              mmasters1@redhat.com Miciah Masters
              frigault Francois Rigault
              Melvin Joseph Melvin Joseph
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: