137 Commits
Author SHA1 Message Date
Davanum Srinivas 79344ea2f3 kubelet: create the gRPC probe client with grpc.NewClient
grpc.DialContext and WithBlock are deprecated. NewClient does no I/O
until the health check runs, so the one probe timeout still covers
connect and RPC. The passthrough resolver keeps the address unresolved
for the probe dialer, as DialContext did. A refused connection now
fails the probe at once with "failed to connect" instead of retrying
until the timeout, and a server that never answers reports "health rpc
did not complete within" the timeout.

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2026-09-27 14:40:08 -04:00
Amritansh Amritansh 5f332877e0 Implement TLS support in gRPC prober 2026-07-22 22:00:07 +05:30
Amritansh Amritansh 1ee57585da Add HTTP/2 cleartext (h2c) support to HTTP prober 2026-07-21 20:48:20 +05:30
Yaroslav Borbat 46ab4b24ee probe: clarify error for unresolved named probe ports
Signed-off-by: Yaroslav Borbat <yaroslav.752@gmail.com>
2026-06-26 11:21:04 +03:00
Mads Jensen f11bb48738 Remove redundant re-assignment in for-loops under pkg
This the forvar rule from modernize. The semantics of the for-loop
changed from Go 1.22 to make this pattern obsolete.
2026-03-02 08:47:43 +01:00
Patrick Ohly ad79e479c2 build: remove deprecated '// +build' tag
This has been replaced by `//build:...` for a long time now.

Removal of the old build tag was automated with:

    for i in $(git grep -l '^// +build' | grep -v -e '^vendor/'); do if ! grep -q '^// Code generated' "$i"; then sed -i -e '/^\/\/ +build/d' "$i"; fi; done
2025-12-18 12:16:21 +01:00
Sergey Kanzhelev 7336f53439 remove usage o ExecProbeTimeout 2025-10-20 18:52:54 +00:00
Vivek Bansal af17392630 Setting the default feature-gate ExecProbeTimeout value to TRUE 2025-10-17 18:38:05 +00:00
Davanum Srinivas d043beb223 HealthChecker has a List method
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2025-05-18 12:52:13 -04:00
Patrick Ohly 8a908e0c0b remove import doc comments
The "// import <path>" comment has been superseded by Go modules.
We don't have to remove them, but doing so has some advantages:

- They are used inconsistently, which is confusing.
- We can then also remove the (currently broken) hack/update-vanity-imports.sh.
- Last but not least, it would be a first step towards avoiding the k8s.io domain.

This commit was generated with
   sed -i -e 's;^package \(.*\) // import.*;package \1;' $(git grep -l '^package.*// import' | grep -v 'vendor/')

Everything was included, except for
   package labels // import k8s.io/kubernetes/pkg/util/labels
because that package is marked as "read-only".
2024-12-02 16:59:34 +01:00
Matthieu MOREL 27b98be303 fix: enable nil-compare and error-nil rules from testifylint in module k8s.io/kubernetes
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-09-25 06:02:47 +02:00
Matthieu MORELandPatrick Ohly f014b754fb fix: enable empty and len rules from testifylint on pkg package
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

Co-authored-by: Patrick Ohly <patrick.ohly@intel.com>
2024-07-06 23:15:43 +00:00
Sascha Grunert 2aa9e76be1 Move pkg/kubelet/cri/remote to cri-client
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2024-05-14 10:58:18 +02:00
Sascha Grunert 36b7d55355 Remove CRI TimeoutError type
The type is a lefover of dockershim and can be replaced by golang native
error wrapping.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2024-05-08 09:26:19 +02:00
Marek Siarkowicz 3ee8178768 Cleanup defer from SetFeatureGateDuringTest function call 2024-04-24 20:25:29 +02:00
tao.yang b35357b6c0 cleanup: omit comparison with bool constants
Signed-off-by: tao.yang <tao.yang@daocloud.io>
2023-09-05 10:24:38 +08:00
Kubernetes Prow Robot 70033bf843 Merge pull request #114606 from tuunit/bugfix-case-sensitive-headers
fix: remove case sensitive checking of probe headers
2023-05-15 22:05:36 -07:00
Chris Bandy 7cbbf47f5e Cleanup environment in tests that call os.Unsetenv
testing.T.Cleanup ensures the environment is restored after a test and
any of its parallel sub-tests. It's possible that these can be
simplified further to T.Setenv(key, ""), but I did not investigate.
2023-04-17 20:40:08 -05:00
dddddai 10a8ec5b2c use case-insensitive header keys for http probes 2023-04-12 15:39:55 +08:00
tuunit 4a667a1026 fix: remove case sensitive checking of probe headers 2023-03-21 12:38:48 +01:00
Kubernetes Prow Robot 2505053b27 Merge pull request #115708 from my-git9/ut-util
[UT] increase ut coverage for probe/util.go
2023-03-10 00:06:40 -08:00
Kubernetes Prow Robot 7da203f60d Merge pull request #116306 from nilskch/add-unit-tests
add unit tests for probe errors and ExecProbeTimeout
2023-03-09 22:43:55 -08:00
xin.li 406b4d4401 [UT] add increase coverage for probe/util.go
Signed-off-by: xin.li <xin.li@daocloud.io>
2023-03-10 14:14:41 +08:00
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
Kubernetes Prow Robot 8745423a7a Merge pull request #114397 from my-git9/ut/util
[UT]And test for pkg/probe/util.go
2023-03-09 21:33:30 -08:00
nilskch 0c11171b7e add tests for probe errors and ExecProbeTimeout 2023-03-08 11:59:59 +01:00
Tim Allclair 67f72d0e90 Document risk of HTTP response body in probe failure msg 2023-02-09 16:37:32 -08:00
Ryan Phillips 12b8944702 kubelet: use custom dialer for grpc probes 2023-01-25 13:28:03 -06:00
Antonio Ojea bfd8f5178e use custom dialer for http probes 2023-01-22 16:57:41 +00:00
Antonio Ojea d21f98c6f9 use custom dialer for tcp probes
Change-Id: I323b472606eaf3242b665022afe2a79ecf3b8358
2023-01-22 16:57:41 +00:00
Antonio Ojea 1978008c8f add custom dialer optimized for probes
probe util dial set linger to 1s
2023-01-22 16:57:32 +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
xin.li b766505653 [UT]And test for pkg/probe/util.go
Signed-off-by: xin.li <xin.li@daocloud.io>
2022-12-10 17:04:40 +08: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
Kubernetes Prow Robot 3ffdfbe286 Merge pull request #111254 from dims/update-to-golang-1.19-rc2
[golang] Update to 1.19rc2 (from 1.18.3)
2022-07-26 14:25:09 -07:00
Kubernetes Prow Robot 631a5a849a Merge pull request #109778 from mythi/grpc-go-update
grpc: move to use grpc.WithTransportCredentials()
2022-07-26 12:45:09 -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
Mikko Ylinen 2c8bfad910 grpc: move to use grpc.WithTransportCredentials()
v1.43.0 marked grpc.WithInsecure() deprecated so this commit moves to use
what is the recommended replacement:

grpc.WithTransportCredentials(insecure.NewCredentials())

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-05-30 21:41:47 +03:00
Sergey Kanzhelev 1df526b3f7 remove TODOs from http package and prober 2022-04-28 16:51:11 +00:00
Kubernetes Prow Robot a18b0272e6 Merge pull request #103967 from pacoxu/probe-warning
add probe warning message body for terminated redirect
2022-01-06 08:57:01 -08: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
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
Sergey Kanzhelev f390d49e24 fix the grpc probes 2021-11-20 00:23:53 +00:00
Sergey Kanzhelev b7affcced1 implement :grpc probe action 2021-11-17 17:31:23 +00:00
yxxhero 4211826c3c add more msg when exec probe timeout
Signed-off-by: yxxhero <aiopsclub@163.com>
2021-11-06 15:59:22 +08:00
刁浩 10284789 d8e91ab727 Fix test order in /pkg/probe/http/http_test.go 2021-06-05 07:27:34 +00:00
Kubernetes Prow Robot 52e42d3ca7 Merge pull request #99702 from wzshiming/fix/http-probe
Fix HTTPProbe initialize header
2021-04-08 15:59:09 -07:00
Shiming Zhang b152001f45 Fix HTTPProbe initialize header 2021-03-03 19:42:31 +08:00