Commit Graph

307 Commits

Author SHA1 Message Date
Yassine TIJANI
6cdcb13531 add a fallback for kube-scheduler when events.k8s.io is disabled
Signed-off-by: Yassine TIJANI <ytijani@vmware.com>

Kubernetes-commit: f970b3413779ef817d2a374847bc0a4cb733a9a0
2019-10-09 20:14:29 +02:00
Bob Killen
dc265f33cf Prune inactive owners from staging/src/k8s.io/client-go/* OWNERS files.
Kubernetes-commit: 3dc01f32eacb4791b248c22f7db9d6dabbec7869
2019-10-12 19:44:19 -04:00
matte21
cc50c9b333 Remove check causing informers to miss notifications
Fix DeltaFIFO bug that caused the sync delta created by a relist
for object ID X to be dropped if the DeltaFIFO already stored a
Delete delta for X. This caused SharedIndexInformer to miss create
notifications. Also, add unit test to expose the bug.

Kubernetes-commit: 9e4be54895e8c0655408b4766cd78de17b6d5b7c
2019-10-14 18:19:05 +02:00
Ted Yu
9be50f2e07 Use consistent short name for receivers
Kubernetes-commit: 21b11c2b6434f949299f85a12c535bfd169c2cf3
2019-10-08 09:08:52 -07:00
Ted Yu
c4ea3eed4f Expose Shutdown func for EventBroadcaster
Kubernetes-commit: 57d43e4946f352f075b219b0a2f35942b06cfeb9
2019-10-07 08:58:38 -07:00
Jordan Liggitt
24302e441b Overriding CA file should override skip TLS and CA data
Kubernetes-commit: 857572168e79430af2dbf05e9d4705dfb3f0d99b
2019-10-06 13:40:21 -04:00
chenyaqi01
3eb165927d replace bytes.Compare() with bytes.Equal()
Kubernetes-commit: 66be69bb0e7fd147be650385d272ae14ee2857c8
2019-09-27 10:06:50 +08:00
chenyixiang
ba49d2a180 migrate leader election to lease API
Change-Id: I21fd5cdc1af59e456628cf15fc84b2d79db2eda0

Kubernetes-commit: 447295aff2bd8cdc92a2376553d83546a4d6eb41
2019-08-07 01:48:32 +08:00
Maru Newby
ab4e4fccf4 Add support for type checking Unstructured via GVK in reflector
It was previously possible to instantiate `Reflector` with
`*unstructured.Unstructured` as the expected type but this did not
support checking that event objects were of the correct API
type (e.g. if event object was `v1.Pod` in `Unstructured` form but
`v1.Service` was expected). This commit adds support for providing a
GVK via an `Unstructured` expected type to compare with the GVK of
event objects. The GVK will also be used in reflector log output.

Kubernetes-commit: 237dbfd8ad322dfcad4bd4d5345368480c22d82f
2019-09-24 01:20:40 +00:00
Jianfei Bai
bc70a20c12 fix: remove reportingInstance field in eventKey.
Kubernetes-commit: 6b17e5e2a48d00946bdf443d9bfaf8a295b344ec
2019-09-23 20:00:16 +08:00
Jianfei Bai
a537b01432 docs: add comments for action.
Kubernetes-commit: 993fe6f4bda183e1583cf0f879fbf9a076e99e8a
2019-09-20 21:32:44 +08:00
RainbowMango
e990876d88 Cleanup staticcheck from staging/src/k8s.io/client-go/tools/cache.
Kubernetes-commit: 19e5c8565d444cbb81d554a69960d7144996b05a
2019-09-04 18:32:06 +08:00
Darren Shepherd
6d3b14b468 Check cache is synced first before sleeping
If a cache was already synced, cache.WaitForCacheSync would
always take 100ms to complete because the PollUntil method will
sleep first before checking the condition.  Switching to
PollImmediateUntil will ensure already synced caches will return
immediately.  For code that has, for example, 20 informers, the time
to check the cache was in sync would take at least 2 seconds, but with
this change it can be as fast as you can actually load the data.

Signed-off-by: Darren Shepherd <darren@rancher.com>

Kubernetes-commit: 8a58f332dd62b68ae22c67585002defe6aeb4b04
2019-09-06 16:30:04 -07:00
RainbowMango
532b6f676e Cleanup staticcheck issues for package in client-go.
Kubernetes-commit: c8c055b3163dd2661b3f9dd1b0ffb718a61aba24
2019-08-26 20:55:32 +08:00
Yassine TIJANI
7ee6383729 move WaitForCacheSync to the sharedInformer package
Signed-off-by: Yassine TIJANI <ytijani@vmware.com>

Kubernetes-commit: 7e4c3096fe71afc6a23c273b3309ed5db7289d8c
2019-08-16 21:15:53 +02:00
Ted Yu
541253da74 Utilize reflectorMutex in LastSyncResourceVersion
Kubernetes-commit: 4f54538ae8ff7a4e6829bea1479194af87b7833c
2019-08-26 07:46:26 -07:00
Yassine TIJANI
72094bc6d5 check that the recorded event is not nil on refreshExistingEventSeries
Signed-off-by: Yassine TIJANI <ytijani@vmware.com>

Kubernetes-commit: 000c2c557f862270ec83341c1af3fcd7c6f7d4a2
2019-08-22 11:56:35 +01:00
likakuli
6a1fb71239 fixes a bug that connection refused error cannot be recognized correctly
Kubernetes-commit: 3cec9098020ecc168573c7ee658282954dac2a2e
2019-08-20 12:18:46 +08:00
Tariq Ibrahim
31cdc04542 Address review comments
Kubernetes-commit: 805640382339f646a175f04f9e4846d5bf2ef61f
2019-08-13 09:07:39 -07:00
tariqibrahim
8ade4cae05 [k8s.io/client-go]fix typo in eventseries_test.go method
Kubernetes-commit: 06e1b38768ba243d29dcc6a3fe51381d2624a62f
2019-08-12 21:16:23 -07:00
Ted Yu
cde59a28d7 Error code incorrectly hidden in recordEvent
Kubernetes-commit: 31f374f42a2c816c8fb928c5db46474f5fc24b31
2019-08-12 12:11:37 -07:00
Mike Spreitzer
0c0e2ef3a2 Added info requested in review of #77636, and more
Added definition of "collection states" and noted that informer cache
queries are answered against these.

Also added an explicit note that the concept of object identity used
in the contract here does _not_ include ObjectMeta.UID.

Also updated the description of the notifications received by a
client, to account for the fact that a client can be added after the
informer starts running.

Added references to `MetaNamespaceKeyFunc` and
`SplitMetaNamespaceKey`.

Noted that a client must process each notification promptly and added
a referral to workqueue.

Made a couple other minor clarifications and corrections.

Kubernetes-commit: 848301e11a8558f6a90e2fada870a91baace812a
2019-07-25 01:45:22 -04:00
wojtekt
6dbe622bff Fix GetReference function
Kubernetes-commit: 399d09ce4ad1728fcecdce09503a07cf1bfecef6
2019-08-05 08:37:55 +02:00
Joe Betz
1522bb2fc6 Replace string concatination with trace fields
Kubernetes-commit: 46a04d50af78e01d06a9879d62cc71fbe892076f
2019-08-02 23:47:24 -07:00
wojtekt
1bed22dd11 Fix selflinks in events tests
Kubernetes-commit: cfa16959e23e4801847b1722f6cc1c73f26e1c3d
2019-08-01 15:23:49 +02:00
Ted Yu
a865205fb0 Store key in TimestampedEntry
Kubernetes-commit: 69fb4e960f7359641b3503b734acc32af6b05e04
2019-07-29 14:53:49 -07:00
Harry Bagdi
bc72a37034 fix: do not allow nil Callbacks functions
If user specifies a nil callback, then error out
rather than crashing at runtime due to a nil reference.

Kubernetes-commit: 9dbbc652efee21bd421db1b1f52235ed20ffb7eb
2019-07-29 11:27:28 -07:00
RainbowMango
2b8d87c082 1. Fix lint errors for the whole directory staging/src/k8s.io/client-go/tools/cache;
2. Remove staging/src/k8s.io/client-go/tools/cache from .golint_failures;
3. Fix some typo from comments.

Kubernetes-commit: 0e0e1f7daba0a6ae6dd59df0a1bb643c323ad8cb
2019-07-10 12:00:52 +08:00
Peter Swica
579ad46bdc Kubectl user exec should accept zero-length environment values #652 (#78875)
* Kubectl user exec should accept zero-length environment values #652

* Changing TestValidateAuthInfoExecInvalidEnv to allow for empty strings as Exec values

Kubernetes-commit: f30af9dd6da46f0f01e38b477d455907da9f1b6c
2019-07-25 19:01:41 -04:00
Wei Huang
43e18f2627 Tolerate the case if related event is nil
Kubernetes-commit: 187fc29e3efa915265f31991fe923ab46f0113ce
2019-07-15 23:19:04 -07:00
wojtekt
a553c2c2cc Enable watch bookmarks in reflector
Kubernetes-commit: 175c07f4e6d3a59bb6d9870c4a4a78c41940b2dd
2019-07-04 13:12:08 +02:00
Sukeesh
94daee0164 Cleanup: Audit log and error capitalization
Kubernetes-commit: 346fdbccf0ac06ab3fa0e51ab3b92fdc041bb4cc
2019-06-30 11:56:27 +09:00
Himanshu Pandey
79ec8b81e2 Added custom error message when wrong file is provided with KUBECONFIG (#78185)
* Added custom error message when wrong file is provided with KUBECONFIG

* Modified test case

* Updated the code to warn the missing files

* Renamed the variable

Kubernetes-commit: a5eedcde611658c220c56d2819bf0420aded4ed6
2019-07-10 20:24:54 -07:00
Yassine TIJANI
2c14e0f870 add wojtek-t and yastij as approvers/reviewers for events package
Signed-off-by: Yassine TIJANI <ytijani@vmware.com>

Kubernetes-commit: a2994a296e3a509b40e74d77ae3f42d25a4fb1a5
2019-07-10 21:41:04 +02:00
Yassine TIJANI
36ad1c08c8 add fakes for events package, add startEventWatcher to event interface
Signed-off-by: Yassine TIJANI <ytijani@vmware.com>

Kubernetes-commit: bfa7de0165c911178daaac1991c08f7424b0048f
2019-07-05 14:18:02 +02:00
Odin Ugedal
2ee65257e5 Fix file permissions for non executable files
Normal files should have permissions 644 by default,
and does not require the last bit to be
executable

Signed-off-by: Odin Ugedal <odin@ugedal.com>

Kubernetes-commit: 35cb87f9cf71776e99a970dfff751cd29ba7ebfb
2019-06-14 21:04:39 +02:00
Mikhail Mazurskiy
458bdf6a67 Add missing TestMain() functions
Kubernetes-commit: ca38fba0af59e1193625a18002d0bf1408c4106c
2019-01-30 15:27:39 +11:00
Mikhail Mazurskiy
c90a87409a Cleanup math/rand package usage
Kubernetes-commit: 4ce1fb7d40beb9010e56d60792c4da25e8d86ed0
2018-11-17 16:45:36 +11:00
Haosdent Huang
465553e287 Fix typos.
Kubernetes-commit: 7ce6e7189166e8b284ab44ae1dccd4df1719ab3e
2019-06-09 15:34:53 +08:00
Mike Spreitzer
1ec4b74c7b Fixed and clarified comments and parameter names in index.go (#77633)
* Fixed and clarified comments and parameter names in index.go

Fixed the comment on IndexFunc to say that it returns multiple indexed values.

Clarified the comments and parameter names in the Indexer interface to
consistently use a dichotomy between "storage keys" and "indexed
values".

* Updated comments in index.go based on review by Liggitt

Kubernetes-commit: 4160909495626262ae514bab30fe81a3ff869d39
2019-06-26 04:54:20 +00:00
Sally O'Malley
23e6ea699e Modify klog Warning 'The resourceVersion for the provided watch is too old' to Info.
This warning comes from Reflector watchHandler, from the apiserver error that
indicates a watch was restarted.  This happens when etcd drops the connection
and resources are relisted.  This informs the user that the watchers are
operating properly, so should be logged as Info rather than Warning.

Kubernetes-commit: a953d1542c06456c6fe97121abd99acd352545df
2019-06-13 16:36:06 -04:00
Monis Khan
55984cdeff cache mutation detector: use correct diff function
The cache mutation detector must use a diff function that is
designed to show differences that cause reflect.DeepEqual to return
false.

Signed-off-by: Monis Khan <mkhan@redhat.com>

Kubernetes-commit: dd4f53cd45499687e768de46a15038d61935ab96
2019-06-10 15:47:51 -04:00
zhoulin xie
4e51191303 remove redundant words 'the' in comment
Signed-off-by: zhoulin xie <zhoulin.xie@daocloud.io>

Kubernetes-commit: 77ba845e6d2f0cba81993621531ae5915e7c072b
2019-02-13 22:40:34 +08:00
Yassine TIJANI
540d4de249 set deprecatedEventSource to be backward compatible
Signed-off-by: Yassine TIJANI <ytijani@vmware.com>

Kubernetes-commit: 41e384397cf8505f226dc18f4250b297f98937ab
2019-05-30 13:03:20 +00:00
Yassine TIJANI
0dc1c77c9f clean singleton event when calling finishSeries
Signed-off-by: Yassine TIJANI <ytijani@vmware.com>

Kubernetes-commit: b6663e8d4fceb6f7de7267149341d51966276df8
2019-05-17 16:55:45 +02:00
Yassine TIJANI
f6c046f83a add event_expansion for v1beta1 Events
Signed-off-by: Yassine TIJANI <ytijani@vmware.com>

Kubernetes-commit: e29cb0fb7fbf5470e7caf2b3f1fc3d039bdda4ca
2019-05-17 12:12:19 +02:00
Mike Danese
ba0da5aa4d NewIndexerInformerWatcher: fix goroutine leak
There was some weird queuing going on. The queue was implement by
spawning goroutines that would block on the "ticketer" until it was
their turn to write to the output channel. If N events where in the
watch when the consumer of the watch stopped reading events, N
goroutines would leak. In unit tests of the certificate manager, this
was causing ~10k goroutines to leak.

Fix it with a buffering event processor that uses only one routine and
cancels correctly.

Kubernetes-commit: cafc640bfa0f7362b178b1b896085962d018afe3
2019-05-03 23:50:53 -04:00
SataQiu
185f79a1f6 fix golint failures of client-go/tools/auth client-go/tools/portforward
Kubernetes-commit: a89d75e3b822a13377373b0ef1c1969c69c616ec
2019-05-13 11:13:38 +08:00
Shintaro Murakami
b37f4f2534 Change to use a constant
Kubernetes-commit: 2fcb248354ed5a3bf3154b1a8a0aafa237b2b37c
2019-05-17 18:40:03 +09:00
Mike Danese
e4a7e70861 cleanup some leader election client doc
Kubernetes-commit: 5df7f529f063ab354b050418b40c1f1dd2600175
2019-05-16 12:54:50 -07:00