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:
Wenkai Yin(尹文开)
2024-10-08 17:18:25 +08:00
parent 14758a3435
commit 0a4e417aab
22 changed files with 128 additions and 79 deletions
+8 -7
View File
@@ -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)
}