mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
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:
15
vendor/sigs.k8s.io/controller-runtime/pkg/reconcile/reconcile.go
generated
vendored
15
vendor/sigs.k8s.io/controller-runtime/pkg/reconcile/reconcile.go
generated
vendored
@ -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) }
|
||||
|
Reference in New Issue
Block a user