Files
kubernetes/pkg/kubelet
Kubernetes Submit Queue 368233b9b8 Merge pull request #61613 from dims/ensure-etc-hosts-always-has-a-header
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Ensure /etc/hosts has a header always - Fix conformance test

**What this PR does / why we need it**:

We need to be able to tell if an /etc/hosts in a container has been touched by kubernetes or not (whether we use the host network or not).

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
ba20e63446 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.

**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 #60938

**Special notes for your reviewer**:
Also see
- https://github.com/kubernetes/kubernetes/pull/61405
- https://github.com/kubernetes/kubernetes/pull/60939
- https://github.com/kubernetes/kubernetes/issues/60938

**Release note**:

```release-note
NONE
```
2018-04-04 18:01:55 -07:00
..
2018-03-30 07:38:19 +00:00
2018-03-27 09:29:35 -07:00
2018-03-27 09:29:35 -07:00
2018-04-02 10:13:35 +08:00
2018-01-29 15:07:51 -05:00
2017-10-15 18:18:13 -07:00
2018-02-23 01:42:35 +00:00
2018-02-16 13:43:01 -08:00
2018-02-16 13:43:01 -08:00
2018-03-27 09:29:35 -07:00
2018-02-24 17:39:21 +08:00
2018-04-02 20:17:01 -07:00
2018-02-27 20:23:35 +08:00
2018-02-20 10:38:41 -05:00
2018-01-29 21:44:54 -08:00
2018-02-27 20:23:35 +08:00