Commit Graph

341 Commits

Author SHA1 Message Date
Miciah Masters
5832b84200 kubelet: parseResolvConf: Handle "search ."
When parsing a resolv.conf file that has "search .", parseResolvConf should
accept the "." entry verbatim.  Before this commit, parseResolvConf
unconditionally trimmed the "." suffix, which in the case of "." resulted
in a "" entry (that is, the empty string).  This empty entry could lead
parseResolvConf to produce a resolv.conf file with "search ".  Resolvers
could fail to parse such a resolv.conf file from parseResolvConf, thus
breaking DNS resolution in pods.  After this commit, parseResolvConf
accepts a resolv.conf file with "search ." and passes the "." entry through
verbatim to produce a valid resolv.conf file.  The "." suffix is still
trimmed for any entry that does not solely comprise ".".

Follow-up to commit a215a88d91.

* pkg/kubelet/network/dns/dns.go (parseResolvConf): Handle a "." entry in
the search path by copying it verbatim.
* pkg/kubelet/network/dns/dns_test.go (TestParseResolvConf): Add a test
case for "search .".
2022-04-12 15:39:31 -04:00
a2ush
393dec26f6 Change the name of the constant 2021-12-14 22:42:57 +09:00
a2ush
d775483381 Fix comment out typo 2021-12-11 22:27:38 +09:00
Davanum Srinivas
9405e9b55e
Check in OWNERS modified by update-yamlfmt.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-12-09 21:31:26 -05:00
Sascha Grunert
de37b9d293
Make CRI v1 the default and allow a fallback to v1alpha2
This patch makes the CRI `v1` API the new project-wide default version.
To allow backwards compatibility, a fallback to `v1alpha2` has been added
as well. This fallback can either used by automatically determined by
the kubelet.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2021-11-17 11:05:05 -08:00
Antonio Ojea
0cd75e8fec run hack/update-netparse-cve.sh 2021-08-20 10:42:09 +02:00
Gunju Kim
6317ce63c6 Add feature gate ExpandedDNSConfig
ExpandedDNSConfig allows kubernetes to have expanded DNS(Domain Name
System) configuration
2021-05-27 07:10:13 +09:00
Gunju Kim
819059f641 kubelet: Validate the length of the DNS search path 2021-05-27 07:09:46 +09:00
Aditi Sharma
a724a3df77 Fix structured logs for dns.go
Signed-off-by: Aditi Sharma <adi.sky17@gmail.com>
2021-03-19 19:05:30 +05:30
Kubernetes Prow Robot
a6a66c3594
Merge pull request #98939 from yangjunmyfm192085/run-test16
Structured Logging migration: modify dockershim and network part logs of kubelet.
2021-03-03 03:31:33 -08:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
JunYang
7735cf7f26 Structured Logging migration: modify dockershim and network part logs of kubelet.
Signed-off-by: JunYang <yang.jun22@zte.com.cn>
2021-02-14 16:01:47 +08:00
Kubernetes Prow Robot
81b13a912c
Merge pull request #97314 from abowloflrf/patch-1
fix typo in dns.go
2021-01-06 15:21:45 -08:00
chymy
0f729ba517 fix log format
Signed-off-by: chymy <chang.min1@zte.com.cn>
2020-12-30 09:28:31 +08:00
Ruofeng Lei
161a801f71
fix typo in dns.go 2020-12-15 16:36:07 +08:00
Dan Winship
75242fce7a kubelet: allow specifying dual-stack node IPs on bare metal
Discussion is ongoing about how to best handle dual-stack with clouds
and autodetected IPs, but there is at least agreement that people on
bare metal ought to be able to specify two explicit IPs on dual-stack
hosts, so allow that.
2020-10-07 17:25:54 -04:00
Jordan Liggitt
124a5ddf72 Fix int->string casts 2020-07-24 16:23:12 -04:00
Davanum Srinivas
07d88617e5
Run hack/update-vendor.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:33 -04:00
Davanum Srinivas
442a69c3bd
switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:27 -04:00
Tim Hockin
fc5b08569f Create an OWNERS alias for net-driver-approvers 2020-02-13 14:43:45 -08:00
Dan Williams
5652819292 kubelet/network: add sig-network-approvers to OWNERS 2019-11-19 23:05:51 -06:00
Bob Killen
2e52875917
Prune inactive owners from pkg/kubelet/* network related OWNERS files. 2019-10-13 08:51:00 -04:00
Fernando Crespo Gravalos
c959b5ef8a don't add extra variable for searches 2019-10-04 12:23:07 +02:00
Fernando Crespo Gravalos
9dac0c2d02 improve explanatory comment about trailing dots in searches 2019-10-04 11:40:40 +02:00
Fernando Crespo Gravalos
0b850c5d82 add comment explaining why we remove trailing dots in searches 2019-09-26 10:05:58 +02:00
Fernando Crespo Gravalos
a215a88d91 remove trailing dots from the parsed searches from host resolv.conf 2019-09-24 16:35:01 +02:00
Tim Allclair
8a495cb5e4 Clean up error messages (ST1005) 2019-08-21 10:40:21 -07:00
Tim Allclair
6510d26b6a Fix misc static check issues 2019-08-21 10:40:21 -07:00
ethan
d21e9a8747
fixup: correct file name in log message 2019-08-05 21:31:38 +08:00
Haiyan Meng
1f270ef4e2
Limit the read length of ioutil.ReadAll in pkg/kubelet and pkg/probe
Signed-off-by: Haiyan Meng <haiyanmeng@google.com>
2019-07-11 13:18:06 -07:00
Davanum Srinivas
33081c1f07
New staging repository for cri-api
Change-Id: I2160b0b0ec4b9870a2d4452b428e395bbe12afbb
2019-03-26 18:21:04 -04:00
xichengliudui
5dd26ecab5 Fix function comment to consistent with its name
update pull request

update pull request
2019-02-12 01:37:20 -05:00
Roy Lenferink
b43c04452f Updated OWNERS files to include link to docs 2019-02-04 22:33:12 +01:00
Zihong Zheng
f2750dd043 Graduate CustomPodDNS feature to GA 2019-01-11 11:28:26 -08:00
Jordan Liggitt
2498ca7606 drop VerifyFeatureGatesUnchanged 2018-11-21 11:51:33 -05:00
Jordan Liggitt
4dca07ef7e Fixup incorrect use of DefaultFeatureGate.Set in tests 2018-11-21 11:51:33 -05:00
Jordan Liggitt
733dd9dfd7 Add tests to ensure feature gate changes don't escape kubelet/scheduler packages 2018-11-16 10:52:53 -05:00
Davanum Srinivas
954996e231
Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
2018-11-10 07:50:31 -05:00
Christoph Blecker
97b2992dc1
Update gofmt for go1.11 2018-10-05 12:59:38 -07:00
k8s-ci-robot
c847a1f04b
Merge pull request #68462 from knightXun/dns
refactor kubelet/network/dns
2018-10-01 00:30:04 -07:00
Mayank Kumar
ef976f1f70 add validation for etc resolve parsing 2018-09-24 21:01:59 -07:00
knight
a578c707c3 refactor kubelet/network/dns 2018-09-10 17:32:28 +08:00
Davanum Srinivas
9b43d97cd4
Add Labels to various OWNERS files
Will reduce the burden of manually adding labels. Information pulled
from:
https://github.com/kubernetes/community/blob/master/sigs.yaml

Change-Id: I17e661e37719f0bccf63e41347b628269cef7c8b
2018-08-21 13:59:08 -04:00
Jeff Grafton
23ceebac22 Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
Guoliang Wang
4f9d2047dd checkLimitsForResolvConf for the pod create and update events instead of checking period 2018-06-07 10:14:22 +08:00
Yu-Ju Hong
4f9d4e1af6 Update bazel BUILD files
Also update the golint_failure file to reflect the new location.
2018-04-11 09:26:02 -07:00
Yu-Ju Hong
42398825ed Move the kubelet network package down to dockershim
With CRI, kubelet no longer sets up networking for the pods. The
dockershim package is the rightful owner and the only user of the
newtork package. This change moves the package into dockershim to make
the distinction obvious, and untangles the codebase.

The`network/dns`is kept in the original package since it is only used by
kubelet.
2018-04-11 09:25:56 -07:00
Yu-Ju Hong
37d30a0815 Remove outdated network plugin code
The code was added to support rktnetes and non-CRI docker integrations.
These legacy integrations have already been removed from the codebase.
This change removes the compatibility code existing soley for the
legacy integrations.
2018-04-11 09:21:17 -07:00
Pengfei Ni
ff38180181 Setup default cni dir correctly 2018-04-03 16:10:46 +08:00
Kubernetes Submit Queue
6a431d1c0e
Merge pull request #60912 from m1093782566/refactor-hostport
Automatic merge from submit-queue (batch tested with PRs 60898, 60912, 60753, 61002, 60796). 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>.

Fix TODO: move openHostPorts and closeHostPorts into a common struct and add UTs

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

* Fix [TODO](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/network/hostport/hostport.go#L132): move openHostPorts and closeHostPorts into a common struct, and eliminate the `hostportOpener` parameter in openHostPorts(), to make them looks more consistent.

* Add UTs for closeHostPorts.

**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
NONE
```
2018-03-20 17:37:10 -07:00