Merge pull request #64218 from deads2k/client-11-leaderconfig

Automatic merge from submit-queue (batch tested with PRs 64060, 63904, 64218, 64208, 64247). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

prevent zero for leader election timeouts

Add conditional checks for a stupid error that took me 20 minutes to find.

I don't see a reason to allow zero for any of the leader election tuning params

```release-note
NONE
```

Kubernetes-commit: 151fe855461b2e85f360435d6fc424e6f6542a97
This commit is contained in:
Kubernetes Publisher 2018-05-24 17:01:17 -07:00
commit b270d8c8ce
2 changed files with 90 additions and 80 deletions

160
Godeps/Godeps.json generated
View File

@ -268,323 +268,323 @@
}, },
{ {
"ImportPath": "k8s.io/api/admissionregistration/v1alpha1", "ImportPath": "k8s.io/api/admissionregistration/v1alpha1",
"Rev": "184e700b32b7f1b532b9fce8dd8c1f412d297c4b" "Rev": "d216743eed4c3242b85d094d2a589f41a793652d"
}, },
{ {
"ImportPath": "k8s.io/api/admissionregistration/v1beta1", "ImportPath": "k8s.io/api/admissionregistration/v1beta1",
"Rev": "184e700b32b7f1b532b9fce8dd8c1f412d297c4b" "Rev": "d216743eed4c3242b85d094d2a589f41a793652d"
}, },
{ {
"ImportPath": "k8s.io/api/apps/v1", "ImportPath": "k8s.io/api/apps/v1",
"Rev": "184e700b32b7f1b532b9fce8dd8c1f412d297c4b" "Rev": "d216743eed4c3242b85d094d2a589f41a793652d"
}, },
{ {
"ImportPath": "k8s.io/api/apps/v1beta1", "ImportPath": "k8s.io/api/apps/v1beta1",
"Rev": "184e700b32b7f1b532b9fce8dd8c1f412d297c4b" "Rev": "d216743eed4c3242b85d094d2a589f41a793652d"
}, },
{ {
"ImportPath": "k8s.io/api/apps/v1beta2", "ImportPath": "k8s.io/api/apps/v1beta2",
"Rev": "184e700b32b7f1b532b9fce8dd8c1f412d297c4b" "Rev": "d216743eed4c3242b85d094d2a589f41a793652d"
}, },
{ {
"ImportPath": "k8s.io/api/authentication/v1", "ImportPath": "k8s.io/api/authentication/v1",
"Rev": "184e700b32b7f1b532b9fce8dd8c1f412d297c4b" "Rev": "d216743eed4c3242b85d094d2a589f41a793652d"
}, },
{ {
"ImportPath": "k8s.io/api/authentication/v1beta1", "ImportPath": "k8s.io/api/authentication/v1beta1",
"Rev": "184e700b32b7f1b532b9fce8dd8c1f412d297c4b" "Rev": "d216743eed4c3242b85d094d2a589f41a793652d"
}, },
{ {
"ImportPath": "k8s.io/api/authorization/v1", "ImportPath": "k8s.io/api/authorization/v1",
"Rev": "184e700b32b7f1b532b9fce8dd8c1f412d297c4b" "Rev": "d216743eed4c3242b85d094d2a589f41a793652d"
}, },
{ {
"ImportPath": "k8s.io/api/authorization/v1beta1", "ImportPath": "k8s.io/api/authorization/v1beta1",
"Rev": "184e700b32b7f1b532b9fce8dd8c1f412d297c4b" "Rev": "d216743eed4c3242b85d094d2a589f41a793652d"
}, },
{ {
"ImportPath": "k8s.io/api/autoscaling/v1", "ImportPath": "k8s.io/api/autoscaling/v1",
"Rev": "184e700b32b7f1b532b9fce8dd8c1f412d297c4b" "Rev": "d216743eed4c3242b85d094d2a589f41a793652d"
}, },
{ {
"ImportPath": "k8s.io/api/autoscaling/v2beta1", "ImportPath": "k8s.io/api/autoscaling/v2beta1",
"Rev": "184e700b32b7f1b532b9fce8dd8c1f412d297c4b" "Rev": "d216743eed4c3242b85d094d2a589f41a793652d"
}, },
{ {
"ImportPath": "k8s.io/api/batch/v1", "ImportPath": "k8s.io/api/batch/v1",
"Rev": "184e700b32b7f1b532b9fce8dd8c1f412d297c4b" "Rev": "d216743eed4c3242b85d094d2a589f41a793652d"
}, },
{ {
"ImportPath": "k8s.io/api/batch/v1beta1", "ImportPath": "k8s.io/api/batch/v1beta1",
"Rev": "184e700b32b7f1b532b9fce8dd8c1f412d297c4b" "Rev": "d216743eed4c3242b85d094d2a589f41a793652d"
}, },
{ {
"ImportPath": "k8s.io/api/batch/v2alpha1", "ImportPath": "k8s.io/api/batch/v2alpha1",
"Rev": "184e700b32b7f1b532b9fce8dd8c1f412d297c4b" "Rev": "d216743eed4c3242b85d094d2a589f41a793652d"
}, },
{ {
"ImportPath": "k8s.io/api/certificates/v1beta1", "ImportPath": "k8s.io/api/certificates/v1beta1",
"Rev": "184e700b32b7f1b532b9fce8dd8c1f412d297c4b" "Rev": "d216743eed4c3242b85d094d2a589f41a793652d"
}, },
{ {
"ImportPath": "k8s.io/api/core/v1", "ImportPath": "k8s.io/api/core/v1",
"Rev": "184e700b32b7f1b532b9fce8dd8c1f412d297c4b" "Rev": "d216743eed4c3242b85d094d2a589f41a793652d"
}, },
{ {
"ImportPath": "k8s.io/api/events/v1beta1", "ImportPath": "k8s.io/api/events/v1beta1",
"Rev": "184e700b32b7f1b532b9fce8dd8c1f412d297c4b" "Rev": "d216743eed4c3242b85d094d2a589f41a793652d"
}, },
{ {
"ImportPath": "k8s.io/api/extensions/v1beta1", "ImportPath": "k8s.io/api/extensions/v1beta1",
"Rev": "184e700b32b7f1b532b9fce8dd8c1f412d297c4b" "Rev": "d216743eed4c3242b85d094d2a589f41a793652d"
}, },
{ {
"ImportPath": "k8s.io/api/imagepolicy/v1alpha1", "ImportPath": "k8s.io/api/imagepolicy/v1alpha1",
"Rev": "184e700b32b7f1b532b9fce8dd8c1f412d297c4b" "Rev": "d216743eed4c3242b85d094d2a589f41a793652d"
}, },
{ {
"ImportPath": "k8s.io/api/networking/v1", "ImportPath": "k8s.io/api/networking/v1",
"Rev": "184e700b32b7f1b532b9fce8dd8c1f412d297c4b" "Rev": "d216743eed4c3242b85d094d2a589f41a793652d"
}, },
{ {
"ImportPath": "k8s.io/api/policy/v1beta1", "ImportPath": "k8s.io/api/policy/v1beta1",
"Rev": "184e700b32b7f1b532b9fce8dd8c1f412d297c4b" "Rev": "d216743eed4c3242b85d094d2a589f41a793652d"
}, },
{ {
"ImportPath": "k8s.io/api/rbac/v1", "ImportPath": "k8s.io/api/rbac/v1",
"Rev": "184e700b32b7f1b532b9fce8dd8c1f412d297c4b" "Rev": "d216743eed4c3242b85d094d2a589f41a793652d"
}, },
{ {
"ImportPath": "k8s.io/api/rbac/v1alpha1", "ImportPath": "k8s.io/api/rbac/v1alpha1",
"Rev": "184e700b32b7f1b532b9fce8dd8c1f412d297c4b" "Rev": "d216743eed4c3242b85d094d2a589f41a793652d"
}, },
{ {
"ImportPath": "k8s.io/api/rbac/v1beta1", "ImportPath": "k8s.io/api/rbac/v1beta1",
"Rev": "184e700b32b7f1b532b9fce8dd8c1f412d297c4b" "Rev": "d216743eed4c3242b85d094d2a589f41a793652d"
}, },
{ {
"ImportPath": "k8s.io/api/scheduling/v1alpha1", "ImportPath": "k8s.io/api/scheduling/v1alpha1",
"Rev": "184e700b32b7f1b532b9fce8dd8c1f412d297c4b" "Rev": "d216743eed4c3242b85d094d2a589f41a793652d"
}, },
{ {
"ImportPath": "k8s.io/api/scheduling/v1beta1", "ImportPath": "k8s.io/api/scheduling/v1beta1",
"Rev": "184e700b32b7f1b532b9fce8dd8c1f412d297c4b" "Rev": "d216743eed4c3242b85d094d2a589f41a793652d"
}, },
{ {
"ImportPath": "k8s.io/api/settings/v1alpha1", "ImportPath": "k8s.io/api/settings/v1alpha1",
"Rev": "184e700b32b7f1b532b9fce8dd8c1f412d297c4b" "Rev": "d216743eed4c3242b85d094d2a589f41a793652d"
}, },
{ {
"ImportPath": "k8s.io/api/storage/v1", "ImportPath": "k8s.io/api/storage/v1",
"Rev": "184e700b32b7f1b532b9fce8dd8c1f412d297c4b" "Rev": "d216743eed4c3242b85d094d2a589f41a793652d"
}, },
{ {
"ImportPath": "k8s.io/api/storage/v1alpha1", "ImportPath": "k8s.io/api/storage/v1alpha1",
"Rev": "184e700b32b7f1b532b9fce8dd8c1f412d297c4b" "Rev": "d216743eed4c3242b85d094d2a589f41a793652d"
}, },
{ {
"ImportPath": "k8s.io/api/storage/v1beta1", "ImportPath": "k8s.io/api/storage/v1beta1",
"Rev": "184e700b32b7f1b532b9fce8dd8c1f412d297c4b" "Rev": "d216743eed4c3242b85d094d2a589f41a793652d"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/equality", "ImportPath": "k8s.io/apimachinery/pkg/api/equality",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/errors", "ImportPath": "k8s.io/apimachinery/pkg/api/errors",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/meta", "ImportPath": "k8s.io/apimachinery/pkg/api/meta",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/resource", "ImportPath": "k8s.io/apimachinery/pkg/api/resource",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/testing", "ImportPath": "k8s.io/apimachinery/pkg/api/testing",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/testing/fuzzer", "ImportPath": "k8s.io/apimachinery/pkg/api/testing/fuzzer",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/testing/roundtrip", "ImportPath": "k8s.io/apimachinery/pkg/api/testing/roundtrip",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/conversion", "ImportPath": "k8s.io/apimachinery/pkg/conversion",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams", "ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/fields", "ImportPath": "k8s.io/apimachinery/pkg/fields",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/labels", "ImportPath": "k8s.io/apimachinery/pkg/labels",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime", "ImportPath": "k8s.io/apimachinery/pkg/runtime",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/schema", "ImportPath": "k8s.io/apimachinery/pkg/runtime/schema",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/selection", "ImportPath": "k8s.io/apimachinery/pkg/selection",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/types", "ImportPath": "k8s.io/apimachinery/pkg/types",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/cache", "ImportPath": "k8s.io/apimachinery/pkg/util/cache",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/clock", "ImportPath": "k8s.io/apimachinery/pkg/util/clock",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/diff", "ImportPath": "k8s.io/apimachinery/pkg/util/diff",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/errors", "ImportPath": "k8s.io/apimachinery/pkg/util/errors",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/framer", "ImportPath": "k8s.io/apimachinery/pkg/util/framer",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream", "ImportPath": "k8s.io/apimachinery/pkg/util/httpstream",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy", "ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/intstr", "ImportPath": "k8s.io/apimachinery/pkg/util/intstr",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/json", "ImportPath": "k8s.io/apimachinery/pkg/util/json",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch", "ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/net", "ImportPath": "k8s.io/apimachinery/pkg/util/net",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand", "ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/runtime", "ImportPath": "k8s.io/apimachinery/pkg/util/runtime",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/sets", "ImportPath": "k8s.io/apimachinery/pkg/util/sets",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch", "ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/validation", "ImportPath": "k8s.io/apimachinery/pkg/util/validation",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/validation/field", "ImportPath": "k8s.io/apimachinery/pkg/util/validation/field",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/wait", "ImportPath": "k8s.io/apimachinery/pkg/util/wait",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/yaml", "ImportPath": "k8s.io/apimachinery/pkg/util/yaml",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/version", "ImportPath": "k8s.io/apimachinery/pkg/version",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/watch", "ImportPath": "k8s.io/apimachinery/pkg/watch",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json", "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil", "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect", "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect",
"Rev": "e226be1f5ed46b19fedc971f410f84de5b3dab8a" "Rev": "084add7e300b3c88d77dded09a20d5063d632b5b"
}, },
{ {
"ImportPath": "k8s.io/kube-openapi/pkg/util/proto", "ImportPath": "k8s.io/kube-openapi/pkg/util/proto",

View File

@ -74,6 +74,16 @@ func NewLeaderElector(lec LeaderElectionConfig) (*LeaderElector, error) {
if lec.RenewDeadline <= time.Duration(JitterFactor*float64(lec.RetryPeriod)) { if lec.RenewDeadline <= time.Duration(JitterFactor*float64(lec.RetryPeriod)) {
return nil, fmt.Errorf("renewDeadline must be greater than retryPeriod*JitterFactor") return nil, fmt.Errorf("renewDeadline must be greater than retryPeriod*JitterFactor")
} }
if lec.LeaseDuration < 1 {
return nil, fmt.Errorf("leaseDuration must be greater than zero")
}
if lec.RenewDeadline < 1 {
return nil, fmt.Errorf("renewDeadline must be greater than zero")
}
if lec.RetryPeriod < 1 {
return nil, fmt.Errorf("retryPeriod must be greater than zero")
}
if lec.Lock == nil { if lec.Lock == nil {
return nil, fmt.Errorf("Lock must not be nil.") return nil, fmt.Errorf("Lock must not be nil.")
} }