From 3979a562c6e105f7ae82d9881be2be7d5a740cbd Mon Sep 17 00:00:00 2001 From: Matt Moore Date: Mon, 24 Aug 2020 09:20:48 -0700 Subject: [PATCH] [master] Auto-update dependencies (#315) Produced via: `./hack/update-deps.sh --upgrade && ./hack/update-codegen.sh` /assign n3wscott vagababov /cc n3wscott vagababov --- go.mod | 2 +- go.sum | 6 ++-- .../knative.dev/pkg/controller/controller.go | 32 ++++++++++--------- vendor/modules.txt | 2 +- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/go.mod b/go.mod index 28621ade..6b5b217d 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( k8s.io/client-go v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible k8s.io/code-generator v0.18.6 k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29 - knative.dev/pkg v0.0.0-20200820181214-50386ad39634 + knative.dev/pkg v0.0.0-20200822174146-f0f096d81292 knative.dev/test-infra v0.0.0-20200820231346-543fe3e80c03 ) diff --git a/go.sum b/go.sum index 16ebd2c8..cc4fa020 100644 --- a/go.sum +++ b/go.sum @@ -1868,15 +1868,13 @@ knative.dev/pkg v0.0.0-20200505191044-3da93ebb24c2/go.mod h1:Q6sL35DdGs8hIQZKdaC knative.dev/pkg v0.0.0-20200515002500-16d7b963416f/go.mod h1:tMOHGbxtRz8zYFGEGpV/bpoTEM1o89MwYFC4YJXl3GY= knative.dev/pkg v0.0.0-20200528142800-1c6815d7e4c9/go.mod h1:QgNZTxnwpB/oSpNcfnLVlw+WpEwwyKAvJlvR3hgeltA= knative.dev/pkg v0.0.0-20200711004937-22502028e31a/go.mod h1:AqAJV6rYi8IGikDjJ/9ZQd9qKdkXVlesVnVjwx62YB8= -knative.dev/pkg v0.0.0-20200820181214-50386ad39634 h1:qIoOfpUOCmy1AWJ/LEhVd5Oj1Vb2PxEQTL+ui4DIaDc= -knative.dev/pkg v0.0.0-20200820181214-50386ad39634/go.mod h1:UQNXXn3xdykWbTkhXYUZnev2H3s82+gNrgxYDJ5jIRE= +knative.dev/pkg v0.0.0-20200822174146-f0f096d81292 h1:PPGDq/mWT0FhqsmJL9B3rO2I+/wgN48sfGlWyqSx3Bk= +knative.dev/pkg v0.0.0-20200822174146-f0f096d81292/go.mod h1:VK46K0GB3wrFYqDinB5gh79csrWKBtd1GchBYVvtwkY= knative.dev/test-infra v0.0.0-20200407185800-1b88cb3b45a5/go.mod h1:xcdUkMJrLlBswIZqL5zCuBFOC22WIPMQoVX1L35i0vQ= knative.dev/test-infra v0.0.0-20200505052144-5ea2f705bb55/go.mod h1:WqF1Azka+FxPZ20keR2zCNtiQA1MP9ZB4BH4HuI+SIU= knative.dev/test-infra v0.0.0-20200513011557-d03429a76034/go.mod h1:aMif0KXL4g19YCYwsy4Ocjjz5xgPlseYV+B95Oo4JGE= knative.dev/test-infra v0.0.0-20200519015156-82551620b0a9/go.mod h1:A5b2OAXTOeHT3hHhVQm3dmtbuWvIDP7qzgtqxA3/2pE= knative.dev/test-infra v0.0.0-20200707183444-aed09e56ddc7/go.mod h1:RjYAhXnZqeHw9+B0zsbqSPlae0lCvjekO/nw5ZMpLCs= -knative.dev/test-infra v0.0.0-20200817225313-c0ea00ce480c h1:AT7+D1fWJlqcCpMDgYYLNPa0//gBTRtX8bnCz4Ar4Jg= -knative.dev/test-infra v0.0.0-20200817225313-c0ea00ce480c/go.mod h1:Pmg2c7Z7q7BGFUV/GOpU5BlrD3ePJft4MPqx8AYBplc= knative.dev/test-infra v0.0.0-20200820231346-543fe3e80c03 h1:tBz8QL+H4chihsWHGDJ8/1xwHiFMDqRWHHid/qlfSoo= knative.dev/test-infra v0.0.0-20200820231346-543fe3e80c03/go.mod h1:Pmg2c7Z7q7BGFUV/GOpU5BlrD3ePJft4MPqx8AYBplc= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= diff --git a/vendor/knative.dev/pkg/controller/controller.go b/vendor/knative.dev/pkg/controller/controller.go index 895b05d0..300f76e8 100644 --- a/vendor/knative.dev/pkg/controller/controller.go +++ b/vendor/knative.dev/pkg/controller/controller.go @@ -216,10 +216,13 @@ type ControllerOptions struct { // NewImpl instantiates an instance of our controller that will feed work to the // provided Reconciler as it is enqueued. +// Deprecated: use NewImplFull. func NewImpl(r Reconciler, logger *zap.SugaredLogger, workQueueName string) *Impl { return NewImplFull(r, ControllerOptions{WorkQueueName: workQueueName, Logger: logger}) } +// NewImplWithStats creates a controller.Impl with stats reporter. +// Deprecated: use NewImplFull. func NewImplWithStats(r Reconciler, logger *zap.SugaredLogger, workQueueName string, reporter StatsReporter) *Impl { return NewImplFull(r, ControllerOptions{WorkQueueName: workQueueName, Logger: logger, Reporter: reporter}) } @@ -416,15 +419,14 @@ func (c *Impl) EnqueueKeyAfter(key types.NamespacedName, delay time.Duration) { // internal work queue and waits for workers to finish processing their current // work items. func (c *Impl) RunContext(ctx context.Context, threadiness int) error { - logger := c.logger - defer runtime.HandleCrash() sg := sync.WaitGroup{} - defer sg.Wait() defer func() { c.workQueue.ShutDown() for c.workQueue.Len() > 0 { time.Sleep(time.Millisecond * 100) } + sg.Wait() + runtime.HandleCrash() }() if la, ok := c.Reconciler.(reconciler.LeaderAware); ok { @@ -441,7 +443,7 @@ func (c *Impl) RunContext(ctx context.Context, threadiness int) error { } // Launch workers to process resources that get enqueued to our workqueue. - logger.Info("Starting controller and workers") + c.logger.Info("Starting controller and workers") for i := 0; i < threadiness; i++ { sg.Add(1) go func() { @@ -451,9 +453,9 @@ func (c *Impl) RunContext(ctx context.Context, threadiness int) error { }() } - logger.Info("Started workers") + c.logger.Info("Started workers") <-ctx.Done() - logger.Info("Shutting down workers") + c.logger.Info("Shutting down workers") return nil } @@ -485,13 +487,6 @@ func (c *Impl) processNextWorkItem() bool { // Send the metrics for the current queue depth c.statsReporter.ReportQueueDepth(int64(c.workQueue.Len())) - // We call Done here so the workqueue knows we have finished - // processing this item. We also must remember to call Forget if - // reconcile succeeds. If a transient error occurs, we do not call - // Forget and put the item back to the queue with an increased - // delay. - defer c.workQueue.Done(key) - var err error defer func() { status := trueString @@ -499,6 +494,13 @@ func (c *Impl) processNextWorkItem() bool { status = falseString } c.statsReporter.ReportReconcile(time.Since(startTime), status) + + // We call Done here so the workqueue knows we have finished + // processing this item. We also must remember to call Forget if + // reconcile succeeds. If a transient error occurs, we do not call + // Forget and put the item back to the queue with an increased + // delay. + c.workQueue.Done(key) }() // Embed the key into the logger and attach that to the context we pass @@ -544,8 +546,8 @@ func (c *Impl) GlobalResync(si cache.SharedInformer) { c.FilteredGlobalResync(alwaysTrue, si) } -// FilteredGlobalResync enqueues (with a delay) all objects from the -// SharedInformer that pass the filter function +// FilteredGlobalResync enqueues all objects from the +// SharedInformer that pass the filter function in to the slow queue. func (c *Impl) FilteredGlobalResync(f func(interface{}) bool, si cache.SharedInformer) { if c.workQueue.ShuttingDown() { return diff --git a/vendor/modules.txt b/vendor/modules.txt index 9ac57d0b..b19b199e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -752,7 +752,7 @@ k8s.io/kube-openapi/pkg/util/sets k8s.io/utils/buffer k8s.io/utils/integer k8s.io/utils/trace -# knative.dev/pkg v0.0.0-20200820181214-50386ad39634 +# knative.dev/pkg v0.0.0-20200822174146-f0f096d81292 ## explicit knative.dev/pkg/apis knative.dev/pkg/apis/duck/ducktypes