mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-05 04:55:22 +00:00
Bump up version of client-go and controller-runtime
Bump up version of client-go to v0.30.5 Bump up version of controller-runtime to v0.18.5 Fixes #8274 Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
This commit is contained in:
@@ -28,6 +28,7 @@ import (
|
||||
ctrl "sigs.k8s.io/controller-runtime"
|
||||
"sigs.k8s.io/controller-runtime/pkg/builder"
|
||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||
"sigs.k8s.io/controller-runtime/pkg/predicate"
|
||||
|
||||
velerov1api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
|
||||
"github.com/vmware-tanzu/velero/pkg/constant"
|
||||
@@ -83,15 +84,18 @@ func NewRestoreOperationsReconciler(
|
||||
}
|
||||
|
||||
func (r *restoreOperationsReconciler) SetupWithManager(mgr ctrl.Manager) error {
|
||||
s := kube.NewPeriodicalEnqueueSource(r.logger.WithField("controller", constant.ControllerRestoreOperations), mgr.GetClient(), &velerov1api.RestoreList{}, r.frequency, kube.PeriodicalEnqueueSourceOption{})
|
||||
gp := kube.NewGenericEventPredicate(func(object client.Object) bool {
|
||||
restore := object.(*velerov1api.Restore)
|
||||
return (restore.Status.Phase == velerov1api.RestorePhaseWaitingForPluginOperations ||
|
||||
restore.Status.Phase == velerov1api.RestorePhaseWaitingForPluginOperationsPartiallyFailed)
|
||||
})
|
||||
s := kube.NewPeriodicalEnqueueSource(r.logger.WithField("controller", constant.ControllerRestoreOperations), mgr.GetClient(), &velerov1api.RestoreList{}, r.frequency, kube.PeriodicalEnqueueSourceOption{
|
||||
Predicates: []predicate.Predicate{gp},
|
||||
})
|
||||
|
||||
return ctrl.NewControllerManagedBy(mgr).
|
||||
For(&velerov1api.Restore{}, builder.WithPredicates(kube.FalsePredicate{})).
|
||||
WatchesRawSource(s, nil, builder.WithPredicates(gp)).
|
||||
WatchesRawSource(s).
|
||||
Complete(r)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user