rebase: update controller-runtime package to v0.9.2

This commit updates controller-runtime to v0.9.2 and
makes changes in persistentvolume.go to add context to
various functions and function calls made here instead of
context.TODO().

Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
Rakshith R
2021-06-25 10:32:01 +05:30
committed by mergify[bot]
parent 1b23d78113
commit 9eaa55506f
238 changed files with 19614 additions and 10805 deletions

View File

@ -17,6 +17,7 @@ limitations under the License.
package reconcile
import (
"context"
"time"
"k8s.io/apimachinery/pkg/types"
@ -32,6 +33,14 @@ type Result struct {
RequeueAfter time.Duration
}
// IsZero returns true if this result is empty.
func (r *Result) IsZero() bool {
if r == nil {
return true
}
return *r == Result{}
}
// Request contains the information necessary to reconcile a Kubernetes object. This includes the
// information to uniquely identify the object - its Name and Namespace. It does NOT contain information about
// any specific Event or the object contents itself.
@ -81,13 +90,13 @@ type Reconciler interface {
// Reconciler performs a full reconciliation for the object referred to by the Request.
// The Controller will requeue the Request to be processed again if an error is non-nil or
// Result.Requeue is true, otherwise upon completion it will remove the work from the queue.
Reconcile(Request) (Result, error)
Reconcile(context.Context, Request) (Result, error)
}
// Func is a function that implements the reconcile interface.
type Func func(Request) (Result, error)
type Func func(context.Context, Request) (Result, error)
var _ Reconciler = Func(nil)
// Reconcile implements Reconciler.
func (r Func) Reconcile(o Request) (Result, error) { return r(o) }
func (r Func) Reconcile(ctx context.Context, o Request) (Result, error) { return r(ctx, o) }