Commit Graph

4738 Commits

Author SHA1 Message Date
Davanum Srinivas
9dffd3c20f Bump x/oauth2 and x/crypto
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 0fede7b8a2fb4c7f120876c9ef1e826f8ef28da2
2025-02-27 10:59:37 -05:00
Kubernetes Publisher
ebce4d7b9d Merge pull request #130291 from Jefftree/cle-beta
LeaseCandidate v1beta1 API

Kubernetes-commit: ef1c659569409471b4bdfeb83ba69cb1772ed37d
2025-02-28 20:07:26 +00:00
Kubernetes Publisher
8247f1e51f Merge pull request #129338 from pohly/log-client-go-certificates
client-go certificate: context-aware APIs and logging

Kubernetes-commit: c92dde6941356e499308b7caf8aa84a7c1f74667
2025-02-28 16:07:32 +00:00
Kubernetes Publisher
b46275ad75 Merge pull request #129688 from cpanato/update-main-go124
[go] Bump images, dependencies and versions to go 1.24.0

Kubernetes-commit: b8c95e1954ef222988c0dfe5b45d5cc96c09bcb8
2025-02-27 20:07:27 +00:00
cpanato
a126675a40 bump go.mod to set min go1.24
Signed-off-by: cpanato <ctadeu@gmail.com>

Kubernetes-commit: 88300c406b9199ed017e1bada29951fc18e66ae1
2025-02-25 13:21:52 +01:00
Kubernetes Publisher
8dd5edb393 Merge pull request #130359 from my-git9/assertion1
fix wrong assertion on tests

Kubernetes-commit: 06d81cfc7a485487375814fd8d5cefdf644c2d28
2025-02-24 15:55:11 +00:00
Kubernetes Publisher
8fa90a0728 Merge pull request #130187 from mansikulkarni96/129084
fix:  Sweep and fix stat, lstat, evalsymlink usage for go1.23 on Windows

Kubernetes-commit: ef54ac803b712137871c1a1f8d635d50e69ffa6c
2025-02-22 23:50:35 +00:00
xin.li
d8b34c3ab2 fix wrong assertion on tests
Signed-off-by: xin.li <xin.li@daocloud.io>

Kubernetes-commit: bc4ae15d77beab23f321bf6547f82c04ba27c3fa
2025-02-22 12:39:01 +08:00
Jefftree
50aba71374 generated
Kubernetes-commit: 2d10dec3a297e6be29f47c68722c1ef5ea727fbf
2025-02-19 21:51:25 +00:00
Jefftree
e6e6fcf176 LeaseCandidate alpha -> beta,
Kubernetes-commit: ac7a95efb092944ad9be0ceecb94a868342af1f1
2025-02-19 21:50:31 +00:00
Jordan Liggitt
c92258a929 Drop winsymlink go 1.23 workaround
(cherry picked from commit 3990b6324d0427eaf9ff970da2be02711567ef5f)

Kubernetes-commit: 1f642c79c3192994e76bbe8e7360fd661cd21ab4
2025-02-06 12:45:52 -05:00
Kubernetes Publisher
9c375bc53d Merge pull request #129790 from aojea/event_name
events: ensure the name is valid

Kubernetes-commit: 052d7a5310b0bab58f81519253e08f456f39e8f3
2025-02-20 19:50:35 +00:00
Antonio Ojea
023460f5a8 events: ensure the name is valid
The event Object is created from the referenced Object name, however,
there is no guarantee that the name from the referenced Object will be a
valid Event Name.

For those Objects with name not valid for an Event, generate a new valid
name using an UUID.

Kubernetes-commit: ee36b817df06f84ce1a48ef4d65ed559c3775404
2025-02-20 09:13:56 +00:00
Kubernetes Publisher
d067ae26c7 Merge pull request #130269 from tmmorin/fix-optimitically-typo
fix typo: optimitically -> optimistically

Kubernetes-commit: c2b8721c3b11306b70f3448053ddcad1b2075834
2025-02-19 23:50:54 +00:00
Kubernetes Publisher
84ec13492b Merge pull request #130047 from HirazawaUi/modify-loopback-cert-valid-period
Extending loopback certificate validity in kube-apiserver

Kubernetes-commit: 77667834b072db7e26a69d78c5e9f3181e12959f
2025-02-19 16:00:48 +00:00
Thomas Morin
89a3804453 fix typo: optimitically -> optimistically
Signed-off-by: Thomas Morin <thomas.morin@orange.com>

Kubernetes-commit: 293a6c5c91619a86b70e9d23e26412a1095db569
2025-02-19 13:37:51 +01:00
Kubernetes Publisher
72c2d4d415 Merge pull request #130249 from seans3/bump-websockets-version
Update gorilla/websockets library from 1.5.0 to latest 1.5.3

Kubernetes-commit: 728dc0d8c7a4d68157b2106330b65abcd5faac87
2025-02-19 03:51:21 +00:00
Sean Sullivan
7392886a8b Update gorilla/websockets library from 1.5.0 to latest 1.5.3
Kubernetes-commit: 3100bbab2f7f013b08910f28d8a3debc28a57ea9
2025-02-19 00:26:21 +00:00
Kubernetes Publisher
90ccd59ab1 Merge pull request #130105 from seans3/websocket-logging-level
Update websocket logging levels for better debuggability

Kubernetes-commit: 4e7e14203db8cde906604b057b1b2a8a15e8a50d
2025-02-15 19:50:49 +00:00
Kubernetes Publisher
bf05f9c594 Merge pull request #130039 from p0lyn0mial/upstream-fake-client-improve-unit-test
fake/clientset: improve TestNewSimpleClientset

Kubernetes-commit: d7db75ce91f74dc560115c9f485032701e913c84
2025-02-12 23:51:42 +00:00
Sean Sullivan
3ead27a3a2 Update websocket logging levels for better debuggability
Kubernetes-commit: d3feb5080c18fa73aa87c81a78d5cac82c6ed06d
2025-02-11 20:20:23 +00:00
Kubernetes Publisher
8683d2da3b Merge pull request #130049 from aojea/avoid_ginkgo_dep
reduce dependencies in apimachinery net testing utils

Kubernetes-commit: 670b98bf9229bb1f193571949871f794f7b11ec3
2025-02-11 11:52:16 +00:00
Antonio Ojea
fb7de29368 reduce dependencies in apimachinery net testing utils
Consumers of the kubernetes golang API and clients must use
k8s.io/api,apimachinery,client-go. This is also require to download all
the necessary dependencies.

The apimachinery code contains a testing util for proxies that is used
in client-go and in the kubectl e2e. Since the tests on e2e require
ginkgo and we want to ensure this testing library is not used in
production, we cast the interface to match one of those libraries, but
the problem is that this forces consumers of apimachinery to also
download the ginkgo library.

Since NewHTTPProxyHandler receives a testing.TB interface, there is no
need to cast the interface, if someone wants to use it by implementing a
testing interface it is already aware of the risks.

Kubernetes-commit: af3b9e613d3b76b826369153760a069aabb4cf7f
2025-02-08 15:27:20 +00:00
HirazawaUi
5c249861a4 adjusting loopback certificate validity in kube-apiserver
Kubernetes-commit: 553e9bf84d199be3d6a3da6675671859723219f4
2025-02-08 19:43:48 +08:00
Lukasz Szaszkiewicz
2b1c073f58 fake/clientset: improve TestNewSimpleClientset
Kubernetes-commit: d195ea8756d7a0babae1e052d17ad891cd3312d2
2025-02-07 14:39:15 +01:00
Kubernetes Publisher
07d61b66a6 Merge pull request #129341 from pohly/log-client-go-watch
client-go watch: context support

Kubernetes-commit: a02fe24385a36f43e96844e19c438cc4097704ef
2025-02-07 12:55:24 +00:00
Patrick Ohly
57bc261e52 client-go watch: NewIndexerInformerWatcherWithContext -> WithLogger
The ability to automatically stop on context cancellation was new functionality
that adds complexity and wasn't really used in Kubernetes. If someone wants
this, they can add it outside of the function.

A *WithLogger variant avoids the complexity and is consistent with
NewStreamWatcherWithLogger over in apimachinery.

Kubernetes-commit: 1a8d8c9b4a33daf9330434e1ad544ef3571722a3
2025-01-31 10:18:04 +01:00
Kubernetes Publisher
362c5e8de9 Merge pull request #129568 from deads2k/tighten-fifo-interface
create RealFIFO implementation

Kubernetes-commit: a8ef3639f9db66d8c894a880fd35a9cd011b2cb9
2025-01-30 00:24:47 +00:00
Kubernetes Publisher
f2030849e1 Merge pull request #129330 from pohly/log-client-go-transport
client-go/transport: structured, contextual logging

Kubernetes-commit: e07aeb7c8b52a486518f2f55ea58595ae007f3b0
2025-01-27 20:23:51 +00:00
Kubernetes Publisher
ce24f3c462 Merge pull request #129815 from dims/linter-to-ensure-go-cmp/cmp-is-used-only-in-tests
Linter to ensure go-cmp/cmp is used ONLY in tests

Kubernetes-commit: d36322f8d76c8e2a456e381bcc6bb43e4bbe602c
2025-01-26 00:23:39 +00:00
Davanum Srinivas
de67e026ad Linter to ensure go-cmp/cmp is used ONLY in tests
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 4e05bc20db99ff89b2d2205218d24b9935a7fdd7
2025-01-24 17:03:29 -05:00
Kubernetes Publisher
97f3d2697c Merge pull request #128546 from atiratree/pod-replacement-policy-terminating-pods
add PodReplacementPolicy for Deployments: terminating pods

Kubernetes-commit: 5aeea45357176e7224f908329fb7958d88a7eeac
2025-01-24 04:23:58 +00:00
David Eads
f2d9cfb8c8 switch to using the real FIFO
Kubernetes-commit: a9aab298b4738f4ea9111131cdf193a3b1ba14e5
2025-01-10 16:23:23 -05:00
David Eads
43bf1a1b0a make a real FIFO implementation
Kubernetes-commit: 24b43ea96ec60ca2c574ccc6b51c989488ca3210
2025-01-10 16:23:07 -05:00
David Eads
52af3bdc0f Remove cache.ErrRequeue
cache.ErrRequeue advertised itself as a way to requeue failures on a
FIFO, but it suffers the same problems as AddIfNotPresent.  If we do
requeue an item at the end, we'll move the informer back in time.  If we
requeue at the beginning we'll simply wedge FIFO.

We didn't find examples in the wild, but by removing the error type
those impacted will get a compile error and get to decide what action is
most appropriate for their failure.  Most of the time, proceeding to the
next item is best.

Kubernetes-commit: 238c32a1d9b2c72d648193fa8642a53a2884975f
2025-01-20 13:59:43 -05:00
David Eads
d853ccf18c Remove Queue.AddIfNotPresent
Logically a cache.Queue.AddIfNotPresent means that the informer can move
back in time since an older item is placed after newer items.  The
alternative of placing errors at the head of the queue leads to
indefinite memory growth and repeated failures on retry.

Luckily this behavior was behind RetryOnError, which was always set to
false and impossible for normal users to set to true.  By removing the
function and setting, impacted users (none found in a github search)
will get a compile failure.

Kubernetes-commit: 8e77ac000131019d5aa49c19aa1f477f6dac4d59
2025-01-20 13:54:32 -05:00
David Eads
f29637f7f2 shrink the cache.Queue interface to what is actually used
Kubernetes-commit: 0ddab1694579d523e3865c75ca44d6cdf1b0ef93
2025-01-08 15:31:47 -05:00
Patrick Ohly
e8a7cb0e18 client-go informers: provide ListWatch *WithContext variants
For compatibility reasons, the old functions without the ctx parameter still
get generated, now with context.Background instead of context.TODO. In practice
that code won't be used by the client-go reflector code because it prefers
the *WithContext functions, but it cannot be ruled out that some other code
only supports the old fields.

Kubernetes-commit: 8cc74e8a266e1042be1c60adfa3091852036f48a
2024-12-09 16:04:52 +01:00
Patrick Ohly
bad1caabde client-go + apimachinery watch: context support
The Lister and Watcher interfaces only supported methods without context, but
were typically implemented with client-go API calls which need a context. New
interfaces get added using the same approach as in
https://github.com/kubernetes/kubernetes/pull/129109.

Kubernetes-commit: 6688adae142e37114d9dfa8d94cd1d8a91fbcc13
2024-12-20 13:55:47 +01:00
Patrick Ohly
d0f5d55191 client-go certificate: context-aware APIs and logging
For NewManager, the Config struct gets changed (not extended!) so that the
caller can provide a logger instead of just a logging function. Breaking the
API was chosen because it avoids having to maintain two different log calls in
various places (one for printf-style logging, one for structured logging).

RequestCertificateWithContext is an extension. It enables getting rid of
context.TODO calls.

NewFileStoreWithLogger also is an extension.

Kubernetes-commit: f9051901cee8d8ff4aed3db27ff495a706f1a487
2024-12-09 12:45:54 +01:00
Patrick Ohly
82fcce0646 client-go/transport: structured, contextual logging
The revised logging emits one log entry at the start of
round-tripping ("Request") and another at the end ("Response"). This avoids the
risk that related output gets interleaved by other output.

No API changes are necessary. A contextual logger is picked up from the context
of the request that is being handled. The verbosity level of that logger is
checked to determine what is supposed to be logged. This enables reducing log
details on a by-request basis by storing a `logger.V(1)` in the context of the
request.

As before, logging only gets injected into request processing at -v6 or higher,
so normally there is no additional overhead.

Kubernetes-commit: a85f489b28d3b0ef82dffb267b6145c73c2d0e33
2024-12-04 15:09:37 +01:00
Filip Křepinský
df7621a0b4 update generated files and feature gates
Kubernetes-commit: 28437797b525b17a5a20b8e6c7daf30046a3864c
2024-11-04 19:52:30 +01:00
Tiago Silva
9f1cce41d5 client-go: transform watchErrorStream to wrap the underlying error (#129765)
* `client-go`: transform `watchErrorStream` to wrap the underlying error

This PR transforms the `client-go`'s `watchErrorStream` to wrap the error instead of transforming it into a single string. This enables clients to use `errors.Is/As/Unwrap` with the errors that come out of `StreamWithContext`

Fixes https://github.com/kubernetes/kubernetes/issues/129763

* adjust unit tests

Kubernetes-commit: 067012f5844b7390e7279f575342ae0536f80520
2025-01-23 20:07:37 +00:00
Kubernetes Publisher
3b09c13448 Merge pull request #128971 from aojea/servicecidr_ga
KEP-1880 Multiple Service CIDRs: Graduate to GA

Kubernetes-commit: 45d0fddaf1f24f7b559eb936308ce2aeb9871850
2025-01-22 20:27:05 +00:00
Kubernetes Publisher
3617101e66 Merge pull request #127709 from pohly/log-client-go-rest
client-go/rest: finish context support

Kubernetes-commit: 427cd18f726be3e3c4f657258dc17a97beca92d5
2025-01-22 20:27:02 +00:00
Patrick Ohly
be86cb59f1 client-go rest: store logger in Result
Storing a context and making sure that it never gets canceled also has
overhead. We might as well just do the klog.FromContext when constructing
the Result and store the logger for later use.

Kubernetes-commit: b7386467c8df686e935c477eac26049a80de789b
2024-11-27 13:19:47 +01:00
Antonio Ojea
a9177f9ca1 make update
Kubernetes-commit: 3606d52cd6de7366ca855d571b27193c32b029fb
2024-11-26 03:52:02 +00:00
Patrick Ohly
5d128adc87 client-go/rest: finish conversion to contextual logging
The remaining calls can be converted without API changes.

Kubernetes-commit: 7821abf2ae289673bbfa3b9a6b8b34f5196c7c7e
2024-09-02 17:55:12 +02:00
Patrick Ohly
7aa9904196 client-go/rest: backoff with context support
The BackoffManager interface sleeps without considering the caller's context,
i.e. cancellation is not supported. This alone is reason enough to deprecate it
and to replace it with an interface that supports a context parameter.

The other reason is that contextual logging needs that parameter.

Kubernetes-commit: b15a1943d51adfb8c5e0185d58d25e038c3d6ade
2024-09-02 20:18:47 +02:00
Patrick Ohly
2b2015d460 client-go/test: warning handler with contextual logging
The default handler now uses contextual logging. Instead of

     warnings.go:106] warning 1

it now logs the caller of client-go and uses structured, contextual
logging

     main.go:100] "Warning" message="warning 1"

Users of client-go have the choice whether the handler that they provide uses
the traditional API (no API break!) or contextual logging.

Kubernetes-commit: 48fb886325fce4b16e4067caadb7bcd3044d460f
2024-09-02 17:51:01 +02:00