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
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
This reverts commit 0af19875add7deb562b2cf7bf6b1d273c44bab1b.
Revert "Ensure the bootstrap rotation code is tested by forcing rotation"
This reverts commit de293b2d7ddb687850258370f2a7f30f224f0ec1.
Kubernetes-commit: 34642222676640b3c1dd255cc453000f2743ccde
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
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
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
Feedback from lavalamp and deads2k.
Changed Check() logic to be central to LeaderElector.
Further changes, especially cleaning up the test code.
Kubernetes-commit: 9c43ee6d6ec6a159b960381af906c130027bc716
This func is only used internally and was copied from
k8s.io/kubernetes/pkg/apis/certificates.
Kubernetes-commit: 41334cfdd3eefc352536943518ffd9eaf570e27c
This func is only used by the kubelet and there's no need to pollute
client-go API with it.
Kubernetes-commit: 5c073abfe16fc0b9f62310b8276fc3b0c7043e60
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
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
- 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