-
Notifications
You must be signed in to change notification settings - Fork 38.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add tests for managed hosts file content #44572
add tests for managed hosts file content #44572
Conversation
Hi @rickypai. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
@k8s-bot ok to test |
my bad. i only ran the unit tests but forgot to run gofmt. let me update this. |
d9308d4
to
56ca3ef
Compare
hi, can I get some eyes on this? It's a small change that adds test and will help with further improvements in this particular section of the kubelet code :) |
@rickypai would you mind squashing your commits? |
add tests to assert the output of `ensureHostsFile`
56ca3ef
to
e21da83
Compare
no problem. squash-rebased |
/lgtm |
munger didn't seem to pick up the label. commenting to try and kick it |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: derekwaynecarr, rickypai
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
Automatic merge from submit-queue (batch tested with PRs 44741, 44853, 44572, 44797, 44439) |
Automatic merge from submit-queue (batch tested with PRs 45110, 45148) write HostAliases to hosts file **What this PR does / why we need it**: using the PodSpec's `HostAliases`, we write entries into the Kubernetes-managed hosts file. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #43632 **Special notes for your reviewer**: Previous PRs in this series: - #44572 isolates the logic of creating the file and writing the file - #44641 introduces the `HostAliases` field in PodSpec along with validations **Release note**: ```release-note PodSpec's `HostAliases` now write entries into the Kubernetes-managed hosts file. ``` @thockin @yujuhong Thanks for reviewing!
What this PR does / why we need it: a tiny refactor to separate concerns host file content from the logic ensuring that the file exists, and also adds unit test.
This is to prepare extending the host file logic to include customized entries described in #43632. I'm wary of changing that logic in absence of any unit tests.
Release note: