• Kubernetes Submit Queue's avatar
    Merge pull request #64931 from dghubble/automated-cherry-pick-of-#61613-upstream-release-1.10 · 93a2e8a4
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue.
    
    Ensure /etc/hosts has a header always - Fix conformance test
    
    We have 2 scenarios where we copy /etc/hosts
    - with host network (we just copy the /etc/hosts from node)
    - without host network (create a fresh /etc/hosts from pod info)
    
    We are having trouble figuring out whether a /etc/hosts in a
    pod/container has been "fixed-up" or not. And whether we used
    host network or a fresh /etc/hosts in the various ways we start
    up the tests which are:
    
    - VM/box against a remote cluster
    - As a container inside the k8s cluster
    - DIND scenario in CI where test runs inside a managed container
    
    Please see previous mis-guided attempt to fix this problem at
    ba20e634 In this commit we revert
    the code from there as well.
    
    So we should make sure:
    - we always add a header if we touched the file
    - we add slightly different headers so we can figure out if we used the
      host network or not.
    
    Update the test case to inject /etc/hosts from node to another path
    (/etc/hosts-original) as well and use that to compare.
    
    
    
    **What this PR does / why we need it**:
    
    **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
    Fixes #
    
    **Special notes for your reviewer**:
    
    **Release note**:
    
    ```release-note
    Rework Kubelet set `/etc/hosts` behavior to fix conformance testability
    ```
    93a2e8a4
Name
Last commit
Last update
..
conformance Loading commit data...
e2e Loading commit data...
e2e_node Loading commit data...
fixtures Loading commit data...
images Loading commit data...
integration Loading commit data...
kubemark Loading commit data...
list Loading commit data...
soak Loading commit data...
typecheck Loading commit data...
utils Loading commit data...
BUILD Loading commit data...
OWNERS Loading commit data...
test_owners.csv Loading commit data...
test_owners.json Loading commit data...