Commit Graph

441 Commits

Author SHA1 Message Date
Jakub Przychodzeń
eae461ddf8 [Leader election] Add documentation to function
Kubernetes-commit: 852075b23c1854d538582e3940dff36947de2907
2021-01-13 17:34:07 +01:00
adamzhoul
5c32e970ce fix replyChan block
Kubernetes-commit: 314a9c4a6215b7e57944c86acacc5c75ab55121f
2021-01-11 08:36:27 +00:00
Chotiwat Chawannakul
a35bc8fe7a Fix stale object causing a panic on DELETE event
Kubernetes-commit: 1f4f78ac414b7a1666e908670c5e447015bdc6b9
2021-01-06 10:38:31 -08:00
Rajalakshmi-Girish
cb8d3d1111 fixes the unit tests to be more tolerant with error messages
Kubernetes-commit: 98948ad8092b41ebc08d50aa557b2d7ba5496e7d
2020-11-27 08:21:56 +00:00
Victor Timofei
53a09c71a4 Update the wording of the DeltaFIFO
Kubernetes-commit: 3a107951f0bf16a022b70a667c98833e4ac1d540
2020-12-24 16:33:04 +02:00
Victor Timofei
710a222444 Move Delta definitions to the top
Kubernetes-commit: bcc1c9a387c898478ed47c629864418be89bf518
2020-12-15 22:07:33 +02:00
Victor Timofei
09cf7147ab Update DeltaFIFO Documentation
Kubernetes-commit: 1a4ed5ea57ac4d562311d2b2852dcc59b78725da
2020-12-15 21:31:30 +02:00
pacoxu
8031d76bd6 fix index test: multi index check for empty list
Signed-off-by: pacoxu <paco.xu@daocloud.io>

Kubernetes-commit: ae6360f6c732d554c332a0bc1b99808149d8376e
2020-11-26 18:23:57 +08:00
Mikhail Mazurskiy
29b07456f5 Check errors of the Close call
Error from out.Close() was not checked

Kubernetes-commit: f9b928f1f13821b65ea4ef783f847993c51fb4dd
2020-06-15 21:47:08 +10:00
Mikhail Mazurskiy
6cc39819fd Make inClusterConfigProvider thread safe
If configuration object is used concurrently
it is not safe to mutate self.
There is no need for mutation so avoid it
just in case.

Kubernetes-commit: 9e360eb05efafd0fcabd5a065b62cb8226da94c2
2020-06-15 21:17:45 +10:00
Mikhail Mazurskiy
6d09f8e62e Stop using mergo.MergeWithOverwrite
Use the recommended replacement instead.

Kubernetes-commit: 243a9b204e14dc9c92f08cd3252c31731b9532fd
2020-06-15 21:11:27 +10:00
Mikhail Mazurskiy
277eea62aa Cleanup currentMigrationRules
1. Use filepath for filename manipulations
2. Restructure method logic

Kubernetes-commit: 11800147f51e85b9a4fb7eb2654cae3ded9d8cf0
2020-06-15 20:59:21 +10:00
adamzhoul
04adad44d6 fix spdy stream, conn deadlock.
Kubernetes-commit: 94a297485bf39a6d69f316c257d351e9432b8cb5
2020-11-15 17:06:34 +08:00
Qing Ju
1d175299a2 Fixed a harmless bug where initialPopulationCount should be based on the key length not list size in DeltaFIFO#Replace()
Kubernetes-commit: bc39672c0638426979feef95baeff39d170161eb
2020-11-22 16:35:19 -08:00
Bryan Boreham
5d2c89de53 Remove unused argument from generateEvent
Kubernetes-commit: beceee68156dff8b10123a37bb4645941b7df0c2
2020-11-17 16:51:10 +00:00
Jordan Liggitt
c476b49dcf Add GC unit tests
Adds unit tests covering the problematic scenarios identified
around conflicting data in child owner references

                      Before   After
package level         51%      68%
garbagecollector.go   60%      75%
graph_builder.go      50%      81%
graph.go              50%      68%

Added/improved coverage of key functions that had lacking unit test coverage:

* attemptToDeleteWorker
* attemptToDeleteItem
* processGraphChanges (added coverage of all added code)

Kubernetes-commit: e491c3bc7056530d82590d95f0af0e8c4d8dded5
2020-10-09 17:50:52 -04:00
Marek Siarkowicz
e93788d387 Add datapolicy tags to staging/src/k8s.io/client-go/
Kubernetes-commit: e29c568c4a9cd45d15665345aa015e21bcff52dd
2020-10-29 18:15:52 +01:00
Maciej Szulik
87661a7415 kubeconfig: add explicit path, if specified to loading precedence
Kubernetes-commit: 7c8e4c83fbe66548aeb446562c29c42efe1d4386
2020-07-21 15:45:36 +02:00
Andrew Keesler
405010f17b exec credential provider: k8s.io/client-go/tools/auth/exec helper
Exec plugin implementations should be able to call
LoadExecCredentialFromEnv() in order to get everything they need to
operate (i.e., cluster information (as long as it is passed in) and
optionally per-cluster configuration).

Signed-off-by: Andrew Keesler <akeesler@vmware.com>

Kubernetes-commit: 875a46bd7c1b79f1fae9cd189eec5fc9c3fbf1bc
2020-10-29 13:38:50 -04:00
Andrew Keesler
a7ba87c612 exec credential provider: ProvideClusterInfo and kubeconfig shadow
- The main idea here is that we want to 1) prevent potentially large CA
  bundles from being set in an exec plugin's environment and 2) ensure
  that the exec plugin is getting everything it needs in order to talk to
  a cluster.
- Avoid breaking existing manual declarations of rest.Config instances by
  moving exec Cluster to kubeconfig internal type.
- Use client.authentication.k8s.io/exec to qualify exec cluster extension.
- Deep copy the exec Cluster.Config when we copy a rest.Config.

Signed-off-by: Andrew Keesler <akeesler@vmware.com>

Kubernetes-commit: c4299d15d5289768808034676858e76a177eeae5
2020-10-29 13:38:42 -04:00
Monis Khan
9e147f192f exec credential provider: wire in cluster info
Signed-off-by: Monis Khan <mok@vmware.com>

Kubernetes-commit: f97422c8bd57692f5a1a3aa6dc6abc31051ebc82
2020-05-06 01:01:09 -04:00
Dave Protasowski
3da398aea9 Re-add the event recorder in the release test
Prior having a mock recorder would cause panics since the lock
would be set to nil on update failures. Now the recorder will
use the cached lock

Kubernetes-commit: 5e7ed7b86d26b651f1ef78a794cdc03fa945a3ce
2020-10-27 22:45:33 -04:00
Dave Protasowski
bfd1732c49 Don't clear the cached resourcelock when errors occurs on updates
This allows the lock to be release normally - even with a
potentially stale lock. This flow should only occur when we're
the lease holders.

Kubernetes-commit: 8160ecfd90284c333101a16bdccd79aacc86360d
2020-10-27 22:41:39 -04:00
Dave Protasowski
a0a4a352aa Add failing test showing release is not working properly
Kubernetes-commit: 23ce312b9f764736d8ac7cb6f8ebf6825d43f817
2020-10-27 22:29:22 -04:00
Zachary Seguin
7efa263687 Add lease release tests in leader election
Kubernetes-commit: a4979cd2a69192138b5998daca07d9b7ca6c8801
2020-04-22 18:52:44 -04:00
Zachary Seguin
710705cfe6 Generate complete leader election record to resolve leader election issues with LeaseLocks
Kubernetes-commit: c902b8a20578a1d299e3563613a66ed32f70efad
2019-08-03 17:40:03 -04:00
Jakub Przychodzeń
5b14150b09 Add new way to generate leader election lock
Kubernetes-commit: 24033c908d8363ea6628b1d1c0b2a48c96a338da
2020-10-16 11:28:42 +02:00
Martin Schimandl
3450a048bc Fix staticchecks in vendor/k8s.io/client-go
Kubernetes-commit: 13c017056c924e148113e42786a511ed2fee7594
2020-10-01 12:40:32 +02:00
wojtekt
866e6a7e3c Allow tracking resource version for reflector store
Kubernetes-commit: 4af1328bb8a3b3eb2289bbbe624480548dd39cdc
2020-08-31 15:58:16 +02:00
knight42
9ff85ef8ef test(portforward): deflake TestGetListener
Signed-off-by: knight42 <anonymousknight96@gmail.com>

Kubernetes-commit: bb68741fcbe82a7b17e05e82f7a71bd0c4815e02
2020-09-09 15:40:56 +08:00
knight42
da11764900 test(tools::events): deflake TestEventSeriesf
Signed-off-by: knight42 <anonymousknight96@gmail.com>

Kubernetes-commit: d9bff7b27618bd31330187add92594a8a520e8d4
2020-09-06 16:31:15 +08:00
Maciej Borsz
a52faa7892 Add WatchListPageSize to cache.Config
Currently there is no way to specify WatchListPageSize used by Controller. This PR adds a field that can be used to specify this.

Change-Id: I241454a45dd94d3ea65a91b297f530e217f843aa

Kubernetes-commit: 43f5afe1a1dd058a2564cd3b2f330fc2a401f607
2020-08-31 12:52:45 +02:00
knight42
a922620591 test(watch-tool): deflake TestRetryWatcherToFinishWithUnreadEvents
Signed-off-by: knight42 <anonymousknight96@gmail.com>

Kubernetes-commit: 1d92314f262548b6b24e309943274e0d9d196a41
2020-09-05 17:19:47 +08:00
Derek Carr
475bc66604 Improve ability to debug Events e2e failure
Kubernetes-commit: 4502fa3cfcd6025ba434f8626102e56d09d95b7e
2020-09-03 15:01:33 -04:00
azush26
5f6a1b08cd modify the warning log format from %d to %v
Kubernetes-commit: ac1168e0e922ccd32b0fcc3d3aecac8920cedbda
2020-08-12 16:05:59 +09:00
Kevin Delgado
4d01b584c3 Add exp backoff for connection refused errors
Currently when ListAndWatch() receives a connection refused error, it is
assumed to be due to the apiserver being transiently unresponsive. In
situations where a controller is running outside the k8s cluster it's
controlling, it is more common for the controller to lose connection
permanently to the apiserver and needs to exponentially backoff its
retry rather than continously spamming logs with Watch attempts that
will never succeed.

Kubernetes-commit: 1ff789f2bb9bf7fbb3df35977bc249c0dd019d31
2020-08-25 19:15:21 +00:00
janeczku
47f16e33aa Fixed reflector not recovering from "Too large resource version" errors with API servers 1.17.0-1.18.5
Kubernetes-commit: e1f4bfe1db8d3975bf626c2c8536dd8076aeb7d4
2020-08-28 21:17:27 +02:00
gobomb
330cb14339 let panics propagate up when processLoop panic
Kubernetes-commit: 19a3ca2c289b6f3dc8cd495e3db0d347b5a3b774
2020-08-03 09:30:39 +00:00
caozhiyuan
fa1e013ed0 reduce type conversion and correct variable name
Kubernetes-commit: 13468442bfbdf69a6e6690497fce427317cff790
2020-07-29 19:18:05 +08:00
Nikhita Raghunath
480d796592 apimachinery: remove inactive members from OWNERS
Kubernetes-commit: db495ea9837cf840639a4e02085253fb341e12b5
2020-07-11 19:28:24 +05:30
Mike Spreitzer
53f29dc721 Replaced repair with returning error, in delta_fifo.go
When dedupDeltas does the impossible and the key is already queued,
return an error rather than maintain the data structure invariants.

Kubernetes-commit: a39481a4f6cf33f9bf4555adcffa28077863e7a9
2020-07-08 01:15:51 -04:00
Mike Spreitzer
a166e2578b Repair instead of panic when data corruption detected in DeltaFIFO
Kubernetes-commit: abcd0f82c5634c7a23b9390172b7c6ae907d84f7
2020-07-02 23:23:59 -04:00
Mike Spreitzer
826338c319 Remove contemplation of invariant violations from delta_fifo.go
Some comments and code incorrectly contemplated violating the
invariant that a keys is in `f.items` if and only if it is in
`f.queue`.

Also fixed up some comment wording.

Kubernetes-commit: 5efd727d112206ef9a8ede93c5878b0d40707ae9
2020-06-09 18:57:28 -04:00
W. Trevor King
42b7b70457 leaderelection: Remove doubled space in "attempting to acquire leader lease" log
The extra space was introduced in 5b854e7b17 (say which lease is being
acquired, 2018-01-16, #58341).

Kubernetes-commit: e5347d48f9e67776984fbe284f03aefc425a951d
2020-08-05 14:31:39 -07:00
Chris Mark
ffcde95237 Document blocking behaviour of RunOrDie and Run
Kubernetes-commit: b09c01c9e2a35b8f91fad319db77bdf8963c05f1
2020-07-30 17:04:57 +03:00
Jordan Liggitt
e6a0f4acba Fix int->string casts
Kubernetes-commit: 124a5ddf725c4862520d8619017cac9db7a03522
2020-07-24 11:13:07 -04:00
Chelsey Chen
51d7273066 Update conversion between ReportingController and Source.Component
Kubernetes-commit: e010436e2acc96d710620a91ceaaa86becca4060
2020-07-07 13:38:48 -04:00
Andrew Keesler
11ef39e643 Fix typo: authentiction -> authentication
Signed-off-by: Andrew Keesler <akeesler@vmware.com>

Kubernetes-commit: eefed60e2300bdb9f5827e2da63d6949bb080d4c
2020-05-21 20:13:20 -04:00
Andrew Keesler
6b620f1777 exec credential provider: add install hint
This commit adds the ability for users to specify an install hint for
their exec credential provider binary.

In the exec credential provider workflow, if the exec credential binary
does not exist, then the user will see some sort of ugly

  exec: exec: "does-not-exist": executable file not found in $PATH

error message.  If some user downloads a kubeconfig from somewhere, they
may not know that kubectl is trying to use a binary to obtain
credentials to auth to the API, and scratch their head when they see
this error message.  Furthermore, even if a user does know that their
kubeconfig is trying to run a binary, they might not know how to obtain
the binary.  This install hint seeks to ease the above 2 user pains.

Signed-off-by: Andrew Keesler <akeesler@vmware.com>

Kubernetes-commit: 94e2065df2eef3b198942efb156ef6e27abcc6f9
2020-05-20 15:20:20 -04:00
Chelsey Chen
c9818a9a30 Remove DeprecatedSource assignment to avoid validation failure
Kubernetes-commit: e54ad20f057f1ca4e94552b9373f2762a39b3fd2
2020-07-02 12:53:25 -04:00