From 1105a2ff45cd768e4447845ca880afa1e8d12ef2 Mon Sep 17 00:00:00 2001 From: Artyom Lukianov Date: Wed, 9 Jan 2019 16:43:10 +0200 Subject: [PATCH] Remove apiserver-builder dependency --- Gopkg.lock | 13 +- cmd/nodelink-controller/main.go | 20 +- test/integration/main.go | 5 +- .../apiserver-builder/LICENSE | 201 ------------------ .../pkg/controller/controller.go | 141 ------------ .../pkg/controller/config/configuration.go | 115 ---------- 6 files changed, 12 insertions(+), 483 deletions(-) delete mode 100644 vendor/github.com/kubernetes-incubator/apiserver-builder/LICENSE delete mode 100644 vendor/github.com/kubernetes-incubator/apiserver-builder/pkg/controller/controller.go delete mode 100644 vendor/sigs.k8s.io/cluster-api/pkg/controller/config/configuration.go diff --git a/Gopkg.lock b/Gopkg.lock index cce0862627..a18fe1ddef 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -285,14 +285,6 @@ revision = "1624edc4454b8682399def8740d46db5e4362ba4" version = "v1.1.5" -[[projects]] - digest = "1:5a4ced6c2dc0b2b1b03fb21bca0529d1edd467d6f5c0e6876089211fba98af6f" - name = "github.com/kubernetes-incubator/apiserver-builder" - packages = ["pkg/controller"] - pruneopts = "NUT" - revision = "83b2c178a8f935a738cebbf41aa5b8af1f19162d" - version = "v0.2-alpha.0" - [[projects]] branch = "master" digest = "1:84a5a2b67486d5d67060ac393aa255d05d24ed5ee41daecd5635ec22657b6492" @@ -935,7 +927,7 @@ [[projects]] branch = "master" - digest = "1:1c4faebf20e7b8fa0bcd7434c62537a145b12def9e4290d4aff032cf4e6d9135" + digest = "1:06e72e0584260bfbd3f221c9bff1b9676df283c306cbe97600dabbf6727933e9" name = "sigs.k8s.io/cluster-api" packages = [ "pkg/apis/cluster/common", @@ -948,7 +940,6 @@ "pkg/client/informers_generated/externalversions/cluster/v1alpha1", "pkg/client/informers_generated/externalversions/internalinterfaces", "pkg/client/listers_generated/cluster/v1alpha1", - "pkg/controller/config", ] pruneopts = "NUT" revision = "63aeb2752b5f250636358b795793f2f53ce1c077" @@ -1000,7 +991,6 @@ "github.com/blang/semver", "github.com/ghodss/yaml", "github.com/golang/glog", - "github.com/kubernetes-incubator/apiserver-builder/pkg/controller", "github.com/openshift/api/config/v1", "github.com/openshift/client-go/config/clientset/versioned", "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1", @@ -1064,7 +1054,6 @@ "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions", "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1", "sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1", - "sigs.k8s.io/cluster-api/pkg/controller/config", "sigs.k8s.io/controller-runtime/pkg/client", "sigs.k8s.io/controller-runtime/pkg/client/config", "sigs.k8s.io/controller-runtime/pkg/client/fake", diff --git a/cmd/nodelink-controller/main.go b/cmd/nodelink-controller/main.go index f6de645bc6..f25d7dea65 100644 --- a/cmd/nodelink-controller/main.go +++ b/cmd/nodelink-controller/main.go @@ -23,11 +23,15 @@ import ( "sync" "time" + "github.com/golang/glog" + "github.com/spf13/pflag" + corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" coreinformers "k8s.io/client-go/informers/core/v1" + "k8s.io/client-go/kubernetes" kubeclientset "k8s.io/client-go/kubernetes" v1core "k8s.io/client-go/kubernetes/typed/core/v1" corelister "k8s.io/client-go/listers/core/v1" @@ -35,20 +39,16 @@ import ( "k8s.io/client-go/tools/record" "k8s.io/client-go/util/workqueue" - "github.com/golang/glog" - "github.com/kubernetes-incubator/apiserver-builder/pkg/controller" - "github.com/spf13/pflag" - "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" + "sigs.k8s.io/controller-runtime/pkg/client/config" capiv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" capiclient "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" + capiinformersfactory "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions" capiinformers "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1" lister "sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1" - "sigs.k8s.io/cluster-api/pkg/controller/config" kubeinformers "k8s.io/client-go/informers" - "k8s.io/client-go/kubernetes" - capiinformersfactory "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions" ) const ( @@ -429,16 +429,12 @@ var ( logLevel string ) -func init() { - config.ControllerConfig.AddFlags(pflag.CommandLine) -} - func main() { pflag.CommandLine.AddGoFlagSet(flag.CommandLine) pflag.Parse() - config, err := controller.GetConfig(config.ControllerConfig.Kubeconfig) + config, err := config.GetConfig() if err != nil { glog.Fatalf("Could not create Config for talking to the apiserver: %v", err) } diff --git a/test/integration/main.go b/test/integration/main.go index 33ee04fb4a..f72317e240 100644 --- a/test/integration/main.go +++ b/test/integration/main.go @@ -13,7 +13,6 @@ import ( log "github.com/sirupsen/logrus" "github.com/spf13/cobra" - "github.com/kubernetes-incubator/apiserver-builder/pkg/controller" appsv1beta2 "k8s.io/api/apps/v1beta2" apiv1 "k8s.io/api/core/v1" rbacv1beta1 "k8s.io/api/rbac/v1beta1" @@ -24,6 +23,8 @@ import ( "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes/scheme" + "k8s.io/client-go/tools/clientcmd" + capiv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" capiv1alpha1scheme "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/scheme" @@ -58,7 +59,7 @@ type TestConfig struct { // NewTestConfig creates new test config with clients func NewTestConfig(kubeconfig string) *TestConfig { - config, err := controller.GetConfig(kubeconfig) + config, err := clientcmd.BuildConfigFromFlags("", kubeconfig) if err != nil { glog.Fatalf("Could not create Config for talking to the apiserver: %v", err) } diff --git a/vendor/github.com/kubernetes-incubator/apiserver-builder/LICENSE b/vendor/github.com/kubernetes-incubator/apiserver-builder/LICENSE deleted file mode 100644 index 8dada3edaf..0000000000 --- a/vendor/github.com/kubernetes-incubator/apiserver-builder/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/kubernetes-incubator/apiserver-builder/pkg/controller/controller.go b/vendor/github.com/kubernetes-incubator/apiserver-builder/pkg/controller/controller.go deleted file mode 100644 index 88084586fb..0000000000 --- a/vendor/github.com/kubernetes-incubator/apiserver-builder/pkg/controller/controller.go +++ /dev/null @@ -1,141 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package controller - -import ( - "time" - - "github.com/golang/glog" - "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/client-go/rest" - "k8s.io/client-go/tools/cache" - "k8s.io/client-go/tools/clientcmd" - "k8s.io/client-go/util/workqueue" -) - -// QueueingEventHandler queues the key for the object on add and update events -type QueueingEventHandler struct { - Queue workqueue.RateLimitingInterface -} - -func (c *QueueingEventHandler) enqueue(obj interface{}) { - key, err := cache.DeletionHandlingMetaNamespaceKeyFunc(obj) - if err != nil { - glog.Errorf("Couldn't get key for object %+v: %v", obj, err) - return - } - c.Queue.Add(key) -} - -func (c *QueueingEventHandler) OnAdd(obj interface{}) { - glog.V(6).Infof("Add event for %+v\n", obj) - c.enqueue(obj) -} - -func (c *QueueingEventHandler) OnUpdate(oldObj, newObj interface{}) { - glog.V(6).Infof("Update event for %+v\n", newObj) - c.enqueue(newObj) -} - -func (c *QueueingEventHandler) OnDelete(obj interface{}) { - glog.V(6).Infof("Delete event for %+v\n", obj) -} - -// QueueWorker continuously runs a Reconcile function against a message Queue -type QueueWorker struct { - Queue workqueue.RateLimitingInterface - MaxRetries int - Name string - Reconcile func(key string) error -} - -// Run schedules a routine to continuously process Queue messages -// until shutdown is closed -func (q *QueueWorker) Run(shutdown <-chan struct{}) { - defer runtime.HandleCrash() - - // Every second, process all messages in the Queue until it is time to shutdown - go wait.Until(q.ProcessAllMessages, time.Second, shutdown) - - go func() { - <-shutdown - - // Stop accepting messages into the Queue - glog.V(1).Infof("Shutting down %s Queue\n", q.Name) - q.Queue.ShutDown() - }() -} - -// ProcessAllMessages tries to process all messages in the Queue -func (q *QueueWorker) ProcessAllMessages() { - for done := false; !done; { - // Process all messages in the Queue - done = q.ProcessMessage() - } -} - -// ProcessMessage tries to process the next message in the Queue, and requeues on an error -func (q *QueueWorker) ProcessMessage() bool { - key, quit := q.Queue.Get() - if quit { - // Queue is empty - return true - } - defer q.Queue.Done(key) - - // Do the work - err := q.Reconcile(key.(string)) - if err == nil { - // Success. Clear the requeue count for this key. - q.Queue.Forget(key) - return false - } - - // Error. Maybe retry if haven't hit the limit. - if q.Queue.NumRequeues(key) < q.MaxRetries { - glog.V(4).Infof("Error handling %s Queue message %v: %v", q.Name, key, err) - q.Queue.AddRateLimited(key) - return false - } - - glog.V(4).Infof("Too many retries for %s Queue message %v: %v", q.Name, key, err) - q.Queue.Forget(key) - return false -} - -type Controller interface { - Run(stopCh <-chan struct{}) - GetName() string -} - -// StartControllerManager -func StartControllerManager(controllers ...Controller) <-chan struct{} { - shutdown := make(chan struct{}) - for _, c := range controllers { - c.Run(shutdown) - } - return shutdown -} - -func GetConfig(kubeconfig string) (*rest.Config, error) { - if len(kubeconfig) > 0 { - return clientcmd.BuildConfigFromFlags("", kubeconfig) - } else { - return rest.InClusterConfig() - } -} diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/config/configuration.go b/vendor/sigs.k8s.io/cluster-api/pkg/controller/config/configuration.go deleted file mode 100644 index dc4bef508e..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/config/configuration.go +++ /dev/null @@ -1,115 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package config - -import ( - "time" - - "github.com/spf13/pflag" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/tools/leaderelection/resourcelock" -) - -// This is a COPY from kubernetes source tree to avoid importing the entire kubernetes tree. - -// LeaderElectionConfiguration defines the configuration of leader election -// clients for components that can run with leader election enabled. -type LeaderElectionConfiguration struct { - // LeaderElect enables a leader election client to gain leadership - // before executing the main loop. Enable this when running replicated - // components for high availability. - LeaderElect bool - // LeaseDuration is the duration that non-leader candidates will wait - // after observing a leadership renewal until attempting to acquire - // leadership of a led but unrenewed leader slot. This is effectively the - // maximum duration that a leader can be stopped before it is replaced - // by another candidate. This is only applicable if leader election is - // enabled. - LeaseDuration metav1.Duration - // RenewDeadline is the interval between attempts by the acting master to - // renew a leadership slot before it stops leading. This must be less - // than or equal to the lease duration. This is only applicable if leader - // election is enabled. - RenewDeadline metav1.Duration - // RetryPeriod is the duration the clients should wait between attempting - // acquisition and renewal of a leadership. This is only applicable if - // leader election is enabled. - RetryPeriod metav1.Duration - // ResourceLock indicates the resource object type that will be used to lock - // during leader election cycles. - ResourceLock string -} - -type Configuration struct { - Kubeconfig string - WorkerCount int - leaderElectionConfig *LeaderElectionConfiguration -} - -const ( - // DefaultLeaseDuration is the default lease duration for leader election - DefaultLeaseDuration = 15 * time.Second - // DefaultRenewDeadline is the default renew duration for leader election - DefaultRenewDeadline = 10 * time.Second - // DefaultRetryPeriod is the default retry period for leader election - DefaultRetryPeriod = 2 * time.Second -) - -var ControllerConfig = Configuration{ - WorkerCount: 5, // Default 5 worker. - leaderElectionConfig: &LeaderElectionConfiguration{ - LeaderElect: false, - LeaseDuration: metav1.Duration{Duration: DefaultLeaseDuration}, - RenewDeadline: metav1.Duration{Duration: DefaultRenewDeadline}, - RetryPeriod: metav1.Duration{Duration: DefaultRetryPeriod}, - ResourceLock: resourcelock.EndpointsResourceLock, - }, -} - -func GetLeaderElectionConfig() *LeaderElectionConfiguration { - return ControllerConfig.leaderElectionConfig -} - -func (c *Configuration) AddFlags(fs *pflag.FlagSet) { - fs.StringVar(&c.Kubeconfig, "kubeconfig", c.Kubeconfig, "Path to kubeconfig file with authorization and master location information.") - fs.IntVar(&c.WorkerCount, "workers", c.WorkerCount, "The number of workers for controller.") - - AddLeaderElectionFlags(c.leaderElectionConfig, fs) -} - -func AddLeaderElectionFlags(l *LeaderElectionConfiguration, fs *pflag.FlagSet) { - fs.BoolVar(&l.LeaderElect, "leader-elect", l.LeaderElect, ""+ - "Start a leader election client and gain leadership before "+ - "executing the main loop. Enable this when running replicated "+ - "components for high availability.") - fs.DurationVar(&l.LeaseDuration.Duration, "leader-elect-lease-duration", l.LeaseDuration.Duration, ""+ - "The duration that non-leader candidates will wait after observing a leadership "+ - "renewal until attempting to acquire leadership of a led but unrenewed leader "+ - "slot. This is effectively the maximum duration that a leader can be stopped "+ - "before it is replaced by another candidate. This is only applicable if leader "+ - "election is enabled.") - fs.DurationVar(&l.RenewDeadline.Duration, "leader-elect-renew-deadline", l.RenewDeadline.Duration, ""+ - "The interval between attempts by the acting master to renew a leadership slot "+ - "before it stops leading. This must be less than or equal to the lease duration. "+ - "This is only applicable if leader election is enabled.") - fs.DurationVar(&l.RetryPeriod.Duration, "leader-elect-retry-period", l.RetryPeriod.Duration, ""+ - "The duration the clients should wait between attempting acquisition and renewal "+ - "of a leadership. This is only applicable if leader election is enabled.") - fs.StringVar(&l.ResourceLock, "leader-elect-resource-lock", l.ResourceLock, ""+ - "The type of resource object that is used for locking during "+ - "leader election. Supported options are `endpoints` (default) and `configmap`.") -}