mirror of
https://github.com/kubernetes/client-go.git
synced 2025-07-21 18:32:50 +00:00
fix golint failures for staging/src/k8s.io/client-go/examples/workqueue
Kubernetes-commit: d3db1ec12d1156fbdefacb15b5c5c6d31523a163
This commit is contained in:
parent
42c4a6e381
commit
3f4798d9ac
@ -34,12 +34,14 @@ import (
|
|||||||
"k8s.io/client-go/util/workqueue"
|
"k8s.io/client-go/util/workqueue"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Controller demonstrates how to implement a controller with client-go.
|
||||||
type Controller struct {
|
type Controller struct {
|
||||||
indexer cache.Indexer
|
indexer cache.Indexer
|
||||||
queue workqueue.RateLimitingInterface
|
queue workqueue.RateLimitingInterface
|
||||||
informer cache.Controller
|
informer cache.Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewController creates a new Controller.
|
||||||
func NewController(queue workqueue.RateLimitingInterface, indexer cache.Indexer, informer cache.Controller) *Controller {
|
func NewController(queue workqueue.RateLimitingInterface, indexer cache.Indexer, informer cache.Controller) *Controller {
|
||||||
return &Controller{
|
return &Controller{
|
||||||
informer: informer,
|
informer: informer,
|
||||||
@ -113,6 +115,7 @@ func (c *Controller) handleErr(err error, key interface{}) {
|
|||||||
klog.Infof("Dropping pod %q out of the queue: %v", key, err)
|
klog.Infof("Dropping pod %q out of the queue: %v", key, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Run begins watching and syncing.
|
||||||
func (c *Controller) Run(threadiness int, stopCh chan struct{}) {
|
func (c *Controller) Run(threadiness int, stopCh chan struct{}) {
|
||||||
defer runtime.HandleCrash()
|
defer runtime.HandleCrash()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user