Commit Graph

269 Commits

Author SHA1 Message Date
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
Ted Yu
3ebee8cab0 Change lock type to write lock in eventBroadcasterImpl
Kubernetes-commit: 94af465819bd41a97b00acf997d5a7e077cbb654
2019-05-17 19:19:42 -07:00
Yassine TIJANI
1a6ae704e2 update LastObservedTime instead of eventTime
Signed-off-by: Yassine TIJANI <ytijani@vmware.com>

Kubernetes-commit: c6b224b16cff3c69b7a0d5b98b02c89777277971
2019-05-17 18:56:38 +02:00
Ted Yu
c3d4ca8db6 Use lock in eventBroadcasterImpl#refreshExistingEventSeries
Kubernetes-commit: 32241b0751c9b9bd5d061eae9a42bd88970d8478
2019-05-17 09:30:54 -07:00
Yassine TIJANI
231e48e9f3 Implementing logic for v1beta1.Event API
Signed-off-by: Yassine TIJANI <ytijani@vmware.com>

Kubernetes-commit: 464a994a10b71c45583f3426fd970291f8a5b756
2018-07-03 22:25:17 +02:00
Jordan Liggitt
9ae57bd75e honor overridden tokenfile, add InClusterConfig override tests
Kubernetes-commit: 7306fb7a89739a2fb48bfeb74595a5daa25060bd
2019-05-15 08:15:02 -04:00
Andy Xie
f2156b6dde enhance leader election doc
Kubernetes-commit: 95f33ce39957e86cc3e81f4c8f325ecd133cbe9d
2019-05-14 10:36:22 +08:00
Mike Danese
459cb72bc6 BoundServiceAccountTokenVolume: fix InClusterConfig
Kubernetes-commit: 4198f28855cbda6dac61408fcba6f2d576a9347c
2019-05-14 09:29:16 -07:00
Mike Spreitzer
76ec0dac1e Fix comment on SharedInformer.Run
The old wording suggested that `Run` only gets the controller started.
Changed the wording to make it clear that `Run` only returns after the
controller is stopped.

Kubernetes-commit: fad9dec758be4dcc49735aea98ada2de46cff9fe
2019-05-04 23:27:42 -04:00
Mike Spreitzer
1dd778153e Made the comment on SharedInformer give a complete description
This comment formerly contained only a contrast with "standard
informer", but there is no longer such a thing so the comment lacked
much important information.

Kubernetes-commit: 121e4741463043eac188bb4eed51f07122262d69
2019-05-09 01:34:02 -04:00
Davanum Srinivas
2537fc5f76 remove unused code
Change-Id: If821920ec8872e326b7d85437ad8d2620807799d

Kubernetes-commit: 7b8c9acc09d51a8f6018eafc49490102ae7cb0c4
2019-04-18 17:22:45 -04:00
fansong.cfs
94d52886d7 add watch bookmark
Kubernetes-commit: d70edd3d39d4430d71c4b7c9adba8df5ba7f16c8
2019-03-19 18:16:23 +08:00
Joe Betz
24499f0573 Add pager.EachPageItem utility function to incrementally process lists
Kubernetes-commit: 6a64ee638780de4dcfa2ab2b4fc739dd23127c49
2019-03-28 15:39:14 -07:00
Ihar Hrachyshka
e413b96486 Fixed log message in client-go
An example of incorrect log message:

{
  "component":"virtctl",
  "level":"info",
  "msg":"Config loaded from fileocp/auth/kubeconfig",
  "pos":"loader.go:359",
  "timestamp":"2019-03-07T18:50:20.923470Z"
}

Note how the resulting message has no characters between the text and
file name.

Kubernetes-commit: 65fb63a15473589f615bdfeb2f35e56414050f94
2019-03-07 08:55:43 -08:00
vivekbagade
060f7d3455 Added config to EventCorrelator in client-go
Added CorrelatorOptions that contains options to change the
defaults in EventSourceObjectSpamFilter and EventAggregator
in EventCorrelator. Added a eventCorrelator property to the
eventBroadcasterImpl to help with this.

Kubernetes-commit: 9d8e6fb1b9cf2d3fac8139a97334287e33ff911f
2019-03-07 10:39:49 +01:00
Joe Betz
d43f2ef228 Add resourceVersion=0 paginated list integration test for disabled and enabled watch cache
Kubernetes-commit: e5a4f09ab3ac15815ceb039fbc7f546266855fd6
2019-03-21 11:25:07 -07:00
Joe Betz
d858f18787 Paginate List call performed by Reflector's ListAndWatch call
Kubernetes-commit: 84723c2d3ef5ff5d30aadd1ad72068bf2254358c
2019-03-14 13:26:19 -07:00
wojtekt
49804083df Avoid allocations in ByIndex() function
Kubernetes-commit: 7d46e27db185e5281b718ad964e9c2f8777c2fc8
2019-03-26 14:14:42 +01:00
shinytang6
861da69465 replace time.Now().Sub with time.Since
Kubernetes-commit: 5c9f4d9dc67b28fb31fd95f88448c09150a4cbfb
2019-03-18 23:57:26 +08:00
Clayton Coleman
c48e0dd815 Avoid using %#v for errors when %T is more informative
`%#v` may have significant performance costs in frequently invoked code.

Kubernetes-commit: 435db312e1773d3ad506604219b9b1d00176d6fc
2019-03-21 22:54:06 -04:00
tiffany jernigan
9e76b965b3 Updated client-go expiration cache to take in expiration policies
Kubernetes-commit: bc226a2a899a6d7d85be3b589d20d22c4777f84e
2019-03-22 07:38:35 +00:00
Kyle Bai
efa2d6bde2 client-go: update leader election example
Kubernetes-commit: 8a82b21f46c261ac920074274b213a888f47c256
2019-03-10 22:44:45 +08:00
Tomas Nozicka
54b354c5dc Handle unstructured status in RetryWatcher
Kubernetes-commit: 8302b5b262c506ff7d363338f980ce204d574354
2019-03-08 09:34:56 +01:00
Tomas Nozicka
c04fc653fa Fix race in RetryWatcher's unit tests
Kubernetes-commit: b39d079b69a9ae6063204278dcd44d98d2315aa1
2019-02-27 16:35:55 +01:00
Han Kang
a1320a3a47 Remove reflector metrics as they currently cause a memory leak
Kubernetes-commit: ca096f8069aff73b774c8ef38900dca898c61938
2019-02-26 16:22:24 -08:00
Martin Helmich
e70639fd33 client-go: Dynamic local port not accessible when port-forwarding
When setting up a port forwarding with the client-go library (using the
`k8s.io/client-go/tools/portforward.PortForwarder`) with a non-defined local
port (i.e. passing `:80` as `ports` parameter to `portforward.New(...)`), a
local port will be assigned dynamically.

Currently, the local port will be _always_ 0 if it was not specified initially.
This is because the assigned local port is only set on a _copy_ of the actual
`ForwardedPort` type that is obtained in a `range` loop. This PR changes this
behaviour to set the local port at the correct instance by passing a pointer
instead of a copy to the relevant functions.

Kubernetes-commit: bbddd27f0dfffe6623763afe2c02c876ba925a7c
2019-02-03 19:01:19 +01:00
Tomas Nozicka
8ecda4e5ed Upgrade ListWatchUntil
Kubernetes-commit: 603dd254ac91b3581f9b431ff91a95d929a97e04
2019-02-18 18:20:23 +01:00
Tomas Nozicka
ce00ab47ae Add Until based on RetryWatcher
Kubernetes-commit: 09af8485f253421cdf0c20a40d12784e8fcffd5a
2019-01-03 13:45:46 +01:00
Jordan Liggitt
e6881e4a02 Update client callers to use explicit versions
Kubernetes-commit: d1e865ee341ba37469efed8c935e22e2b483eec2
2019-02-22 10:27:46 -05:00
Adrián Orive
0f2b134a3e Add newInformer documentation
Signed-off-by: Adrián Orive <adrian.orive.oneca@gmail.com>

Kubernetes-commit: b09c1ce5ddb7473b8b9dd5d63b46267381ed852f
2018-11-14 08:36:38 +01:00
Adrián Orive
2e9f26a34c Remove duplicate code
Signed-off-by: Adrián Orive <adrian.orive.oneca@gmail.com>

Kubernetes-commit: b6c3129ac5895db6df61601cfc72e2efa03fd72c
2018-11-08 15:46:56 +01:00
Justin SB
931e6a04ad Remove executable file permission from OWNERS files
Kubernetes-commit: dd19b923b7c26420af39fcf4eedfa213b236c8d3
2019-01-03 12:18:20 -05:00
Ted Yu
353e58d58a Reduce the duration where expirationLock is held for expiration_cache
Kubernetes-commit: 4e3fd13a93b0ed7ec0d81a00f61da54bb3936fbc
2019-02-06 10:16:54 -08:00
Mikalai Radchuk
bd4105de0e Fixes address parsing in port-forward
The rules for address parsing are:

* Explicitly specified addresses must bind successfully
* `localhost` is pinned to `127.0.0.1` and `::1` and at least one of those must bind successfully

This change also makes output of the command consistent
between runs with the same arguments.
Previously the command was using the range via map of addresses
which sometimes was producing different output because the order
of values is not guaranteed in Go.

Kubernetes-commit: 4ee2010111af602988bf9bedf66d1a0c36419b09
2018-11-12 00:06:35 +00:00
Roy Lenferink
94093d2527 Updated OWNERS files to include link to docs
Kubernetes-commit: b43c04452f3b563473b5c2a765d4ac18cc0ff58f
2019-01-30 20:05:00 +01:00
Kubernetes Prow Robot
0d661d3855 sync: squashed up to merge 94b5aeba9dfa5f10c8a920a229795249a919c127 in e72b32558c8e9ed16690ef5a8e909c12fcc47f87 2019-02-01 14:01:34 +00:00
Krzysztof Siedlecki
57d4daeaf4 adding trace to reflector initialization
Kubernetes-commit: 4e4d380b32105c3ff7641661120da876bca060de
2019-01-24 16:30:47 +01:00
Andrew Kim
3fa0933a1e replace client-go/util/buffer with k8s.io/utils/buffer
Kubernetes-commit: 2358e75da3379720d2cc1d86384d4830a1557b88
2019-01-24 11:37:48 -05:00
Matthew Wong
e10ef5817f Add Lease implementation to leaderelection package
Kubernetes-commit: 410175851c092dae63f72f7d12abf19b1b74e200
2018-11-20 10:29:44 -05:00