mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 18:43:34 +00:00
rebase: update sigs.k8s.io/controller-runtime to current version
There is no release for sigs.k8s.io/controller-runtime that supports Kubernetes v1.27. The main branch has all the required modifications, so we can use that for the time being. Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
committed by
mergify[bot]
parent
2551a0b05f
commit
b1a4590967
24
vendor/sigs.k8s.io/controller-runtime/pkg/reconcile/reconcile.go
generated
vendored
24
vendor/sigs.k8s.io/controller-runtime/pkg/reconcile/reconcile.go
generated
vendored
@ -18,6 +18,7 @@ package reconcile
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
@ -100,3 +101,26 @@ var _ Reconciler = Func(nil)
|
||||
|
||||
// Reconcile implements Reconciler.
|
||||
func (r Func) Reconcile(ctx context.Context, o Request) (Result, error) { return r(ctx, o) }
|
||||
|
||||
// TerminalError is an error that will not be retried but still be logged
|
||||
// and recorded in metrics.
|
||||
func TerminalError(wrapped error) error {
|
||||
return &terminalError{err: wrapped}
|
||||
}
|
||||
|
||||
type terminalError struct {
|
||||
err error
|
||||
}
|
||||
|
||||
func (te *terminalError) Unwrap() error {
|
||||
return te.err
|
||||
}
|
||||
|
||||
func (te *terminalError) Error() string {
|
||||
return "terminal error: " + te.err.Error()
|
||||
}
|
||||
|
||||
func (te *terminalError) Is(target error) bool {
|
||||
tp := &terminalError{}
|
||||
return errors.As(target, &tp)
|
||||
}
|
||||
|
Reference in New Issue
Block a user