Commit Graph

71 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
78fe7c0dbc
Merge pull request #114426 from my-git9/ut/request_
[UT] add test for pkg/probe/http/request.go
2023-03-09 21:33:45 -08:00
Tim Allclair
67f72d0e90 Document risk of HTTP response body in probe failure msg 2023-02-09 16:37:32 -08:00
Antonio Ojea
bfd8f5178e use custom dialer for http probes 2023-01-22 16:57:41 +00:00
xin.li
8848f848db [ut] add test for pkg/probe/http/request.go
Signed-off-by: xin.li <xin.li@daocloud.io>
2022-12-30 10:13:54 +08:00
Jordan Liggitt
78cb3862f1
Fix indentation/spacing in comments to render correctly in godoc 2022-12-17 23:27:38 -05:00
Jason Simmons
5a6acf85fa Align lifecycle handlers and probes
Align the behavior of HTTP-based lifecycle handlers and HTTP-based
probers, converging on the probers implementation. This fixes multiple
deficiencies in the current implementation of lifecycle handlers
surrounding what functionality is available.

The functionality is gated by the features.ConsistentHTTPGetHandlers feature gate.
2022-10-19 09:51:52 -07:00
Davanum Srinivas
a9593d634c
Generate and format files
- Run hack/update-codegen.sh
- Run hack/update-generated-device-plugin.sh
- Run hack/update-generated-protobuf.sh
- Run hack/update-generated-runtime.sh
- Run hack/update-generated-swagger-docs.sh
- Run hack/update-openapi-spec.sh
- Run hack/update-gofmt.sh

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-07-26 13:14:05 -04:00
Sergey Kanzhelev
1df526b3f7 remove TODOs from http package and prober 2022-04-28 16:51:11 +00:00
Paco Xu
3c06ef9c0c probe: add test case for redirect terminating cases 2021-12-16 13:04:56 +08:00
Paco Xu
65529fe6e9 add probe warning event body like 'Probe terminated redirects' 2021-12-16 13:04:51 +08:00
刁浩 10284789
d8e91ab727 Fix test order in /pkg/probe/http/http_test.go 2021-06-05 07:27:34 +00:00
Shiming Zhang
b152001f45 Fix HTTPProbe initialize header 2021-03-03 19:42:31 +08:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
Hugo Fonseca
ba514718da HTTP Prove: Removes Accept-Encoding header from http probe
The Accept-Encoding header is added by default because compression is enabled by default. By removing it we are reducing the sent payload.
2020-11-09 22:20:56 +00:00
Hugo Fonseca
0794bf65bc HTTP Probe: Add 'Accept' header by default
When using a HTTP probe, the request will now have a "Accept" header by default with the "*/*" (accept all)
Most tools do add this header (see curl) so it's a reasonable expectation that http probe has it as well
2020-10-30 00:32:49 +00:00
Jordan Liggitt
fdf9cab843 Deflake TestHTTPProbeProxy 2020-09-04 11:22:11 -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
SataQiu
68ba2fecc1 fix staticcheck failures of pkg/probe/http 2020-04-10 12:14:25 +08:00
Han Kang
866ea74326 remove pkg/version and some of redundant copies of it
Change-Id: Ia58367c1b1274bfb49c8a4784051463abaf795de
2019-09-16 16:24:35 -07:00
Ryan Phillips
1065add75e fix kubelet status http calls with truncation
PR#76518 introduced a change to limit the the read on various calls with
utilio.ReadAtMost.  By design, ReadAtMost will return an error if there
is a truncation, but the calling code needs to know to handle it.
2019-09-12 19:55:27 -05: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
mattjmcnaughton
46267759bc
Code cleanup for for probe/http
Two small code cleanup changes for `probe/http`.

- Tests name the `followNonLocalRedirects` variable before passing to
`New`, so its clear what the boolean flag in the construct impacts.
- Change import name from `httprobe` to `httpprobe` when used by
`pkg/kubelet/prober/prober.go`. Establishes consistency with other uses
in the repo.
2019-06-15 12:09:00 -04:00
Abdullah Gharaibeh
ef2e5bb8ed Addressed reviewers comments. 2019-05-17 10:48:43 -04:00
Abdullah Gharaibeh
71b1565f2e Fixed the unit test and added a failure case. 2019-05-16 18:21:51 -04:00
Abdullah Gharaibeh
792ab9d3d0 Added a unit test to verify that host header is preserved after probe redirect. 2019-05-16 10:37:56 -04:00
Tim Allclair
e6ea4f0538 Don't follow non-local redirects for http probes 2019-03-15 11:04:30 -07:00
WanLinghao
29f7e537a9 When node got proxy settings like "http_proxy=xxx".
The http probe would use that settings. This could cause probe failure.
This patch fix it.
2018-11-29 16:35:56 +08: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
k8s-ci-robot
dad07683b1
Merge pull request #69013 from ibrasho-forks/switch-to-http.Error
Update usages of http.ResponseWriter.WriteHeader to use http.Error
2018-10-23 15:31:55 -07:00
Ibrahim AshShohail
2fb3ba71f1
Update usages of http.ResponseWriter.WriteHeader to use http.Error
Signed-off-by: Ibrahim AshShohail <me@ibrasho.com>
2018-10-14 05:58:00 +03:00
Jon Friesen
b971c3e200 Fix golint for pkg/probe
This change adds comments to exported things and renames the tcp,
http, and exec probe interfaces to just be Prober within their
namespace.

Issue #68026
2018-09-12 14:18:16 -07:00
Jeff Grafton
23ceebac22 Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
Jeff Grafton
ef56a8d6bb Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
Jeff Grafton
efee0704c6 Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
Yongkun Anfernee Gui
cb6df34bef Test probe for redirect endpoint
Make sure #18233 works
2017-12-13 14:15:24 -08:00
Jeff Grafton
aee5f457db update BUILD files 2017-10-15 18:18:13 -07:00
Jeff Grafton
a7f49c906d Use buildozer to delete licenses() rules except under third_party/ 2017-08-11 09:32:39 -07:00
Jeff Grafton
33276f06be Use buildozer to remove deprecated automanaged tags 2017-08-11 09:31:50 -07:00
Paul Tyng
a990e60193 Set default User-Agent on http probe
If unspecified in probe definition, User-Agent will be set to
`kube-probe/<version major.minor>` on httpGet probe types
instead of the default Go User-Agent.
2017-06-21 10:50:33 -04:00
zhouhaibing089
b1040171b6 componentstatus: support client cert health check
etcd has support for client-cert-auth, which can be configured via the flag `--ca-file`,
when that is enabled, all the client requests must present with a client certificate,
however, the current component status check uses a single transport for all of the checks,
this is wrong, the checks should be different for each of different component, and make
each of them use different transport(tls configurations).
2017-04-17 13:58:33 +08:00
Mike Danese
a05c3c0efd autogenerated 2017-04-14 10:40:57 -07:00
deads2k
6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Jeff Grafton
20d221f75c Enable auto-generating sources rules 2017-01-05 14:14:13 -08:00
Mike Danese
161c391f44 autogenerated 2016-12-29 13:04:10 -08:00
Mike Danese
c87de85347 autoupdate BUILD files 2016-12-12 13:30:07 -08:00
Mike Danese
3b6a067afc autogenerated 2016-10-21 17:32:32 -07:00
Eric Chiang
a1b310e004 pkg/probe/http: don't compare error strings in tests
TestHTTPProbeChecker fails on the Go1.7 release candidates. The
package's history show that this was the case for Go1.5 and Go1.6
as well.

The test depend on errors holding specific string values, behavior
not guarenteed in the standard library API, and causing new test
failures every minor Go release. Just look for an error rather than
trying to inspect it using string comparison. If we feel this
impacts coverage we can add more test cases.
2016-07-19 11:13:36 -07:00
David McMahon
ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
zhouhaibing089
5923fd352e followup to add http server close method 2016-05-05 12:04:41 +08:00