Commit Graph

3707 Commits

Author SHA1 Message Date
Mike Danese
9edd019f97 vendor: removed unused dep github.com/elazarl/goproxy
Kubernetes-commit: f61c4245c18724dcac88f0ad9f347e82bbb57cd7
2022-11-04 22:14:46 +00:00
Kubernetes Publisher
e6998df99e Merge pull request #115093 from xuzhenglun/too-large-resource-version-1.16
Fix bug in reflector not detecting "Too large resource version" error before 1.17.0

Kubernetes-commit: d3f881f7508ec3bd8aa83712038bdcf5f4703396
2023-01-18 11:59:00 +00:00
Kubernetes Publisher
a13376f3fa Merge pull request #114542 from pacoxu/EphemeralContainers
cleanup: EphemeralContainers feature gate related codes

Kubernetes-commit: c913e6ce62d23b19eebec9beda91d7599bf5099b
2023-01-17 20:14:45 +00:00
xuzhenglun
7685b51912 Fix bug in reflector not detecting "Too large resource version" error before 1.17.0
Kubernetes-commit: 11e5e92dc65c1caaeb248a60d90ccc8e29eb9ff0
2023-01-16 11:36:28 +08:00
Kubernetes Publisher
228b004f4a Merge pull request #115077 from smarterclayton/reflector_mock_clock
cache: Reflector should have the same injected clock as its informer

Kubernetes-commit: 4c4d4ad0a4aea4d015561ae3e7d48e8aaf609277
2023-01-15 17:24:49 -08:00
Clayton Coleman
08e22c4b64 cache: Reflector should have the same injected clock as its informer
While refactoring the backoff manager to simplify and unify the code
in wait a race condition was encountered in
TestSharedInformerWatchDisruption. The new implementation failed
because the fake clock was not propagated to the backoff managers
when the reflector was used in a controller. After ensuring the
mangaers, reflector, controller, and informer shared the same
clock the test needed was updated to avoid the race condition by
advancing the fake clock and adding real sleeps to wait for
asynchronous propagation of the various goroutines in the controller.

Due to the deep structure of informers it is difficult to inject
hooks to avoid having to perform sleeps. At a minimum the FakeClock
interface should allow a caller to determine the number of waiting
timers (to avoid the first sleep).

Kubernetes-commit: 91b3a81fbd916713afe215f7d701950e13a02869
2023-01-14 14:17:33 -05:00
Kubernetes Publisher
241dfe3630 Merge pull request #114794 from lavalamp/improved-has-synced
Do not N^2 loading webhook configurations

Kubernetes-commit: cc9cc4d3eaec45206f353216a1c3ff6edaf07d30
2023-01-12 16:03:24 -08:00
Daniel Smith
cb28a0e57e Fix N^2 startup for webhook configurations
Add a "lazy" type to track when an update is needed. It uses a nested
locking technique to avoid extra evaluation calls.

Kubernetes-commit: 5a1091d88d95bd1dd5c27f2c72cee4ecb4219dda
2023-01-09 23:29:25 +00:00
Kubernetes Publisher
895a515b59 Merge pull request #114766 from MadhavJivrajani/prepare-for-go1.20
[Prepare for go1.20] *: Bump versions and fix tests

Kubernetes-commit: 4802d7bb62c2623be8e4f940f6b5c1fcddd6c744
2023-01-12 18:42:58 +00:00
Madhav Jivrajani
47c0033395 *: Bump version of vmware/govmomi
Bumping version to include changes that
better handle TLS errors. Bump nescessary
to prepare for when the version of Go is
bumped to 1.20

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>

Kubernetes-commit: 8b064fa4be71b5f1b498fabb5caade3c57f5d434
2023-01-02 20:56:02 +05:30
Kubernetes Publisher
ce349e1afa Merge pull request #114879 from olivierlemasle/bump-kube-openapi
Bump kube-openapi

Kubernetes-commit: 8fdaac238e4f7f560066ea3a324cdbcaae564ac9
2023-01-12 02:09:56 +00:00
Kubernetes Publisher
6500345693 Merge pull request #113467 from pacoxu/psp-cleanup
Remove PodSecurityPolicy related code except client-go & API type

Kubernetes-commit: 08d9a0ef5b3b30952a558786e4b6e360701a16c6
2023-01-12 02:09:49 +00:00
Kubernetes Publisher
674e53a7cb Merge pull request #112365 from dgrisonnet/consolidate-isomorphic-events
Update isomorphic event definition in the events/v1 client to match aggregation logic from core/v1

Kubernetes-commit: f56c79398e3c58b4f5a9c7e6a1f4d64248ef1b83
2023-01-11 09:22:09 +00:00
Kubernetes Publisher
2c828f0e97 Merge pull request #114859 from pohly/e2e-ginkgo-spec-ordering
dependencies: update ginkgo to v2.7.0

Kubernetes-commit: a11ad04564f05e5d7e2d5a3f421ec5a45b6807c5
2023-01-11 01:23:10 +00:00
Olivier Lemasle
640dd29fa4 Bump kube-openapi
Kubernetes-commit: 8b8e20fcdbbeeb4520995e4f7c6a003a33062dd2
2023-01-09 20:41:41 +01:00
Patrick Ohly
e96d4a06a4 dependencies: update ginkgo to v2.7.0
The new ginkgo release adds sorting of specs. This was triggered by
the observation that parallel test execution of Kubernetes E2E tests
sometimes ran the same spec twice and (presumably) other specs not at all
because spec order was random due to iteration over a map.

Sorting should avoid that problem.

Kubernetes-commit: baf832d80d798d53ceb7d4de3a39330c6eda5c6a
2023-01-05 21:19:14 +01:00
Kubernetes Publisher
fda1b1132e Merge pull request #114869 from liggitt/kube-openapi
bump kube-openapi

Kubernetes-commit: 0e49c542d7a73dd056f8f32f33939207dd009b14
2023-01-07 07:51:03 +00:00
Jordan Liggitt
61a4d65439 bump kube-openapi
Kubernetes-commit: d78de56d769ee9bd2193ccadbac5621d4a0ae89d
2023-01-06 12:21:58 -05:00
Kubernetes Publisher
bd7ed9e647 Merge pull request #114460 from brianpursley/pf-exit
portforward: return error on lost connection to pod

Kubernetes-commit: 61cdb86814489624dd5a169526797e186a118e66
2023-01-07 07:51:00 +00:00
Kubernetes Publisher
5ea7f43b5d Merge pull request #113654 from stevekuznetsov/skuznets/fake-group-name-registration
code-generator: refer to the API package for GV{R,K}

Kubernetes-commit: c97dbd1afb815731cbebf9cb0d888a29c39e2b76
2023-01-07 07:50:58 +00:00
Kubernetes Publisher
dc46266e11 Merge pull request #114829 from liggitt/oauth-revert
Revert "bump golang.org/x/oauth2"

Kubernetes-commit: 293bf70916de8ef61d5f868f53959f1e15b3e091
2023-01-07 07:50:56 +00:00
Kubernetes Publisher
37a1df5cba Merge pull request #111660 from pacoxu/key-encipherment-v1.26
Key encipherment usage  v1.27

Kubernetes-commit: 492637878f0b26fa126f2025af2ee5c1f1fd5867
2023-01-07 07:50:51 +00:00
Kubernetes Publisher
26d70e3a1c Merge pull request #114822 from liggitt/oauth2
bump golang.org/x/oauth2

Kubernetes-commit: 4e785dc7e3ac1d01cedd23a0ed9c4a67dc9c214f
2023-01-07 07:50:50 +00:00
Jordan Liggitt
338dcc21ed Revert "bump golang.org/x/oauth2"
This reverts commit fc9a140badf29382c1396b7de4813849d6f3e3c9.

Kubernetes-commit: 9f07c8e346fef454942d205f2702885475c7fc9a
2023-01-04 17:58:08 -05:00
Jordan Liggitt
4dad476f03 bump golang.org/x/oauth2
Kubernetes-commit: fc9a140badf29382c1396b7de4813849d6f3e3c9
2023-01-04 11:16:43 -05:00
Kubernetes Publisher
3e0d990533 Merge pull request #114236 from dgrisonnet/fix-eventseries-race
Fix data race when emitting similar Events consecutively

Kubernetes-commit: ca858e0c961db6ef8b22ecc3e257a02757261ea1
2023-01-02 17:28:37 +00:00
Kubernetes Publisher
7e3470802f Merge pull request #114237 from dgrisonnet/handle-series-error
Retry when recording an EventSerie results in an AlreadyExist error

Kubernetes-commit: 2b6c8420a245583d5055e9b4b8ed2b648c42529d
2023-01-02 17:28:33 +00:00
Brian Pursley
b0a6a6f777 portforward: Add unit test to cover stopChan usage
Kubernetes-commit: 6f08ab013c6ce54de239aab46b4086c09464f977
2022-12-23 10:11:21 -05:00
Kubernetes Publisher
b69cda3e4e Merge pull request #113538 from pohly/e2e-ginkgo-timeline
e2e: ginkgo timeline

Kubernetes-commit: 020fb2eb776c0affad3a9ff7dd21ba231e6c646d
2022-12-23 02:39:06 +00:00
Kubernetes Publisher
32f9a1505d Merge pull request #114585 from JoelSpeed/fix-resource-requirements-claims
Resource Claims must be a map type, not set

Kubernetes-commit: 5882479457ac2554f70fc4678aa86eca8c49ae8b
2022-12-23 02:39:04 +00:00
Kubernetes Publisher
bc218e478a Merge pull request #114578 from ardaguclu/wrap-ctx-error-until
Embed context deadline exceeded in error to let errors.Is can work

Kubernetes-commit: b704b96565249fe451d9d023f7f743efc1cc90fe
2022-12-23 02:39:02 +00:00
Kubernetes Publisher
19c9966172 Merge pull request #114291 from MaxHorstmann/master
#79612 fix(client-go): return error in fake discovery

Kubernetes-commit: 0783cf49e853e56f2f5e1708519c09fa83f0349f
2022-12-23 02:38:59 +00:00
Joel Speed
984a230dff Resource claims should be a map type
Kubernetes-commit: e50e8a0c919c0e02dc9a0ffaebb685d5348027b4
2022-12-19 16:02:02 +00:00
Arda Güçlü
21fffc1153 Embed context deadline exceeded in error to let errors.Is can work
Currently, watch package embeds context deadlineexceeded error
in it's own error using `%v`, as can be seen in here;

`fmt.Errorf("UntilWithSync: unable to sync caches: %v", ctx.Err())`

However, consumers of this function can not use
`errors.Is(err, context.DeadlineExceeded)` due this `%v`.

To let consumers can distinguish context deadlineexceeded errors,
this PR changes error embedding format to `%w`.

Kubernetes-commit: 6b7c365f8f6d50280c2dab171efdd4b93d964f32
2022-12-19 15:26:08 +03:00
Kubernetes Publisher
089645a7c5 Merge pull request #114559 from liggitt/gofmt
Fix indentation/spacing in comments to render correctly in godoc

Kubernetes-commit: 76522eb1a339a95544523c1ed85da09f287f1ade
2022-12-19 01:08:52 +00:00
Jordan Liggitt
422fe1f61e Fix indentation/spacing in comments to render correctly in godoc
Kubernetes-commit: 78cb3862f11225135afdf76f3424e2d7b33104c7
2022-12-17 17:31:05 -05:00
Paco Xu
20ca706950 cleanup: EphemeralContainers feature gate related codes
Kubernetes-commit: 70e56fa71af5aa4f3d1448fcbc26e86309cd0cf3
2022-12-16 23:46:47 +08:00
Kubernetes Publisher
97591331ce Merge pull request #113985 from lavalamp/improved-has-synced
Propagate HasSynced properly

Kubernetes-commit: 843b40aeb421347ae00f206ea879bc1e1ae2912d
2022-12-15 21:18:24 +00:00
Max Horstmann
24248303bf client-go: properly return error in fake discovery (#79612)
Fake discovery should return an error if an error-returning reactor was prepended.

This is relevant e.g. for unit tests which test a function which relies
on discovery to check if an API Server is available.

Matches existing behavior of other fake types, for example fake_namespace.

Adds unit test coverage as well.

Kubernetes-commit: b47748103a53c0fe5ba1ddc950662ffc9bd9ed0f
2022-12-14 11:41:10 -05:00
Brian Pursley
d0842249d3 portforward: return error on lost connection to pod
Currently, when the remote connection is unexpected closed, forward() prints an error message saying "lost connection to pod" via runtime.HandleError, but then it returns nil for the error.

This prevents the caller from being able to handle this error differently.

This commit changes forward() to return the "lost connection to pod" error so that it can be handled by the caller.

Making this change enables kubectl port-forward to exit with code 1, instead of 0, which is the expected behavior for a command that has failed.

Kubernetes-commit: a9f04103854893056237a09250ad3335867b0391
2022-12-13 13:32:42 -05:00
Damien Grisonnet
e3ded99476 tools/events: retry on AlreadyExist for Series
When attempting to record a new Event and a new Serie on the apiserver
at the same time, the patch of the Serie might happen before the Event
is actually created. In that case, we handle the error and try to create
the Event. But the Event might be created during that period of time and
it is treated as an error today. So in order to handle that scenario, we
need to retry when a Create call for a Serie results in an AlreadyExist
error.

Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>

Kubernetes-commit: 2f83117bcfe30ad3ada7f1ca66f4b885a1d5df25
2022-12-01 15:40:01 +01:00
Damien Grisonnet
4b578e1242 tools/events: fix data race when emitting series
There was a data race in the recordToSink function that caused changes
to the events cache to be overriden if events were emitted
simultaneously via Eventf calls.

The race lies in the fact that when recording an Event, there might be
multiple calls updating the cache simultaneously. The lock period is
optimized so that after updating the cache with the new Event, the lock
is unlocked until the Event is recorded on the apiserver side and then
the cache is locked again to be updated with the new value returned by
the apiserver.

The are a few problem with the approach:

1. If two identical Events are emitted successively the changes of the
   second Event will override the first one. In code the following
   happen:
   1. Eventf(ev1)
   2. Eventf(ev2)
   3. Lock cache
   4. Set cache[getKey(ev1)] = &ev1
   5. Unlock cache
   6. Lock cache
   7. Update cache[getKey(ev2)] = &ev1 + Series{Count: 1}
   8. Unlock cache
   9. Start attempting to record the first event &ev1 on the apiserver side.

   This can be mitigated by recording a copy of the Event stored in
   cache instead of reusing the pointer from the cache.

2. When the Event has been recorded on the apiserver the cache is
   updated again with the value of the Event returned by the server.
   This update will override any changes made to the cache entry when
   attempting to record the new Event since the cache was unlocked at
   that time. This might lead to some inconsistencies when dealing with
   EventSeries since the count may be overriden or the client might even
   try to record the first isomorphic Event multiple time.

   This could be mitigated with a lock that has a larger scope, but we
   shouldn't want to reflect Event returned by the apiserver in the
   cache in the first place since mutation could mess with the
   aggregation by either allowing users to manipulate values to update
   a different cache entry or even having two cache entries for the same
   Events.

Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>

Kubernetes-commit: 55ec09d377274b4a6107fe0b7a061ad408fe05a7
2022-12-01 15:39:34 +01:00
Daniel Smith
5d70a118df Enable propagration of HasSynced
* Add tracker types and tests
* Modify ResourceEventHandler interface's OnAdd member
* Add additional ResourceEventHandlerDetailedFuncs struct
* Fix SharedInformer to let users track HasSynced for their handlers
* Fix in-tree controllers which weren't computing HasSynced correctly
* Deprecate the cache.Pop function

Kubernetes-commit: 8100efc7b3122ad119ee8fa4bbbedef3b90f2e0d
2022-11-18 00:12:50 +00:00
Kubernetes Publisher
e7e7d01afd Merge pull request #110991 from thockin/svc-typenames-starTrafficPolicyType
Svc typenames star traffic policy type

Kubernetes-commit: 923ee203f362aa947a7b0c9b1357488e0a244ea7
2022-12-13 04:24:09 +00:00
Steve Kuznetsov
9bcbb56a27 code-generator: refer to the API package for GV{R,K}
There should only be one source of truth for the API group's name and
version.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>

Kubernetes-commit: e13198ec6f52c4a6405388e90053954dc7656a31
2022-11-06 07:05:42 -07:00
Paco Xu
be1f5d4ebb client-go: remove extensions psp only
Kubernetes-commit: e41b1bff5853c616f7872ccf36fbefa480f72892
2022-11-03 10:12:16 +08:00
Patrick Ohly
beb71aae41 dependencies: update to ginkgo v2.6.1, gomega v1.24.2
Ginkgo v2.5.0 adds support for a "timeline": a full description of what happened
while a specific test ran, including failures, timeouts, and log output.

Ginkgo v2.6.0 adds ReportBeforeSuite which we need for
https://github.com/kubernetes/kubernetes/issues/114313.

Kubernetes-commit: f3ef4004317c1a12d84021be29dd5f92badc8eff
2022-11-02 09:07:12 +01:00
Damien Grisonnet
1113415196 event_broadcaster: update isomorphic event def
Update the definition of an isomorphic event in the events/v1 client to
match the aggregation logic that was already present in the core/v1
implementation.

The note field was omitted even though the message was used in the core
API aggregation because we didn't reach consensus.

Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>

Kubernetes-commit: 21f2f746abc1a5a1b3193274401f5728e19cc26f
2022-09-09 19:16:40 +02:00
Paco Xu
6a07cedcd3 kubelet: add key encipherment usage only if it is rsa key
remove allowOmittingUsageKeyEncipherment as it is always true

Signed-off-by: Paco Xu <paco.xu@daocloud.io>

Kubernetes-commit: 160f015ef4affe903f98e74cf42b40fceef15cb9
2022-08-03 16:41:09 +08:00
Tim Hockin
31e7d402a3 ServiceInternalTrafficPolicyType: s/Type//
Rename ServiceInternalTrafficPolicyType => ServiceInternalTrafficPolicy

Kubernetes-commit: dd0a50336e283775e05e54b0b174b7c7a9367d99
2021-11-09 23:30:23 -08:00