mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-07-19 22:42:44 +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:
@@ -32,6 +32,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
"sigs.k8s.io/controller-runtime/pkg/builder"
|
||||
"sigs.k8s.io/controller-runtime/pkg/predicate"
|
||||
|
||||
velerov1api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
|
||||
"github.com/vmware-tanzu/velero/pkg/constant"
|
||||
@@ -347,25 +348,25 @@ func (b *backupSyncReconciler) filterBackupOwnerReferences(ctx context.Context,
|
||||
|
||||
// SetupWithManager is used to setup controller and its watching sources.
|
||||
func (b *backupSyncReconciler) SetupWithManager(mgr ctrl.Manager) error {
|
||||
gp := kube.NewGenericEventPredicate(func(object client.Object) bool {
|
||||
location := object.(*velerov1api.BackupStorageLocation)
|
||||
return b.locationFilterFunc(location)
|
||||
})
|
||||
backupSyncSource := kube.NewPeriodicalEnqueueSource(
|
||||
b.logger.WithField("controller", constant.ControllerBackupSync),
|
||||
mgr.GetClient(),
|
||||
&velerov1api.BackupStorageLocationList{},
|
||||
backupSyncReconcilePeriod,
|
||||
kube.PeriodicalEnqueueSourceOption{
|
||||
OrderFunc: backupSyncSourceOrderFunc,
|
||||
OrderFunc: backupSyncSourceOrderFunc,
|
||||
Predicates: []predicate.Predicate{gp},
|
||||
},
|
||||
)
|
||||
|
||||
gp := kube.NewGenericEventPredicate(func(object client.Object) bool {
|
||||
location := object.(*velerov1api.BackupStorageLocation)
|
||||
return b.locationFilterFunc(location)
|
||||
})
|
||||
|
||||
return ctrl.NewControllerManagedBy(mgr).
|
||||
// Filter all BSL events, because this controller is supposed to run periodically, not by event.
|
||||
For(&velerov1api.BackupStorageLocation{}, builder.WithPredicates(kube.FalsePredicate{})).
|
||||
WatchesRawSource(backupSyncSource, nil, builder.WithPredicates(gp)).
|
||||
WatchesRawSource(backupSyncSource).
|
||||
Complete(b)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user