Commit Graph

1763 Commits

Author SHA1 Message Date
Clayton Coleman
30b06a83d6 leaderelection: Allow leader elected code to step down on a context cancel
The current code simply exits without continuing to renew the lease, which means
participants using a slower lease duration might have to wait multiple minutes
before a new leader is elected. Allow an optional flag to be set on
LeaderElectionConfig that will release the lease when the calling context is
cancelled. Callers *must* ensure their lease guarded code has completed before
the context is cancelled, or other processes may acquire the lease before this
lease has released.

Add an example command that demonstrates how cancellation could be done.

As a convenience to users, make event recorder optional - not all users of the
lock code will need a recorder.

Kubernetes-commit: 09890b6c48da8e85237a5674d6256900f482b0a5
2018-11-27 21:51:21 -05:00
Kubernetes Publisher
8abb210312 Merge pull request #71296 from cblecker/json-iterator-bump
Update github.com/json-iterator/go to 1.1.4

Kubernetes-commit: 18619f0849b18944300cb22c224afe071d4317bd
2018-11-21 07:14:15 +00:00
danielqsj
c270b352df Use prometheus conventions for workqueue metrics
Kubernetes-commit: b828bc1a50dfa29ab85248e5af6da5acb27189c1
2018-11-21 11:43:47 +08:00
Christoph Blecker
67246686ed Update github.com/json-iterator/go to 1.1.4
Kubernetes-commit: c7d39519279937693e654149eb6b67af46836135
2018-11-20 18:13:01 -08:00
Matthew Wong
e10ef5817f Add Lease implementation to leaderelection package
Kubernetes-commit: 410175851c092dae63f72f7d12abf19b1b74e200
2018-11-20 10:29:44 -05:00
João Taveira Araújo
93c815ca99 Fix duped watch in client-go/testing.
This commit fixes a bug in the client-go/testing fixture whereby a
watcher would fire twice for objects with no namespace.

Kubernetes-commit: bd268c9971efd4db46074a80e52ce765583e0787
2018-11-19 09:50:17 -08:00
Yang Li
f3619f04f1 Call cancel functions to avoid context leaks
Kubernetes-commit: 8dc9619d44ce2074696a4036b2acdc21f3cd0662
2018-11-18 17:40:35 +08:00
Clayton Coleman
96e95840d4 Restore "Make bootstrap client cert loading part of rotation""
This reverts the revert of commit 34642222676640b3c1dd255cc453000f2743ccde.

Kubernetes-commit: 486577df17570b321a91b223901d7e4fdbb63519
2018-11-17 13:44:58 -05:00
Kubernetes Publisher
3dda0e1788 Merge pull request #71173 from smarterclayton/revert_bootstrap
Revert "Make bootstrap client cert loading part of rotation"

Kubernetes-commit: 8996fc1639f20c17b4b321c184a734f8894b736a
2018-11-17 10:33:43 -08:00
Clayton Coleman
57b75fe80b Revert "Make bootstrap client cert loading part of rotation"
This reverts commit 0af19875add7deb562b2cf7bf6b1d273c44bab1b.

Revert "Ensure the bootstrap rotation code is tested by forcing rotation"

This reverts commit de293b2d7ddb687850258370f2a7f30f224f0ec1.

Kubernetes-commit: 34642222676640b3c1dd255cc453000f2743ccde
2018-11-17 10:24:23 -05:00
Kubernetes Publisher
4e63d755dc Merge pull request #69890 from smarterclayton/bootstrap_retry
Make bootstrap client cert loading part of rotation

Kubernetes-commit: 3be3510814d9ddb31d10287e86687b24cf14bf79
2018-11-17 11:16:01 +00:00
Kubernetes Publisher
acc621f88d Merge pull request #70998 from deads2k/client-07-listwatchtimeout
update the client generator to set a client-side timeout

Kubernetes-commit: 9878253c3cb8fa4699615b41375578fe681b0f9a
2018-11-16 23:13:37 +00:00
David Eads
8987df28a4 generated
Kubernetes-commit: 8f7edec615fb9cd722b7f8310dab3efa25351b7c
2018-11-16 08:38:57 -05:00
Clayton Coleman
cbb80ab872 Ensure the bootstrap rotation code is tested by forcing rotation
Expose both a Stop() method (for cleanup) and a method to force
cert rotation, but only expose Stop() on the interface.

Verify that we choose the correct client.

Kubernetes-commit: de293b2d7ddb687850258370f2a7f30f224f0ec1
2018-11-15 17:21:02 -05:00
Kubernetes Publisher
9bea17718d Merge pull request #70971 from cheftako/leaseCheck
Report KCM as unhealthy if leader election is wedged.

Kubernetes-commit: f48e18faa4dc035cc927c6a2b34c83c8475b55fa
2018-11-15 11:13:58 +00:00
Kubernetes Publisher
79203b61db Merge pull request #69929 from jsafrane/csi-ga
Promote CSIPersistentVolume feature to GA

Kubernetes-commit: 726c07eb26c372c8a6920d5ec7422e8a8deb9eda
2018-11-15 07:16:16 +00:00
Kubernetes Publisher
9a85277e68 Merge pull request #70966 from awly/cert-triple-cleanup
Remove k8s.io/client-go/util/cert/triple

Kubernetes-commit: 22eb2b0dae49891ccf13be98e25d5d0683dea134
2018-11-15 07:15:53 +00:00
Kubernetes Publisher
4ed618c609 Merge pull request #70801 from Adirio/deltafifo-cleanup
DeltaFIFO cleanup

Kubernetes-commit: 4fb368e5fdd287d0feb9f603360293c8dd8ae816
2018-11-15 07:15:52 +00:00
xichengliudui
b9c7cc1b30 update notes
Kubernetes-commit: 3b9798efe9c0caaa7437c8f0203e000d85c4dd8e
2018-11-15 01:29:59 -05:00
Ihar Hrachyshka
0892273a33 Expose object tracker for fake clientsets
Not every object kind can be registered via tracker .Add() called as
part of SimpleClientset initialization. This is because .Add() relies
on UnsafeGuessKindToResource to convert object kinds into resource
type names, which is broken for some resources. An example of an
affected kind is NetworkAttachmentDefinitions CRD that uses
network-attachment-definitions as its resource type name. When
UnsafeGuessKindToResource is called for this kind, it returns
networkattachmentdefinitions (without dashes).

As per the comment inside .Add, kinds affected by
UnsafeGuessKindToResource deficiencies should instead register objects
using tracker .Create() method.  Problem is, current SimpleClientset
struct definition doesn't expose the object tracker in any way, which
makes it impossible to properly register these kinds at all.

To address the issue, this change modifies the definition of
SimpleClientset struct to expose the object tracker used via Tracker()
method.

Kubernetes-commit: d68cd8a0c7e6137ca4219078a3d651ecff03c21f
2018-11-14 15:22:48 -08:00
Kubernetes Publisher
e9ae4fad33 Merge pull request #70969 from awly/node-csr-move
Move csr.RequestNodeCertificate into kubelet bootstrap package

Kubernetes-commit: 68fb529ec193458d3cf4a8d8e90c5bd8b36ff5bd
2018-11-14 23:13:44 +00:00
Kubernetes Publisher
1f68873668 Merge pull request #70999 from liggitt/oversized-spdystream-frames
Ensure oversized data frames are not written to spdystreams

Kubernetes-commit: 774f1628843f298c61bed9ea58818c9cceb6d8e7
2018-11-14 19:13:50 +00:00
Jan Safranek
48718c4bec Generated files
Kubernetes-commit: e95b18865667aa27f055bbb2db7c326fe116c793
2018-11-14 14:01:16 +01:00
Adrián Orive
cb4ba7f9b2 DeltaFIFO cleanup
Remove non-needed else condition
Remove non-needed swallow copy
Simplify return for IsClosed()
Keep amount decrement next to element extraction from the queue

Signed-off-by: Adrián Orive <adrian.orive.oneca@gmail.com>

Kubernetes-commit: 0b16c43f59b736060bc18e2e1de0e7fcc268f39b
2018-11-14 08:59:51 +01: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
Kubernetes Publisher
d56d3df33a Merge pull request #71002 from awly/certutil-cleanup
Remove unused funcs in certutil

Kubernetes-commit: d399e079f2726f1f667343e0ad862b18abf9977a
2018-11-13 23:13:42 +00:00
Kubernetes Publisher
c4b39e7952 Merge pull request #70884 from lavalamp/workqueue
add a metric that can be used to notice stuck worker threads

Kubernetes-commit: bc6aee19b019a6a0d0bbac93ae087d767c1bdbe9
2018-11-13 23:13:18 +00:00
Andrew Lytvynov
8986d6b66c Remove unused funcs in certutil
Kubernetes-commit: 162b3642921ef18a2f5d5489f034409936c42e27
2018-11-13 10:26:43 -08:00
Jordan Liggitt
5a40e141bd Fix sending oversided data frames to spdy stream
Kubernetes-commit: 0202e269a3deb7ff96d3b9e3fce767c4b37a766e
2018-11-13 10:57:33 -05:00
Maciej Borsz
5865254254 Refactor memCacheClient to retry requests.
Kubernetes-commit: c94bee0b8b88851e5f5fd6538b99adff8b3a13f0
2018-11-13 13:10:31 +01:00
xichengliudui
c2d0ac0df3 Delete some redundant code
Delete some redundant code

Kubernetes-commit: 9a25d46e8b5c079d97b909bb6e0bc1c1399c3e8c
2018-11-13 03:28:31 -05:00
Walter Fender
f0a328366e Report KCM as unhealthy if leader election is wedged.
Feedback from lavalamp and deads2k.
Changed Check() logic to be central to LeaderElector.
Further changes, especially cleaning up the test code.

Kubernetes-commit: 9c43ee6d6ec6a159b960381af906c130027bc716
2018-11-12 18:45:21 -08:00
Kubernetes Publisher
b5f2e1aa4f Merge pull request #70970 from awly/unexport-csr-parsecsr
Unexport csr.ParseCSR

Kubernetes-commit: efd19d3c9419b60f8a75cb1bd45b2c31c88cfb51
2018-11-12 18:31:45 -08:00
Andrew Lytvynov
28931a70f2 Unexport csr.ParseCSR
This func is only used internally and was copied from
k8s.io/kubernetes/pkg/apis/certificates.

Kubernetes-commit: 41334cfdd3eefc352536943518ffd9eaf570e27c
2018-11-12 17:15:09 -08:00
Andrew Lytvynov
5dc6658914 Move csr.RequestNodeCertificate into kubelet bootstrap package
This func is only used by the kubelet and there's no need to pollute
client-go API with it.

Kubernetes-commit: 5c073abfe16fc0b9f62310b8276fc3b0c7043e60
2018-11-12 16:53:53 -08:00
Andrew Lytvynov
ef24efb2a3 Remove k8s.io/client-go/util/cert/triple
The package is unused.

Kubernetes-commit: 09db5bc951e08ff355edb4be9e3944af61b5ce74
2018-11-12 16:08:56 -08:00
Daniel Smith
f0e9de6741 fixup! add longest_running_processor_microseconds metric
fix data race

Kubernetes-commit: 680ddd49d8d23a88744f9de720f266022effd409
2018-11-12 12:57:42 -08:00
Daniel Smith
952b05be23 add longest_running_processor_microseconds metric
Kubernetes-commit: fd77aa5a41bbce7490dd4538c0d5743cb59b2be4
2018-11-12 10:52:18 -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
Daniel Smith
cc2731ad7e fixup! Test workqueue metrics
change units to seconds

Kubernetes-commit: 578962d934df19cb2cb7ec0536dcb76f53951e68
2018-11-10 18:46:43 -08:00
Daniel Smith
e403f1715c fixup! Test workqueue metrics
Kubernetes-commit: 44a87baf09aec4f2e8e159de4c409d27aebbb1da
2018-11-10 18:24:59 -08:00
Kubernetes Publisher
ee7a1ba5cd Merge pull request #70889 from dims/update-cadvisor-and-other-repos-for-klog-take-2
Update cadvisor and other repos for klog

Kubernetes-commit: a3ccea9d8743f2ff82e41b6c2af6dc2c41dc7b10
2018-11-10 19:13:52 +00:00
Daniel Smith
7d7bf3381f generated files
Kubernetes-commit: 74c50c0ad334ec2c1cc5b8fb9677315ef5aa8f44
2018-11-09 16:13:15 -08:00
Daniel Smith
26f9385b8e Test workqueue metrics
Kubernetes-commit: 5a8444ceec9e28e8a7dbf36bfd7cb55554c5b865
2018-11-09 16:12:11 -08:00
Davanum Srinivas
af3b000da0 Update all the staging Godeps.json
Change-Id: I64b30c68a606b4f5c095a66496a1e48c4d62ea88

Kubernetes-commit: 68ce375d0039738df5a2a837122215f3224f1fde
2018-11-09 16:41:26 -05:00
Bouke van der Bijl
213a1e8b13 client-go/testing: properly handle Patch actions for missing Objects
Currently the fake client will return a default empty Object when a
Patch action is submitted on a missing Object. The correct behavior is to
instead propagate the NotFound error.

Kubernetes-commit: 96d0588440a96c5eba8b3ba0810563ad1e1a08b6
2018-11-09 19:25:02 +00:00
Davanum Srinivas
74cd8bbeee Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135

Kubernetes-commit: 954996e231074dc7429f7be1256a579bedd8344c
2018-11-09 13:49:10 -05:00
Daniel Smith
75d4dad922 add a metric that can be used to notice stuck worker threads
Kubernetes-commit: 6195d1005d81eaa5dd49da744f5beab178340f5a
2018-11-09 10:43:44 -08:00
Kubernetes Publisher
b1c1d2e7ca Merge pull request #70598 from dims/switch-from-sigs.k8s.io/yaml-to-ghodss/yaml
Switch to sigs.k8s.io/yaml from ghodss/yaml

Kubernetes-commit: f212b9db236344d3121879e609d53b79f9f106f9
2018-11-08 19:35:15 +00: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