Commit Graph

4339 Commits

Author SHA1 Message Date
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
wongearl
5d95f80033 diff.ObjectReflectDiff is DEPRECATED use cmp.Diff
Kubernetes-commit: 6da08775f9fc8d70f867435f55cf712d3a6ef056
2022-11-02 17:40:19 +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
Tim Hockin
f5f28c4de4 ServiceExternalTrafficPolicyType: s/Type//
Rename ServiceExternalTrafficPolicyType => ServiceExternalTrafficPolicy

Kubernetes-commit: d0e2b068500b260851f48c636185e1dcbb438d2e
2021-11-09 23:25:43 -08:00
Kubernetes Publisher
5a489e8d10 Merge pull request #114404 from hoskeri/discovery-error-check
Check the correct error in d.downloadAPIs

Kubernetes-commit: 47d58265ae6661fa5e21575f688ce761a11c090e
2022-12-11 00:05:15 -08:00
Abhijit Hoskeri
4dbb1cd1d5 Check the correct error in d.downloadAPIs
The error result of `d.downloadAPIs()` is set in `aerr`,
not `err`.

This prevents a nil-ptr dereference of apiGroups in the next step.

Signed-off-by: Abhijit Hoskeri <abhijithoskeri@gmail.com>

Kubernetes-commit: 450ba4f50638ad9ee4d287a762a8530c64e89ebd
2022-12-10 16:32:02 -08:00
Kubernetes Publisher
58ff029093 Merge pull request #113933 from liggitt/retry-race
Fix client-go request retry race

Kubernetes-commit: 8d2fbfc5a9635bc3247d7f739f8a057962049aca
2022-12-10 23:34:13 +00:00
Kubernetes Publisher
ca60156554 Merge pull request #111898 from ncdc/reflector-unstructured-fixes
Reflector: support logging Unstructured type

Kubernetes-commit: 054274d77c3fc12eeb56fd03d6e371d4aa61f0c1
2022-12-10 03:34:09 +00:00
Kubernetes Publisher
d21defd4b1 Merge pull request #113904 from apelisse/add-owners-apelisse
Add apelisse into some more OWNERS files

Kubernetes-commit: b47752022b5b856a3516ad5377e3b020f43c4f2b
2022-12-09 23:33:52 +00:00
Kubernetes Publisher
6cbd19f22f Merge pull request #114319 from liggitt/net-master
Update golang.org/x/net 1e63c2f

Kubernetes-commit: 72acaad83924360960e21915aa94cd1db8d0196c
2022-12-07 02:03:56 +00:00
Jordan Liggitt
b044399795 Update golang.org/x/net 1e63c2f
Includes fix for CVE-2022-41717

Kubernetes-commit: afe5378db9d17b1e16ea0028ecfab432475f8e25
2022-12-06 17:29:11 -05:00
Andy Goldstein
fbb7f087d1 reflector: refactor setting typeDescription & expectedGVK
Signed-off-by: Andy Goldstein <andy.goldstein@redhat.com>

Kubernetes-commit: 784ec157e67c86bc3383b326bbfe8ee70737aa4d
2022-12-02 12:39:58 -05:00
Antoine Pelisse
0193d08605 Add jpbetz to k8s.io/client-go/applyconfigurations
Kubernetes-commit: a1f5e36fab45645ad4776eca927347d8dc715c8b
2022-11-17 14:54:41 -08:00
Jordan Liggitt
e2f402cda3 Limit request retrying to []byte request bodies
Kubernetes-commit: 69fad419a7666ac416307de4c3ee88c7e61b94db
2022-11-15 17:47:35 -05:00
Antoine Pelisse
a4d38f89cb Add apelisse into some more OWNERS files
Kubernetes-commit: b5f2130f240b0a9ebd1d0edd400b899d0efb8b2b
2022-11-14 16:28:14 -08:00
Kubernetes Publisher
1ac8d45935 Merge pull request #113797 from seans3/force-no-aggregated
Adds field to force non-aggregated discovery

Kubernetes-commit: 418608e926049e7458f03226fe27f101e7fdc47f
2022-11-14 21:50:55 +00:00
Kubernetes Publisher
c8ffed3108 Merge pull request #111023 from pohly/dynamic-resource-allocation
dynamic resource allocation

Kubernetes-commit: d1c0171aed848900daa07212370c991c19c318b1
2022-11-12 01:50:36 +00:00
Kubernetes Publisher
61cd728579 Merge pull request #113826 from jsafrane/add-openstack
Add CSI migration of OpenStack Cinder volumes

Kubernetes-commit: e4d46148de9d83c23001323d6613618c2897a427
2022-11-11 21:50:36 +00:00
Kubernetes Publisher
cfd682c60b Merge pull request #113375 from atiratree/PodHealthyPolicy-api
api: add unhealthyPodEvictionPolicy for PDBs

Kubernetes-commit: cc704f97784c3359db4690b97201ebfe6b481869
2022-11-11 13:50:33 +00:00
Patrick Ohly
522eaa15ef api: generated files
Kubernetes-commit: 9683c60c05491a9e9cafd3419c150caf7355bf49
2022-11-10 20:22:42 +01:00
Filip Křepinský
f1c80d7a4f generated
Kubernetes-commit: 3e3912467a0d7b00ec8a5231da3603b3aa31337d
2022-11-10 18:41:33 +01:00